hw1sol - Computer Science 340 Reasoning about Computation...

• Homework Help
• PresidentHackerCaribou10582
• 5
• 93% (14) 13 out of 14 people found this document helpful

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

Computer Science 340 Reasoning about Computation Homework 1 Due at the beginning of class on Wed, September 26, 2007 Problem 1 Prove that if x ≥ - 1, then for any integer n 0, (1 + x ) n > nx . Solution: We will strengthen the inductive hypothesis: we will prove that for any integer n 0, (1+ x ) n nx +1. The problem statement follows directly. (Note: induction on the problem statement directly does not work) Base case: n = 0, then (1 + x ) n = (1 + x ) 0 = 1 = 0 x + 1 = nx + 1 — OK Inductive hypothesis: Suppose for some integer n = n 0 0, (1 + x ) n nx + 1. Inductive step: Consider n = n 0 + 1. Using the inductive hypothesis (1+ x ) n = (1+ x ) n 0 (1+ x ) ( n 0 x +1)(1+ x ) = n 0 x + n 0 x 2 +1+ x ( n 0 +1) x +1 = nx +1 and we are done. Problem 2 Show that at a party of n people, there are two people who have the same number of friends in the party. (Friendship is symmetric) Solution: Bin the people at the party by the number of friends each person has. Each person can be friends with between 0 and n - 1 people (inclusively). This is n bins and does not yet solve the problem. However, since friendship is symmetric, if a person has 0 friends, there is no person with n - 1 friends (who would be friends with everyone). So, there are at most n - 1 non-empty bins, with n people in them. By the pigeonhole principle, there is some bin that contains at least two people, and the people in that bin have the same number of friends in the party. Problem 3 There are two children sitting on a (very long) bench. The child on the left is a boy, the child on the right is a girl. Every minute, either two children arrive and sit down next to each other on the bench (possibly squeezing between two children who are already sitting), or two children who had been sitting next to each other get up off the bench and leave.

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

View Full Document
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