Week 6
CSE 390Z
November 5, 2024
Welcome in!
Grab your nametag and the workshop problems from the back
Talk with your neighbors:
What classes do you plan to take winter quarter?
Announcements
Past Assignments
Assignments
Reminder: Grading Structure
Workshop Participation: 7 of 9
Quick Checks: 7 of 9
Skills Assessments: 4 of 4
Exam Preparation: 2 of 2
A Special Announcement
Mid-Quarter Feedback
We appreciate your feedback!
Conceptual Review: Induction
Induction
General idea: Show that knocking down one domino will cause the next domino to fall.
Induction
General idea: Show that knocking down one domino will cause the next domino to fall.
A toy example: Prove that if the first domino falls, then all dominos will fall.
Let k be any arbitrary domino in this sequence.
Let P(x) := “Domino x will fall.”
Essentially, induction involves assuming P(k) and showing P(k+1).
In other words, we do a direct proof for P(k) → P(k+1)!
Induction
General idea: Show that knocking down one domino will cause the next domino to fall.
P(1) → P(2) → … → P(k-2) → P(k-1) → P(k) → P(k+1) → P(k+2) ... etc…
Induction Steps - Weak Induction
Q0 Walkthrough
Induction with inequalities: Question 0
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
2). Base Case: (n = 4): 4! = 24 and 24 = 16, since 24 > 16, P(4) is true.
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
2). Base Case: (n = 4): 4! = 24 and 24 = 16, since 24 > 16, P(4) is true.
Do not start with 4! > 24. That is backwards reasoning because that is what we are trying to prove
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
2). Base Case: (n = 4): 4! = 24 and 24 = 16, since 24 > 16, P(4) is true.
3). Inductive Hypothesis: Suppose that P(k) is true for some arbitrary integer k ∈ N, k ≥ 4.
4). Inductive Step: Goal: Show P(k + 1), i.e. show (k + 1)! > 2k+1
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
2). Base Case: (n = 4): 4! = 24 and 24 = 16, since 24 > 16, P(4) is true.
3). Inductive Hypothesis: Suppose that P(k) is true for some arbitrary integer k ∈ N, k ≥ 4.
4). Inductive Step: Goal: Show P(k + 1), i.e. show (k + 1)! > 2k+1
(k + 1)! = k! · (k + 1) [expanding factorial]
.
.
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
2). Base Case: (n = 4): 4! = 24 and 24 = 16, since 24 > 16, P(4) is true.
3). Inductive Hypothesis: Suppose that P(k) is true for some arbitrary integer k ∈ N, k ≥ 4.
4). Inductive Step: Goal: Show P(k + 1), i.e. show (k + 1)! > 2k+1
(k + 1)! = k! · (k + 1) [expanding factorial]
> 2k · (k + 1) (By I.H., k! > 2k )
.
.
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
2). Base Case: (n = 4): 4! = 24 and 24 = 16, since 24 > 16, P(4) is true.
3). Inductive Hypothesis: Suppose that P(k) is true for some arbitrary integer k ∈ N, k ≥ 4.
4). Inductive Step: Goal: Show P(k + 1), i.e. show (k + 1)! > 2k+1
(k + 1)! = k! · (k + 1) [expanding factorial]
> 2k · (k + 1) (By I.H., k! > 2k )
> 2k · 2 (Since k ≥ 4, so k + 1 ≥ 5 > 2)
.
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
2). Base Case: (n = 4): 4! = 24 and 24 = 16, since 24 > 16, P(4) is true.
3). Inductive Hypothesis: Suppose that P(k) is true for some arbitrary integer k ∈ N, k ≥ 4.
4). Inductive Step: Goal: Show P(k + 1), i.e. show (k + 1)! > 2k+1
(k + 1)! = k! · (k + 1) [expanding factorial]
> 2k · (k + 1) (By I.H., k! > 2k )
> 2k · 2 (Since k ≥ 4, so k + 1 ≥ 5 > 2)
= 2k+1 (exponent properties)
Prove by induction on n that for all integers n ≥ 4, the inequality n! > 2n is true.
1). Let P(n) be "n! > 2n ". We will prove P(n) is true for all n ∈ N, n ≥ 4, by induction
2). Base Case: (n = 4): 4! = 24 and 24 = 16, since 24 > 16, P(4) is true.
3). Inductive Hypothesis: Suppose that P(k) is true for some arbitrary integer k ∈ N, k ≥ 4.
4). Inductive Step: Goal: Show P(k + 1), i.e. show (k + 1)! > 2k+1
(k + 1)! = k! · (k + 1) [expanding factorial]
> 2k · (k + 1) (By I.H., k! > 2k )
> 2k · 2 (Since k ≥ 4, so k + 1 ≥ 5 > 2)
= 2k+1 (exponent properties)
5). Conclusion: So by induction, P(n) is true for all n ∈ N, n ≥ 4.
Q2 Walkthrough
Induction with Divides: Problem Set Question 2
Prove that 9 | (n3 + (n + 1)3 + (n + 2)3) for all n > 1 by induction
Prove that 9 | (n3 + (n + 1)3 + (n + 2)3) for all n > 1 by induction.
1). Let P(n) be “9 | n3 + (n + 1)3 + (n + 2)3”. We will prove P (n) for all integers n > 1 by induction on n.
Prove that 9 | (n3 + (n + 1)3 + (n + 2)3) for all n > 1 by induction.
1). Let P(n) be “9 | n3 + (n + 1)3 + (n + 2)3”. We will prove P (n) for all integers n > 1 by induction on n.
2). Base Case (n = 2): 23 + (2 + 1)3 + (2 + 2)3 = 8 + 27 + 64 = 99 = 9 · 11, so 9 | 23 + (2 + 1)3 + (2 + 2)3, so P(2) holds.
Prove that 9 | (n3 + (n + 1)3 + (n + 2)3) for all n > 1 by induction.
1). Let P(n) be “9 | n3 + (n + 1)3 + (n + 2)3”. We will prove P(n) for all integers n > 1 by induction on n.
2). Base Case (n = 2): 23 + (2 + 1)3 + (2 + 2)3 = 8 + 27 + 64 = 99 = 9 · 11, so 9 | 23 + (2 + 1)3 + (2 + 2)3, so P(2) holds.
3). Inductive Hypothesis: Assume that 9 | k3 + (k + 1)3 + (k + 2)3 for an arbitrary integer k > 1. ** Note that this is equivalent to assuming that k3 + (k + 1)3 + (k + 2)3 = 9j for some integer j by the definition of divides.
Prove that 9 | (n3 + (n + 1)3 + (n + 2)3) for all n > 1 by induction.
3). Inductive Hypothesis: Assume that 9 | k3 + (k + 1)3 + (k + 2)3 for an arbitrary integer k > 1. ** Note that this is equivalent to assuming that k3 + (k + 1)3 + (k + 2)3 = 9j for some integer j by the definition of divides.
4). Inductive Step: Goal: Show 9 | (k + 1)3 + (k + 2)3 + (k + 3)3
(k + 1)3 + (k + 2)3 + (k + 3)3 = (k2 + 6k + 9)(k + 3) + (k + 1)3 + (k + 2)3 [expanding trinomial]
= (k3 + 6k2 + 9k + 3k2 + 18k + 27) + (k + 1)3 + (k + 2)3 [expanding binomial]
= 9k2 + 27k + 27 + k3 + (k + 1)3 + (k + 2)3 [adding like terms]
= 9k2 + 27k + 27 + 9j [by I.H.]
= 9(k2 + 3k + 3 + j) [factoring out 9]
Since k and j are integers, k2 + 3k + 3 + j is also an integer. Therefore, by the definition of divides,
9 | (k + 1)3 + (k + 2)3 + (k + 3)3, so P(k) → P (k + 1) for an arbitrary integer k > 1.
Prove that 9 | (n3 + (n + 1)3 + (n + 2)3) for all n > 1 by induction.
3). Inductive Hypothesis: Assume that 9 | k3 + (k + 1)3 + (k + 2)3 for an arbitrary integer k > 1. ** Note that this is equivalent to assuming that k3 + (k + 1)3 + (k + 2)3 = 9j for some integer j by the definition of divides.
4). Inductive Step: Goal: Show 9 | (k + 1)3 + (k + 2)3 + (k + 3)3
(k + 1)3 + (k + 2)3 + (k + 3)3 = (k2 + 6k + 9)(k + 3) + (k + 1)3 + (k + 2)3 [expanding trinomial]
= (k3 + 6k2 + 9k + 3k2 + 18k + 27) + (k + 1)3 + (k + 2)3 [expanding binomial]
= 9k2 + 27k + 27 + k3 + (k + 1)3 + (k + 2)3 [adding like terms]
= 9k2 + 27k + 27 + 9j [by I.H.]
= 9(k2 + 3k + 3 + j) [factoring out 9]
Since k and j are integers, k2 + 3k + 3 + j is also an integer. Therefore, by the definition of divides,
9 | (k + 1)3 + (k + 2)3 + (k + 3)3, so P(k) → P (k + 1) for an arbitrary integer k > 1.
Prove that 9 | (n3 + (n + 1)3 + (n + 2)3) for all n > 1 by induction.
3). Inductive Hypothesis: Assume that 9 | k3 + (k + 1)3 + (k + 2)3 for an arbitrary integer k > 1. ** Note that this is equivalent to assuming that k3 + (k + 1)3 + (k + 2)3 = 9j for some integer j by the definition of divides.
4). Inductive Step: Goal: Show 9 | (k + 1)3 + (k + 2)3 + (k + 3)3
(k + 1)3 + (k + 2)3 + (k + 3)3 = (k2 + 6k + 9)(k + 3) + (k + 1)3 + (k + 2)3 [expanding trinomial]
= (k3 + 6k2 + 9k + 3k2 + 18k + 27) + (k + 1)3 + (k + 2)3 [expanding binomial]
= 9k2 + 27k + 27 + k3 + (k + 1)3 + (k + 2)3 [adding like terms]
= 9k2 + 27k + 27 + 9j [by I.H.]
= 9(k2 + 3k + 3 + j) [factoring out 9]
Since k and j are integers, k2 + 3k + 3 + j is also an integer. Therefore, by the definition of divides,
9 | (k + 1)3 + (k + 2)3 + (k + 3)3, so P(k) → P(k + 1) for an arbitrary integer k > 1.
5). Conclusion: P(n) holds for all integers n > 1 by induction on n.
Q4 Walkthrough
2) Base Cases.
eg. n = 1: f(1) = 1 = 1^2
3) Inductive Hypothesis.
Another way:
IH: Suppose P(1)⋀P(2)⋀P(3)⋀…⋀P(k) for some arbitrary integer k ≥ 3.
1
3
IH: Suppose P(1)⋀P(2)⋀P(3)⋀…⋀P(k) for some arbitrary integer k ≥ 3.
4) Inductive Step.
1. Apply definition of f.
2. Simplify
3. Use the Inductive Hypothesis
4. Expansion.
5. Group like terms.
6. By algebra.
IH: [eg. f(k) = k^2]
1
3
IH: Suppose P(1)⋀P(2)⋀P(3)⋀…⋀P(k) for some arbitrary integer k ≥ 3.
5) Conclusion.
1
3
1
Q5 Walkthrough
A store sells candy in packs of 4 and packs of 7. Let P(n) be defined as "You are able to buy n packs of candy". For example, P(3) is not true, because you cannot buy exactly 3 packs of candy from the store. However, it turns out that P(n) is true for any n ≥ 18. Use strong induction on n to prove this.
1). INTRO: define P(N)
2). Base case:
.
.
.
A store sells candy in packs of 4 and packs of 7. Let P(n) be defined as "You are able to buy n packs of candy". For example, P(3) is not true, because you cannot buy exactly 3 packs of candy from the store. However, it turns out that P(n) is true for any n ≥ 18. Use strong induction on n to prove this.
1). INTRO: Let P(n) be defined as "You are able to buy n packs of candy". We will prove P(n) is true for all integers n ≥ 18 by strong induction.
2). Base cases: (n = 18,19,20,21):
n = 18: 18 packs of candy can be made up of 2 packs of 7 and 1 pack of 4 (18 = 2 ∗ 7 + 1 ∗ 4).
.
.
.
3). Inductive Hypothesis:
A store sells candy in packs of 4 and packs of 7. Let P(n) be defined as "You are able to buy n packs of candy". For example, P(3) is not true, because you cannot buy exactly 3 packs of candy from the store. However, it turns out that P(n) is true for any n ≥ 18. Use strong induction on n to prove this.
1). INTRO: Let P(n) be defined as "You are able to buy n packs of candy". We will prove P(n) is true for all integers n ≥ 18 by strong induction.
2). Base cases: (n = 18,19,20,21):
n = 18: 18 packs of candy can be made up of 2 packs of 7 and 1 pack of 4 (18 = 2 ∗ 7 + 1 ∗ 4).
n = 19: 19 packs of candy can be made up of 1 pack of 7 and 3 packs of 4 (19 = 1 ∗ 7 + 3 ∗ 4)
.
.
3). Inductive Hypothesis:
A store sells candy in packs of 4 and packs of 7. Let P(n) be defined as "You are able to buy n packs of candy". For example, P(3) is not true, because you cannot buy exactly 3 packs of candy from the store. However, it turns out that P(n) is true for any n ≥ 18. Use strong induction on n to prove this.
1). INTRO: Let P(n) be defined as "You are able to buy n packs of candy". We will prove P(n) is true for all integers n ≥ 18 by strong induction.
2). Base cases: (n = 18,19,20,21):
n = 18: 18 packs of candy can be made up of 2 packs of 7 and 1 pack of 4 (18 = 2 ∗ 7 + 1 ∗ 4).
n = 19: 19 packs of candy can be made up of 1 pack of 7 and 3 packs of 4 (19 = 1 ∗ 7 + 3 ∗ 4)
n = 20: 20 packs of candy can be made up of 5 packs of 4 (20 = 5 ∗ 4).
.
3). Inductive Hypothesis:
A store sells candy in packs of 4 and packs of 7. Let P(n) be defined as "You are able to buy n packs of candy". For example, P(3) is not true, because you cannot buy exactly 3 packs of candy from the store. However, it turns out that P(n) is true for any n ≥ 18. Use strong induction on n to prove this.
1). INTRO: Let P(n) be defined as "You are able to buy n packs of candy". We will prove P(n) is true for all integers n ≥ 18 by strong induction.
2). Base cases: (n = 18,19,20,21):
n = 18: 18 packs of candy can be made up of 2 packs of 7 and 1 pack of 4 (18 = 2 ∗ 7 + 1 ∗ 4).
n = 19: 19 packs of candy can be made up of 1 pack of 7 and 3 packs of 4 (19 = 1 ∗ 7 + 3 ∗ 4)
n = 20: 20 packs of candy can be made up of 5 packs of 4 (20 = 5 ∗ 4).
n = 21: 21 packs of candy can be made up of 3 packs of 7 (21 = 3 ∗ 7).
3). Inductive Hypothesis: Suppose for some arbitrary integer k ≥ 21, P(18) ∧... ∧P(k)
A store sells candy in packs of 4 and packs of 7. it turns out that P(n) is true for any n ≥ 18. Use strong induction on n to prove this.
1). Intro: Let P(n) be defined as "You are able to buy n packs of candy". We will prove P(n) is true for all integers n ≥ 18 by strong induction.
3). Inductive Hypothesis: Suppose for some arbitrary integer k ≥ 21, P(18) ∧... ∧P(k)
4). Inductive step: Goal: Show P(k + 1), i.e. show that we can buy k + 1 packs of candy
…
5). Conclusion: So by strong induction, P(n) is true for all integers n ≥ 18.
A store sells candy in packs of 4 and packs of 7. it turns out that P(n) is true for any n ≥ 18. Use strong induction on n to prove this.
1). Intro: Let P(n) be defined as "You are able to buy n packs of candy". We will prove P(n) is true for all integers n ≥ 18 by strong induction.
3). Inductive Hypothesis: Suppose for some arbitrary integer k ≥ 21, P(18) ∧... ∧P(k)
4). Inductive step: Goal: Show P(k + 1), i.e. show that we can buy k + 1 packs of candy
We want to buy k + 1 packs of candy. By the I.H., we can buy exactly k −3 packs, so we can add another pack of 4 packs in order to buy k + 1 packs of candy, so P(k + 1) is true.
5). Conclusion: So by strong induction, P(n) is true for all integers n ≥ 18.
Q7 Structural Induction
Definitions to Cite & Come back to:
Exit Ticket
Your Full Name +
How do you plan to study for the 311 midterm?