SlideShare a Scribd company logo
1 of 44
Mathematical Induction
1
M.M.A. Hashem, PhD
Professor
Dept. of Computer Science and Engineering
Khulna University of Engineering & Technology
(KUET)
CSE 1107
Discrete Mathematics
April 9, 2024 Dept of CSE, KUET
Mathematical Induction
April 9, 2024 Dept of CSE, KUET 2
This Lecture
Last time we have discussed different proof techniques.
This time we will focus on probably the most important one
– mathematical induction.
This lecture’s plan is to go through the following:
• The idea of mathematical induction
• Basic induction proofs (e.g. equality, inequality, property, etc)
• Inductive constructions
• A paradox
April 9, 2024 Dept of CSE, KUET 3
Proving For-All Statements
Objective: Prove
It is very common to prove statements of this form. Some Examples:
For an odd number m, mi is odd for all non-negative integer i.
Any integer n > 1 is divisible by a prime number.
(Cauchy-Schwarz inequality) For any a1,…,an, and any b1,…bn
April 9, 2024 Dept of CSE, KUET 4
Universal Generalization
( )
. ( )
A R c
A x R x

 
valid rule providing c is independent of A
One way to prove a for-all statement is to prove that R(c) is true for any c,
but this is often difficult to prove directly
(e.g. consider the statements in the previous slide).
Mathematical induction provides another way to prove a for-all statement.
It allows us to prove the statement step-by-step.
Let us first see the idea in two examples.
April 9, 2024 Dept of CSE, KUET 5
Odd Powers Are Odd
Fact: If m is odd and n is odd, then nm is odd.
Proposition: for an odd number m, mi is odd for all non-negative integer i.
Let P(i) be the proposition that mi is odd.
• P(1) is true by definition.
• P(2) is true by P(1) and the fact.
• P(3) is true by P(2) and the fact.
• P(i+1) is true by P(i) and the fact.
• So P(i) is true for all i.
Idea of induction.
April 9, 2024 Dept of CSE, KUET 6
Divisibility by a Prime
Theorem. Any integer n > 1 is divisible by a prime number.
Idea of induction.
•Let n be an integer.
•If n is a prime number, then we are done.
•Otherwise, n = ab, both are smaller than n.
•If a or b is a prime number, then we are done.
•Otherwise, a = cd, both are smaller than a.
•If c or d is a prime number, then we are done.
•Otherwise, repeat this argument, since the numbers are
getting smaller and smaller, this will eventually stop and
we have found a prime factor of n.
April 9, 2024 Dept of CSE, KUET 7
Objective: Prove
Idea of Induction
This is to prove
The idea of induction is to first prove P(0) unconditionally,
then use P(0) to prove P(1)
then use P(1) to prove P(2)
and repeat this to infinity…
April 9, 2024 Dept of CSE, KUET 8
The Induction Rule
0 and (from n to n +1),
proves 0, 1, 2, 3,….
P (0), nZ P (n)P (n+1)
mZ P (m)
Very easy
to prove
Much easier to
prove with P(n) as
an assumption.
The point is to use the knowledge on smaller problems to
solve bigger problems (i.e. can assume P(n) to prove P(n+1)).
Compare it with the universal generalization rule.
induction rule
(an axiom)
April 9, 2024 Dept of CSE, KUET 9
This Lecture
• The idea of mathematical induction
• Basic induction proofs (e.g. equality, inequality, property,etc)
• Inductive constructions
• A paradox
April 9, 2024 Dept of CSE, KUET 10
Proving an Equality
Let P(n) be the induction hypothesis that the statement is true for n.
Base case: P(1) is true
Induction step: assume P(n) is true, prove P(n+1) is true.
because both LHS and RHS equal to 1
That is, assuming:
Want to prove:
This is much easier to prove than proving it directly,
because we already know the sum of the first n terms!
April 9, 2024 Dept of CSE, KUET 11
Proving an Equality
Let P(n) be the induction hypothesis that the statement is true for n.
Base case: P(1) is true
Induction step: assume P(n) is true, prove P(n+1) is true.
by induction
because both LHS and RHS equal to 1
April 9, 2024 Dept of CSE, KUET 12
Proving an Equality
Let P(n) be the induction hypothesis that the statement is true for n.
Base case: P(1) is true
Induction step: assume P(n) is true, prove P(n+1) is true.
by induction
April 9, 2024 Dept of CSE, KUET 13
Proving a Property
Base Case (n = 1):
Induction Step: Assume P(i) for some i  1 and prove P(i + 1):
Assume is divisible by 3, prove is divisible by 3.
Divisible by 3 by induction
Divisible by 3
April 9, 2024 Dept of CSE, KUET 14
Proving a Property
Base Case (n = 2):
Induction Step: Assume P(i) for some i  2 and prove P(i + 1):
Assume is divisible by 6
is divisible by 6.
Divisible by 2
by case analysis
Divisible by 6
by induction
Prove
April 9, 2024 Dept of CSE, KUET 15
Proving an Inequality
Base Case (n = 2): is true
Induction Step: Assume P(i) for some i  2 and prove P(i + 1):
by induction
April 9, 2024 Dept of CSE, KUET 16
Cauchy-Schwarz
(Cauchy-Schwarz inequality) For any a1,…,an, and any b1,…bn
Proof by induction (on n): When n=1, LHS <= RHS.
When n=2, want to show
Consider
April 9, 2024 Dept of CSE, KUET 17
Cauchy-Schwarz
(Cauchy-Schwarz inequality) For any a1,…,an, and any b1,…bn
Induction step: assume true for <=n, prove n+1.
induction
by P(2)
April 9, 2024 Dept of CSE, KUET 18
This Lecture
• The idea of mathematical induction
• Basic induction proofs (e.g. equality, inequality, property,etc)
• Inductive constructions
• A paradox
April 9, 2024 Dept of CSE, KUET 19
Gray Code
Can you find an ordering of all the n-bit strings in such a way that
two consecutive n-bit strings differed by only one bit?
This is called the Gray code and has some applications.
How to construct them? Think inductively!
2 bit
00
01
11
10
3 bit
000
001
011
010
110
111
101
100
Can you see the pattern?
How to construct 4-bit gray code?
April 9, 2024 Dept of CSE, KUET 20
Gray Code
3 bit
000
001
011
010
110
111
101
100
3 bit (reversed)
100
101
111
110
010
011
001
000
000
001
011
010
110
111
101
100
100
101
111
110
010
011
001
000
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
4 bit
differed by 1 bit
by induction
differed by 1 bit
by induction
differed by 1 bit
by construction
Every 4-bit string appears exactly once.
April 9, 2024 Dept of CSE, KUET 21
Gray Code
n bit
000…0
…
…
…
…
…
…
100…0
n bit (reversed)
100…0
…
…
…
…
…
…
000…0
000…0
…
…
…
…
…
…
100…0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
n+1 bit
differed by 1 bit
by induction
differed by 1 bit
by induction
differed by 1 bit
by construction
100…0
…
…
…
…
…
…
000…0
So, by induction,
Gray code exists for any n.
Every (n+1)-bit string appears exactly once.
April 9, 2024 Dept of CSE, KUET 22
Goal: tile the squares, except one in the middle for Bill.
n
2
n
2
Puzzle
April 9, 2024 Dept of CSE, KUET 23
There are only trominos (L-shaped tiles) covering three squares:
For example, for 8 x 8 puzzle might tile for Bill this way:
Puzzle
April 9, 2024 Dept of CSE, KUET 24
Theorem: For any 2n x 2n puzzle, there is a tiling with Bill in the middle.
Proof: (by induction on n)
P(n) ::= can tile 2n x 2n with Bill in middle.
Base case: (n=0)
(no tiles needed)
Puzzle
(Did you remember that we proved is divisble by 3?)
April 9, 2024 Dept of CSE, KUET 25
n
2
Induction step: assume can tile 2n x 2n,
prove can handle 2n+1 x 2n+1.
1
2 +
n
Puzzle
Now
what??
April 9, 2024 Dept of CSE, KUET 26
Puzzle
Idea: It would be nice if we could control the locations of the empty square.
n
2
n
2
April 9, 2024 Dept of CSE, KUET 27
Done!
Puzzle
Idea: It would be nice if we could control the locations of the empty square.
April 9, 2024 Dept of CSE, KUET 28
The new idea:
Prove that we can always find a tiling with Bill anywhere.
Puzzle
Theorem B: For any 2n x 2n plaza, there is a tiling with Bill anywhere.
Theorem: For any 2n x 2n plaza, there is a tiling with Bill in the middle.
Clearly Theorem B implies Theorem.
A stronger property
April 9, 2024 Dept of CSE, KUET 29
Theorem B: For any 2n x 2n plaza, there is a tiling with Bill anywhere.
Proof: (by induction on n)
P(n) ::= can tile 2n x 2n with Bill anywhere.
Base case: (n=0)
(no tiles needed)
Puzzle
April 9, 2024 Dept of CSE, KUET 30
Induction step:
Assume we can get Bill anywhere in 2n x 2n.
Prove we can get Bill anywhere in 2n+1 x 2n+1.
Puzzle
April 9, 2024 Dept of CSE, KUET 31
Puzzle
Induction step:
Assume we can get Bill anywhere in 2n x 2n.
Prove we can get Bill anywhere in 2n+1 x 2n+1.
n
2
n
2
April 9, 2024 Dept of CSE, KUET 32
Method: Now group the squares together,
and fill the center with a tile.
Done!
Puzzle
April 9, 2024 Dept of CSE, KUET 33
Some Remarks
Note 1: It may help to choose a stronger hypothesis
than the desired result (e.g. “Bill in anywhere”).
We need to prove a stronger statement, but in
return we can assume a stronger property in
the induction step.
Note 2: The induction proof of “Bill anywhere” implicitly
defines a recursive algorithm for finding such a tiling.
April 9, 2024 Dept of CSE, KUET 34
Hadamard Matrix
Can you construct an nxn matrix with all entries +-1 and
all the rows are orthogonal to each other?
Two rows are orthogonal if their inner product is zero.
That is, let a = (a1, …, an) and b = (b1, …, bn),
their inner product ab = a1b1 + a2b2 + … + anbn
This matrix is famous and has applications in coding theory.
To think inductively, first we come up with small examples.
1 1
1 -1
April 9, 2024 Dept of CSE, KUET 35
Hadamard Matrix
Then we use the small examples to build larger examples.
Suppose we have an nxn Hadamard matrix Hn.
We can use it to construct an 2nx2n Hadamard matrix as follows.
Hn Hn
Hn -Hn
So by induction there is a 2k x 2k Hardmard matrix for any k.
It is an exercise to check that the rows are orthogonal to each other.
April 9, 2024 Dept of CSE, KUET 36
Inductive Construction
This technique is very useful.
We can use it to construct:
- codes
- graphs
- matrices
- circuits
- algorithms
- designs
- proofs
- buildings
- …
April 9, 2024 Dept of CSE, KUET 37
This Lecture
• The idea of mathematical induction
• Basic induction proofs (e.g. equality, inequality, property,etc)
• Inductive constructions
• A paradox
April 9, 2024 Dept of CSE, KUET 38
Paradox
Theorem: All horses have the same color.
Proof: (by induction on n)
Induction hypothesis:
P(n) ::= any set of n horses have the same color
Base case (n=0):
No horses so obviously true!
…
April 9, 2024 Dept of CSE, KUET 39
(Inductive case)
Assume any n horses have the same color.
Prove that any n+1 horses have the same color.
Paradox
…
n+1
April 9, 2024 Dept of CSE, KUET 40
…
First set of n horses have the same color
Second set of n horses have the same color
(Inductive case)
Assume any n horses have the same color.
Prove that any n+1 horses have the same color.
Paradox
April 9, 2024 Dept of CSE, KUET 41
…
Therefore the set of n+1 have the same color!
(Inductive case)
Assume any n horses have the same color.
Prove that any n+1 horses have the same color.
Paradox
April 9, 2024 Dept of CSE, KUET 42
What is wrong?
Proof that P(n) → P(n+1)
is false if n = 1, because the two
horse groups do not overlap.
First set of n=1 horses
n =1
Second set of n=1 horses
Paradox
(But proof works for all n ≠ 1)
April 9, 2024 Dept of CSE, KUET 43
Quick Summary
You should understand the principle of mathematical induction well,
and do basic induction proofs like
• proving equality
• proving inequality
• proving property
Mathematical induction has a wide range of applications in computer science.
In the next lecture we will see more applications and more techniques.
April 9, 2024 Dept of CSE, KUET 44

More Related Content

Similar to L05 Mathematical Induction in Discrete Mathmatics.ppt

Similar to L05 Mathematical Induction in Discrete Mathmatics.ppt (20)

Theory of Computation Unit 1
Theory of Computation Unit 1Theory of Computation Unit 1
Theory of Computation Unit 1
 
Induction.pdf
Induction.pdfInduction.pdf
Induction.pdf
 
Discrete Math Lecture 03: Methods of Proof
Discrete Math Lecture 03: Methods of ProofDiscrete Math Lecture 03: Methods of Proof
Discrete Math Lecture 03: Methods of Proof
 
DM(1).pptx
DM(1).pptxDM(1).pptx
DM(1).pptx
 
Lect 18
Lect 18Lect 18
Lect 18
 
SESSION-12 PPT.pptx
SESSION-12 PPT.pptxSESSION-12 PPT.pptx
SESSION-12 PPT.pptx
 
Pnp
PnpPnp
Pnp
 
Chapter 4 dis 2011
Chapter 4 dis 2011Chapter 4 dis 2011
Chapter 4 dis 2011
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Recursion (in Python)
Recursion (in Python)Recursion (in Python)
Recursion (in Python)
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
probability assignment help (2)
probability assignment help (2)probability assignment help (2)
probability assignment help (2)
 
Discrete mathematics notes
Discrete mathematics notesDiscrete mathematics notes
Discrete mathematics notes
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
 
10.1.1.96.9176
10.1.1.96.917610.1.1.96.9176
10.1.1.96.9176
 
artficial intelligence
artficial intelligenceartficial intelligence
artficial intelligence
 
Problemas de Smale
Problemas de SmaleProblemas de Smale
Problemas de Smale
 
Factorials as sums
Factorials as sumsFactorials as sums
Factorials as sums
 
AI Lesson 29
AI Lesson 29AI Lesson 29
AI Lesson 29
 
Lesson 29
Lesson 29Lesson 29
Lesson 29
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

L05 Mathematical Induction in Discrete Mathmatics.ppt

  • 1. Mathematical Induction 1 M.M.A. Hashem, PhD Professor Dept. of Computer Science and Engineering Khulna University of Engineering & Technology (KUET) CSE 1107 Discrete Mathematics April 9, 2024 Dept of CSE, KUET
  • 2. Mathematical Induction April 9, 2024 Dept of CSE, KUET 2
  • 3. This Lecture Last time we have discussed different proof techniques. This time we will focus on probably the most important one – mathematical induction. This lecture’s plan is to go through the following: • The idea of mathematical induction • Basic induction proofs (e.g. equality, inequality, property, etc) • Inductive constructions • A paradox April 9, 2024 Dept of CSE, KUET 3
  • 4. Proving For-All Statements Objective: Prove It is very common to prove statements of this form. Some Examples: For an odd number m, mi is odd for all non-negative integer i. Any integer n > 1 is divisible by a prime number. (Cauchy-Schwarz inequality) For any a1,…,an, and any b1,…bn April 9, 2024 Dept of CSE, KUET 4
  • 5. Universal Generalization ( ) . ( ) A R c A x R x    valid rule providing c is independent of A One way to prove a for-all statement is to prove that R(c) is true for any c, but this is often difficult to prove directly (e.g. consider the statements in the previous slide). Mathematical induction provides another way to prove a for-all statement. It allows us to prove the statement step-by-step. Let us first see the idea in two examples. April 9, 2024 Dept of CSE, KUET 5
  • 6. Odd Powers Are Odd Fact: If m is odd and n is odd, then nm is odd. Proposition: for an odd number m, mi is odd for all non-negative integer i. Let P(i) be the proposition that mi is odd. • P(1) is true by definition. • P(2) is true by P(1) and the fact. • P(3) is true by P(2) and the fact. • P(i+1) is true by P(i) and the fact. • So P(i) is true for all i. Idea of induction. April 9, 2024 Dept of CSE, KUET 6
  • 7. Divisibility by a Prime Theorem. Any integer n > 1 is divisible by a prime number. Idea of induction. •Let n be an integer. •If n is a prime number, then we are done. •Otherwise, n = ab, both are smaller than n. •If a or b is a prime number, then we are done. •Otherwise, a = cd, both are smaller than a. •If c or d is a prime number, then we are done. •Otherwise, repeat this argument, since the numbers are getting smaller and smaller, this will eventually stop and we have found a prime factor of n. April 9, 2024 Dept of CSE, KUET 7
  • 8. Objective: Prove Idea of Induction This is to prove The idea of induction is to first prove P(0) unconditionally, then use P(0) to prove P(1) then use P(1) to prove P(2) and repeat this to infinity… April 9, 2024 Dept of CSE, KUET 8
  • 9. The Induction Rule 0 and (from n to n +1), proves 0, 1, 2, 3,…. P (0), nZ P (n)P (n+1) mZ P (m) Very easy to prove Much easier to prove with P(n) as an assumption. The point is to use the knowledge on smaller problems to solve bigger problems (i.e. can assume P(n) to prove P(n+1)). Compare it with the universal generalization rule. induction rule (an axiom) April 9, 2024 Dept of CSE, KUET 9
  • 10. This Lecture • The idea of mathematical induction • Basic induction proofs (e.g. equality, inequality, property,etc) • Inductive constructions • A paradox April 9, 2024 Dept of CSE, KUET 10
  • 11. Proving an Equality Let P(n) be the induction hypothesis that the statement is true for n. Base case: P(1) is true Induction step: assume P(n) is true, prove P(n+1) is true. because both LHS and RHS equal to 1 That is, assuming: Want to prove: This is much easier to prove than proving it directly, because we already know the sum of the first n terms! April 9, 2024 Dept of CSE, KUET 11
  • 12. Proving an Equality Let P(n) be the induction hypothesis that the statement is true for n. Base case: P(1) is true Induction step: assume P(n) is true, prove P(n+1) is true. by induction because both LHS and RHS equal to 1 April 9, 2024 Dept of CSE, KUET 12
  • 13. Proving an Equality Let P(n) be the induction hypothesis that the statement is true for n. Base case: P(1) is true Induction step: assume P(n) is true, prove P(n+1) is true. by induction April 9, 2024 Dept of CSE, KUET 13
  • 14. Proving a Property Base Case (n = 1): Induction Step: Assume P(i) for some i  1 and prove P(i + 1): Assume is divisible by 3, prove is divisible by 3. Divisible by 3 by induction Divisible by 3 April 9, 2024 Dept of CSE, KUET 14
  • 15. Proving a Property Base Case (n = 2): Induction Step: Assume P(i) for some i  2 and prove P(i + 1): Assume is divisible by 6 is divisible by 6. Divisible by 2 by case analysis Divisible by 6 by induction Prove April 9, 2024 Dept of CSE, KUET 15
  • 16. Proving an Inequality Base Case (n = 2): is true Induction Step: Assume P(i) for some i  2 and prove P(i + 1): by induction April 9, 2024 Dept of CSE, KUET 16
  • 17. Cauchy-Schwarz (Cauchy-Schwarz inequality) For any a1,…,an, and any b1,…bn Proof by induction (on n): When n=1, LHS <= RHS. When n=2, want to show Consider April 9, 2024 Dept of CSE, KUET 17
  • 18. Cauchy-Schwarz (Cauchy-Schwarz inequality) For any a1,…,an, and any b1,…bn Induction step: assume true for <=n, prove n+1. induction by P(2) April 9, 2024 Dept of CSE, KUET 18
  • 19. This Lecture • The idea of mathematical induction • Basic induction proofs (e.g. equality, inequality, property,etc) • Inductive constructions • A paradox April 9, 2024 Dept of CSE, KUET 19
  • 20. Gray Code Can you find an ordering of all the n-bit strings in such a way that two consecutive n-bit strings differed by only one bit? This is called the Gray code and has some applications. How to construct them? Think inductively! 2 bit 00 01 11 10 3 bit 000 001 011 010 110 111 101 100 Can you see the pattern? How to construct 4-bit gray code? April 9, 2024 Dept of CSE, KUET 20
  • 21. Gray Code 3 bit 000 001 011 010 110 111 101 100 3 bit (reversed) 100 101 111 110 010 011 001 000 000 001 011 010 110 111 101 100 100 101 111 110 010 011 001 000 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 4 bit differed by 1 bit by induction differed by 1 bit by induction differed by 1 bit by construction Every 4-bit string appears exactly once. April 9, 2024 Dept of CSE, KUET 21
  • 22. Gray Code n bit 000…0 … … … … … … 100…0 n bit (reversed) 100…0 … … … … … … 000…0 000…0 … … … … … … 100…0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 n+1 bit differed by 1 bit by induction differed by 1 bit by induction differed by 1 bit by construction 100…0 … … … … … … 000…0 So, by induction, Gray code exists for any n. Every (n+1)-bit string appears exactly once. April 9, 2024 Dept of CSE, KUET 22
  • 23. Goal: tile the squares, except one in the middle for Bill. n 2 n 2 Puzzle April 9, 2024 Dept of CSE, KUET 23
  • 24. There are only trominos (L-shaped tiles) covering three squares: For example, for 8 x 8 puzzle might tile for Bill this way: Puzzle April 9, 2024 Dept of CSE, KUET 24
  • 25. Theorem: For any 2n x 2n puzzle, there is a tiling with Bill in the middle. Proof: (by induction on n) P(n) ::= can tile 2n x 2n with Bill in middle. Base case: (n=0) (no tiles needed) Puzzle (Did you remember that we proved is divisble by 3?) April 9, 2024 Dept of CSE, KUET 25
  • 26. n 2 Induction step: assume can tile 2n x 2n, prove can handle 2n+1 x 2n+1. 1 2 + n Puzzle Now what?? April 9, 2024 Dept of CSE, KUET 26
  • 27. Puzzle Idea: It would be nice if we could control the locations of the empty square. n 2 n 2 April 9, 2024 Dept of CSE, KUET 27
  • 28. Done! Puzzle Idea: It would be nice if we could control the locations of the empty square. April 9, 2024 Dept of CSE, KUET 28
  • 29. The new idea: Prove that we can always find a tiling with Bill anywhere. Puzzle Theorem B: For any 2n x 2n plaza, there is a tiling with Bill anywhere. Theorem: For any 2n x 2n plaza, there is a tiling with Bill in the middle. Clearly Theorem B implies Theorem. A stronger property April 9, 2024 Dept of CSE, KUET 29
  • 30. Theorem B: For any 2n x 2n plaza, there is a tiling with Bill anywhere. Proof: (by induction on n) P(n) ::= can tile 2n x 2n with Bill anywhere. Base case: (n=0) (no tiles needed) Puzzle April 9, 2024 Dept of CSE, KUET 30
  • 31. Induction step: Assume we can get Bill anywhere in 2n x 2n. Prove we can get Bill anywhere in 2n+1 x 2n+1. Puzzle April 9, 2024 Dept of CSE, KUET 31
  • 32. Puzzle Induction step: Assume we can get Bill anywhere in 2n x 2n. Prove we can get Bill anywhere in 2n+1 x 2n+1. n 2 n 2 April 9, 2024 Dept of CSE, KUET 32
  • 33. Method: Now group the squares together, and fill the center with a tile. Done! Puzzle April 9, 2024 Dept of CSE, KUET 33
  • 34. Some Remarks Note 1: It may help to choose a stronger hypothesis than the desired result (e.g. “Bill in anywhere”). We need to prove a stronger statement, but in return we can assume a stronger property in the induction step. Note 2: The induction proof of “Bill anywhere” implicitly defines a recursive algorithm for finding such a tiling. April 9, 2024 Dept of CSE, KUET 34
  • 35. Hadamard Matrix Can you construct an nxn matrix with all entries +-1 and all the rows are orthogonal to each other? Two rows are orthogonal if their inner product is zero. That is, let a = (a1, …, an) and b = (b1, …, bn), their inner product ab = a1b1 + a2b2 + … + anbn This matrix is famous and has applications in coding theory. To think inductively, first we come up with small examples. 1 1 1 -1 April 9, 2024 Dept of CSE, KUET 35
  • 36. Hadamard Matrix Then we use the small examples to build larger examples. Suppose we have an nxn Hadamard matrix Hn. We can use it to construct an 2nx2n Hadamard matrix as follows. Hn Hn Hn -Hn So by induction there is a 2k x 2k Hardmard matrix for any k. It is an exercise to check that the rows are orthogonal to each other. April 9, 2024 Dept of CSE, KUET 36
  • 37. Inductive Construction This technique is very useful. We can use it to construct: - codes - graphs - matrices - circuits - algorithms - designs - proofs - buildings - … April 9, 2024 Dept of CSE, KUET 37
  • 38. This Lecture • The idea of mathematical induction • Basic induction proofs (e.g. equality, inequality, property,etc) • Inductive constructions • A paradox April 9, 2024 Dept of CSE, KUET 38
  • 39. Paradox Theorem: All horses have the same color. Proof: (by induction on n) Induction hypothesis: P(n) ::= any set of n horses have the same color Base case (n=0): No horses so obviously true! … April 9, 2024 Dept of CSE, KUET 39
  • 40. (Inductive case) Assume any n horses have the same color. Prove that any n+1 horses have the same color. Paradox … n+1 April 9, 2024 Dept of CSE, KUET 40
  • 41. … First set of n horses have the same color Second set of n horses have the same color (Inductive case) Assume any n horses have the same color. Prove that any n+1 horses have the same color. Paradox April 9, 2024 Dept of CSE, KUET 41
  • 42. … Therefore the set of n+1 have the same color! (Inductive case) Assume any n horses have the same color. Prove that any n+1 horses have the same color. Paradox April 9, 2024 Dept of CSE, KUET 42
  • 43. What is wrong? Proof that P(n) → P(n+1) is false if n = 1, because the two horse groups do not overlap. First set of n=1 horses n =1 Second set of n=1 horses Paradox (But proof works for all n ≠ 1) April 9, 2024 Dept of CSE, KUET 43
  • 44. Quick Summary You should understand the principle of mathematical induction well, and do basic induction proofs like • proving equality • proving inequality • proving property Mathematical induction has a wide range of applications in computer science. In the next lecture we will see more applications and more techniques. April 9, 2024 Dept of CSE, KUET 44