# sol4 - CS 70 Fall 2010 Discrete Mathematics and Probability...

• Notes
• 9

This preview shows pages 1–3. Sign up to view the full content.

CS 70 Discrete Mathematics and Probability Theory Fall 2010 Tse/Wagner Soln 4 1. (10 pts.) Recurrence relations Let f ( n ) be defined by the recurrence relation f ( n ) = 7 f ( n - 1 ) - 10 f ( n - 2 ) (for all n 2) and f ( 0 ) = 1, f ( 1 ) = 2. Prove that f ( n ) = 2 n for every n N . Answer: Proof : The proof is by strong induction over n . Let P ( k ) be the proposition that f ( k ) = 2 k . Base cases: If k = 0, then f ( 0 ) = 1 = 2 0 . If k = 1, then f ( 1 ) = 2 = 2 1 . Thus the base cases P ( 0 ) and P ( 1 ) are correct. Inductive hypothesis: Assume that for some k N satisfying k 1, P ( 0 ) P ( 1 ) ∧ ··· ∧ P ( k ) is true, i.e., f ( j ) = 2 j for j = 0 , 1 , 2 ,..., k . Inductive step: By the problem statement, we know that f ( k + 1 ) = 7 f ( k ) - 10 f ( k - 1 ) . Since k k and k - 1 k , and both k and k - 1 are positive, the inductive hypothesis tells us that f ( k + 1 ) = 7 · ( 2 k ) - 10 · ( 2 k - 1 ) = 7 · ( 2 k ) - 5 · ( 2 k ) = ( 7 - 5 ) · ( 2 k ) = 2 k + 1 . Thus, ( k N ) (( P ( 0 ) P ( 1 ) ∧···∧ P ( k )) P ( k + 1 )) , and we are done. 2 2. (20 pts.) Marbles In a game that’s about to sweep the nation, there is a bucket that contains some number of gold-colored marbles, silver-colored marbles, and bronze-colored marbles. When it is a player’s turn, the player may either: (i) remove one gold marble from the bucket, and add up to 3 silver marbles into the bucket; (ii) remove two silver marbles from the bucket, and add up to 7 bronze marbles into the bucket; or, (iii) remove a bronze marble from the bucket. These are the only legal moves. The last player that can make a legal move wins. Prove by induction that, if the bucket initially contains a finite number of marbles at the start of the game, then the game will end after a finite number of moves. Answer 1: An easy way to prove this is to think of the marbles as having values. For example, say that a gold marble is worth 100 dollars, a silver marble is worth 10 dollars, and a bronze marble is worth 1 dollar. This implicitly assigns a value to every possible bucket of marbles. Moreover, with this choice of values, every legal move will decrease the value by at least 1 dollar. Since the bucket can never have a negative value (and it starts with a finite value), the game cannot go forever. This intuition is formalized in the following proof. Lemma 1 : Let v 0 be the value of the initial configuration and v n be the value of the configuration after n moves where n is a natural number. Then v n v 0 - n. CS 70, Fall 2010, Soln 4 1

This preview has intentionally blurred sections. Sign up to view the full version.

Proof : Proof by simple induction over n , the number of moves. Let P ( k ) be the proposition that the value after k moves is at most v 0 - k . Base case: Let k = 0, then v k = v 0 v 0 - 0 = v 0 - k , i.e. v k v 0 - k so P ( 0 ) is true. Inductive hypothesis: Assume that for some k N , P ( k ) is true, i.e. v k v 0 - k . Inductive step: Now consider the k + 1st turn. Since we know that each step will decrease the dollar value by at least 1, we conclude that v k + 1 v k - 1. Hence v k + 1 v k - 1 ( v 0 - k ) - 1 = v 0 - ( k + 1 ) , where in the second step we used the inductive hypothesis. Thus, P ( k ) P ( k + 1 ) for all k N .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern