hw5-sol-sp11 - !"!#$%&"...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: !"!#$%&" #$'&" !#$# ( ,) ) * $ ++ '- ( $) '& .&$ ++ 1. (10 points) Considers n nodes numbered 1 through n, each holding a k-bit value. Node 1 wants to find the parity of the n*k bits collectively held by the n nodes. One solution for this will be for node 1 to obtain the k-bit values from nodes 2 through n, and then compute the parity. This will require (n-1)k bits of communication. Suggest a more efficient algorithm. What is the worst-case communication complexity (in bits) using your algorithm? Nodes 2…n can send a 1 if the number of 1s in its k-bit value is odd or a bit 0 if it is even. Node 1 can then compute the overall parity. This algorithm requires (n-1) bits of communication. ! # " $ & ! % ' & ! & ' %' & %' ' ( $ ) * , $ $ $ $ , + * $ - ! . , ! " . + ! + ! / . & ' ! ' & %' ,& ' %1 ' & ' 0' & ' 0' / / 0 0 " ! # 2 3 . - 4 ! 0 +# . ! 4 0 . + ' -' 0' !& & 5 ! ! ( ! 0 )) 4 / ! ! ! 12 * * '. 3 12 + * * '# 3 ! )) . ' + 44 - 6 3 , - 7 $ 8 ! , % # , ! 9 ! ! . ) ) ) - : ) ) ) - % ) , + , 0 + $ ) -# 1$ ) . - ! + ; $ 67 8 . 2 < 6 1+ 6+- * = / ) 60 $ )3 )5 ! + 3 $3 1+ - 1 # ) + , 9 :; ( 7 8 + $0 +33 6 %1+ 6$ % +3 $ ...
View Full Document

Ask a homework question - tutors are online