Successfully reported this slideshow.
Upcoming SlideShare
×

of

Upcoming SlideShare
ΠΛΗ31 ΜΑΘΗΜΑ 4.2 - ΒΕΛΤΙΣΤΟΠΟΙΗΣΗ ΑΡΙΘΜΗΤΙΚΩΝ ΣΥΝΑΡΤΗΣΕΩΝ
Next

0 Likes

Share

# ΠΛΗ31 ΜΑΘΗΜΑ 4.2 (ΕΚΤΥΠΩΣΗ)

.

See all

### Related Audiobooks

#### Free with a 30 day trial from Scribd

See all
• Be the first to like this

### ΠΛΗ31 ΜΑΘΗΜΑ 4.2 (ΕΚΤΥΠΩΣΗ)

1. 1. 31 4: 4.2: !" # \$ % # & ' ( & ! " " # \$ % ! & " ' ( ) * + , & ' ! ,- . )/0 1 ' ,- !. )/0 1! ( ,- '. )/0 1' 2 # ! " #\$ %& ' A. \$ 1. )\$)# 1. * # #& & ! " #\$ %& ' • ! * # #& * &, & + # " f * , * ( &. • # -# : ( , • " f (objective function) • . , .* & & " & ( ( " / ") ( - " 0 .* ) & ( &: • ) : • • . " 0 " . f . 0& 0&. • . + 0& 0&, ( ) " # , . 0& 0&. • ) ,. + +# " : • ( .& ) " # " 0 ( . " ) . .* . 1/ " 0& )) & ) + # " " * # &. • + ) 0/ " : • / .- " " " (2 " ) - # & " & • " & \$& 0 / ,# & , & 0 . . *0 . 21 A. \$ 1. )\$)# 1. * # #& & ! " #\$ %& ' ( (
2. 2. A. \$ 2. .& ). & ) 0& !" # &. (! " #\$ %& ' . 2#& *# : 1. " " ( (Initialization) 2. 0 * : 1. / " " " ( 2. .& 0 " " ( ( #& )#&) 3. ! " / \$ " " ( ( #& + ( \$ &) 4. # / \$ " " ( ( #& 2 &) \$& . " ! " # " \$& ( / # " ) . ). ) ) # " # " A. \$ 2. .& ). & ) 0& !" # & )! " #\$ %& ' • .& ). & ) 0& !" # & " , 2#& + . : • 0 - 0 & . & ) \$ \$ * # . • / +" + # \$+ • . & ) ")/ " # * + + 3 - \$ * . • . & ) ) \$+ \$+ \$ * • . & " .& ") 0 & " & . & + - &. • " . *# + " " + . . ). : • )# ) 2 ) 0 " 0 . • + ( \$ ( ". • 2 ) )# bit * "& "/ "& (&. A. \$ 2. .& ). & ) 0& !" # &. *! " #\$ %& ' \$ # %\$ & % ' ( %&) ' * \$&+# ' & #& \$&+#,%&), -'( \$%,-,: \$ " & ( + & " # # %& # ,! - # ! ./.01234 56 & & 78 ' + 9 + ' + : ; " + < \$ 7 = & 6 ! &9 A. \$ 2. .& ). & ) 0& !" # & -1. % ( \$ " ( * # & ) & >! " #\$ %& ' + ) % + # " : ( ( ( ( 4 " !! ( ! , ( 0 . 0) "#\$%&'( )#' '*(+),&(-. /012*&,/, ( 3 , . 0& / . + " : • - • - ) • - & • -
3. 3. A. \$ 2. .& ). & ) 0& !" # & 0. \$+ \$ ( \$ +" + . ( ?! " #\$ %& ' , " ! ! . . - & + " # * + + 3 - , 0 \$ q : % + / ) * # x1,x2,…xn • 5\$ , " + 4 5 6 !78 + # • , " / 9 ) /( : :; <; 6 =>? @ AB; = • # " / 9 bits. !" & ( : • 9 bits ( 1 * # • . 9( bits ( 2 * # • … • . . . A. \$ 2. .& ). & ) 0& !" # & 0. \$+ \$ ( \$ +" + . ( @! " #\$ %& ' + ) ! # " : ( ( ( ( 4 " !! ( ! 6 0 + + 3 - . !" & ) * # / : !! 6 !7C @ D E ! F G @ D E ! F HIJK @ HIJD E F HIJK @ 9 . 7 3 bits. ) * # ( / : ! 6 !7C @ D L ! F M @ D L ! F HIJ @ HIJD L F HIJ @ 9( . 7 2 bits. !" . ( 5 bits. ( # & x1 + ( * # x2 A. \$ 2. .& ). & ) 0& !" # & 0. \$+ \$ ( \$ +" + . ( ! " #\$ %& ' + ) ! # " : ( ( ( ( 4 " !! ( ! \$+ & ( & (6,2) NO P Q NO P D 7!7 NO P D ! NO P ! 7! 7 ( \$+ \$& 01001. \$+ " + " & 01111 RSTN9 H 7!! !! DU ! M G ( ( RSTN9 H !! ! D( ! ! M ( (7,4) ). &) &,-, \$+ & #& & * #& xi ) \$& 2#&: / , +" + # " * bin_stri, 0 : NO P 4 6 4D V !55 ). &) &,-, \$+ & +" + #& " * & / + + # # ) ( : RSTN9 H4 NOWXYP 5 D V ! A. \$ 2. .& ). & ) 0& !" # & 1. / ! " #\$ %& ' / 1 \$ . " .& 0/ pop_size=4 ) " 4 +" + 0& " * 0& # "& 5 "/ . : : 00110 : 11000 : 01101 : 11111 ! *# & / & + " ) ( 0 "/ " . . +" 0& ( & # & \$ "/ \$ ( \$ " ) pop_size ( & " * # & 0) & " " ( 0 . + " ) ".
4. 4. A. \$ 2. .& ). & ) 0& !" # & 2.1. 2 .) ! " #\$ %& ' 2 .) : 00110 \$+ … Z (5,3) 2 .) : ( ( ( ( !Q 7 : SZ H Z !Q : 11000 \$+ …(10,1) 2 .) : ( ( ( ( [[ 7 : SZ H Z( [[ : 01101 \$+ …(7,2) 2 .) : ( ( ( ( 7 : SZ H ZU : 11111 \$+ …(11,4) 2 .) : ( ( ( ( !7 7 : SZ H Z] !7 2 .) ) +( *# . 1) \$+ & ( & / + " : Z . 2) ( " ) , # & #& " &: SZ H4Z 5. A. \$ 2. .& ). & ) 0& !" # & 2.2. )# ! " #\$ %& ' - )# & )#& + ) • \$ 2 )# \$ \$ : ^ !Q [[ !7 DQ • . )#& \$ : • _`ab4`E5 c d ( de 7f7Q7 • ( _`ab4`L5 c gg ( de 7fMG • U _`ab4`h5 c ]e ( de 7f!G7 • ] _`ab4`i5 c Ce ( de 7fM[Q • # . \$ : • j 7f7Q7 • j( ( 7f M • jU ( U 7fQ7 • j] ( U ] !f777 )# ) 0 + & : A. \$ 2. .& ). & ) 0& !" # & 2.2. )# (! " #\$ %& ' )#: % + / . ) # "/ \$ 0/ " : • P 7f kl(mno. &n0 p • P 7fK[ kl(mno. &n0 " • P 7fG kl(mno. &n0 " • P 7f7[ kl(mno. &n0 q r*n/s*(1tu lm,+0/)tu %#1'( n 4p" " q5 3 # " < 7f7Q 7f M 7fQ7 !f7 7 A. \$ 2. .& ). & ) 0& !" # & 2.3. % ( \$ )! " #\$ %& ' % ! 8 9! 8 ! 8 – ! " * " ( 0/ 0) & 5. + " \$ & n-1=4. 0 " 0 . 1/4=0.25. !" & + /\$ ( 0) "/ * "& "/ "& (& 0) &: • 0 & 1-2 + [0.00, 0.25] • 0 & 2-3 + (0.25, 0.50] • 0 & 3-4 + (0.50, 0.75] • 0 & 4-5 + (0.75, 1.00] ! " + ( \$ " ) ( "
5. 5. A. \$ 2. .& ). & ) 0& !" # & 2.3. % ( \$ *! " #\$ %& ' % ( \$ ( pc=0.80) • 0) " "/ "& (& . 0 & 1 ) 0 & " \$ ( " ( ( ,%,%, ) 0 \$ . & + . " "/ \$ • 0.45 0.68 0.77 0.93 0.35 0.22 1 , () & ( ,%). • "/ & .&: 0.45:pc. % " ! • "/ & .&: 0.68, 2( 0 \$ 3-4. • =011|01 ’=011|11 • =111|11 ’=111|01 2 , () & (%, ). • "/ & .&: 0.77:pc. % " ! • "/ & .&: 0.93, 2( 0 \$ 4-5. • =1111|1 ’=1111|0 • =1100|0 ’=1100|1 A. \$ 2. .& ). & ) 0& !" # & 2.3. % ( \$ >! " #\$ %& ' % ( \$ ( pc=0.80) !" & " .& *# & + " \$ & : • ’=01111 • ’=11101 • ’=11110 • ’=11001 A. \$ 2. .& ). & ) 0& !" # & 2.4. 2 ?! " #\$ %& ' # bit / \$ & , "/ & .& " 0) " . & . . 2 & pm. % ( \$ ( pc=0.30) 5 & 2#& " "/ \$ : 0.77 0.23 0.09 0.93 0.28 0.22 0.15 0.82 0.34 0.32 0.44. 1 bit 2o bit 3 bit 4 bit 5 bit 0.77 0 0.23 1 0.09 1 0.93 1 0.28 1 0.22 1 0.15 1 0.82 1 0.34 0 0.32 1 0.44 1 0.77 1 0.23 1 0.09 1 0.93 0 0.28 1 0.22 1 0.15 0 0.82 0 0.34 1 ’=01111 ’’=01011 ’=11101 ’’=11101 ’=11110 ’’=11100 ’=11001 ’’=11001 A. \$ 2. .& ). & ) 0& !" # & @! " #\$ %& ' 0 # 3 ) . ). ) * & #& " &. 2 )# " " . " 0 "3 : 2 .) : 01011 \$+ … Z (6,4) 2 .) : ( ( ( ( D7 7 : SZ H Z D7 : 11101 \$+ …(11,2) 2 .) : ( ( ( ( !!G 7 : SZ H Z( !!G : 11100 \$+ …(11,4) 2 .) : ( ( ( ( !7 7 : SZ H ZU !7 : 11001 \$+ …(10,2) 2 .) : ( ( ( ( [Q 7 : SZ H Z] [Q
6. 6. A. \$ 3. )# " ( ) " ! " #\$ %& ' • %8, • 0 \$ 2 \$ . • / +. 0 \$ ) . ! * * " ( " &) / " ) ( ) ". • *# & )#& + ! • *# & + ( \$ & + - ! • *# & 2 & + ! + ( 0 \$ " + ) & " * * ". A. \$ 3. )# " ( ) " 1. \$+ ! " #\$ %& ' , " . A. \$ 3. )# " ( ) " 1. \$+ ! " #\$ %& ' , " . A. \$ 3. )# " ( ) " 2. / ! " #\$ %& ' , . . . bit
7. 7. A. \$ 3. )# " ( ) " 3. 2 .) (! " #\$ %& ' , . " -' A. \$ 3. )# " ( ) " 4. )# )! " #\$ %& ' , . - - \$ A. \$ 3. )# " ( ) " 4. )# *! " #\$ %& ' , . - - \$ A. \$ 3. )# " ( ) " 4. )# >! " #\$ %& ' , . - - \$ & .& r = 0.513870 ) ( & " q10 . & " q11, ) ) .& " . v11 0) ) v w 0 " .. + ( & .& r = 0.175741 ) ( & " q3 . & " q4, . v4 0) ) 0 " .. !" / , & + . " , " 0 " .: ! " # , 0 0 , - " / ( " ( " 0/ " ( ) - ) . ) .
8. 8. A. \$ 3. )# " ( ) " 5. % ( \$ ?! " #\$ %& ' \$ - /,! . ! " %'/ & - \$&+# - 0 pc A. \$ 3. )# " ( ) " 5. % ( \$ @! " #\$ %& ' 1 2 ! # ( ! " ! . A. \$ 3. )# " ( ) " 5. % ( \$ ! " #\$ %& ' " . / \$& 0/ " . ) . A. \$ 3. )# " ( ) " 6. 2 ! " #\$ %& ' 2 ) + . . bit 0) "/ & .&. ! + ) (" ) ) 2 . pm=0.01
9. 9. . # & %8/ -1 ! " #\$ %& ' % 2#& " .& ) 0: =11011, =01011, =11001, %=10111 2#& # " ) 2 .) \$ " " (: NYOSXX x ! 4 !5yV3 D ] zC . " bi i- . +" + . 3 - ( +" + . 3 - 0/ + i=0). &, + \$ "/ \$ " 0/ / / # & ) # & "/ \$ : 0.25, 0.73, 0.15, 0.52, 0.81, 0.65 \$ # . : 1. . . / # )#& roulette wheel selection. 2. . 2 & 0. 3. H . + ( \$ & 1.0. 4. )# \$ . \$ " " 0/ " + ( \$ ) * # )#& "& "/ "& (& " 0 "3 . ) # "/ \$ . #& + ( \$ & ( " + ( \$ & 0) "/ 0 + ( \$ & / \$ &. * "/ . + ( \$ & 0) . & + 2 + . ) 0 (0.25 ) # 0 ). % +# "/ & .& 0.45 + ( \$ & +" + . 3 - 1 +" + . 3 - 2 ( . 3 - " * & 0/ . 0). 5. +( + " ( " . + ( \$ ( "& ) & "& " . & . & ) &. * & \$ " 0 & " ) . " : . # & %8/ -1 ! " #\$ %& ' ) % ! 0. .+ . " " " ( ) 0 : f(11011) = 2 f(01011) = 1 f(11001) = 3 f(10111) = 4 b) % ! 0. 0 .+ " " ( ) 0 : " # .+ ) ) 0 : 2+1+3+4 = 10, . 0 .+ & ) & 0 " . 4 10/4=2.5. c) % " " 0. ( 3 ! !. " 0 " + " ) * .+ \$ . \$ + . . " /# , . " ( ) * 20%, + ( ( ) 10%, ( ) 30% 0 (%) 40%. . # & %8/ -1 (! " #\$ %& ' d) % " " 1. " .& \$ . \$ ) 1 " ) , \$& 2#&: : . & )#& ) 0 & " " ( : pA = 0.2, pB = 0.1, p = 0.3, p% = 0.4 8 ) , " & 0& . &. " 0& : q = 0.2, q = 0.3, q = 0.6, q% = 1.0, 0) " " " . ( \$ .) " .. " . ) / # \$ \$ \$ "/ \$ " & 0/ " + . 1 0/ " 0.2<0.25<0.30 . 0) , 0.6<0.73<1.0 . 0) %, 0.15<0.2 . 0) 0.3<0.52<0.6 . 0) . 7 \$ .& " .& : 01011 ( ), 10111 (%), 11011 ( ), 11001 ( ) : +" , ") " 0 "3 ) + ( \$ : 01011 ( ) 10111 (%) 11011 ( ) 11001 ( ) +# . + ( \$ & 1.0 (100%) +" , ") + " \$ ( /\$ & ) 0 )/ & "/ .. 0 . + ( + ( \$ & (0 ) , ") ). 1 ) , ") + ( \$ & ( / # " 0 " "/ " ( " 0.81 + \$& + ( \$ & " . 0 +" + . 3 - , . ( ) 3 " ) , ") . : . # & %8/ -1 )! " #\$ %& ' 1 ) , ") + ( \$ & ( / # " 0 " "/ " ( " 0.81 + \$& + ( \$ & " . 0 +" + . 3 - , . ( ) 3 " ) , ") . . : 0101|1 1011|1 . " ) # ( | ) + + ( \$ &. .) " ( " : 01011 10111 + ( , ") , + ( \$ & * / # " " " "/ " ( (0.65) ( . 2( + ( " " +" + ( 3 - ". 7 + ( , ") ) - : 110|11 110|01 .) " ( " : 11001 11011 : +# . 2 & 0 + ) 2 . . , ( & " .& & ) & 1 . \$& 0 "3 . & +" + " &: =01011, =10111, =11001, %=11011
10. 10. 0 .+ " " ( ) 1 " # .+ ) ) 1 1+4+3+2 = 10, . 0 .+ & ) & 1 10/4=2.5. . # & %8/ -1 *! " #\$ %& ' e) % ! 1. .+ . " " " ( ) 1 : f(01011) = 1 f(10111) = 4 f(11001) = 3 f(11011) = 2 f) % ! 1. / # .& ( ) " ( " ( " .* & ( & " byte " 0/ & . & + &. 1 \$ . " . . () 0) . 2#& 4 : =01101100 =10100010 =00110001 %=00111101 . " . / ( " 2 .) & " \$ +" + 3 - \$ . ": x { z . " bi i- +" + . 3 - " . " i 0& . 1 0\$& 8. 1 \$ . . . % 0 (roulette wheel selection), # + ( \$ & .& " ! " 0.8 # 2 & 0.2. 1 \$, &, . + \$ 4 - " 1 : 0.9501 0.2311 0.6068 0.7860 0.8913 0.7621 0.4565 0.0185 0.8214 0.4447 0.6154 0.7919 0.9218 0.7382 0.1763 0.4057 0.9355 0.9169 0.4103 0.8936 0.0579 0.3529 0.8132 0.0099 0.1389 0.2028 0.1987 0.6030 0.8381 0.0196 0.6813 0.3795 0.83180 0.5028 0.7095 0.4966 0.8998 0.8216 0.6449 0.2897 . # & %8/ -3 >! " #\$ %& ' \$.%,# % ( 1 a) * " 2 .) & " 02 " (a) * # 2 .) & . " & ) & 0, " # .+ & ) & 0 0 .+ & ) & 0. ( : .+ \$ " " ( : f(A) = 4 f(B) = 3 f( ) = 3 f(%) = 5 & ) & 0 4+3+3+5 = 15 15/4=3.75. 1 b) / # \$ + 0 \$ 3 "+.- "/ \$ ( / ( . , # / ( . , . "& / 2 + . /#) - )# \$ ) • )#&, • + ( \$ & • 2 & * " " ( & . & ) & () 1). \$ . - ( \$ + + & )#& ) . " ., + " +" " 0 "3 . + + & )#&. & \$ . #& 2 & - ., # \$ & + + & + ( \$ & ) . " .. . # & %8/ -3 ?! " #\$ %& ' : - . " # #& ) #& )#& 0 " ) " & " \$ " 0 & . & \$ . \$ " " ( " " " 0 . . & )#& ) 4 " " ( : pA = 4/15 = 0.26667, p = 3/15 = 0.2, p = 3/15 = 0.2, p% = 5/15 = 0.33333 / & " \$ " 0 & . & : q(A) = 0.26667, q( ) = 0.46667, q( ) = 0.66667, q(%) = 1.0 1/ & " ) & " \$ " 0 & . & ( " / # " # & #& ) #& )#& * + 0 " 3 "+. "/ \$ ( * ( " / ( " ( " « " » \$ . " .. • / # " " 3 "+ "/ " ( 0.9591 & * + (0.6667, 1], 0) %. • / # " + ( " 3 "+ "/ " ( 0.2311 & * + (0, 0.26667), 0) . • / # " " 3 "+ "/ " ( 0.6068 & * + (0.4667, 0.66667), 0) . • / # " 0 " 3 "+ "/ " ( 0.7860 & * + (0.66667, 1.0), 0) %. \$ .& " .& " ( : 00111101 (%), 01101100 ( ), 00110001 ( ), 00111101 (%) . # & %8/ -3 @! " #\$ %& '
11. 11. : 1/ & + + )#&, ( /\$ # " + + & + ( \$ &. !( -\$ - " * # & + " +" " 0 "3 . + + & )#&. • 1 , ") ) + ( \$ . % & ) & 0. 2 , " " . , ") . \$& + " \$ ") & . ( 0 ) 3 "+ "/ . 0.8913 . + ( \$ & " 0.8. +# 3 "+ "/ & .& ) ( & & . & + ( \$ & + 0/ " + ( \$ , . +( " \$ ( " ( 0 " \$& 0/ " . • + ( , ") , , . %. 2 , " +" " + " ") & . (0 ) 3 "+ "/ . 0.7621 . + ( \$ & " 0.8. +# 3 "+ "/ & .& . & ) + ( \$ , . 0 ) + ( \$ &. " . 0) * . (0*+ ) 3 "+ "/ . " & 0.4565 ) ) .& " + ) )# " " + ( \$ & 2( 4 " 5 " +" + ( 3 - " \$ . \$ . !/ " . : 0011|0001 0011|1101 \$ /# + ). "& 00111101 00110001. . # & %8/ -3 ! " #\$ %& ' # \$ & + + & + ( \$ & " .& " 0/ (3 0/ \$& 2#&: 00111101 01101100 00111101 00110001 : 0 - #& 2 &. ) " . / ,. 4x8 = 32 3 "+ "/ "& (& / , & . 8 & + 0 & " &. !" & 3 "+ "/ " / # " : 0.0185 0.8214 0.4447 0.6154 0.7919 0.9218 0.7382 0.1763 0.4057 0.9355 0.9169 0.4103 0.8936 0.0579 0.3529 0.8132 0.0099 0.1389 0.2028 0.1987 0.6030 0.8381 0.0196 0.6813 0.3795 0.8318 0.5028 0.7095 0.4966 0.8998 0.8216 0.6449 8 ) 0 " . " 0.2 " / ( bits: 00111101 01101100 00111101 00110001 0- : 10111100 01101000 11101101 00110001 . # & %8/ -3 ! " #\$ %& ' 1 c) * " 2 .) & * .+ \$ . \$ & ) & 1, " # .+ & ) & 1 0 .+ & ) & 1. () / 0 & ) & 0 .+ \$ " " ( & ) & 1 : f(A;) = 5 f(B;) = 3 f( ;) = 7 f(%;) = 3 . " # .+ & ) & 1 5+3+7+3 = 18 0 .+ " " ( 18/4 = 4.5. ( , . , -# * \$ . " #, . 0 .+ " " ( & ) & 1 /0 " . & ) & 0. . # & %8/ -3 ! " #\$ %& ' . # & - )# 1 ! " #\$ %& ' : 2 1 2 221 ),( xxxxf x1 x2 [0, 7]. 3 bits (23 = 8), 6 bits 3 x1 3 x2. ! ( 4 " # ). - - (FITNESS) 101011 \$ 111000 111011 % 101000 & 111001
12. 12. (! " #\$ %& ' ( ) " ) .+ (Fitness) 0 "& " " ( ( ) 3 # & \$ ). +# . ( . ) 0/ 0& 0&, + ( " ) ( . & )#&. & \$ " . .* ; )# # & " # # " \$ , 0 . . .* " / " ) . & . & )#& " 2 " . "; \$& \$ ; ( ) " ) . )#& . ", / & )# 2 ) 0 & " 0 & ( ) 3 # & \$ ). )! " #\$ %& ' ( ) " ) . . ) -\$ . " . ) ( ) 3 # & \$ ). ( ) 1 \$ . 1 ) " ( - )# \$ ) & )#&, + ( \$ & 2 & " # " , . 1/ * \$ 0 .+ " " ( ) 1 /0 ) 0; . 0/ * .+ " ( " 0 "& " " ( ) 1 /0 ) 0; – 111 100 \$ 110 110 111 000 % 110 011 & 111 011

.

Total views

3,395

On Slideshare

0

From embeds

0

Number of embeds

2,800

145

Shares

0