
CSE 260
Homework 8- Integer Division
1. Section 2.4: 42 (hint: example 20 on page 159), 46, 47\\
Section 3.4: 27, 28, 31
2. Which positive integers less than 30 are relatively prime to 30.
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+pb= (a+b) mod p and aโpb= (a.b) mod p, where a, b๎Z(p)
An important modulo arithmetic is in Z(2) as follows:
For example, 1+21=(1+1) mod 2=2 mod 2=0 and 1โ21=(1.1) mod 2=
1 mod 2=1
The addition and the multiplication table for the +2,โ2, respectively,
are as follows:
+2|0 1 *2|0 1
----|------- ----|------
0 | 0 1 0 | 0 0
1 | 1 0 1 | 0 1
(a) Give the tables for +5and โ5
(b) Give the following sum and product in base 5:
42352145
+2405โ3345
โโโ โโโ-
(c) Based on the above tables for +5and โ5, solve the following equa-
tions for xin Z(5).
2 +5x= 1
2โ5x= 3
4. Make the following conversions between bases:
(a) 743A11 =x14
(b) 110011000110101002=x8