Homework #1 CMSC351 - Spring 2013 PRINT Name : Due: Feb 12 th at the start of class o Grades depend on neatness and clarity. o Write your answers with enough detail about your approach and concepts used, so that the grader will be able to understand it easily. You should ALWAYS prove the correctness of your algorithms either directly or by referring to a proof in the book. o Write your answers in the spaces provided. If needed, attach other pages. o The grades would be out of 20. Four problems would be selected and everyone s grade would be based only on those problems. You will also get 5 bonus points for trying to solve all problems. 1. [Prob 2.3, Pg 31] Find the following sum and prove your claim: Denote the sum we are interested in as To find we subtract the sum to find that In class we saw that, so that We now prove that by induction. For this is trivial. Assume that, we now show that. We have that
2. Let denote the number with ones. For example, and and so on. For each prove that is divisible by. The base case k=1 is true since = 111 = 3x37. The induction hypothesis is that is divisible by. Observe that to write down you have to write down three times. Hence where the digits of the number in the bracket are one, followed by k-1 zeros, then a one, again k-1 zeros and the last digit is one. For example. By induction hypothesis is divisible by The sum of digits of the number in the bracket is three, and hence it is divisible by 3 which implies is divisible by Note that sum of digits of is exactly. Hence it follows that there are infinitely many natural numbers (none of which contain zero as a digit) which are divisible by the sum of their digits. This fact is not so easy to prove otherwise!!
3. [Prob 2.11, Pg 32] Find an expression for the sum of the ith row of the following triangle, and prove the correctness of your claim. Each entry in the triangle is the sum of the three entries directly above it (a nonexisting entry is considered 0) 1 1 1 1 1 2 3 2 1 1 3 6 7 6 3 1 1 4 10 16 19 16 10 4 1 The sums of each of the first few rows are 1,3,9,27 which suggests that the sum of the nth row is. We prove this by induction. For n=1 this is trivial. Assume the sum of the nth row is, we now show that the sum of the (n +1)-th row is. Let denote the ith entry in the (n+1)-th row and note that, by definition, We need to show that Each entry from the n-th row appears three times in this expression, so by the inductive hypothesis which proves the result.
4. [Prob 2.19, Pg 32] Prove that the regions formed by n circles (see figure below) can be colored with two colors such that any neighboring regions are colored differently. We prove this by induction on the number of circles. The base case of n=1 can be trivially colored by two colors: one for the region insider the circle and one for the big outer region. Now suppose we have n+1 circles. Draw only the first n circles. By induction hypothesis we can color the regions formed by these n circles. Now draw the n+1 th circle, which we denote by say C. For any region inside C flip its color. For any region outside C keep its color same. The claim is that this is a valid coloring. We have the following 3 cases for two neighboring regions: Both are inside C : In this case they had different colors before, and we flipped both their colors. So they have different colors even now. Both are outside C : In this case they had different colors before, and we do not change color of either region. So they have different colors even now. One is outside C and other is inside C : In this case these two regions were part of the same region before we added C, and hence had the same color in that coloring. But now we flipped color of only the region which is inside C, and hence they have different colors now.
5. Are the following pairs of functions in terms of order of magnitude. In each case, briefly explain whether,, and/or. a) Using a similar approach to part (c) below you can show that and, and thus. b) Since, we have ( ). c) We show which implies that ( ) Let, so. Now, By Theorem 3.1 (Theorem 1, Lecture 4 notes), ( ) which proves the result. d) We have. By increasing we can make this ratio arbitrary big, thus.
6. [Prob 3.16, Pg 57] Find a counterexample to the following claim: and imply Since we don t need upper bounds to be tight, finding counterexamples in this case is easy. For example
7. [Prob 3.3, Pg 56] Prove, by using Theorem 3.1, that 5 = Note that it is enough to show that, c = 5 and a = 5 = This follows easily from Theorem 3.1 with