{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw8 - 2 1=(1.1 mod 2= 1 mod 2=1 The addition and the...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 260 Homework 8- Integer Division -Answer October 12, 2007 1. Section 2.4: 42 (hint: example 20 on page 159), 46, 47 42. For each pair ( i, j ) ( Z + × Z + ) one can order the pairs the same way as in figure 2 of page 159. 46. Associate the real number 0 .d 1 d 2 ...d n ... to the function f with f ( n ) = d n . For example, if the real is 0.234 . . . then the function will be f(1)= 2 f(2)=3 f(3)=4 and so on. Section 3.4: 27, 28, 31 28: We just calculate using the formula. We are given x 0 = 3. Then x 1 =(4.3+1) mod 7=13 mod 7=6; x 2 =(4.6+1) mod 7=25 mod 7=4; x 3 =(4.4+1) mod 7 = 17 mod 7=3. At this point the sequence must continue to repeat 3, 6, 4, 3, 6, 4, . . . forever. 2. Which positive integers less than 30 are relatively prime to 30. { 7 , 11 , 13 , 17 , 19 , 23 , 29 } 3. The mod function is defined as: mod p : Z Z ( p ), mod(x,p)=x mod p, and Z ( p ) = { 0 , 1 , 2 , ...p - 1 } We can define add and multiplication in modulo arithmetic as follows: a + p b = ( a + b ) mod p and a * p b = ( a.b ) mod p, where a, b Z ( p ) An important modulo arithmetic is in Z (2) as follows: For example, 1+ 2 1=(1+1) mod 2=2 mod 2=0 and 1
Image of page 1

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

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

Unformatted text preview: * 2 1=(1.1) mod 2= 1 mod 2=1 The addition and the multiplication table ±or the + 2 , * 2 , respectively, are as ±ollows: + 2 | 0 1 * 2 | 0 1----|-----------|------| 0 1 | 0 1 | 1 1 | 0 1 (a) Give the tables ±or + 5 and * 5 + 5 | 0 1 2 3 4 * 5 | 0 1 2 3 4----|------------------|--------------| 0 1 2 3 4 0 | 0 1 | 1 2 3 4 1 | 0 1 2 3 4 2 | 2 3 4 1 2 | 0 2 4 1 3 3 | 3 4 1 2 3 | 0 3 1 4 2 4 | 4 1 2 3 4 | 0 4 3 2 1 (b) Give the following sum and product in base 5: 423 5 214 5 +240 5 * 334 5 ——— ———-1213 5 1421 – 1202x – 1202x – —————-– 134141 (c) Based on the above tables for + 5 and * 5 , solve the following equa-tions for x in Z (5). 2 + 5 x = 1 + 5 3 + 5 3 x = 4 2 * 5 x = 3 * 5 3 * 5 3 x = 4 4. Make the following conversions between bases: (a) 743 A 11 = x 14 3832 14 (b) 11001100011010100 2 = x 8 314324 8...
View Full Document

{[ snackBarMessage ]}