Download Homework 4 - UNM Computer Science

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Numbers (TV series) wikipedia , lookup

History of logarithms wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Infinitesimal wikipedia , lookup

Infinity wikipedia , lookup

Approximations of π wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Location arithmetic wikipedia , lookup

Large numbers wikipedia , lookup

Real number wikipedia , lookup

List of prime numbers wikipedia , lookup

Positional notation wikipedia , lookup

Arithmetic wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Collatz conjecture wikipedia , lookup

P-adic number wikipedia , lookup

Elementary mathematics wikipedia , lookup

Addition wikipedia , lookup

Quadratic reciprocity wikipedia , lookup

Transcript
CS 261 Homework 4
Spring 2017
Homework should be saved in PDF format and submitted to UNM Learn.
1. What are the quotient and remainder for the following.
(a) 44 divided by 8.
(b) 777 divided by 21.
(c) -123 divided by 19.
(d) -1 divided by 23.
(e) -2002 divided by 87.
(f) 0 divided by 17
(g) 1,234,567 divided by 1001.
(h) -100 divided by 101.
2. Show that if a is an integer and d is an integer greater than 1, then the quotient and
remainder obtained when a is divided by d are b ad c and a − db ad c.
3. Show that if a, b, c, and d are integers, where a 6= 0, such that a|c and b|d, then ab|cd.
4. Prove or disprove that if a|bc, where a, b, and c are positive integers and a 6= 0, then
a|b or a|c.
5. Determine whether each of these integers is prime.
(a) 19
(b) 93
(c) 107
(d) 3571
6. Find the prime factorization of each of these integers.
(a) 39
(b) 81
1
(c) 143
(d) 289
7. Find gcd(1000, 625) and lcm(1000, 625) and verify that gcd(1000, 625)·lcm(1000, 625) =
1000 · 625.
8. Use the modified Euclidean algorithm to express the greatest common divisor of each of
these pairs of integers as a linear combination of these integers as in Bézout’s Identity.
(a) 9, 11
(b) 25, 55
(c) 102, 248
9. Calculate the following values.
(a) (177 + 270) mod 31
(b) 177 mod 31 + 270 mod 31
(c) (177 mod 31 + 270 mod 31) mod 31
(d) (177 × 270) mod 31
(e) 177 mod 31 × 270 mod 31
(f) (177 mod 31 × 270 mod 31) mod 31
(g) ((−133) + 261) mod 23
(h) ((−133) mod 23 + 261 mod 23) mod 23
(i) ((−133) × 261) mod 23
(j) ((−133) mod 23 × 261 mod 23) mod 23
10. Calculate the following values.
(a) 191,000,000,000 mod 9
(b) 201,000,000,000 mod 9
11. Show that if a ≡ b (mod m) and c ≡ d (mod m), where a, b, c, d, and m are integers
with m ≥ 2, then a − c ≡ b − d (mod m).
12. Show that if n is an integer then n2 ≡ 0 or 1 (mod 4).
13. Convert the following decimal numbers into binary numbers:
(a) 277
(b) 9620
(c) 27796
14. Convert the following decimal numbers into base 7 numbers:
2
(a) 277
(b) 9620
(c) 27796
15. Convert the following binary numbers into decimal numbers
(a) 1001
(b) 10010010
(c) 1110110011
16. Convert the following octal (base 8) numbers to binary numbers.
(a) (505)8
(b) (277)8
(c) (620)8
17. Convert the following hexadecimal numbers to binary numbers.
(a) (F EC)16
(b) (ECE)16
18. Convert the following binary numbers into hexadecimal numbers
(a) 1001
(b) 10010010
(c) 1110110011
19. Calculate the following sum without converting the numbers to decimal.
(a) (1001100100)2 + (1110110011)2
(b) (505)8 + (277)8
(c) (F EC)16 + (ECE)16
20. Calculate the following multiplication without converting the numbers to decimal.
(a) (10011)2 × (1111)2
(b) (10011)2 × (1001)2
21. Calculate the quotient and remainder of the integer division (1001100100)2 ÷ (11101)2
without converting the numbers to decimal.
22. The Cantor expansion is a representation of integers in the format:
an · n! + an−1 · (n − 1)! + ... + a2 · 2! + a1 · 1!
where 0 ≤ ak ≤ k for k = 1, 2, ..., n.
Find the Cantor expansion for:
3
(a) 2
(b) 7
(c) 19
(d) 87
(e) Based on the experience with the above numbers, develop a systematic method
to convert an arbitrary integer to its Cantor expansion.
23. Suppose Charlie has the following public keys and private key: m = 2867, e = 7,
d = 1183. With the help of a computer or a calculator, encrypt the secret number
a = 277 into message b and decrypt b.
24. Suppose Lucy has the following public keys m = 3127, e = 21. Charlie sends Lucy an
encrypted message b = 123. Can we crack the secret number?
25. Use mathematical induction to prove that n2 − 7n + 12 is nonnegative whenever n is
an integer ≥ 3.
26. Use mathematical induction to prove:
n
X
j · 2j = (n − 1)2n+1 + 2
j=1
27. Solve the system of congruence x ≡ 3 (mod 6) and x ≡ 4 (mod 7)
4