Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Assignment 7 Problems - Discrete Structures | CMSC 250, Assignments of Discrete Structures and Graph Theory

Material Type: Assignment; Professor: Perlis; Class: Discrete Structures; Subject: Computer Science; University: University of Maryland; Term: Fall 2009;

Typology: Assignments

Pre 2010

Uploaded on 12/15/2009

irasekh3
irasekh3 🇺🇸

31 documents

1 / 5

Toggle sidebar

Related documents


Partial preview of the text

Download Assignment 7 Problems - Discrete Structures | CMSC 250 and more Assignments Discrete Structures and Graph Theory in PDF only on Docsity! 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 = 22∙0, 𝑃 1 ∶ 𝑎1 = 4 = 2 2 = 22∙1 INDUCTIVE STEP: Assume 𝑃 0 , 𝑃 1 , …, 𝑃 𝑘 . Prove 𝑃 𝑘 + 1 . 𝑃 𝑘 + 1 ∶ 𝑎𝑘+1 = 2 2 𝑘+1 𝑎𝑘+1 = 2 ∙ 𝑎𝑘 + 8 ∙ 𝑎𝑘−1 𝑎𝑘+1 = 2 ∙ 2 2𝑘 + 8 ∙ 22 𝑘−1 , by the inductive hypothesis. 𝑎𝑘+1 = 2 ∙ 2 2𝑘 + 8 ∙ 22𝑘−2 = 22𝑘+1 + 22𝑘+1 = 2 ∙ 22𝑘+1 = 22𝑘+2 = 22 𝑘+1 Problem 4. Find a formula for 𝑎𝑛 such that 𝑖 2𝑛 𝑖=1 = 𝑎𝑛 . Using constructive induction, prove and find a formula at the same time. Guess that ∀𝑛 𝑖2𝑛𝑖=1 = 𝑎𝑛 3 + 𝑏𝑛2 + 𝑐𝑛 + 𝑑. Let 𝑃(𝑛) be 𝑖2𝑛𝑖=1 = 𝑎𝑛 3 + 𝑏𝑛2 + 𝑐𝑛 + 𝑑. BASE CASE: 𝑃(1): 𝑎 + 𝑏 + 𝑐 + 𝑑 = 1. Since we want the RHS to equal the LHS, we take 𝑎 + 𝑏 + 𝑐 + 𝑑 = 1. INDUCTIVE STEP: Assume 𝑃 𝑘 . Prove 𝑃 𝑘 + 1 ∶ 𝑖2𝑘+1𝑖=1 = 𝑎 𝑛 + 1 3 + 𝑏 𝑛 + 1 2 + 𝑐 𝑛 + 1 + 𝑑. The LHS is 𝑖2𝑘+1𝑖=1 = 𝑘 + 1 2 + 𝑖2𝑘𝑖=1 By the inductive hypothesis, 𝑘 + 1 2 + 𝑖2𝑘𝑖=1 = 𝑘 + 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.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved