SlideShare a Scribd company logo
1 of 105
Discrete Structures
Engr. Tooba Khan
Department of Computer Engineering
Lecture 01 (Cont’d.)
1
2 Examples – 14b
3
Translating from English to
Symbols – 15
4
Translating from English to
Symbols – 16a
5
Translating from English to
Symbols – 16
6
Translating from English to
Symbols – 17a
7
Translating from English to
Symbols – 17b
8
Negation – 19
9
Truth Table for ~p – 20
10
Conjunction – 21
11
Truth Table for p ^ q – 22
12 Disjunction – 23
13
Truth Table for p q – 15
14
Truth Table
15 Truth Table for ~p^q - 2
16 Truth Table for ~p^q – 2a
17
Truth Table for ~p^q – 2b
18 Truth Table for ~p^q – 2c
19 ~p ^ (q v~ r) – (2 - 3a)
20 ~p ^ (q v~ r) – 2 - 3b
21 ~p ^ (q v~ r) – 2 - 3c
22 ~p ^ (q v~ r) – 2 - 3d
23 Truth Table for ~p (p v~ q) – 2 - 3e
v
24 Truth Table for (pvq) ^~ (p^q) – 2 - 4a
25
Truth Table for (pvq) ^~ (p^q) – 2 -
4c
26
Truth Table for (pvq) ^~ (p^q) – 2 -
4e
v
v
27
Truth Table for (pvq) ^~ (p^q) – 2 -
4f
28 Exclusive OR – 2 - 5
29 Symbols for Exclusive OR – 2 - 5a
30 Logical Equivalence – 2 - 6
31 Double Negation ~(~p) ≡ p – 2 - 7
32 Examples – 2 - 12
33 Example – 2 - 17c
34 Example – 2 - 17d
35 Example – 2 - 17e
36 De Morgan’s Laws – 2 - 9
37 De Morgan’s Laws – 2 - 9a
38 Proof – 2 - 16
39 Proof – 2 - 16d
40 Application – 2 - 10
41 Exercise – 2 - 19
42 Tautology – 2 - 21
43 Example – 2 - 21a
44 Contradiction – 2 - 22
45 Example – 2 - 22a
( p  q )  (~ p  ( p  ~q ))
Tautology or not
(p  ~q) (~pq)
Contradiction or not
48 Exercise – 2 - 23
49 Exercise – 2 - 24
50 Laws of Logic – 2 - 25
51 Laws of Logic – 2 - 25a
52 Laws of Logic – 2 - 25b
53 Laws of Logic – 2 - 25c
54 Laws of Logic – 2 - 25d
APPLYING LAWS OF LOGIC
 p  [~(~p  q)]
56
Application - 1
APPLYING LAWS OF LOGIC
 ~ (~ p  q)  (p  q)
58 Example - 2
59 Simplifying a Statement – 3
60
Distributive Law in Reverse – 4
61 Exercise – 5
62 Exercise - 5a
63 Conditional Statements - 6
64 Conditional Statements – 6a
65 Truth Table for p  q - 8
66
Conditional Statements or
Implications - 7
67
Conditional Statements OR
Implications – 7a
Conditional statements
 A friend tells you “If you upload that picture to Facebook, you’ll lose your job.”
Under what conditions can you say that your friend was wrong?
 There are four possible outcomes:
1. You upload the picture and lose your job
2. You upload the picture and don’t lose your job
3. You don’t upload the picture and lose your job
4. You don’t upload the picture and don’t lose your job
There is only one possible case in which you can say your friend was wrong: the
second outcome in which you upload the picture but keep your job. In the last two
cases, your friend didn’t say anything about what would happen if you didn’t upload
the picture, so you can’t say that their statement was wrong.
Even if you didn’t upload the picture and lost your job anyway, your friend never said
that you were guaranteed to keep your job if you didn’t upload the picture; you
might lose your job for missing a shift or punching your boss instead.
Conditional statement : If p is true then q
is true
P Q P->Q ~p ~P v Q
T T T F T
T F F F F
F T T T T
F F T T T
So, when the hypothesis is false the statement is vacuously true.
or
When the hypothesis is not true the conclusion is irrelevant.
If I am the prime minister of Pakistan, then I am a Pakistani citizen
Conditional statement : If p is true then q
is true
 If I study hard, then I will pass VS Either I don’t study hard, or I pass
 If earth is flat then, 2=3
 If it is raining, then there are clouds is the sky
71 Example – 9
72 Example – 9
 For any conditional, there are three related statements, the converse, the inverse,
and the contrapositive.
1. The original conditional is "if p, then q′′ p→q
2. The converse is "if q, then p′′ q→p
3. The inverse is "if not p, then not q′′ ∼p→∼q
4. The contrapositive is "if not q, then not p′′ ∼q→∼p
 Consider again the conditional “If it is raining, then there are clouds in the sky.” It
seems reasonable to assume that this is true.
 The converse would be “If there are clouds in the sky, then it is raining.” This is not
always true.
 The inverse would be “If it is not raining, then there are no clouds in the sky.” Likewise,
this is not always true.
 The contrapositive would be “If there are no clouds in the sky, then it is not raining.”
This statement is true and is equivalent to the original conditional.
“If I eat this giant cookie, then I will feel sick.” If this statement is true which of the following
statements must also be true ?
1. If I feel sick, then I ate that giant cookie.
2. If I don’t eat this giant cookie, then I won’t feel sick.
3. If I don’t feel sick, then I didn’t eat that giant cookie.
Solution
1. This is the converse, which is not necessarily true. I could feel sick for some other reason,
such as drinking sour milk.
2. This is the inverse, which is not necessarily true. Again, I could feel sick for some other
reason; avoiding the cookie doesn’t guarantee that I won’t feel sick.
3. This is the contrapositive, which is true, but we have to think somewhat backwards to explain
it. If I ate the cookie, I would feel sick, but since I don’t feel sick, I must not have eaten the
cookie.
“If you microwave salmon in the staff kitchen, then I will be mad at you.” If this statement is true,
which of the following statements must also be true?
1. If you don’t microwave salmon in the staff kitchen, then I won’t be mad at you.
2. If I am not mad at you, then you didn’t microwave salmon in the staff kitchen.
3. If I am mad at you, then you microwaved salmon in the staff kitchen.
Solution : Choice b is correct because it is the contrapositive of the original statement.
Consider the statement “If you park here, then you will get a ticket.” What set of conditions would
prove this statement false?
1. You don’t park here, and you get a ticket.
2. You don’t park here, and you don’t get a ticket.
3. You park here and you don’t get a ticket.
The first two statements are irrelevant because we don’t know what will happen if you park somewhere
else. The third statement, however, contradicts the conditional statement “If you park here, then you
will get a ticket” because you parked here but didn’t get a ticket.
This example demonstrates a general rule; the negation of a conditional can be written as a
conjunction: “It is not the case that if you park here, then you will get a ticket” is equivalent to “You
park here and you do not get a ticket.”
The negation of a conditional statement is equivalent to a conjunction of the hypothesis and the
negation of the conclusion.
∼(p→q) is equivalent to p∧∼q
Which of the following statements is equivalent to the negation of “If you don’t grease the
pan, then the food will stick to it” ?
1. I didn’t grease the pan and the food didn’t stick to it.
2. I didn’t grease the pan and the food stuck to it.
3. I greased the pan, and the food didn’t stick to it.
Solution
1. This is correct; it is the conjunction of the hypothesis and the negation of the conclusion.
To disprove that not greasing the pan will cause the food to stick, I have to not grease
the pan and have the food not stick.
2. This is essentially the original statement with no negation; the “if…then” has been
replaced by “and”.
3. This essentially agrees with the original statement and cannot disprove it.
“If you go swimming less than an hour after eating lunch, then you will get cramps.” Which of the
following statements is equivalent to the negation of this statement?
1. I went swimming more than an hour after eating lunch and I got cramps.
2. I went swimming less than an hour after eating lunch and I didn’t get cramps.
3. I went swimming more than an hour after eating lunch and I didn’t get cramps.
Solution: choice b is equivalent to the negation; it keeps the first part the same and negates the
second part.
Biconditional statements
 A biconditional is a logical conditional statement in which the hypothesis and
conclusion are interchangeable.
 A biconditional is written as p↔q and is translated as " p if and only if q′′ .
P Q P <-> Q
T T T
T F F
F T F
F F T
Biconditional statements "p if and only if
q′′
 “The garbage truck comes down my street if and only if it is Thursday morning.” Which
of the following statements could be true?
1. It is noon on Thursday and the garbage truck did not come down my street this morning.
2. It is Monday and the garbage truck is coming down my street.
3. It is Wednesday at 11:59PM and the garbage truck did not come down my street today.
 Solution
1. This cannot be true. This is like the second row of the truth table; it is true that I just
experienced Thursday morning, but it is false that the garbage truck came.
2. This cannot be true. This is like the third row of the truth table; it is false that it is
Thursday, but it is true that the garbage truck came.
3. This could be true. This is like the fourth row of the truth table; it is false that it is
Thursday, but it is also false that the garbage truck came, so everything worked out
like it should.
Biconditional statements "p if and only if
q′′
 Suppose this statement is true: “I wear my running shoes if and only if I am
exercising.” Determine whether each of the following statements must be true or
false.
 I am exercising and I am not wearing my running shoes.
 I am wearing my running shoes and I am not exercising.
 I am not exercising, and I am not wearing my running shoes.
Biconditional statements "p if and only if
q′′
 Suppose your boss needs you to do either project A or project B (or both, if you
have the time). You will not get a bad review if and only if you do project A or
project B. Make the truth table for this scenario.
1. Identify atomic propositions
2. Determine appropriate logical connections
 If I go to the store or the movies, I won't do my homework
85
Translating English Sentences to
Symbols
86 Translating English Sentences to
Symbols – 12a
87 Translating English Sentences to
Symbols – 12a
88
Translating English Sentences to
Symbols – 12b
89
Translating English Sentences to
Symbols – (3 – 12c)
90
Translating Symbolic Propositions
to English – 13
91
Translating Symbolic Propositions
to English – 13a
92
Translating Symbolic Propositions
to English – 13a
93
Translating Symbolic Propositions
to English – 13b
94
Translating Symbolic Propositions
to English – 13b
 You can get a free sandwich on Thursday if you buy a sandwich or a cup of tea
 You can get a free sandwich on Thursday only if you buy a sandwich or a cup
of tea
 The automated reply can't be sent when the system is full
96
Hierarchy of Operations for Logical
Connectives - 14
97 Truth Table for p v ~ q ~ p – 20a
98 Truth Table for p v ~ q ~ p – 20a
99 Truth Table for p v ~ q ~ p – 20b
100 (p  q) (~p  r) - 21
101 (p  q) (~p  r) - 21
102 (p  q) (~p  r) – 21a
103
(p  q) (~p  r) – 21c
Solving Logic Puzzles
 An island has two kinds of inhabitants, knights, who always tell the truth and
knaves, who always lie. You go to the island and meet A and B. A says “B is a
knight”. B says, “ The two of us are of opposite types.”. What are A and B.
 When planning a party, you want to know whom to invite. Among the people you
would like to invite are three touchy friends. You know that if Sara attends, she will
become unhappy if Anum is there, Anum will attend only if Meral will be there, and
Meral will not attend unless Sara also does. Which combinations of these three
friends can you invite so as not to make someone unhappy.
Quiz will be held on 5th October 2022 if and only
it its Wednesday and we have a class.

More Related Content

Similar to Discrete maths lecture 2

Propositional Logic.pdf
Propositional Logic.pdfPropositional Logic.pdf
Propositional Logic.pdfZLEMORHAN3
 
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptxDisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptxAdeel Saifee
 
Discrete Structure vs Discrete Mathematics
Discrete Structure vs Discrete MathematicsDiscrete Structure vs Discrete Mathematics
Discrete Structure vs Discrete MathematicsAbdulRehman378540
 
Mathmatical reasoning
Mathmatical reasoningMathmatical reasoning
Mathmatical reasoningindu psthakur
 
proposition Logic-1.pptx Discrete Mathematics
proposition Logic-1.pptx Discrete Mathematicsproposition Logic-1.pptx Discrete Mathematics
proposition Logic-1.pptx Discrete MathematicsVimalKumar375828
 
Mathematical Logic
Mathematical LogicMathematical Logic
Mathematical LogicJoey Valdriz
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdfjayarao21
 
desmath(1).ppt
desmath(1).pptdesmath(1).ppt
desmath(1).pptMemMem25
 
Lecture-13---Reasoning-and--Decision-Making-Van-Selst2.ppt
Lecture-13---Reasoning-and--Decision-Making-Van-Selst2.pptLecture-13---Reasoning-and--Decision-Making-Van-Selst2.ppt
Lecture-13---Reasoning-and--Decision-Making-Van-Selst2.pptDr. Vartika Dutta
 
If-then-Statements.pptx
If-then-Statements.pptxIf-then-Statements.pptx
If-then-Statements.pptxjulie gelera
 
UNIT-III-PPT.pptx
UNIT-III-PPT.pptxUNIT-III-PPT.pptx
UNIT-III-PPT.pptxDakshBaveja
 
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negationLogic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negationZaidAly1
 

Similar to Discrete maths lecture 2 (20)

Propositional logic
Propositional logicPropositional logic
Propositional logic
 
If Clauses.pptx
If Clauses.pptxIf Clauses.pptx
If Clauses.pptx
 
Propositional Logic.pdf
Propositional Logic.pdfPropositional Logic.pdf
Propositional Logic.pdf
 
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptxDisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
 
Discrete Structure vs Discrete Mathematics
Discrete Structure vs Discrete MathematicsDiscrete Structure vs Discrete Mathematics
Discrete Structure vs Discrete Mathematics
 
Mathmatical reasoning
Mathmatical reasoningMathmatical reasoning
Mathmatical reasoning
 
Chapter1p1 2.pptx
Chapter1p1 2.pptxChapter1p1 2.pptx
Chapter1p1 2.pptx
 
logicj-160412050513.pptx
logicj-160412050513.pptxlogicj-160412050513.pptx
logicj-160412050513.pptx
 
Course notes1
Course notes1Course notes1
Course notes1
 
proposition Logic-1.pptx Discrete Mathematics
proposition Logic-1.pptx Discrete Mathematicsproposition Logic-1.pptx Discrete Mathematics
proposition Logic-1.pptx Discrete Mathematics
 
Mathematical Logic
Mathematical LogicMathematical Logic
Mathematical Logic
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
 
Bab 1 proposisi
Bab 1 proposisiBab 1 proposisi
Bab 1 proposisi
 
desmath(1).ppt
desmath(1).pptdesmath(1).ppt
desmath(1).ppt
 
12_Truth_Tables.pptx
12_Truth_Tables.pptx12_Truth_Tables.pptx
12_Truth_Tables.pptx
 
Lecture-13---Reasoning-and--Decision-Making-Van-Selst2.ppt
Lecture-13---Reasoning-and--Decision-Making-Van-Selst2.pptLecture-13---Reasoning-and--Decision-Making-Van-Selst2.ppt
Lecture-13---Reasoning-and--Decision-Making-Van-Selst2.ppt
 
If-then-Statements.pptx
If-then-Statements.pptxIf-then-Statements.pptx
If-then-Statements.pptx
 
BICONDITIONAL STATEMENTS.pptx
BICONDITIONAL STATEMENTS.pptxBICONDITIONAL STATEMENTS.pptx
BICONDITIONAL STATEMENTS.pptx
 
UNIT-III-PPT.pptx
UNIT-III-PPT.pptxUNIT-III-PPT.pptx
UNIT-III-PPT.pptx
 
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negationLogic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
 

Recently uploaded

Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxNANDHAKUMARA10
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementDr. Deepak Mudgal
 
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...gragchanchal546
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptAfnanAhmad53
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 

Recently uploaded (20)

Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
Ghuma $ Russian Call Girls Ahmedabad ₹7.5k Pick Up & Drop With Cash Payment 8...
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 

Discrete maths lecture 2

  • 1. Discrete Structures Engr. Tooba Khan Department of Computer Engineering Lecture 01 (Cont’d.) 1
  • 3. 3 Translating from English to Symbols – 15
  • 4. 4 Translating from English to Symbols – 16a
  • 5. 5 Translating from English to Symbols – 16
  • 6. 6 Translating from English to Symbols – 17a
  • 7. 7 Translating from English to Symbols – 17b
  • 9. 9 Truth Table for ~p – 20
  • 11. 11 Truth Table for p ^ q – 22
  • 13. 13 Truth Table for p q – 15
  • 15. 15 Truth Table for ~p^q - 2
  • 16. 16 Truth Table for ~p^q – 2a
  • 17. 17 Truth Table for ~p^q – 2b
  • 18. 18 Truth Table for ~p^q – 2c
  • 19. 19 ~p ^ (q v~ r) – (2 - 3a)
  • 20. 20 ~p ^ (q v~ r) – 2 - 3b
  • 21. 21 ~p ^ (q v~ r) – 2 - 3c
  • 22. 22 ~p ^ (q v~ r) – 2 - 3d
  • 23. 23 Truth Table for ~p (p v~ q) – 2 - 3e v
  • 24. 24 Truth Table for (pvq) ^~ (p^q) – 2 - 4a
  • 25. 25 Truth Table for (pvq) ^~ (p^q) – 2 - 4c
  • 26. 26 Truth Table for (pvq) ^~ (p^q) – 2 - 4e v v
  • 27. 27 Truth Table for (pvq) ^~ (p^q) – 2 - 4f
  • 28. 28 Exclusive OR – 2 - 5
  • 29. 29 Symbols for Exclusive OR – 2 - 5a
  • 31. 31 Double Negation ~(~p) ≡ p – 2 - 7
  • 32. 32 Examples – 2 - 12
  • 33. 33 Example – 2 - 17c
  • 34. 34 Example – 2 - 17d
  • 35. 35 Example – 2 - 17e
  • 36. 36 De Morgan’s Laws – 2 - 9
  • 37. 37 De Morgan’s Laws – 2 - 9a
  • 38. 38 Proof – 2 - 16
  • 39. 39 Proof – 2 - 16d
  • 41. 41 Exercise – 2 - 19
  • 43. 43 Example – 2 - 21a
  • 45. 45 Example – 2 - 22a
  • 46. ( p  q )  (~ p  ( p  ~q )) Tautology or not
  • 47. (p  ~q) (~pq) Contradiction or not
  • 48. 48 Exercise – 2 - 23
  • 49. 49 Exercise – 2 - 24
  • 50. 50 Laws of Logic – 2 - 25
  • 51. 51 Laws of Logic – 2 - 25a
  • 52. 52 Laws of Logic – 2 - 25b
  • 53. 53 Laws of Logic – 2 - 25c
  • 54. 54 Laws of Logic – 2 - 25d
  • 55. APPLYING LAWS OF LOGIC  p  [~(~p  q)]
  • 57. APPLYING LAWS OF LOGIC  ~ (~ p  q)  (p  q)
  • 59. 59 Simplifying a Statement – 3
  • 60. 60 Distributive Law in Reverse – 4
  • 65. 65 Truth Table for p  q - 8
  • 68. Conditional statements  A friend tells you “If you upload that picture to Facebook, you’ll lose your job.” Under what conditions can you say that your friend was wrong?  There are four possible outcomes: 1. You upload the picture and lose your job 2. You upload the picture and don’t lose your job 3. You don’t upload the picture and lose your job 4. You don’t upload the picture and don’t lose your job There is only one possible case in which you can say your friend was wrong: the second outcome in which you upload the picture but keep your job. In the last two cases, your friend didn’t say anything about what would happen if you didn’t upload the picture, so you can’t say that their statement was wrong. Even if you didn’t upload the picture and lost your job anyway, your friend never said that you were guaranteed to keep your job if you didn’t upload the picture; you might lose your job for missing a shift or punching your boss instead.
  • 69. Conditional statement : If p is true then q is true P Q P->Q ~p ~P v Q T T T F T T F F F F F T T T T F F T T T So, when the hypothesis is false the statement is vacuously true. or When the hypothesis is not true the conclusion is irrelevant. If I am the prime minister of Pakistan, then I am a Pakistani citizen
  • 70. Conditional statement : If p is true then q is true  If I study hard, then I will pass VS Either I don’t study hard, or I pass  If earth is flat then, 2=3  If it is raining, then there are clouds is the sky
  • 73.  For any conditional, there are three related statements, the converse, the inverse, and the contrapositive. 1. The original conditional is "if p, then q′′ p→q 2. The converse is "if q, then p′′ q→p 3. The inverse is "if not p, then not q′′ ∼p→∼q 4. The contrapositive is "if not q, then not p′′ ∼q→∼p
  • 74.  Consider again the conditional “If it is raining, then there are clouds in the sky.” It seems reasonable to assume that this is true.  The converse would be “If there are clouds in the sky, then it is raining.” This is not always true.  The inverse would be “If it is not raining, then there are no clouds in the sky.” Likewise, this is not always true.  The contrapositive would be “If there are no clouds in the sky, then it is not raining.” This statement is true and is equivalent to the original conditional.
  • 75.
  • 76. “If I eat this giant cookie, then I will feel sick.” If this statement is true which of the following statements must also be true ? 1. If I feel sick, then I ate that giant cookie. 2. If I don’t eat this giant cookie, then I won’t feel sick. 3. If I don’t feel sick, then I didn’t eat that giant cookie. Solution 1. This is the converse, which is not necessarily true. I could feel sick for some other reason, such as drinking sour milk. 2. This is the inverse, which is not necessarily true. Again, I could feel sick for some other reason; avoiding the cookie doesn’t guarantee that I won’t feel sick. 3. This is the contrapositive, which is true, but we have to think somewhat backwards to explain it. If I ate the cookie, I would feel sick, but since I don’t feel sick, I must not have eaten the cookie.
  • 77. “If you microwave salmon in the staff kitchen, then I will be mad at you.” If this statement is true, which of the following statements must also be true? 1. If you don’t microwave salmon in the staff kitchen, then I won’t be mad at you. 2. If I am not mad at you, then you didn’t microwave salmon in the staff kitchen. 3. If I am mad at you, then you microwaved salmon in the staff kitchen. Solution : Choice b is correct because it is the contrapositive of the original statement.
  • 78. Consider the statement “If you park here, then you will get a ticket.” What set of conditions would prove this statement false? 1. You don’t park here, and you get a ticket. 2. You don’t park here, and you don’t get a ticket. 3. You park here and you don’t get a ticket. The first two statements are irrelevant because we don’t know what will happen if you park somewhere else. The third statement, however, contradicts the conditional statement “If you park here, then you will get a ticket” because you parked here but didn’t get a ticket. This example demonstrates a general rule; the negation of a conditional can be written as a conjunction: “It is not the case that if you park here, then you will get a ticket” is equivalent to “You park here and you do not get a ticket.” The negation of a conditional statement is equivalent to a conjunction of the hypothesis and the negation of the conclusion. ∼(p→q) is equivalent to p∧∼q
  • 79. Which of the following statements is equivalent to the negation of “If you don’t grease the pan, then the food will stick to it” ? 1. I didn’t grease the pan and the food didn’t stick to it. 2. I didn’t grease the pan and the food stuck to it. 3. I greased the pan, and the food didn’t stick to it. Solution 1. This is correct; it is the conjunction of the hypothesis and the negation of the conclusion. To disprove that not greasing the pan will cause the food to stick, I have to not grease the pan and have the food not stick. 2. This is essentially the original statement with no negation; the “if…then” has been replaced by “and”. 3. This essentially agrees with the original statement and cannot disprove it.
  • 80. “If you go swimming less than an hour after eating lunch, then you will get cramps.” Which of the following statements is equivalent to the negation of this statement? 1. I went swimming more than an hour after eating lunch and I got cramps. 2. I went swimming less than an hour after eating lunch and I didn’t get cramps. 3. I went swimming more than an hour after eating lunch and I didn’t get cramps. Solution: choice b is equivalent to the negation; it keeps the first part the same and negates the second part.
  • 81. Biconditional statements  A biconditional is a logical conditional statement in which the hypothesis and conclusion are interchangeable.  A biconditional is written as p↔q and is translated as " p if and only if q′′ . P Q P <-> Q T T T T F F F T F F F T
  • 82. Biconditional statements "p if and only if q′′  “The garbage truck comes down my street if and only if it is Thursday morning.” Which of the following statements could be true? 1. It is noon on Thursday and the garbage truck did not come down my street this morning. 2. It is Monday and the garbage truck is coming down my street. 3. It is Wednesday at 11:59PM and the garbage truck did not come down my street today.  Solution 1. This cannot be true. This is like the second row of the truth table; it is true that I just experienced Thursday morning, but it is false that the garbage truck came. 2. This cannot be true. This is like the third row of the truth table; it is false that it is Thursday, but it is true that the garbage truck came. 3. This could be true. This is like the fourth row of the truth table; it is false that it is Thursday, but it is also false that the garbage truck came, so everything worked out like it should.
  • 83. Biconditional statements "p if and only if q′′  Suppose this statement is true: “I wear my running shoes if and only if I am exercising.” Determine whether each of the following statements must be true or false.  I am exercising and I am not wearing my running shoes.  I am wearing my running shoes and I am not exercising.  I am not exercising, and I am not wearing my running shoes.
  • 84. Biconditional statements "p if and only if q′′  Suppose your boss needs you to do either project A or project B (or both, if you have the time). You will not get a bad review if and only if you do project A or project B. Make the truth table for this scenario.
  • 85. 1. Identify atomic propositions 2. Determine appropriate logical connections  If I go to the store or the movies, I won't do my homework 85 Translating English Sentences to Symbols
  • 86. 86 Translating English Sentences to Symbols – 12a
  • 87. 87 Translating English Sentences to Symbols – 12a
  • 88. 88 Translating English Sentences to Symbols – 12b
  • 89. 89 Translating English Sentences to Symbols – (3 – 12c)
  • 95.  You can get a free sandwich on Thursday if you buy a sandwich or a cup of tea  You can get a free sandwich on Thursday only if you buy a sandwich or a cup of tea  The automated reply can't be sent when the system is full
  • 96. 96 Hierarchy of Operations for Logical Connectives - 14
  • 97. 97 Truth Table for p v ~ q ~ p – 20a
  • 98. 98 Truth Table for p v ~ q ~ p – 20a
  • 99. 99 Truth Table for p v ~ q ~ p – 20b
  • 100. 100 (p  q) (~p  r) - 21
  • 101. 101 (p  q) (~p  r) - 21
  • 102. 102 (p  q) (~p  r) – 21a
  • 103. 103 (p  q) (~p  r) – 21c
  • 104. Solving Logic Puzzles  An island has two kinds of inhabitants, knights, who always tell the truth and knaves, who always lie. You go to the island and meet A and B. A says “B is a knight”. B says, “ The two of us are of opposite types.”. What are A and B.  When planning a party, you want to know whom to invite. Among the people you would like to invite are three touchy friends. You know that if Sara attends, she will become unhappy if Anum is there, Anum will attend only if Meral will be there, and Meral will not attend unless Sara also does. Which combinations of these three friends can you invite so as not to make someone unhappy.
  • 105. Quiz will be held on 5th October 2022 if and only it its Wednesday and we have a class.