Docsity

Homework 4 | Applied Discrete Structures | COT 3100, Assignments of Computer Science

Partial preview of the text

Download Homework 4 | Applied Discrete Structures | COT 3100 and more Assignments Computer Science in PDF only on Docsity!

Section 3.1 G/ If there were integer solutions to this equation, then by definition we would have 2? = 3 (mod 4). But impossible, because the square of an even number is congruent to 0 modulo 4 (since (2k)? = 4k?), and square of an odd number is congruent to 1 modulo 4 (since (2k + 1)? = 4(k? +k) +1) give a proof by cases. There are four possible remainders when an integer n not divisible by 5 is divided 5, namely 1, 2, 3, and 4. Thus we can write n=5k+1, or n=5k+2, or n=5k+3, orn=5k+4. will show that in each case the remainder when n? is divided by 5 is either 1 or 4. First suppose that n = 5k+1. Then n? = (5k + 1)? = 25k? + 10k + 1 = 5(5k? + 2k) +1. Therefore e see that the remainder when n? is divided by 5 is 1. Next suppose that n = 5k +2. This time = 5(5k? + 4k) + 4, so the remainder when n? is divided by 5 is 4. For the third case we have n? = bk +3)? = 25k? + 30k + 9 = 5(5k? + 6k +1) +4, so again the remainder is 4. Finally, in the last case we n? = (5k + 4)? = 5(5k? + 8k + 3) +1, so the remainder is 1. 38. We can give a nice indirect proof here, by showing that if n is not prime, then the sum of its divisors is n+1. There are two cases. If n = 1, then the sum of the divisors is 1 # 1+ 1. Otherwise n is com so can be written as n = ab, where both a and 6 are divisors of n different from 1 and from n (althe it might happen that a = b). Then 7 has at least the three distinct divisors 1, a, and n, and their si clearly not equal to n +1. This completes the indirect proof. One should also observe that the conver this statement is also true: if n is prime, then the sum of its divisors is n + 1 (since its only divisors and itself). Section 3.2 BY BYrag = (-2) = 1, a = (-2)! = -2, a2 = (-2)? =4, ag = (—2)? =-8 Bb) =a, =a, =a, =3 €) @=74+4°=8,a,=74+4'=11, a =74+4? = 23, ag =7+43=71 ) a = 2° + (—2)° = 2, ay = 2! + (—2)! =0, ay = 2? + (2)? = 8, ag = 23 + (-2)3 =0 . a) The first term is 3, and the n> term is obtained by adding 2n —1 to the previous term. In other we successively add 3, then 5, then 7, and so on. Alternatively, we see that the n'" term is n? +2; we this by inspection if we happen to notice how close each term is to a perfect square, or we can fit a qui polynomial to the data. b) This is an arithmetic sequence whose first term is 7 and whose difference is 4. Thus the nt T+4(n-1)=4n43. c) The n*® term is clearly the binary expansion of n. d) The sequence consists of one 1, followed by three 3s, followed by five 5s, and so on, with the num copies of the next value increasing by 2 each time, and the values themselves following the rule that the two values are 1 and 2 and each subsequent value is the sum of the previous two values. Obviously answers are possible as well. e) If we stare at this sequence long enough and compare it with Table 1, then we notice that the n‘® te 37-1. f) We notice that each term evenly divides the next, and the multipliers are successively 3, 5,7, 9, 11, and on. That must he the intended pattern. @) The sequence consists of one 1, followed by two 0s, then three 1s, four 0s, five 1s, and so on, alternatit between 0s and 1s and having one more item in each group than in the previous group. h) It doesn’t take long to notice that each term is the square of its predecessor.