



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Fall 2009 CMSC 250: Homework 7 Perlis
Due at the start of discussion section Wednesday, October 28, 2009.
Please staple your homeworks together if you use more than one page.
Problem 1. (1 point) Print your name , section number , and your TA’s name.
Problem 2. (1 point) When is the SECOND exam? (NOT Oct. 20!) |
Problem 3. (24 points) Consider the sequence 𝑎𝑛 = 2 ∙ 𝑎𝑛− 1 + 8 ∙ 𝑎𝑛− 2 , where 𝑎 0 = 1 and 𝑎 1 = 4. Prove that 𝑎𝑛 = 2^2 𝑛^ using strong induction.
Let 𝑃(𝑛) be 𝑎𝑛 = 2^2 𝑛^.
BASE CASE:
𝑃 0 ∶ 𝑎 0 = 1 = 2^0 = 2^2 ∙^0 , 𝑃 1 ∶ 𝑎 1 = 4 = 2^2 = 2^2 ∙^1
INDUCTIVE STEP: Assume 𝑃 0 , 𝑃 1 , …, 𝑃 𝑘. Prove 𝑃 𝑘 + 1.
𝑃 𝑘 + 1 ∶ 𝑎𝑘+1 = 2^2 𝑘+
𝑎𝑘+1 = 2 ∙ 𝑎𝑘 + 8 ∙ 𝑎𝑘− 1
𝑎𝑘+1 = 2 ∙ 22 𝑘^ + 8 ∙ 22 𝑘−^1 , by the inductive hypothesis.
𝑎𝑘+1 = 2 ∙ 22 𝑘^ + 8 ∙ 22 𝑘−^2 = 2^2 𝑘+1^ + 2^2 𝑘+1^ = 2 ∙ 22 𝑘+1^ = 2^2 𝑘+2^ = 2^2 𝑘+
Problem 4. Find a formula for 𝑎𝑛 such that 𝑛𝑖=1 𝑖^2 = 𝑎𝑛. Using constructive induction, prove and find a formula at the same time.
Guess that ∀𝑛 𝑛𝑖=1 𝑖^2 = 𝑎𝑛^3 + 𝑏𝑛^2 + 𝑐𝑛 + 𝑑. Let 𝑃(𝑛) be 𝑛𝑖=1 𝑖^2 = 𝑎𝑛^3 + 𝑏𝑛^2 + 𝑐𝑛 + 𝑑.
BASE CASE: 𝑃(1):
𝑎 + 𝑏 + 𝑐 + 𝑑 = 1.
Since we want the RHS to equal the LHS, we take 𝑎 + 𝑏 + 𝑐 + 𝑑 = 1.
INDUCTIVE STEP: Assume 𝑃 𝑘. Prove 𝑃 𝑘 + 1 ∶ 𝑘 𝑖=1+1 𝑖^2 = 𝑎 𝑛 + 1 3 + 𝑏 𝑛 + 1 2 + 𝑐 𝑛 + 1 + 𝑑.
The LHS is 𝑘 𝑖=1+1 𝑖^2 = 𝑘 + 1 2 + 𝑘𝑖=1𝑖^2
By the inductive hypothesis, 𝑘 + 1 2 + 𝑘𝑖=1 𝑖^2 = 𝑘 + 1 2 + 𝑎𝑘^3 + 𝑏𝑘^2 + 𝑐𝑘 + 𝑑.
𝑘 + 1 2 + 𝑎𝑘^3 + 𝑏𝑘^2 + 𝑐𝑘 + 𝑑 = 𝑘^2 + 2 𝑘 + 1 + 𝑎𝑘^3 + 𝑏𝑘^2 + 𝑐𝑘 + 𝑑.
Similarly for the RHS:
𝑎 𝑘 + 1 3 + 𝑏 𝑘 + 1 2 + 𝑐 𝑘 + 1 + 𝑑 = 𝑎𝑘^3 + 3𝑎𝑘^2 + 𝑏𝑘^2 + 3𝑎𝑘 + 2𝑏𝑘 + 𝑐𝑘 + 𝑎 + 𝑏 + 𝑐 + 𝑑
Since we want the RHS to equal the LHS,
𝑘^2 + 2𝑘 + 1 + 𝑎𝑘^3 + 𝑏𝑘^2 + 𝑐𝑘 + 𝑑 = 𝑎𝑘^3 + 3𝑎𝑘^2 + 𝑏𝑘^2 + 3𝑎𝑘 + 2𝑏𝑘 + 𝑐𝑘 + 𝑎 + 𝑏 + 𝑐 + 𝑑 Which is true iff, 𝑘^2 + 2𝑘 + 1 = 3𝑎𝑘^2 + 3𝑎𝑘 + 2𝑏𝑘 + 𝑎 + 𝑏 + 𝑐 Which is true iff, 1 − 3 𝑎 𝑘^2 + 2 − 3 𝑎 − 2 𝑏 𝑘 + 𝑎 + 𝑏 + 𝑐 = 1
Since 𝑎 + 𝑏 + 𝑐 + 𝑑 = 1, 𝑎 + 𝑏 + 𝑐 = 1 − 𝑑. 1 − 3 𝑎 𝑘^2 + 2 − 3 𝑎 − 2 𝑏 𝑘 + 1 − 𝑑 = 1 Which is true iff, 1 − 3 𝑎 𝑘^2 + 2 − 3 𝑎 − 2 𝑏 𝑘 − 𝑑 = 0
A polynomial with non-zero coefficients cannot be identically zero. That is, we need the equations above to hold for ALL 𝑛 (while 𝑎, 𝑏, 𝑐, 𝑑 remain constant) But then this holds iff 𝑎 = 1 3 ,^ 𝑏^ =^
1 2 ,^ 𝑐^ =^
1 6 ,^ 𝑑^ = 0. So with these values of the four constants, the above equivalent equations hold and so the 𝑘 + 1 case has been proven.
Problem 5. (25 points) Start with a pile of n pieces of candy. Split it into two (non-empty piles), of sizes say 𝑗 and 𝑘. You get paid 𝑗𝑘 dollars. Keep splitting piles and getting paid based on the sizes of the new piles until all piles are of size 1.
For example start with four candies. Split into two piles of size two each and get paid 2 ∙ 2 = 4 dollars. Each of those piles is split into two piles of size one and you get paid 1 ∙ 1 = 1 dollar for each pile. The total is 6 dollars. Alternatively split the original pile into one and three and get paid 1 ∙ 3 = 3 dollars. Split the three piles into a one and two and get paid 1 ∙ 2 = 2 dollars. Split the two piles into a one and one and get paid 1 ∙ 1 = 1 dollar. The total is 6 dollars. Use strong induction to show that for 𝑛 candies, no matter how you split the piles, at the end you are paid exactly 𝑛 𝑛− 1 2 dollars.
𝑃 𝑛 ∶ You will be paid 𝑛 𝑛 − 1 2 dollars for splitting a pile of size^ 𝑛. BASE CASE:
𝑃 1 ∶ You will be paid 1 1 − 1 2 = 0^ for splitting a pile of size^1. Since you can’t split a single candy into two non-zero piles, you will be paid nothing.
𝑃 2 ∶ You will be paid 2 2 − 1 2 = 1^ for splitting a pile of size^1. A pile of size 2 can only be split into two piles of size 1 , so you will get paid 1 ∙ 1 = 1 dollar.
Problem 6. (25 points) Consider a stone path that is 𝑛 feet long and 1 foot wide. There are three type of stones that may be used: Block type A, which is 1 × 1 square, Block type B, which is 2 × 1 rectangle, and Block type C, which is 2 × 1 right triangle. For a path of a given length, there are many ways to pave it. For example there are 11 ways to fill a 4 foot path with type A, B and C stones:
A A A A
Prove that there are 1 3 2
𝑛+1 (^) ways to pave a path of length 𝑛, for 𝑛 ≥ 1 , using strong induction.
Let 𝑎𝑛 = the number of ways to fill a path of length 𝑛.
𝑃 𝑛 ∶ There are 1 3 2
𝑛+1 (^) ways to pave a path of length 𝑛.
𝑎𝑛 = 1 3 2
𝑛+
𝑃 1 ∶ There are 1 3 2
1+1 (^) ways to pave a path of length 1.
There is only one way to pave a path of length 1 , i.e. using a single type A stone.
𝑎 1 = 1 = 4 3 −^
1 3 =^
1 3 2
1+
𝑃 2 ∶ There are 1 3 2
2+1 (^) ways to pave a path of length 2.
There are three ways to pave a path or length 2.
A A
8 3 +^
1 3 =^
1 3 2
2+
INDUCTIVE STEP: Assume 𝑃 0 , 𝑃 1 , …, 𝑃 𝑘. Prove 𝑃 𝑘 + 1.
Every way of filling a path of length 𝑛 > 2 can be expressed as a type A at the end followed by a path of length 𝑛 − 1 , a type B stone at the end followed by a path of length 𝑛 − 2 , or a pair of type C stones at the end followed by a path of length 𝑛 − 2.
A
𝑛 (^) − (^1)
This means that, 𝑎𝑘+1 = 𝑎𝑘 + 2 ∙ 𝑎𝑘− 1. By the inductive hypothesis,
𝑎𝑘+1 = 1 3 2
𝑘− 1 +
𝑎𝑘+1 = 1 3 2
1 3 2
1 3 2
1 3 2
𝑘+
𝑎𝑘+1 = 1 3 2
𝑘+1 +