Genetic Algorithms W02

65
Genetic Algorithms W02

description

Genetic Algorithms W02. What is randomness?. What is randomness?. Having no specific pattern, purpose, or objective; lacking a definite plan, purpose, or pattern. What is probability?. What is probability?. The quality or condition of being probable; likelihood. - PowerPoint PPT Presentation

Transcript of Genetic Algorithms W02

Page 1: Genetic Algorithms W02

Genetic Algorithms

W02

Page 2: Genetic Algorithms W02

What is randomness?

Page 3: Genetic Algorithms W02

What is randomness?

Having no specific pattern, purpose, or objective; lacking a definite plan, purpose, or pattern

Page 4: Genetic Algorithms W02

What is probability?

Page 5: Genetic Algorithms W02

What is probability?

1. The quality or condition of being probable; likelihood.

2. A probable situation, condition, or event.

3.a. The likelihood that a given event will occur.

b. Statistics. A number expressing the likelihood that a specific event will occur, expressed as the ratio of the number of actual occurrences to the number of possible occurrences.

Page 6: Genetic Algorithms W02

001001001001001001001001001001001001001001001001001001001

Page 7: Genetic Algorithms W02

001001001001001001001001001001001001001001001001001001001

000000000000100000000100000000000001000001000100000000001

010100111010001101001010111010010001110101001011010100010

Page 8: Genetic Algorithms W02

001001001001001001001001001001001001001001001001001001001

000000000000100000000100000000000001000001000100000000001

010100111010001101001010111010010001110101001011010100010

Page 9: Genetic Algorithms W02

$k = 0;while(true){ string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);

print(($k++) + " " + $genome + "\n");if($genome=="0011")break;

};

Page 10: Genetic Algorithms W02

$k = 0;while(true){ string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);

print(($k++) + " " + $genome + "\n");if($genome=="0011")break;

};

0 00011 01012 01113 10004 0011

Page 11: Genetic Algorithms W02

$k = 0;while(true){ string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);

print(($k++) + " " + $genome + "\n");if($genome=="0011")break;

};

0 00011 01012 01113 10004 0011

0 10001 10002 10113 11114 00015 01116 11117 00008 00109 111110 110011 100112 101113 011014 010015 100016 100117 110018 010119 101120 010021 010122 011023 011124 000125 0011

Page 12: Genetic Algorithms W02

$k = 0;while(true){ string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);

print(($k++) + " " + $genome + "\n");if($genome=="0011")break;

};

0 00011 01012 01113 10004 0011

0 10001 10002 10113 11114 00015 01116 11117 00008 00109 111110 110011 100112 101113 011014 010015 100016 100117 110018 010119 101120 010021 010122 011023 011124 000125 0011

0 0011

Page 13: Genetic Algorithms W02

$k = 0;while(true){ string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);

print(($k++) + " " + $genome + "\n");if($genome=="0011")break;

};

0 00011 01012 01113 10004 0011

0 10001 10002 10113 11114 00015 01116 11117 00008 00109 111110 110011 100112 101113 011014 010015 100016 100117 110018 010119 101120 010021 010122 011023 011124 000125 0011

0 0011 0 10111 01012 10013 10004 10115 10006 10117 01018 11109 101110 110111 011112 010113 101114 111015 101116 111017 010118 010019 100120 000021 100022 111023 0011

Page 14: Genetic Algorithms W02

$k = 0;while(true){ string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);

print(($k++) + " " + $genome + "\n");if($genome=="0011")break;

};

0 00011 01012 01113 10004 0011

0 10001 10002 10113 11114 00015 01116 11117 00008 00109 111110 110011 100112 101113 011014 010015 100016 100117 110018 010119 101120 010021 010122 011023 011124 000125 0011

0 0011 0 10111 01012 10013 10004 10115 10006 10117 01018 11109 101110 110111 011112 010113 101114 111015 101116 111017 010118 010019 100120 000021 100022 111023 0011

0 10101 00012 10113 01004 01005 01116 11007 01008 11009 011110 000111 000112 001013 100014 100015 111016 010017 100018 000119 010020 101121 111122 011123 101024 100125 111126 110127 111028 010129 111130 0011

Page 15: Genetic Algorithms W02

$k = 0;while(true){ string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);

print(($k++) + " " + $genome + "\n");if($genome=="0011")break;

};

0 00011 01012 01113 10004 0011

0 10001 10002 10113 11114 00015 01116 11117 00008 00109 111110 110011 100112 101113 011014 010015 100016 100117 110018 010119 101120 010021 010122 011023 011124 000125 0011

0 0011 0 10111 01012 10013 10004 10115 10006 10117 01018 11109 101110 110111 011112 010113 101114 111015 101116 111017 010118 010019 100120 000021 100022 111023 0011

0 10101 00012 10113 01004 01005 01116 11007 01008 11009 011110 000111 000112 001013 100014 100015 111016 010017 100018 000119 010020 101121 111122 011123 101024 100125 111126 110127 111028 010129 111130 0011

0 10001 00002 10003 01104 10005 01016 01117 10108 11009 100110 110111 011012 111113 101114 0011

Page 16: Genetic Algorithms W02

$k = 0;while(true){ string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);

print(($k++) + " " + $genome + "\n");if($genome=="0011")break;

};

0 00011 01012 01113 10004 0011

0 10001 10002 10113 11114 00015 01116 11117 00008 00109 111110 110011 100112 101113 011014 010015 100016 100117 110018 010119 101120 010021 010122 011023 011124 000125 0011

0 0011 0 10111 01012 10013 10004 10115 10006 10117 01018 11109 101110 110111 011112 010113 101114 111015 101116 111017 010118 010019 100120 000021 100022 111023 0011

0 10101 00012 10113 01004 01005 01116 11007 01008 11009 011110 000111 000112 001013 100014 100015 111016 010017 100018 000119 010020 101121 111122 011123 101024 100125 111126 110127 111028 010129 111130 0011

0 10001 00002 10003 01104 10005 01016 01117 10108 11009 100110 110111 011012 111113 101114 0011

0 01011 00102 00003 10014 11115 00006 10007 11118 01109 100110 011011 011112 011013 111114 100015 111116 111117 001018 001019 010120 101021 011022 101023 100124 001025 010026 110027 011128 111129 111130 011131 0011

Page 17: Genetic Algorithms W02

$acc = 0;for($i=0; $i<100; $i++){

$k = 0;while(true){

string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);$k++;

if($genome=="0011")break;};$acc += $k;

};print(($acc/$i));

Page 18: Genetic Algorithms W02

$acc = 0;for($i=0; $i<100; $i++){

$k = 0;while(true){

string $genome = (int)rand(2) + "" + (int)rand(2) + (int)rand(2) + (int)rand(2);$k++;

if($genome=="0011")break;};$acc += $k;

};print(($acc/$i));

15 16 16 17 14 15 15 16 17 17 …

Page 19: Genetic Algorithms W02
Page 20: Genetic Algorithms W02

001010

Page 21: Genetic Algorithms W02

001010 a) 110100 b) 111101 c) 011011 d) 101100

Page 22: Genetic Algorithms W02

001010 a) 110100 b) 111101 c) 011011 d) 101100

a 110100 score 1 b 111101 score 1 c 011011 score 4 d 101100 score 3

Page 23: Genetic Algorithms W02

001010 a) 110100 b) 111101 c) 011011 d) 101100

a 110100 score 1 b 111101 score 1 c 011011 score 4 d 101100 score 3

4. Crossover: take first 2 digits of c + last 4 of d: e 011100 5. Crossover: take first 2 digits of d + last 4 of c: f 101011 6. Crossover: take first 4 c + last 2 d: g 011000 7. Crossover: take first 4 d + last 2 c: h 101111

Page 24: Genetic Algorithms W02

001010 a) 110100 b) 111101 c) 011011 d) 101100

a 110100 score 1 b 111101 score 1 c 011011 score 4 d 101100 score 3

4. Crossover: take first 2 digits of c + last 4 of d: e 011100 5. Crossover: take first 2 digits of d + last 4 of c: f 101011 6. Crossover: take first 4 c + last 2 d: g 011000 7. Crossover: take first 4 d + last 2 c: h 101111

e 011100 score 3 f 101011 score 4 g 011000 score 4 h 101111 score 3

Page 25: Genetic Algorithms W02

001010 a) 110100 b) 111101 c) 011011 d) 101100

a 110100 score 1 b 111101 score 1 c 011011 score 4 d 101100 score 3

4. Crossover: take first 2 digits of c + last 4 of d: e 011100 5. Crossover: take first 2 digits of d + last 4 of c: f 101011 6. Crossover: take first 4 c + last 2 d: g 011000 7. Crossover: take first 4 d + last 2 c: h 101111

e 011100 score 3 f 101011 score 4 g 011000 score 4 h 101111 score 3

10. Crossover 1st f + last 5 g: i 111000 11. Crossover 1st g + last 5 f: j 001011 12. Crossover first 3 f + last 3 g: k 101000 13. Crossover first 3 g + last 3 f: l 011011 15. Crossover 1st 5 j + last 1 k: m 001010

Page 26: Genetic Algorithms W02

001010 a) 110100 b) 111101 c) 011011 d) 101100

a 110100 score 1 b 111101 score 1 c 011011 score 4 d 101100 score 3

4. Crossover: take first 2 digits of c + last 4 of d: e 011100 5. Crossover: take first 2 digits of d + last 4 of c: f 101011 6. Crossover: take first 4 c + last 2 d: g 011000 7. Crossover: take first 4 d + last 2 c: h 101111

e 011100 score 3 f 101011 score 4 g 011000 score 4 h 101111 score 3

10. Crossover 1st f + last 5 g: i 111000 11. Crossover 1st g + last 5 f: j 001011 12. Crossover first 3 f + last 3 g: k 101000 13. Crossover first 3 g + last 3 f: l 011011 15. Crossover 1st 5 j + last 1 k: m 001010

i 111000 score 3 j 001011 score 5 k 101000 score 4 l 011011 score 4 m 001010 score 6 = solution in 13 guesses

Page 27: Genetic Algorithms W02
Page 28: Genetic Algorithms W02

0 Best: lRDt2 p:h4do fitness: 105 Best: Je51+ wAr\d! fitness: 610 Best: HeQ7o wAr[d! fitness: 415 Best: Hex:o w9r=d! fitness: 420 Best: He8$o wWr9d! fitness: 425 Best: HeM$o wQrsd! fitness: 430 Best: HeELo worsd! fitness: 335 Best: He4xo worrd! fitness: 340 Best: Hew]o worVd! fitness: 345 Best: Hew,o worod! fitness: 350 Best: He7<o worjd! fitness: 355 Best: He]\o worKd! fitness: 360 Best: He.Mo world! fitness: 265 Best: Hel)o world! fitness: 170 Best: Qello world! fitness: 173 Best: Hello world! fitness: 0

Page 29: Genetic Algorithms W02
Page 30: Genetic Algorithms W02
Page 31: Genetic Algorithms W02
Page 32: Genetic Algorithms W02

P = {(x, y, c) x, y, c N, 0x<w, 0y<h, 0c<d } where w=132, h=193, and d=2.

So, possible combinations are 2 (132 x 193) = 1.097669

Page 33: Genetic Algorithms W02

16,400 x 200 = 3,280,000

Page 34: Genetic Algorithms W02
Page 35: Genetic Algorithms W02
Page 36: Genetic Algorithms W02

“equilibrium”

Page 37: Genetic Algorithms W02
Page 38: Genetic Algorithms W02

Designer Design

Page 39: Genetic Algorithms W02

If - then

Page 40: Genetic Algorithms W02

If – then – else

Page 41: Genetic Algorithms W02

Designer A designs home for client B

B

A

Page 42: Genetic Algorithms W02

Designer A designs home for client B

Designer A designs home for client C

B

C

A

Page 43: Genetic Algorithms W02

Designer A designs home for client B

Designer A designs home for client C

Designer A designs home for client D

B

C

D

A

Page 44: Genetic Algorithms W02

Designer A designs home for client B

Designer A designs home for client C

Designer A designs home for client D

Designer A designs home for client EB

C

D

EA

Page 45: Genetic Algorithms W02

Designer A designs home for client B

Designer A designs home for client C

Designer A designs home for client D

Designer A designs home for client E

Designer A designs home for client F

B

C

D

EA

F

Page 46: Genetic Algorithms W02

Designer A designs home for client B

Designer A designs home for client C

Designer A designs home for client D

Designer A designs home for client E

Designer A designs home for client F

Designer A designs home for client A

B

C

D

EA

F

Page 47: Genetic Algorithms W02

You know that you know

Page 48: Genetic Algorithms W02

You know that you know

You know that you do not know

Page 49: Genetic Algorithms W02

You know that you know

You know that you do not know

You do not know that you know

Page 50: Genetic Algorithms W02

You know that you know

You know that you do not know

You do not know that you know

You do not know that you do not know

Page 51: Genetic Algorithms W02
Page 52: Genetic Algorithms W02

Godel

Page 53: Genetic Algorithms W02

Designer Design

Page 54: Genetic Algorithms W02

Designer Design

Page 55: Genetic Algorithms W02

Designer Design

Dada: automatic scripts

Page 56: Genetic Algorithms W02

Designer Design

Dada: automatic scripts

Markov processes

Page 57: Genetic Algorithms W02

Designer Design

Dada: automatic scripts

Markov processes

Possible Palladian Villas

Page 58: Genetic Algorithms W02

Designer Design

Page 59: Genetic Algorithms W02

Designer Design

Page 60: Genetic Algorithms W02
Page 61: Genetic Algorithms W02
Page 62: Genetic Algorithms W02
Page 63: Genetic Algorithms W02
Page 64: Genetic Algorithms W02
Page 65: Genetic Algorithms W02