genetic algorithms w02

Post on 03-Jan-2016

37 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

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

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?

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.

001001001001001001001001001001001001001001001001001001001

001001001001001001001001001001001001001001001001001001001

000000000000100000000100000000000001000001000100000000001

010100111010001101001010111010010001110101001011010100010

001001001001001001001001001001001001001001001001001001001

000000000000100000000100000000000001000001000100000000001

010100111010001101001010111010010001110101001011010100010

$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;

};

$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

$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

$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

$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

$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

$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

$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

$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));

$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 …

001010

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

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

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

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

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

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

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

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

16,400 x 200 = 3,280,000

“equilibrium”

Designer Design

If - then

If – then – else

Designer A designs home for client B

B

A

Designer A designs home for client B

Designer A designs home for client C

B

C

A

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

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

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

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

You know that you know

You know that you know

You know that you do not know

You know that you know

You know that you do not know

You do not know that you know

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

Godel

Designer Design

Designer Design

Designer Design

Dada: automatic scripts

Designer Design

Dada: automatic scripts

Markov processes

Designer Design

Dada: automatic scripts

Markov processes

Possible Palladian Villas

Designer Design

Designer Design

top related