sam2sol

# sam2sol - Solution of CSE20 Exercise 2 Question 1 Represent...

This preview shows pages 1–3. Sign up to view the full content.

Solution of CSE20 Exercise 2 February 16, 2010 Question 1 Represent 38 with a residual number system of moduli ( m 1 ,m 2 ,m 3 ) = (3 , 5 , 7). (38%3 , 38%5 , 38%7) = (2 , 3 , 3) Question 2 Suppose ( x %5 ,x %7 ,x %11) = (1 , 2 , 3). Find the smallest positive integer x that satisﬁes this system. We use the Chinese remainder theorem. Recall that x k X i =1 M i s i r i (mod M ) where M = k Y i =1 m i , M i = M m i , and s i is the unique value mod m i such that M i s i 1 (mod m i ) . Plugging in our values, we have M = 5 · 7 · 11 = 385 M 1 = 7 · 11 = 77 M 2 = 5 · 11 = 55 M 3 = 5 · 7 = 35 We now solve for each of the s i . We need M 1 s 1 1 (mod 5) 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
77 s 1 1 (mod 5) , which is satisﬁed by s 1 = 3. We need M 2 s 2 1 (mod 7) or 55 s 2 1 (mod 7) , which is satisﬁed by s 2 = 6. Finally, we need M 3 s 3 1 (mod 11) or 35 s 3 1 (mod 11) , which is satisﬁed by s 3 = 6. Now we plug all our values into the expression from the Chinese remainder theorem. x k i =1 M i s i r i (mod M ) 3 i =1 M i s i r i (mod M ) 77 · 3 · 1 + 55 · 6 · 2 + 35 · 6 · 3 (mod 385) 231 + 660 + 630 (mod 385) (231%385) + (660%385) + (630%385) (mod 385) 231 + 275 + 245 (mod 385) 366 (mod 385) So the smallest positive number that satisﬁes this system is 366. Question 3 Show the operation of 38+44 in a residual number system with moduli ( m 1 ,m 2 ,m 3 ) = (3 , 5 , 7). From question 1, we have 38 is (2 , 3 , 3) in this system. We represent 44 by (44%3 , 44%5 , 44%7) = (2 , 4 , 2) . Adding our representations pairwise and modding appropriately, we get
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/12/2011 for the course CS 1 taught by Professor Staff during the Fall '08 term at Cornell.

### Page1 / 7

sam2sol - Solution of CSE20 Exercise 2 Question 1 Represent...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online