SlideShare a Scribd company logo
Discrete Mathematics
Chapter 1:
Fundamentals of Logic
1
Presented By,
Nandini S R
Department of Computer Science
1.1 Propositions
• A proposition is a declarative sentence (a sentence that declares a
fact) that is either true or false, but not both.
• Are the following sentences propositions?
• Delhi is the capital of India.
• Read this carefully.
• 1+2=3
• x+1=2
• What time is it?
• 3 is a prime number.
• Bengaluru is in Karnataka.
2
1.1 Propositions
• Propositional Variables – variables that represent propositions: p, q,
r, s
• E.g. Proposition p – “3 is a prime number.”
• Truth values – The truth or falsity of a proposition
If proposition is true, its truth value is 1 (T)
If proposition is false, its truth value is 0 (F)
3
Logical connectives
• Propositions used with words as not , and, if….then and if and only if,
gives new propositions called compound propositions.
• Words such as not , and, if….then and if and only if are called logical
connectives.
• Propositions which do not contain any logical connective are called
Simple propositions.
4
Negation
• Examples
• Find the negation of the proposition “Today is Friday.”
• Find the negation of the proposition “3 is a prime number.”
5
Let p be a proposition. The negation of p, denoted by ¬p.
The proposition ¬p is read “not p.” The truth value of the negation of p, ¬p
is the opposite of the truth value of p.
Solution: The negation is “Today is not Friday.” or “It is not
Friday today.”
Solution: The negation is “3 is not a prime number.”
Negation
The Truth Table for the
Negation of a Proposition.
p ¬p
T
F
F
T
6
Conjuction
• Examples
• Find the conjunction of the propositions p and q where p is the
proposition “9 is a prime number.” and q is the proposition “2+5=7”, and
the truth value of the conjunction.
7
Let p and q be propositions. The conjunction of p and q, denoted by
p Λ q, is the proposition “p and q”. The conjunction p Λ q is true when
both p and q are true and is false otherwise.
Solution: The conjunction is the proposition “9 is a prime number
and 2+5=7.” The proposition is False.
1.1 Propositional Logic
• E.g Find the conjunction of the propositions p and q where p is the proposition “4
is a prime number.” or q is the proposition “2+4=7”, and the truth value of the
conjunction
• Solution: The conjunction is the proposition “4 is a prime number and
2+4=7.” The proposition is False.
8
DEFINITION 3
Let p and q be propositions. The disjunction of p and q, denoted by p ν
q, is the proposition “p or q”. The conjunction p ν q is false when both
p and q are false and is true otherwise.
1.1 Propositional Logic
The Truth Table for the
Exclusive Or (XOR) of
Two Propositions.
p q p q
T T
T F
F T
F F
F
T
T
F

The Truth Table for
the Conjunction of
Two Propositions.
p q p Λ q
T T
T F
F T
F F
T
F
F
F
The Truth Table for
the Disjunction of
Two Propositions.
p q p ν q
T T
T F
F T
F F
T
T
T
F
9
DEFINITION 4
Let p and q be propositions. The exclusive or of p and q, denoted by p q,
is the proposition that is true when exactly one of p and q is true and is
false otherwise.


1.1 Propositional Logic

10
DEFINITION 5
Let p and q be propositions. The conditional statement p → q, is the
proposition “if p, then q.” The conditional statement is false when p is
true and q is false, and true otherwise. In the conditional statement p
→ q, p is called the hypothesis (or antecedent or premise) and q is
called the conclusion (or consequence).
Conditional Statements
 A conditional statement is also called an implication.
 Example: “If I am elected, then I will lower taxes.” p → q
implication:
elected, lower taxes. T T | T
not elected, lower taxes. F T | T
not elected, not lower taxes. F F | T
elected, not lower taxes. T F | F
1.1 Propositional Logic
• Example:
• Let p be the statement “Maria learns discrete mathematics.” and q the
statement “Maria will find a good job.” Express the statement p → q as a
statement in English.
11
Solution: Any of the following -
“If Maria learns discrete mathematics, then she will find a
good job.
1.1 Propositional Logic
• Other conditional statements:
• Converse of p → q : q → p
• Contrapositive of p → q : ¬ q → ¬ p
• Inverse of p → q : ¬ p → ¬ q
12
1.1 Propositional Logic
• p ↔ q has the same truth value as (p → q) Λ (q → p)
• “if and only if” can be expressed by “iff”
• Example:
• Let p be the statement “You can take the flight” and let q be the
statement “You buy a ticket.” Then p ↔ q is the statement
“You can take the flight if and only if you buy a ticket.”
Implication:
If you buy a ticket you can take the flight.
If you don’t buy a ticket you cannot take the flight.
13
DEFINITION 6
Let p and q be propositions. The biconditional statement p ↔ q is the
proposition “p if and only if q.” The biconditional statement p ↔ q is
true when p and q have the same truth values, and is false otherwise.
Biconditional statements are also called bi-implications.
1.1 Propositional Logic
The Truth Table for the
Biconditional p ↔ q.
p q p ↔ q
T T
T F
F T
F F
T
F
F
T
14
1.1 Propositional Logic
• We can use connectives to build up complicated compound propositions
involving any number of propositional variables, then use truth tables to
determine the truth value of these compound propositions.
• Example: Construct the truth table of the compound proposition
(p ν ¬q) → (p Λ q).
The Truth Table of (p ν ¬q) → (p Λ q).
p q ¬q p ν ¬q p Λ q (p ν ¬q) → (p Λ q)
T T
T F
F T
F F
F
T
F
T
T
T
F
T
T
F
F
F
T
F
T
F
15
Truth Tables of Compound Propositions
1.1 Propositional Logic
• We can use parentheses to specify the order in which logical operators in a
compound proposition are to be applied.
• To reduce the number of parentheses, the precedence order is defined for
logical operators.
Precedence of Logical Operators.
Operator Precedence
¬ 1
Λ
ν
2
3
→
↔
4
5
16
Precedence of Logical Operators
E.g. ¬p Λ q = (¬p ) Λ q
p Λ q ν r = (p Λ q ) ν r
p ν q Λ r = p ν (q Λ r)
1.1 Propositional Logic
• Example: How can this English sentence be translated into a logical
expression?
“You can access the Internet from campus only if you are a
computer science major or you are not a freshman.”
17
Solution: Let p, q, and r represent “You can access the Internet from
campus,” “You are a computer science major,” and “You are
a freshman.” The sentence can be translated into:
p → (q ν ¬r).
1.1 Propositional Logic
• Computers represent information using bits.
• A bit is a symbol with two possible values, 0 and 1.
• By convention, 1 represents T (true) and 0 represents F (false).
• A variable is called a Boolean variable if its value is either true or false.
• Bit operation – replace true by 1 and false by 0 in logical operations.
Table for the Bit Operators OR, AND, and XOR.
x y x ν y x Λ y x y
0
0
1
1
0
1
0
1
0
1
1
1
0
0
0
1
0
1
1
0

18
Logic and Bit Operations
1.1 Propositional Logic
• Example: Find the bitwise OR, bitwise AND, and bitwise XOR of the bit string
01 1011 0110 and 11 0001 1101.
19
DEFINITION 7
A bit string is a sequence of zero or more bits. The length of this string
is the number of bits in the string.
Solution:
01 1011 0110
11 0001 1101
-------------------
11 1011 1111 bitwise OR
01 0001 0100 bitwise AND
10 1010 1011 bitwise XOR
1.2 Propositional Equivalences
Examples of a Tautology and a Contradiction.
p ¬p p ν ¬p p Λ ¬p
T
F
F
T
T
T
F
F
20
DEFINITION 1
A compound proposition that is always true, no matter what the truth
values of the propositions that occurs in it, is called a tautology. A
compound proposition that is always false is called a contradiction. A
compound proposition that is neither a tautology or a contradiction is
called a contingency.
Introduction
1.2 Propositional Equivalences
• Compound propositions that have the same truth values in all possible cases
are called logically equivalent.
• Example: Show that ¬p ν q and p → q are logically equivalent.
Truth Tables for ¬p ν q and p → q .
p q ¬p ¬p ν q p → q
T
T
F
F
T
F
T
F
F
F
T
T
T
F
T
T
T
F
T
T 21
DEFINITION 2
The compound propositions p and q are called logically equivalent if p ↔
q is a tautology. The notation p ≡ q denotes that p and q are logically
equivalent.
Logical Equivalences
1.2 Propositional Equivalences
• In general, 2n rows are required if a compound proposition involves n
propositional variables in order to get the combination of all truth values.
• See page 24, 25 for more logical equivalences.
22
1.2 Propositional Equivalences
• Example: Show that ¬(p → q ) and p Λ ¬q are logically equivalent.
Solution:
¬(p → q ) ≡ ¬(¬p ν q) by example on slide 21
≡ ¬(¬p) Λ ¬q by the second De Morgan law
≡ p Λ ¬q by the double negation law
• Example: Show that (p Λ q) → (p ν q) is a tautology.
Solution: To show that this statement is a tautology, we will use logical
equivalences to demonstrate that it is logically equivalent to T.
(p Λ q) → (p ν q) ≡ ¬(p Λ q) ν (p ν q) by example on slide 21
≡ (¬ p ν ¬q) ν (p ν q) by the first De Morgan law
≡ (¬ p ν p) ν (¬ q ν q) by the associative and
communicative law for disjunction
≡ T ν T
≡ T
• Note: The above examples can also be done using truth tables.
23
Constructing New Logical Equivalences
Ad

More Related Content

Similar to Discrete mathematics Chapter1 presentation.ppt (20)

Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
Angel Martinez
 
logicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdflogicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdf
PradeeshSAI
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdf
smarwaneid
 
Per3 logika&pembuktian
Per3 logika&pembuktianPer3 logika&pembuktian
Per3 logika&pembuktian
Evert Sandye Taasiringan
 
DMS UNIT-1 ppt.pptx
DMS UNIT-1 ppt.pptxDMS UNIT-1 ppt.pptx
DMS UNIT-1 ppt.pptx
DrMadhavaReddyCh
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]
DIwakar Rajput
 
Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
Ravind8
 
Logic&proof
Logic&proofLogic&proof
Logic&proof
Fathan Hakim
 
Discrete Maths141 - Course Outline and Lecture Slides
Discrete Maths141 - Course Outline and Lecture SlidesDiscrete Maths141 - Course Outline and Lecture Slides
Discrete Maths141 - Course Outline and Lecture Slides
AryanZia3
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
Eli Lilly and Company
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
Eli Lilly and Company
 
Logic2.pptx
Logic2.pptxLogic2.pptx
Logic2.pptx
RestyLlagas1
 
Discrete_Mathematics_Chapter1_Part1.pptx
Discrete_Mathematics_Chapter1_Part1.pptxDiscrete_Mathematics_Chapter1_Part1.pptx
Discrete_Mathematics_Chapter1_Part1.pptx
jannatuncse
 
Chapter1p1.pdf
Chapter1p1.pdfChapter1p1.pdf
Chapter1p1.pdf
IqraAli875037
 
Logic
LogicLogic
Logic
Jeane Paguio
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptx
PriyalMayurManvar
 
DM(1).pptx
DM(1).pptxDM(1).pptx
DM(1).pptx
PradeeshSAI
 
dm-logic.pdf
dm-logic.pdfdm-logic.pdf
dm-logic.pdf
TsegayeAndualem
 
20220818151924_PPT01 - The Logic of Compound and Quantitative Statement.pptx
20220818151924_PPT01 - The Logic of Compound and Quantitative Statement.pptx20220818151924_PPT01 - The Logic of Compound and Quantitative Statement.pptx
20220818151924_PPT01 - The Logic of Compound and Quantitative Statement.pptx
ssuser92109d
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
jayarao21
 
logicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdflogicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdf
PradeeshSAI
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdf
smarwaneid
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]
DIwakar Rajput
 
Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
Ravind8
 
Discrete Maths141 - Course Outline and Lecture Slides
Discrete Maths141 - Course Outline and Lecture SlidesDiscrete Maths141 - Course Outline and Lecture Slides
Discrete Maths141 - Course Outline and Lecture Slides
AryanZia3
 
Discrete_Mathematics_Chapter1_Part1.pptx
Discrete_Mathematics_Chapter1_Part1.pptxDiscrete_Mathematics_Chapter1_Part1.pptx
Discrete_Mathematics_Chapter1_Part1.pptx
jannatuncse
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptx
PriyalMayurManvar
 
20220818151924_PPT01 - The Logic of Compound and Quantitative Statement.pptx
20220818151924_PPT01 - The Logic of Compound and Quantitative Statement.pptx20220818151924_PPT01 - The Logic of Compound and Quantitative Statement.pptx
20220818151924_PPT01 - The Logic of Compound and Quantitative Statement.pptx
ssuser92109d
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
jayarao21
 

Recently uploaded (20)

ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation RateModeling the Influence of Environmental Factors on Concrete Evaporation Rate
Modeling the Influence of Environmental Factors on Concrete Evaporation Rate
Journal of Soft Computing in Civil Engineering
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
AI Publications
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Artificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptxArtificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptx
rakshanatarajan005
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
AI Publications
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Artificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptxArtificial intelligence and machine learning.pptx
Artificial intelligence and machine learning.pptx
rakshanatarajan005
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
Ad

Discrete mathematics Chapter1 presentation.ppt

  • 1. Discrete Mathematics Chapter 1: Fundamentals of Logic 1 Presented By, Nandini S R Department of Computer Science
  • 2. 1.1 Propositions • A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both. • Are the following sentences propositions? • Delhi is the capital of India. • Read this carefully. • 1+2=3 • x+1=2 • What time is it? • 3 is a prime number. • Bengaluru is in Karnataka. 2
  • 3. 1.1 Propositions • Propositional Variables – variables that represent propositions: p, q, r, s • E.g. Proposition p – “3 is a prime number.” • Truth values – The truth or falsity of a proposition If proposition is true, its truth value is 1 (T) If proposition is false, its truth value is 0 (F) 3
  • 4. Logical connectives • Propositions used with words as not , and, if….then and if and only if, gives new propositions called compound propositions. • Words such as not , and, if….then and if and only if are called logical connectives. • Propositions which do not contain any logical connective are called Simple propositions. 4
  • 5. Negation • Examples • Find the negation of the proposition “Today is Friday.” • Find the negation of the proposition “3 is a prime number.” 5 Let p be a proposition. The negation of p, denoted by ¬p. The proposition ¬p is read “not p.” The truth value of the negation of p, ¬p is the opposite of the truth value of p. Solution: The negation is “Today is not Friday.” or “It is not Friday today.” Solution: The negation is “3 is not a prime number.”
  • 6. Negation The Truth Table for the Negation of a Proposition. p ¬p T F F T 6
  • 7. Conjuction • Examples • Find the conjunction of the propositions p and q where p is the proposition “9 is a prime number.” and q is the proposition “2+5=7”, and the truth value of the conjunction. 7 Let p and q be propositions. The conjunction of p and q, denoted by p Λ q, is the proposition “p and q”. The conjunction p Λ q is true when both p and q are true and is false otherwise. Solution: The conjunction is the proposition “9 is a prime number and 2+5=7.” The proposition is False.
  • 8. 1.1 Propositional Logic • E.g Find the conjunction of the propositions p and q where p is the proposition “4 is a prime number.” or q is the proposition “2+4=7”, and the truth value of the conjunction • Solution: The conjunction is the proposition “4 is a prime number and 2+4=7.” The proposition is False. 8 DEFINITION 3 Let p and q be propositions. The disjunction of p and q, denoted by p ν q, is the proposition “p or q”. The conjunction p ν q is false when both p and q are false and is true otherwise.
  • 9. 1.1 Propositional Logic The Truth Table for the Exclusive Or (XOR) of Two Propositions. p q p q T T T F F T F F F T T F  The Truth Table for the Conjunction of Two Propositions. p q p Λ q T T T F F T F F T F F F The Truth Table for the Disjunction of Two Propositions. p q p ν q T T T F F T F F T T T F 9 DEFINITION 4 Let p and q be propositions. The exclusive or of p and q, denoted by p q, is the proposition that is true when exactly one of p and q is true and is false otherwise.  
  • 10. 1.1 Propositional Logic  10 DEFINITION 5 Let p and q be propositions. The conditional statement p → q, is the proposition “if p, then q.” The conditional statement is false when p is true and q is false, and true otherwise. In the conditional statement p → q, p is called the hypothesis (or antecedent or premise) and q is called the conclusion (or consequence). Conditional Statements  A conditional statement is also called an implication.  Example: “If I am elected, then I will lower taxes.” p → q implication: elected, lower taxes. T T | T not elected, lower taxes. F T | T not elected, not lower taxes. F F | T elected, not lower taxes. T F | F
  • 11. 1.1 Propositional Logic • Example: • Let p be the statement “Maria learns discrete mathematics.” and q the statement “Maria will find a good job.” Express the statement p → q as a statement in English. 11 Solution: Any of the following - “If Maria learns discrete mathematics, then she will find a good job.
  • 12. 1.1 Propositional Logic • Other conditional statements: • Converse of p → q : q → p • Contrapositive of p → q : ¬ q → ¬ p • Inverse of p → q : ¬ p → ¬ q 12
  • 13. 1.1 Propositional Logic • p ↔ q has the same truth value as (p → q) Λ (q → p) • “if and only if” can be expressed by “iff” • Example: • Let p be the statement “You can take the flight” and let q be the statement “You buy a ticket.” Then p ↔ q is the statement “You can take the flight if and only if you buy a ticket.” Implication: If you buy a ticket you can take the flight. If you don’t buy a ticket you cannot take the flight. 13 DEFINITION 6 Let p and q be propositions. The biconditional statement p ↔ q is the proposition “p if and only if q.” The biconditional statement p ↔ q is true when p and q have the same truth values, and is false otherwise. Biconditional statements are also called bi-implications.
  • 14. 1.1 Propositional Logic The Truth Table for the Biconditional p ↔ q. p q p ↔ q T T T F F T F F T F F T 14
  • 15. 1.1 Propositional Logic • We can use connectives to build up complicated compound propositions involving any number of propositional variables, then use truth tables to determine the truth value of these compound propositions. • Example: Construct the truth table of the compound proposition (p ν ¬q) → (p Λ q). The Truth Table of (p ν ¬q) → (p Λ q). p q ¬q p ν ¬q p Λ q (p ν ¬q) → (p Λ q) T T T F F T F F F T F T T T F T T F F F T F T F 15 Truth Tables of Compound Propositions
  • 16. 1.1 Propositional Logic • We can use parentheses to specify the order in which logical operators in a compound proposition are to be applied. • To reduce the number of parentheses, the precedence order is defined for logical operators. Precedence of Logical Operators. Operator Precedence ¬ 1 Λ ν 2 3 → ↔ 4 5 16 Precedence of Logical Operators E.g. ¬p Λ q = (¬p ) Λ q p Λ q ν r = (p Λ q ) ν r p ν q Λ r = p ν (q Λ r)
  • 17. 1.1 Propositional Logic • Example: How can this English sentence be translated into a logical expression? “You can access the Internet from campus only if you are a computer science major or you are not a freshman.” 17 Solution: Let p, q, and r represent “You can access the Internet from campus,” “You are a computer science major,” and “You are a freshman.” The sentence can be translated into: p → (q ν ¬r).
  • 18. 1.1 Propositional Logic • Computers represent information using bits. • A bit is a symbol with two possible values, 0 and 1. • By convention, 1 represents T (true) and 0 represents F (false). • A variable is called a Boolean variable if its value is either true or false. • Bit operation – replace true by 1 and false by 0 in logical operations. Table for the Bit Operators OR, AND, and XOR. x y x ν y x Λ y x y 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 1 0  18 Logic and Bit Operations
  • 19. 1.1 Propositional Logic • Example: Find the bitwise OR, bitwise AND, and bitwise XOR of the bit string 01 1011 0110 and 11 0001 1101. 19 DEFINITION 7 A bit string is a sequence of zero or more bits. The length of this string is the number of bits in the string. Solution: 01 1011 0110 11 0001 1101 ------------------- 11 1011 1111 bitwise OR 01 0001 0100 bitwise AND 10 1010 1011 bitwise XOR
  • 20. 1.2 Propositional Equivalences Examples of a Tautology and a Contradiction. p ¬p p ν ¬p p Λ ¬p T F F T T T F F 20 DEFINITION 1 A compound proposition that is always true, no matter what the truth values of the propositions that occurs in it, is called a tautology. A compound proposition that is always false is called a contradiction. A compound proposition that is neither a tautology or a contradiction is called a contingency. Introduction
  • 21. 1.2 Propositional Equivalences • Compound propositions that have the same truth values in all possible cases are called logically equivalent. • Example: Show that ¬p ν q and p → q are logically equivalent. Truth Tables for ¬p ν q and p → q . p q ¬p ¬p ν q p → q T T F F T F T F F F T T T F T T T F T T 21 DEFINITION 2 The compound propositions p and q are called logically equivalent if p ↔ q is a tautology. The notation p ≡ q denotes that p and q are logically equivalent. Logical Equivalences
  • 22. 1.2 Propositional Equivalences • In general, 2n rows are required if a compound proposition involves n propositional variables in order to get the combination of all truth values. • See page 24, 25 for more logical equivalences. 22
  • 23. 1.2 Propositional Equivalences • Example: Show that ¬(p → q ) and p Λ ¬q are logically equivalent. Solution: ¬(p → q ) ≡ ¬(¬p ν q) by example on slide 21 ≡ ¬(¬p) Λ ¬q by the second De Morgan law ≡ p Λ ¬q by the double negation law • Example: Show that (p Λ q) → (p ν q) is a tautology. Solution: To show that this statement is a tautology, we will use logical equivalences to demonstrate that it is logically equivalent to T. (p Λ q) → (p ν q) ≡ ¬(p Λ q) ν (p ν q) by example on slide 21 ≡ (¬ p ν ¬q) ν (p ν q) by the first De Morgan law ≡ (¬ p ν p) ν (¬ q ν q) by the associative and communicative law for disjunction ≡ T ν T ≡ T • Note: The above examples can also be done using truth tables. 23 Constructing New Logical Equivalences
  翻译: