This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: ECE 496 SOLUTIONS TO HOMEWORK ASSIGNMENT IV Spring 2007 1. Start with the complicated one and work on it. First note that the k = 0-term is zero in the sum, so n X k =0 n k ! kp sel ( x ) k (1- p sel ( x )) n- k = n X k =1 n k ! kp sel ( x ) k (1- p sel ( x )) n- k = n X k =1 n- 1 k- 1 ! np sel ( x ) k (1- p sel ( x )) n- k , where the last equality follows from one of the helpful hints. Now change index of summation to r = k- 1, pull the n out of the sum, and you get thing above = n n- 1 X r =0 n- 1 r ! p sel ( x ) r +1 (1- p sel ( x )) n- 1- r = np sel ( x ) n- 1 X r =0 n- 1 r ! p sel ( x ) r (1- p sel ( x )) n- 1- r = np sel ( x )( p sel ( x ) + [1- p sel ( x )]) n- 1 = np sel ( x ) , where the second-to-last equality follows from the other helpful hint using m = n- 1. 2. Consider first the situation that the Suggestion alludes to. Let u be the output of your random-number generator. The probability that u lies in any sub-interval [ , ] or [ , ) of [0 , 1] is just ( - ). So, lets divide up the unit interval into three sub-intervals of the appropriate lengths, namely I 1 = [0 , 1 / 7), I 2 = [1 / 7 , 10 / 21), and I 3 = [10 / 21 , 1]. Select the string of fitness 3 when u I 1 , the string of fitness 7 when u I 2 , and the string of fitness 11 when u I 3 . Youre using your random-number generator as a linear roulette wheel; the spin of the wheel is the (random) value of u . More generally, if you have n strings x 1 ,x 2 ,...,x n in your population, divide up the unit interval into n sub-intervals I 1 ,I 2 ,...,I n , where I k has length f ( x k ) / ( P n i =1 f ( x i )), 1 k n . To pick a string for parenthood, first generate a value u with your random-number generator and select x k if u I k . Do this n times and youve implemented roulette-wheel selection of n parents for the next generation. 3. In parts (a) through (c), we have to check and see whether f 2 ( x ) / ( P y A f 2 ( y )) is the same for every x A as f 1 ( x ) / ( P y A f 1 ( y )). If so, the two fitness functions f 1 and f 2 yield the same p sel ( x ) for every string x A (as usual, Im referring to the population as A ). (a) If A has size n , then f 2 ( x ) P y A f 2 ( y ) = f 1 ( x ) + 37 37 n + P y A f 1 ( y ) . This is clearly not always equal to f 1 ( x ) / ( P y A f 1 ( y )) for every x A . If you do the algebra, you find that this requires f 1 ( x ) P y A f 1 ( y ) = 1 n for every x A , which means that every x A has the same fitness f 1 ( x ) (and also the same fitness f 2 ( x ) when f 2 ( x ) = f 1 ( x ) + 37). Accordingly, the answer 1 to (a) is: you get the same p sel ( x ) from f 2 as from f 1 if and only if f 1 ( x ) is the same for every x A ....
View Full Document
- Spring '07