
CSE 260
Homework 8- Integer Division -Answer
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.
Part 1: Set of all computer programs in a particular programming lan-
guage is countable (problem 45). A programs can be thought of binary
strings which is a subset of all possible binary strings.. All binary strings
are countable. Therefore, subset is countable.
Part 2: Associate the real number 0.d1d2...dn... to the function fwith
f(n) = dn. 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.
Thus the set of real numbers (between 0 and 1) maps into a subset of
the functions.
Section 3.4: 27, 28, 31
28: We just calculate using the formula. We are given x0= 3. Then
x1=(4.3+1) mod 7=13 mod 7=6; x2=(4.6+1) mod 7=25 mod 7=4;
x3=(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+pb= (a+b) mod p and a∗pb= (a.b) mod p, where a, bZ(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