尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
1
Module 2:Logic
Prof. Shiwani Gupta
History and Applications
• Derived from the greek word ‘logos’.
• It is called science of thought.
• It starts from Aristotle.
• Real Life: Expert Systems, VLSI, Semantic Web.
• Computer Science: Godel’s incompleteness
theorem, Frame problem, Category theory, Curry-
Howard correspondence.
2
Statements in Grammar
• Declarative: The sky is blue.
• Imperative: Speak truth.
• Interrogative: Are you interested in maths?
• Exclamatory: Wow! You are so beautiful.
3
Propositional logic
• Propositional logic is the simplest logic – illustrates basic ideas.
• A declarative sentence which can be classified as either true or false.
• Simple statement
Eg. Aristotle was a philosopher
• Compound Statement
Eg. If you will commit a mistake, you will pay for it
Symbols of propositional logic
• Logical constants TRUE and FALSE are sentences
• Proposition symbols P,Q,S1,S2 are sentences
• ∧, V, , , are logical connectives
• parenthesis ( )
• Order of precedence (), , ∧, V, ,
Connectives
– If S is a sentence, S is a sentence
(negation)
– If S1 and S2 are sentences, S1  S2 is a sentence
(conjunction)
– If S1 and S2 are sentences, S1  S2 is a sentence
(disjunction)
– If S1 and S2 are sentences, S1  S2 is a sentence
(implication)
– If S1 and S2 are sentences, S1  S2 is a sentence
(biconditional)
6
Propositional logic: Semantics
Each model specifies true/false for each proposition symbol
E.g. P1 P2 P3
false true false
With these symbols, 8 possible models, can be enumerated automatically.
Rules for evaluating truth with respect to a model m:
S or S is true iff S is false
S1  S2 is true iff S1 is true and S2 is true
S1  S2 is true iff S1is true or S2 is true
S1  S2 is true iff S1 is false or S2 is true
i.e., is false iff S1 is true and S2 is false
S1  S2 is true iff S1S2 is true and S2S1 is true
Simple recursive process evaluates an arbitrary sentence, e.g.,
P1  (P2  P3) = true  (true  false) = true  true = true
Truth tables for connectives
If P then Q
 P V Q
If P then Q and If Q then P
(if and only if)
Truth tables for connectives
Converse, Inverse and Contrapositive
Given an implication "if p, then q“, we can create three related statements:
• A conditional statement consists of two parts, a premise in the “if” clause and a
conclusion in the “then” clause. For instance, “If it rains, then they cancel school.”
"It rains" is the premise.
"They cancel school" is the conclusion.
• To form the converse of the conditional statement, interchange the premise and the
conclusion.
The converse of "If it rains, then they cancel school" is
"If they cancel school, then it rains."
• To form the inverse of the conditional statement, take the negation of both the
premise and the conclusion.
The inverse of “If it rains, then they cancel school” is
“If it does not rain, then they do not cancel school.”
• To form the contrapositive of the conditional statement, interchange the premise
and the conclusion of the inverse statement.
The contrapositive of "If it rains, then they cancel school" is
"If they do not cancel school, then it does not rain."
Converse, Inverse and Contrapositive
Eg.1
Statement: If p, then q.
Converse: If q, then p.
Inverse: If not p, then not q.
Contrapositive: If not q, then not p.
Eg.2
Statement: If two angles are congruent, then they have the same measure.
Converse: If two angles have the same measure, then they are congruent.
Inverse: If two angles are not congruent, then they do not have the same measure.
Contrapositive: If two angles do not have the same measure, then they are not
congruent.
(Laws of Logic)
Logical equivalence - Biconditional
• Two sentences are logically equivalent iff true in same models:
i.e. they have identical truth tables
Involution law
• Two sentences are logically equivalent iff true in same models:
i.e. they have identical truth tables
α  α ≡ α α ∧ α ≡ α Idempotent Law
α  F ≡ α α ∧ T ≡ T Identity Law
α  T ≡ T α ∧ F ≡ F Annihilation Law
α   α ≡ T α ∧  α ≡ F Inverse Law
 T ≡ F  F ≡ T Complement Law
(Laws of Logic)
Logical equivalence
Validity (tautology), contradiction and contingency
A proposition which is always true is called tautology
α   α
A proposition which is always false is called contradiction
α ∧  α
A proposition which is neither a tautology nor a contradiction is
called contingency
 α   ,  α  , α  
Propositions quantifying
• All humans are mortal.
• Everything is perishable.
• Some people have pink hair.
• Nothing is perfect.
• There exists a white crow.
15
16
Quantifiers
• A quantifier is “an operator that limits the
variables of a proposition”
• Two types:
– Universal : the proposition is true for all, for
each, for every possible values in the universe
of discourse
– Existential : the proposition is true for some
value(s) in the universe of discourse
Universal quantification
•  <variables> <sentence> or A <variables> <sentence>
Example:
“All elephants are gray”
(x )(elephant(x) color(x, GRAY))
• x P is true in a model m iff P is true with x being each possible
object in the model
• Roughly speaking, equivalent to the conjunction of instantiations of P
Example:
“Everyone at NUS is smart”
x At(x,NUS)  Smart(x)
At(KingJohn,NUS) Smart(KingJohn)  At(Richard,NUS)
Smart(Richard)  At(NUS,NUS) Smart(NUS) …
Existential quantification
• <variables> <sentence> or E <variables> <sentence>
Example:
“Someone wrote Computer Chess”
(x write(x, COMPUTER-CHESS))
• x P is true in a model m iff P is true with x being some possible
object in the model
• Roughly speaking, equivalent to the disjunction of instantiations of P
Example:
Someone at NUS is smart:
x At(x,NUS)  Smart(x)
At(KingJohn,NUS)  Smart(KingJohn)  At(Richard,NUS) 
Smart(Richard)  At(NUS,NUS)  Smart(NUS)  ...
Properties of quantifiers
• x y is the same as y x
• x y is the same as y x
• x y is not the same as y x
• “There is a person who loves everyone in the house”
x y Loves(x,y)
• “Everyone in the house loves at least one person”
x y Loves(x,y)
Quantifier duality(De Morgan’s law for quantification):
each can be expressed using the other
• x Likes(x,IceCream) x Likes(x,IceCream)
• x Likes(x,Broccoli) x Likes(x,Broccoli)
Nested quantifiers
Examples on Predicate Logic
• x loves y Loves(x,y)
Everybody loves Jerry x Loves (x, Jerry)
• Everybody loves somebody x y Loves (x, y)
• There is somebody whom somebody loves y x Loves (x, y)
• Nobody loves everybody  x y Loves (x, y) = x y Loves (x, y)
• There is somebody whom Rachita doesn’t love y Loves (Rachita, y)
• There is somebody whom no one loves y x Loves (x, y)
• Everybody loves himself or herself x Loves(x,x)
Normal Forms
A problem in logic is to find whether a given statement is
tautology or contradiction via truth tables, especially where the
statement form may contain a large no. of variables.
Hence reduce statement form to normal form.
• Disjunctive Normal Form (dnf): A statement form consisting
of disjunction of fundamental conjuncts (minterm)
(P  Q  R) V (X   Y  Z) [SOP]
• Conjunctive Normal Form (cnf): A statement form consisting
of conjunction of fundamental disjuncts (maxterm)
( P V X)  (P V  Y)  (P V Z)  (…..) [POS]
DNF (SOP) to CNF (POS)
for resolution refutation
Disjunctive Normal Form
(P  Q  R) V (X   Y  Z)
Conjunctive Normal Form
( P V X)  (P V  Y)  (P V Z)  (…..)
Every sentence of propositional logic is logically equivalent
to a conjunction of disjuncts of literals
Conversion to CNF
• Eliminate α ß to (α  ß )  (ß  α )
• Eliminate α  ß to  α V ß
• CNF requires  to appear only with literals
For this apply
( α) ≡ α (double-negative elimination)
 (α  ß) ≡  α V  ß (de Morgan)
 (α V ß) ≡  α   ß (de Morgan)
• Now we have a sentence with nested  and V operators
applied to literals. Apply distributivity law distributing V
over 
Inference Rules
26
Principle of Mathematical
Induction
Mathematical induction is a form of mathematical proof.
Just because a rule, pattern, or formula seems to work for several
values of n, you cannot simply decide that it is valid for all
values of n without going through a legitimate proof.
The Principle of Mathematical Induction
Let Pn be a statement involving the positive integer n. If
1. Verification: P1 is true, and
2. Induction: the truth of Pk implies the truth of Pk+1 ,
for every positive integer k,
Conclusion: then Pn must be true for all integers n.
27
Example: Sum of Odd Integers
➢ Proposition: 1 + 3 + … + (2n-1) = n2
for all integers n≥1.
➢ Proof (by induction):
1) Basis step:
The statement is true for n=1: 1=12 .
2) Inductive step:
Assume the statement is true for some k≥1
(inductive hypothesis) ,
show that it is true for k+1 .
Example: Sum of Odd Integers
➢ Proof (cont.):
The statement is true for k:
1+3+…+(2k-1) = k2 (1)
We need to show it for k+1:
1+3+…+(2(k+1)-1) = (k+1)2 (2)
Showing (2):
1+3+…+(2(k+1)-1) = 1+3+…+(2k+1) =
1+3+…+(2k-1)+(2k+1) =
k2+(2k+1) = (k+1)2 .
We proved the basis and inductive steps,
so we conclude that the given statement true. ■
by (1)
29
Example: Sum of square of
Integers
➢ Proposition:
for all integers n≥1.
➢ Proof (by induction):
1) Basis step:
The statement is true for n=1: 12= .
2) Inductive step:
Assume the statement is true for some k≥1
(inductive hypothesis) ,
show that it is true for k+1 .
Sn = 12 + 22 + 32 + 42 + . . . + n2 = ( )( )
6
121 ++ nnn
( )( )
6
321
Example: Sum of square of
Integers
➢ Proof (cont.):
The statement is true for k:
We need to show it for k+1:
by (1)
12 + 22 + 32 + 42 + . . . + k2 = (1)
( )( )
6
121 ++ kkk
( )( )( )
6
3221 +++ kkk
( )( ) ( )
6
16121
2
++++
=
kkkk
( ) ( ) ( ) 
6
16121 ++++
=
kkkk ( ) 
6
6721 2
+++
=
kkk ( )( )( )
6
3221 +++
=
kkk
Showing (2): (12 + 22 + 32 + 42 + . . . + k2) + (k + 1)2

=
k k +1( ) 2k +1( )
6
+ (k + 1)2
12 + 22 + 32 + 42 + . . . + k2 + (k+1)2 = (2)
We proved the basis and inductive steps,
so we conclude that the given statement true.

More Related Content

What's hot

Philosophy,logic and its kind,inductive and deductive reasoning ppt
Philosophy,logic and its kind,inductive and deductive reasoning pptPhilosophy,logic and its kind,inductive and deductive reasoning ppt
Philosophy,logic and its kind,inductive and deductive reasoning ppt
Umer Niazi
 
Logic Ppt
Logic PptLogic Ppt
Logic Ppt
DMMMSU-MLUC
 
Chapter 5 part1- The Sampling Distribution of a Sample Mean
Chapter 5 part1- The Sampling Distribution of a Sample MeanChapter 5 part1- The Sampling Distribution of a Sample Mean
Chapter 5 part1- The Sampling Distribution of a Sample Mean
nszakir
 
Logic
LogicLogic
A Powerpoint on Logic
A Powerpoint on LogicA Powerpoint on Logic
A Powerpoint on Logic
Rosielyn Mae Bolon
 
LOGIC - Seminar In Problem Solving
LOGIC - Seminar In Problem SolvingLOGIC - Seminar In Problem Solving
LOGIC - Seminar In Problem Solving
Menchie Magistrado
 
Introduction to Logic
Introduction to LogicIntroduction to Logic
Introduction to Logic
Ruby Angela
 
Proposition (Logic)
Proposition (Logic)Proposition (Logic)
Proposition (Logic)
EFREN ARCHIDE
 
logic - workbook summary
logic - workbook summarylogic - workbook summary
logic - workbook summary
Kim Clyde Mallari
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
Birinder Singh Gulati
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
blaircomp2003
 
Logic introduction
Logic   introductionLogic   introduction
Logic introduction
Abdul Qadir Memon
 
Probability distribution
Probability distributionProbability distribution
Probability distribution
Ranjan Kumar
 
Percentile
PercentilePercentile
Percentile
Fahadi302
 
Formal Logic - Lesson 1 - Introduction to Logic
Formal Logic - Lesson 1 - Introduction to LogicFormal Logic - Lesson 1 - Introduction to Logic
Formal Logic - Lesson 1 - Introduction to Logic
Laguna State Polytechnic University
 
Measure of Relationship: Correlation Coefficient
Measure of Relationship: Correlation CoefficientMeasure of Relationship: Correlation Coefficient
Measure of Relationship: Correlation Coefficient
Lade Asrah Carim
 
Logical Opposition (Social Philosophy and Logic)
Logical Opposition (Social Philosophy and Logic)Logical Opposition (Social Philosophy and Logic)
Logical Opposition (Social Philosophy and Logic)
Daryl Melo
 
Point and Interval Estimation
Point and Interval EstimationPoint and Interval Estimation
Point and Interval Estimation
Shubham Mehta
 
Lecture 13.1 Social philosophy.ppt
Lecture 13.1 Social philosophy.pptLecture 13.1 Social philosophy.ppt
Lecture 13.1 Social philosophy.ppt
Shivamsharma15812
 
Chapter 4 logical reasoning
Chapter 4 logical reasoningChapter 4 logical reasoning
Chapter 4 logical reasoning
Jaypee Sidon
 

What's hot (20)

Philosophy,logic and its kind,inductive and deductive reasoning ppt
Philosophy,logic and its kind,inductive and deductive reasoning pptPhilosophy,logic and its kind,inductive and deductive reasoning ppt
Philosophy,logic and its kind,inductive and deductive reasoning ppt
 
Logic Ppt
Logic PptLogic Ppt
Logic Ppt
 
Chapter 5 part1- The Sampling Distribution of a Sample Mean
Chapter 5 part1- The Sampling Distribution of a Sample MeanChapter 5 part1- The Sampling Distribution of a Sample Mean
Chapter 5 part1- The Sampling Distribution of a Sample Mean
 
Logic
LogicLogic
Logic
 
A Powerpoint on Logic
A Powerpoint on LogicA Powerpoint on Logic
A Powerpoint on Logic
 
LOGIC - Seminar In Problem Solving
LOGIC - Seminar In Problem SolvingLOGIC - Seminar In Problem Solving
LOGIC - Seminar In Problem Solving
 
Introduction to Logic
Introduction to LogicIntroduction to Logic
Introduction to Logic
 
Proposition (Logic)
Proposition (Logic)Proposition (Logic)
Proposition (Logic)
 
logic - workbook summary
logic - workbook summarylogic - workbook summary
logic - workbook summary
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
 
Logic introduction
Logic   introductionLogic   introduction
Logic introduction
 
Probability distribution
Probability distributionProbability distribution
Probability distribution
 
Percentile
PercentilePercentile
Percentile
 
Formal Logic - Lesson 1 - Introduction to Logic
Formal Logic - Lesson 1 - Introduction to LogicFormal Logic - Lesson 1 - Introduction to Logic
Formal Logic - Lesson 1 - Introduction to Logic
 
Measure of Relationship: Correlation Coefficient
Measure of Relationship: Correlation CoefficientMeasure of Relationship: Correlation Coefficient
Measure of Relationship: Correlation Coefficient
 
Logical Opposition (Social Philosophy and Logic)
Logical Opposition (Social Philosophy and Logic)Logical Opposition (Social Philosophy and Logic)
Logical Opposition (Social Philosophy and Logic)
 
Point and Interval Estimation
Point and Interval EstimationPoint and Interval Estimation
Point and Interval Estimation
 
Lecture 13.1 Social philosophy.ppt
Lecture 13.1 Social philosophy.pptLecture 13.1 Social philosophy.ppt
Lecture 13.1 Social philosophy.ppt
 
Chapter 4 logical reasoning
Chapter 4 logical reasoningChapter 4 logical reasoning
Chapter 4 logical reasoning
 

Similar to Logic

dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
BatoolKhan15
 
Valid &amp; invalid arguments
Valid &amp; invalid argumentsValid &amp; invalid arguments
Valid &amp; invalid arguments
Abdur Rehman
 
Valid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptxValid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptx
LuisSalenga1
 
Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdf
MuhammadUmerIhtisham
 
Course notes1
Course notes1Course notes1
Course notes1
Von Adam Martinez
 
Lecture5
Lecture5Lecture5
Lecture 01.ppt
Lecture 01.pptLecture 01.ppt
Lecture 01.ppt
VinhQuang898733
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
smarwaneid
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.ppt
NandiniSR2
 
AI-Unit4.ppt
AI-Unit4.pptAI-Unit4.ppt
AI-Unit4.ppt
ssuserd0df33
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
NomanMehboob4
 
1019Lec1.ppt
1019Lec1.ppt1019Lec1.ppt
1019Lec1.ppt
VimbainasheMavhima
 
Discrete-Chapter 05 Inference and Proofs
Discrete-Chapter 05 Inference and ProofsDiscrete-Chapter 05 Inference and Proofs
Discrete-Chapter 05 Inference and Proofs
Wongyos Keardsri
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Dr. Khaled Bakro
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
Angel Martinez
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
Omnia A. Abdullah
 
Logic agent
Logic agentLogic agent
Logic agent
Slideshare
 
Quantification
QuantificationQuantification
Quantification
Abdur Rehman
 
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
PalGov
 
Chapter 01 - p3.pdf
Chapter 01 - p3.pdfChapter 01 - p3.pdf
Chapter 01 - p3.pdf
smarwaneid
 

Similar to Logic (20)

dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
 
Valid &amp; invalid arguments
Valid &amp; invalid argumentsValid &amp; invalid arguments
Valid &amp; invalid arguments
 
Valid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptxValid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptx
 
Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdf
 
Course notes1
Course notes1Course notes1
Course notes1
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture 01.ppt
Lecture 01.pptLecture 01.ppt
Lecture 01.ppt
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.ppt
 
AI-Unit4.ppt
AI-Unit4.pptAI-Unit4.ppt
AI-Unit4.ppt
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
 
1019Lec1.ppt
1019Lec1.ppt1019Lec1.ppt
1019Lec1.ppt
 
Discrete-Chapter 05 Inference and Proofs
Discrete-Chapter 05 Inference and ProofsDiscrete-Chapter 05 Inference and Proofs
Discrete-Chapter 05 Inference and Proofs
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
 
Logic agent
Logic agentLogic agent
Logic agent
 
Quantification
QuantificationQuantification
Quantification
 
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
 
Chapter 01 - p3.pdf
Chapter 01 - p3.pdfChapter 01 - p3.pdf
Chapter 01 - p3.pdf
 

More from Shiwani Gupta

ML MODULE 6.pdf
ML MODULE 6.pdfML MODULE 6.pdf
ML MODULE 6.pdf
Shiwani Gupta
 
ML MODULE 5.pdf
ML MODULE 5.pdfML MODULE 5.pdf
ML MODULE 5.pdf
Shiwani Gupta
 
ML MODULE 4.pdf
ML MODULE 4.pdfML MODULE 4.pdf
ML MODULE 4.pdf
Shiwani Gupta
 
module6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdfmodule6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdf
Shiwani Gupta
 
module5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdfmodule5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdf
Shiwani Gupta
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf
Shiwani Gupta
 
module3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdfmodule3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdf
Shiwani Gupta
 
module2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdfmodule2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdf
Shiwani Gupta
 
module1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdfmodule1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdf
Shiwani Gupta
 
ML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdfML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdf
Shiwani Gupta
 
ML MODULE 2.pdf
ML MODULE 2.pdfML MODULE 2.pdf
ML MODULE 2.pdf
Shiwani Gupta
 
ML Module 3.pdf
ML Module 3.pdfML Module 3.pdf
ML Module 3.pdf
Shiwani Gupta
 
Problem formulation
Problem formulationProblem formulation
Problem formulation
Shiwani Gupta
 
Simplex method
Simplex methodSimplex method
Simplex method
Shiwani Gupta
 
Functionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleFunctionsandpigeonholeprinciple
Functionsandpigeonholeprinciple
Shiwani Gupta
 
Relations
RelationsRelations
Relations
Shiwani Gupta
 
Set theory
Set theorySet theory
Set theory
Shiwani Gupta
 
Uncertain knowledge and reasoning
Uncertain knowledge and reasoningUncertain knowledge and reasoning
Uncertain knowledge and reasoning
Shiwani Gupta
 
Introduction to ai
Introduction to aiIntroduction to ai
Introduction to ai
Shiwani Gupta
 
Planning Agent
Planning AgentPlanning Agent
Planning Agent
Shiwani Gupta
 

More from Shiwani Gupta (20)

ML MODULE 6.pdf
ML MODULE 6.pdfML MODULE 6.pdf
ML MODULE 6.pdf
 
ML MODULE 5.pdf
ML MODULE 5.pdfML MODULE 5.pdf
ML MODULE 5.pdf
 
ML MODULE 4.pdf
ML MODULE 4.pdfML MODULE 4.pdf
ML MODULE 4.pdf
 
module6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdfmodule6_stringmatchingalgorithm_2022.pdf
module6_stringmatchingalgorithm_2022.pdf
 
module5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdfmodule5_backtrackingnbranchnbound_2022.pdf
module5_backtrackingnbranchnbound_2022.pdf
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf
 
module3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdfmodule3_Greedymethod_2022.pdf
module3_Greedymethod_2022.pdf
 
module2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdfmodule2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdf
 
module1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdfmodule1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdf
 
ML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdfML MODULE 1_slideshare.pdf
ML MODULE 1_slideshare.pdf
 
ML MODULE 2.pdf
ML MODULE 2.pdfML MODULE 2.pdf
ML MODULE 2.pdf
 
ML Module 3.pdf
ML Module 3.pdfML Module 3.pdf
ML Module 3.pdf
 
Problem formulation
Problem formulationProblem formulation
Problem formulation
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Functionsandpigeonholeprinciple
FunctionsandpigeonholeprincipleFunctionsandpigeonholeprinciple
Functionsandpigeonholeprinciple
 
Relations
RelationsRelations
Relations
 
Set theory
Set theorySet theory
Set theory
 
Uncertain knowledge and reasoning
Uncertain knowledge and reasoningUncertain knowledge and reasoning
Uncertain knowledge and reasoning
 
Introduction to ai
Introduction to aiIntroduction to ai
Introduction to ai
 
Planning Agent
Planning AgentPlanning Agent
Planning Agent
 

Recently uploaded

一比一原版(psu学位证书)美国匹兹堡州立大学毕业证如何办理
一比一原版(psu学位证书)美国匹兹堡州立大学毕业证如何办理一比一原版(psu学位证书)美国匹兹堡州立大学毕业证如何办理
一比一原版(psu学位证书)美国匹兹堡州立大学毕业证如何办理
nonods
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
GOKULKANNANMMECLECTC
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
ShurooqTaib
 
Data Communication and Computer Networks Management System Project Report.pdf
Data Communication and Computer Networks Management System Project Report.pdfData Communication and Computer Networks Management System Project Report.pdf
Data Communication and Computer Networks Management System Project Report.pdf
Kamal Acharya
 
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl LucknowCall Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
yogita singh$A17
 
My Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdfMy Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdf
Geoffrey Wardle. MSc. MSc. Snr.MAIAA
 
Microsoft Azure AD architecture and features
Microsoft Azure AD architecture and featuresMicrosoft Azure AD architecture and features
Microsoft Azure AD architecture and features
ssuser381403
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
gapboxn
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
Lubi Valves
 
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
IJCNCJournal
 
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
DharmaBanothu
 
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 MinutesCall Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
kamka4105
 
Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine, Issue 49 / Spring 2024Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
EMERSON EDUARDO RODRIGUES
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
paraasingh12 #V08
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Dr.Costas Sachpazis
 
SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )
Tsuyoshi Horigome
 
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
aarusi sexy model
 

Recently uploaded (20)

一比一原版(psu学位证书)美国匹兹堡州立大学毕业证如何办理
一比一原版(psu学位证书)美国匹兹堡州立大学毕业证如何办理一比一原版(psu学位证书)美国匹兹堡州立大学毕业证如何办理
一比一原版(psu学位证书)美国匹兹堡州立大学毕业证如何办理
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
 
Data Communication and Computer Networks Management System Project Report.pdf
Data Communication and Computer Networks Management System Project Report.pdfData Communication and Computer Networks Management System Project Report.pdf
Data Communication and Computer Networks Management System Project Report.pdf
 
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl LucknowCall Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
 
My Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdfMy Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdf
 
Microsoft Azure AD architecture and features
Microsoft Azure AD architecture and featuresMicrosoft Azure AD architecture and features
Microsoft Azure AD architecture and features
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
 
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
Particle Swarm Optimization–Long Short-Term Memory based Channel Estimation w...
 
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
 
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 MinutesCall Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
 
Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine, Issue 49 / Spring 2024Better Builder Magazine, Issue 49 / Spring 2024
Better Builder Magazine, Issue 49 / Spring 2024
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
Sachpazis_Consolidation Settlement Calculation Program-The Python Code and th...
 
SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )
 
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
🔥 Hyderabad Call Girls  👉 9352988975 👫 High Profile Call Girls Whatsapp Numbe...
 

Logic

  • 2. History and Applications • Derived from the greek word ‘logos’. • It is called science of thought. • It starts from Aristotle. • Real Life: Expert Systems, VLSI, Semantic Web. • Computer Science: Godel’s incompleteness theorem, Frame problem, Category theory, Curry- Howard correspondence. 2
  • 3. Statements in Grammar • Declarative: The sky is blue. • Imperative: Speak truth. • Interrogative: Are you interested in maths? • Exclamatory: Wow! You are so beautiful. 3
  • 4. Propositional logic • Propositional logic is the simplest logic – illustrates basic ideas. • A declarative sentence which can be classified as either true or false. • Simple statement Eg. Aristotle was a philosopher • Compound Statement Eg. If you will commit a mistake, you will pay for it
  • 5. Symbols of propositional logic • Logical constants TRUE and FALSE are sentences • Proposition symbols P,Q,S1,S2 are sentences • ∧, V, , , are logical connectives • parenthesis ( ) • Order of precedence (), , ∧, V, ,
  • 6. Connectives – If S is a sentence, S is a sentence (negation) – If S1 and S2 are sentences, S1  S2 is a sentence (conjunction) – If S1 and S2 are sentences, S1  S2 is a sentence (disjunction) – If S1 and S2 are sentences, S1  S2 is a sentence (implication) – If S1 and S2 are sentences, S1  S2 is a sentence (biconditional) 6
  • 7. Propositional logic: Semantics Each model specifies true/false for each proposition symbol E.g. P1 P2 P3 false true false With these symbols, 8 possible models, can be enumerated automatically. Rules for evaluating truth with respect to a model m: S or S is true iff S is false S1  S2 is true iff S1 is true and S2 is true S1  S2 is true iff S1is true or S2 is true S1  S2 is true iff S1 is false or S2 is true i.e., is false iff S1 is true and S2 is false S1  S2 is true iff S1S2 is true and S2S1 is true Simple recursive process evaluates an arbitrary sentence, e.g., P1  (P2  P3) = true  (true  false) = true  true = true
  • 8. Truth tables for connectives If P then Q  P V Q If P then Q and If Q then P (if and only if)
  • 9. Truth tables for connectives
  • 10. Converse, Inverse and Contrapositive Given an implication "if p, then q“, we can create three related statements: • A conditional statement consists of two parts, a premise in the “if” clause and a conclusion in the “then” clause. For instance, “If it rains, then they cancel school.” "It rains" is the premise. "They cancel school" is the conclusion. • To form the converse of the conditional statement, interchange the premise and the conclusion. The converse of "If it rains, then they cancel school" is "If they cancel school, then it rains." • To form the inverse of the conditional statement, take the negation of both the premise and the conclusion. The inverse of “If it rains, then they cancel school” is “If it does not rain, then they do not cancel school.” • To form the contrapositive of the conditional statement, interchange the premise and the conclusion of the inverse statement. The contrapositive of "If it rains, then they cancel school" is "If they do not cancel school, then it does not rain."
  • 11. Converse, Inverse and Contrapositive Eg.1 Statement: If p, then q. Converse: If q, then p. Inverse: If not p, then not q. Contrapositive: If not q, then not p. Eg.2 Statement: If two angles are congruent, then they have the same measure. Converse: If two angles have the same measure, then they are congruent. Inverse: If two angles are not congruent, then they do not have the same measure. Contrapositive: If two angles do not have the same measure, then they are not congruent.
  • 12. (Laws of Logic) Logical equivalence - Biconditional • Two sentences are logically equivalent iff true in same models: i.e. they have identical truth tables Involution law
  • 13. • Two sentences are logically equivalent iff true in same models: i.e. they have identical truth tables α  α ≡ α α ∧ α ≡ α Idempotent Law α  F ≡ α α ∧ T ≡ T Identity Law α  T ≡ T α ∧ F ≡ F Annihilation Law α   α ≡ T α ∧  α ≡ F Inverse Law  T ≡ F  F ≡ T Complement Law (Laws of Logic) Logical equivalence
  • 14. Validity (tautology), contradiction and contingency A proposition which is always true is called tautology α   α A proposition which is always false is called contradiction α ∧  α A proposition which is neither a tautology nor a contradiction is called contingency  α   ,  α  , α  
  • 15. Propositions quantifying • All humans are mortal. • Everything is perishable. • Some people have pink hair. • Nothing is perfect. • There exists a white crow. 15
  • 16. 16 Quantifiers • A quantifier is “an operator that limits the variables of a proposition” • Two types: – Universal : the proposition is true for all, for each, for every possible values in the universe of discourse – Existential : the proposition is true for some value(s) in the universe of discourse
  • 17. Universal quantification •  <variables> <sentence> or A <variables> <sentence> Example: “All elephants are gray” (x )(elephant(x) color(x, GRAY)) • x P is true in a model m iff P is true with x being each possible object in the model • Roughly speaking, equivalent to the conjunction of instantiations of P Example: “Everyone at NUS is smart” x At(x,NUS)  Smart(x) At(KingJohn,NUS) Smart(KingJohn)  At(Richard,NUS) Smart(Richard)  At(NUS,NUS) Smart(NUS) …
  • 18. Existential quantification • <variables> <sentence> or E <variables> <sentence> Example: “Someone wrote Computer Chess” (x write(x, COMPUTER-CHESS)) • x P is true in a model m iff P is true with x being some possible object in the model • Roughly speaking, equivalent to the disjunction of instantiations of P Example: Someone at NUS is smart: x At(x,NUS)  Smart(x) At(KingJohn,NUS)  Smart(KingJohn)  At(Richard,NUS)  Smart(Richard)  At(NUS,NUS)  Smart(NUS)  ...
  • 19. Properties of quantifiers • x y is the same as y x • x y is the same as y x • x y is not the same as y x • “There is a person who loves everyone in the house” x y Loves(x,y) • “Everyone in the house loves at least one person” x y Loves(x,y) Quantifier duality(De Morgan’s law for quantification): each can be expressed using the other • x Likes(x,IceCream) x Likes(x,IceCream) • x Likes(x,Broccoli) x Likes(x,Broccoli)
  • 21. Examples on Predicate Logic • x loves y Loves(x,y) Everybody loves Jerry x Loves (x, Jerry) • Everybody loves somebody x y Loves (x, y) • There is somebody whom somebody loves y x Loves (x, y) • Nobody loves everybody  x y Loves (x, y) = x y Loves (x, y) • There is somebody whom Rachita doesn’t love y Loves (Rachita, y) • There is somebody whom no one loves y x Loves (x, y) • Everybody loves himself or herself x Loves(x,x)
  • 22. Normal Forms A problem in logic is to find whether a given statement is tautology or contradiction via truth tables, especially where the statement form may contain a large no. of variables. Hence reduce statement form to normal form. • Disjunctive Normal Form (dnf): A statement form consisting of disjunction of fundamental conjuncts (minterm) (P  Q  R) V (X   Y  Z) [SOP] • Conjunctive Normal Form (cnf): A statement form consisting of conjunction of fundamental disjuncts (maxterm) ( P V X)  (P V  Y)  (P V Z)  (…..) [POS]
  • 23. DNF (SOP) to CNF (POS) for resolution refutation Disjunctive Normal Form (P  Q  R) V (X   Y  Z) Conjunctive Normal Form ( P V X)  (P V  Y)  (P V Z)  (…..) Every sentence of propositional logic is logically equivalent to a conjunction of disjuncts of literals
  • 24. Conversion to CNF • Eliminate α ß to (α  ß )  (ß  α ) • Eliminate α  ß to  α V ß • CNF requires  to appear only with literals For this apply ( α) ≡ α (double-negative elimination)  (α  ß) ≡  α V  ß (de Morgan)  (α V ß) ≡  α   ß (de Morgan) • Now we have a sentence with nested  and V operators applied to literals. Apply distributivity law distributing V over 
  • 26. 26 Principle of Mathematical Induction Mathematical induction is a form of mathematical proof. Just because a rule, pattern, or formula seems to work for several values of n, you cannot simply decide that it is valid for all values of n without going through a legitimate proof. The Principle of Mathematical Induction Let Pn be a statement involving the positive integer n. If 1. Verification: P1 is true, and 2. Induction: the truth of Pk implies the truth of Pk+1 , for every positive integer k, Conclusion: then Pn must be true for all integers n.
  • 27. 27 Example: Sum of Odd Integers ➢ Proposition: 1 + 3 + … + (2n-1) = n2 for all integers n≥1. ➢ Proof (by induction): 1) Basis step: The statement is true for n=1: 1=12 . 2) Inductive step: Assume the statement is true for some k≥1 (inductive hypothesis) , show that it is true for k+1 .
  • 28. Example: Sum of Odd Integers ➢ Proof (cont.): The statement is true for k: 1+3+…+(2k-1) = k2 (1) We need to show it for k+1: 1+3+…+(2(k+1)-1) = (k+1)2 (2) Showing (2): 1+3+…+(2(k+1)-1) = 1+3+…+(2k+1) = 1+3+…+(2k-1)+(2k+1) = k2+(2k+1) = (k+1)2 . We proved the basis and inductive steps, so we conclude that the given statement true. ■ by (1)
  • 29. 29 Example: Sum of square of Integers ➢ Proposition: for all integers n≥1. ➢ Proof (by induction): 1) Basis step: The statement is true for n=1: 12= . 2) Inductive step: Assume the statement is true for some k≥1 (inductive hypothesis) , show that it is true for k+1 . Sn = 12 + 22 + 32 + 42 + . . . + n2 = ( )( ) 6 121 ++ nnn ( )( ) 6 321
  • 30. Example: Sum of square of Integers ➢ Proof (cont.): The statement is true for k: We need to show it for k+1: by (1) 12 + 22 + 32 + 42 + . . . + k2 = (1) ( )( ) 6 121 ++ kkk ( )( )( ) 6 3221 +++ kkk ( )( ) ( ) 6 16121 2 ++++ = kkkk ( ) ( ) ( )  6 16121 ++++ = kkkk ( )  6 6721 2 +++ = kkk ( )( )( ) 6 3221 +++ = kkk Showing (2): (12 + 22 + 32 + 42 + . . . + k2) + (k + 1)2  = k k +1( ) 2k +1( ) 6 + (k + 1)2 12 + 22 + 32 + 42 + . . . + k2 + (k+1)2 = (2) We proved the basis and inductive steps, so we conclude that the given statement true.
  翻译: