SlideShare a Scribd company logo
Discrete
Structures
or
Mathematics
Muhammad Nawaz, (PhD, UK)
Assistant Professor (Multimedia Systems)
PhD and MS-Computer Science Programs Coordinator
Centre for Excellence in Information Technology
IMSciences Peshawar- Pakistan
Introduction
• Discrete mathematics is the part of mathematics devoted to the study
of discrete objects.
• Here “Discrete” means consisting of unconnected elements.
• Examples
• How many ways are there to choose a valid password on a computer
system?
• What is the probability of winning a lottery?
• Is there a link between two computers in a network?
• How can I identify spam email messages?
• How can I encrypt a messages so that no unintended recipient can
read it?
• What is the shortest path between two cities using a transportation
system?
• How can a list of integers be sorted so that the integers are in
increasing order?
• How many steps are required to do such a sorting?
• How can it be proved that a sorting algorithm correctly sorts a list?
• How can a circuit that adds two integers be designed?
• How many valid Internet addresses are there?
• More generally, discrete mathematics is used whenever objects are
counted, when relationships between finite (or countable) sets are
studied, and when processes involving a finite number of steps are
analyzed.
Why Study Discrete Mathematics?
• There are several important reasons for studying discrete
mathematics.
• First, through this course you can develop your mathematical
maturity: that is, your ability to understand and create mathematical
arguments.
• Second, discrete mathematics is the gate way to more advanced
courses in all parts of the mathematical sciences i.e. data structures,
algorithms, database theory, automata theory, formal languages,
compiler theory, computer security, and operating systems.
• Also, discrete mathematics contains the necessary mathematical
background for solving problems in operations research ( including
many discrete optimization techniques), chemistry, engineering,
biology, and soon.
Logic?????
• Logic is the study of the principles and methods that distinguish
between a valid and invalid argument.
Propositions
• A proposition is a declarative sentence (that is, a sentence that
declares a fact) that is either true or false, but not both.
• Examples
1. Islamabad is the capital of Pakistan.
2. Madras is the capital of India.
3. 1+1=2.
4. 2+2=3.
• Note that sentences 1 and 3 are true but 2 an 4 are false but in any
case all the four sentences are proposition according to the definition
• Some sentences that are not propositions are given as follows.
1. What time is it?
2. Read this carefully.
3. x+1=2.
4. x+y=z.
• Sentences 1 and 2 are not propositions because they are not declarative
sentences. Sentences 3 and 4 are not propositions because they are
neither true nor false.
• Note that each of sentences 3 and 4 can be turned into a proposition if we
assign values to the variables.
Proposition Variables
• Propositions are denoted by letters i.e. p, q, r, s.
• The truth value of proposition is denoted by T and False values are
denoted by F.
Atomic Propositions
• Atomic proposition is the proposition that cannot be divided into
more simpler propositions.
• For example
• “Dr. Sajid Anwar is the assistant professor in IMS.
• 50>40
• Ali is rich
Molecular Proposition
• When atomic propositions are combined with the help of connective,
molecular propositions are formed. (and, or, not).
• For example consider the following propositions
• p: Pakistan is situated in South Asia
• q: Islamabad is the capital of Pakistan
• By using connective “and” a molecular proposition can be formed as;
• r: Pakistan is situated in South Asia and Islamabad is the capital of
Pakistan.
Truth Table
• A truth table displays the relationship between the truth values of
propositions.
• It is constructed from simpler propositions.
• Let see how to construct a truth tables for different forms of
propositions???
Negation
• Let p be a proposition. The negation of p, denoted by ~p (also
denoted by p), is the statement
“It is not the case that 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.
• For example
• “Today is Friday”
• The negation of the given sentence would be
• “Today is not Friday”
• “Ali’s smart phone has at least 32GB of memory”
• The negation of this sentence would be
• “Ali’s smart phone does not have at least 32GB of memory”
• Or simply
• “Ali’s smart phone has less than 32GB of memory”
Truth table for Negation
• Truth table for negation is given
in the table shown.
• T represents true value and F
represents false value.
Conjunction ()
• If p and q are statements, then
the conjunction of p and q is “p
and q”, denoted as “p  q”.
• It is true when, and only when,
both p and q are true. If either p
or q is false, or if both are false,
p  q is false.
• Truth table for conjunction can
be shown as;
Disjunction ()
• If p & q are statements, then the
disjunction of p and q is “p or
q”, denoted as “p  q”.
• It is true when at least one of p
or q is true and is false only
when both p and q are false.
• Truth table for disjunction is
shown as;
Conditional statements or Implications
• Let p and q be propositions. The
conditional statement p → q is the
proposition “if p, then q.” The
conditional statement p → q 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).
• Truth table for implication is shown
as;
p q p q
T T T
T F F
F T T
F F T
Implication Examples
• If there is flood then the crops will destroy.
• Hassan will pass the exam if he studies hard.
• If it rains then the streets get wet.
• If It snows then we will go on skiing.
• “If 1 = 1, then 3 = 3.” TRUE
• “If 1 = 1, then 2 = 3.” FALSE
• “If 1 = 0, then 3 = 3.” TRUE
• “If 1 = 2, then 2 = 3.” TRUE
• “If 1 = 1, then 1 = 2 and 2 = 3.” FALSE
• “If 1 = 3 or 1 = 2 then 3 = 3.” TRUE
Inverse of a Conditional Statement
• The inverse of the conditional statement p  q is ~p  ~q
• A conditional and its inverse are not equivalent as could be seen from
the truth table.
Examples
1. If today is Friday, then 2 + 3 = 5.
If today is not Friday, then 2 + 3  5.
2. If it snows today, I will ski tomorrow.
If it does not snow today I will not ski tomorrow.
3. If P is a square, then P is a rectangle.
If P is not a square then P is not a rectangle.
4. If my car is in the repair shop, then I cannot get to class.
If my car is not in the repair shop, then I shall get to the class.
Converse of a conditional statement
• The converse of the conditional
statement p  q is q p
• A conditional and its converse
are not equivalent i.e.,  is not
a commutative operator.
Examples
1. If today is Friday, then 2 + 3 = 5.
If 2 + 3 = 5, then today is Friday.
2. If it snows today, I will ski tomorrow.
I will ski tomorrow only if it snows today.
3. If P is a square, then P is a rectangle.
If P is a rectangle then P is a square.
4. If my car is in the repair shop, then I cannot get to class.
If I cannot get to the class, then my car is in the repair shop.
Contrapositive of a conditional statement
• The contrapositive of the conditional statement p  q is ~ q  ~ p
• A conditional and its contrapositive are equivalent.
1. If today is Friday, then 2 + 3 = 5.
If 2 + 3  5, then today is not Friday.
2. If it snows today, I will ski tomorrow.
I will not ski tomorrow only if it does not snow today.
3. If P is a square, then P is a rectangle.
If P is not a rectangle then P is not a square.
4. If my car is in the repair shop, then I cannot get to class.
If I get to the class, then my car is not in the repair shop.
Biconditional
• If p and q are statement
variables, the biconditional of p
and q is
• “p if and only if, q” and is
denoted p  q. if and only if
abbreviated iff.
• The double headed arrow " "
is the biconditional operator.
• Truth table for biconditional
statement is shown as;
Examples
• True or false?
1. “1+1 = 3 if and only if earth is flat”
TRUE
2. “Sky is blue iff 1 = 0”
FALSE
3. “Milk is white iff birds lay eggs”
TRUE
4. “33 is divisible by 4 if and only if horse has four legs”
FALSE
Compound Propositions
• A string consisting of variables, parenthesis and connectives is called a
compound proposition.
• Example
• ~(p  q), ~(p Ʌ q), (p(p  q  r))
Note: “2n” is used to create a truth table for the given expression.
Where n is the number of variable used in the expression.
Tautology
• A tautology is a statement form
that is always true regardless of
the truth values of the
statement variables.
• A tautology is represented by
the symbol “T”.
• EXAMPLE: The statement form p
 ~ p is tautology
Contradiction
• A contradiction is a statement
form that is always false
regardless of the truth values of
the statement variables.
• A contradiction is represented
by the symbol “c”.
• EXAMPLE:
• The statement form p  ~ p is a
contradiction.
p ~ p p  ~ p
T F F
F T F
Exclusive Or
• When or is used in its exclusive sense, the statement “p or q” means
“p or q but not both” or “p or q and not p and q” which translates
into symbols as:
• (p  q)  ~ (p  q)
• Which is abbreviated as:
• p  q
• or p XOR q
• Basically
• p  q ≡ (p Ʌ ~q) v (~p Ʌ q)
• ≡ [p Ʌ ~q) v ~p] Ʌ [(p Ʌ ~q) v q]
• ≡ (p v q) Ʌ ~(p Ʌ q)
• ≡ (p v q) Ʌ (~p v ~q)
•
p q pq pq ~ (pq) (pq)  ~ (pq)
T T T T F F
T F T F T T
F T T F T T
F F F F T F
TRUTH TABLE FOR EXCLUSIVE OR:
Logical Equivalence
• Two compound propositions A, B are regarded as logically equivalent,
if they have the same truth values.
OR
• Two compound propositions A, B are logically equivalent if and only if
A  B is a tautology.
• Examples
• p Ʌ T  p Laws of identity
• p v F  p
• p Ʌ p  p Idempotent Law
• p v p  p
• ~(~p)  p Double Negative
• p v q  q v p
• p Ʌ q  q Ʌ p
• Commutative Law
• ((p v q) Ʌ r)  ((p v (q v r))
• ((p v (q Ʌ r)  ((p v q) Ʌ (p v r))
• Distributive Laws
• ((p v q) v r)  ((p v (q v r))
• ((p Ʌ q) Ʌ r)  ((p Ʌ (q Ʌ r))
• Associative Laws
• ~(p v q)  ~p Ʌ ~q
• ~(p Ʌ q)  ~p v ~q
• Demargan’s Laws
• p  q  ~q  ~p Contrapositive
Applying Laws Of Logic
• Using law of logic, simplify the statement form
• p  [~(~p  q)]
• Solution:
• p  [~(~p  q)]  p  [~(~p)  (~q)] DeMorgan’s Law
• p  [p(~q)] Double Negative Law
•  [p  p](~q) Associative Law for 
• p  (~q) Indempotent Law
• Using Laws of Logic, verify the logical equivalence
• ~ (~ p  q)  (p  q) p
• Solution:
• ~(~p  q)  (pq)  (~(~p)  ~q) (p  q) DeMorgan’s Law
•  (p  ~q)  (p  q) Double Negative Law
 p  (~q  q) Distributive Law
•  p  c Negation Law
•  p Identity Law
Translating From English To Symbols
• Let p = “It is hot”, and q = “It is sunny”
• SENTENCE SYMBOLIC FORM
• It is not hot. ~ p
• It is hot and sunny. p q
• It is hot or sunny. p  q
• It is not hot but sunny. ~ p q
• It is neither hot nor sunny. ~ p  ~ q
• p = “Islamabad is the capital of Pakistan”
• q = “17 is divisible by 3”
• p Ʌ q = “Islamabad is the capital of Pakistan and 17 is divisible by 3”
• p v q = “Islamabad is the capital of Pakistan or 17 is divisible by 3”
• ~p = “It is not the case that Islamabad is the capital of Pakistan” or
simply
• “Islamabad is not the capital of Pakistan”
• Let h = “Zia is healthy”
• w = “Zia is wealthy”
• s = “Zia is wise”
• Translate the compound statements to symbolic form:
1. Zia is healthy and wealthy but not wise. (h  w)  (~s)
2. Zia is not wealthy but he is healthy and wise. ~w  (h  s)
3. Zia is neither healthy, wealthy nor wise. ~h  ~w  ~s
Translating From Symbols To English
• Let m = “Ali is good in Mathematics”
• c = “Ali is a Computer Science student”
• Translate the following statement forms into plain English:
• ~ c Ali is not a Computer Science student
• c  m Ali is a Computer Science student or good in Maths.
• m  ~c Ali is good in Maths but not a Computer Science
student
• A convenient method for analyzing a compound statement is to make
a truth table for it.
Rules of Inference
• In propositional logic there are certain statements that are accepted
as axioms- statements that do not need to be proved. An axiom is
therefore a statement whose truth is self evident.
• On the other hand a theorem is a statement that is shown to be true.
It can be demonstrated that a theorem is true with the sequence of
statements that form an argument, called a proof.
• To construct proofs, methods are needed to derive new statements
from the old ones. Here axioms are used.
• The rules of inference tie together the step of a proof.
Rules of Inference
• Let P an Q are two compound
propositions. P logically implies
Q (i.e. P => Q) if and only if P 
Q is tautology.
• Example
• p  (p v q) Addition
• p Ʌ q  p Simplification
• (p c)  ~p Absurdity
• (p Ʌ (p  q))  q Modus ponens
• ((p  q) Ʌ ~q => ~p
• Modus tollens
• ((p q) Ʌ (q  r)) => p  r
• Transitivity of Implication
• ((p  q) Ʌ (q  r)) (p  r)
• Hypothetical syllogism
• ((p v q) Ʌ ~p)  q
• Disjunctive syllogism
Argument
• An argument is a list of statements called premises (or assumptions or
hypotheses) followed by a statement called the conclusion.
• P1 Premise
• P2 Premise
• P3 Premise
• . . . . .. . . . .
• Pn Premise
• ______________
• C Conclusion
• NOTE The symbol  read “therefore,” is normally placed just before the
conclusion.
Valid argument
• An argument is valid if the
conclusion is true when all the
premises are true.
• Alternatively, an argument is
valid if conjunction of its
premises imply conclusion. That
is (P1 P2  P3  . . .  Pn)  C
is a tautology.
EXAMPLE:
Show that the following argument form is valid:
pq
p
 q
SOLUTION
premises conclusion
FFTFF
TFTTF
FTFFT
TTTTT
qppqqp
critical row
Invalid argument
• An argument is invalid if the
conclusion is false when all the
premises are true.
• Alternatively, an argument is
invalid if conjunction of its
premises does not imply
conclusion.
• EXAMPLE Show that the
following argument form is invalid:
• p  q
• q
•  p
SOLUTION premises conclusion
FFTFF
FTTTF
TFFFT
TTTTT
pqpqqp
critical row
Example
• Use truth table to determine the
argument form
• p  q
• p  ~q
• p  r
•  r
• is valid or invalid.
premises conclusion
FTTFFFF
TTTFTFF
FTTTFTF
TTTTTTF
FFTTFFT
TTTTTFT
FFFTFTT
TTFTTTT
rprp~qpqrqp
Critical rows
Word Form Example
• If Tariq is not on team A, then Hameed is
on team B.
• If Hameed is not on team B, then Tariq is
on team A. Tariq is not on team A or
Hameed is not on team B.
• SOLUTION
• Let
• p = Tariq is on team A
• q = Hameed is on team B
• Then the argument is
• ~ p  q
• ~ q  p
•  ~ p  ~ q
p q ~p  q ~p  q ~p ~q
T T T T F
T F T T T
F T T T T
F F F F T
• Argument is invalid. Because there are three critical rows ( Remember
that the critical rows are those rows where the premises have truth
value T) and in the first critical row conclusion has truth value F. (Also
remember that we say an argument is valid if in all critical rows
conclusion has truth value T).
• If at least one of these two
numbers is divisible by 6, then
the product of these two
numbers is divisible by 6.
• Neither of these two numbers is
divisible by 6.
•  The product of these two
numbers is not divisible by 6.
• SOLUTION
• Let p = at least one of these
two numbers is divisible by 6.
• q = product of these two
numbers is divisible by 6.
• Then the argument become in
these symbols
• p  q
• ~ p
•  ~ q
p q p  q ~p ~q
T T T F F
T F F F T
F T T T F
F F T T T
• Here there are two critical rows
the 3rd and 4th rows. The
conclusion of the third row is F.
This shows that the given
argument is invalid.
• If I got an Eid bonus, I’ll buy a
stereo.
• If I sell my motorcycle, I’ll buy a
stereo.
•  If I get an Eid bonus or I sell my
motorcycle, then I’ll buy a stereo.
• SOLUTION:
• Let
• e = I got an Eid bonus
• s = I’ll buy a stereo
• m = I sell my motorcycle
• The argument is
• e  s
• m  s
• e  m  s
e s me sm s emem s
T T T T T T T
T T F T T T T
T F T F F T F
T F F F T T F
F T T T T T T
F T F T T F T
F F T T F T F
F F F T T F T
• The argument is valid. Because
there are five critical rows (
Remember that the critical rows
are those rows where the
premises have truth value T) and
in all critical row conclusion has
truth value T. (Also remember
that we say an argument is valid
if in all critical rows conclusion
has truth value T).
• An interesting teacher keeps me
awake. I stay awake in Discrete
Mathematics class. Therefore, my
Discrete Mathematics teacher is
interesting.
• Solution:
• t: my teacher is interesting
a: I stay awake
• m: I am in Discrete Mathematics
class the argument to be tested is
• t  a,
• a  m
•  m  t
t a m t  a a  m m  t
T T T T T T
T T F T F F
T F T F F T
T F F F F F
F T T T T F
F T F T F F
F F T T F F
F F F T F F

More Related Content

What's hot

Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
rey castro
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematics
asad faraz
 
mathematical induction
mathematical inductionmathematical induction
mathematical induction
ankush_kumar
 
Maths probability
Maths probabilityMaths probability
Maths probability
Saurabh Sonwalkar
 
Truth table
Truth tableTruth table
Truth table
Abdur Rehman
 
Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional Logic
IT Engineering Department
 
CMSC 56 | Lecture 1: Propositional Logic
CMSC 56 | Lecture 1: Propositional LogicCMSC 56 | Lecture 1: Propositional Logic
CMSC 56 | Lecture 1: Propositional Logic
allyn joy calcaben
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
BindhuBhargaviTalasi
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
ForwardBlog Enewzletter
 
Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inference
raksharao
 
Recurrence relations
Recurrence relationsRecurrence relations
Recurrence relations
IIUM
 
Combinatorics
CombinatoricsCombinatorics
Combinatorics
Anjali Devi J S
 
Proof By Contradictions
Proof By ContradictionsProof By Contradictions
Proof By Contradictions
GC University Fsd
 
Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)
Ikhtiar Khan Sohan
 
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
taimoor iftikhar
 
Logical equivalence, laws of logic
Logical equivalence, laws of logicLogical equivalence, laws of logic
Logical equivalence, laws of logic
Lakshmi R
 
Mathematical Logic - Part 1
Mathematical Logic - Part 1Mathematical Logic - Part 1
Mathematical Logic - Part 1
blaircomp2003
 
Binomial Theorem
Binomial TheoremBinomial Theorem
Binomial Theorem
itutor
 
CMSC 56 | Lecture 2: Propositional Equivalences
CMSC 56 | Lecture 2: Propositional EquivalencesCMSC 56 | Lecture 2: Propositional Equivalences
CMSC 56 | Lecture 2: Propositional Equivalences
allyn joy calcaben
 
Truth tables
Truth tablesTruth tables
Truth tables
walkerlj
 

What's hot (20)

Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematics
 
mathematical induction
mathematical inductionmathematical induction
mathematical induction
 
Maths probability
Maths probabilityMaths probability
Maths probability
 
Truth table
Truth tableTruth table
Truth table
 
Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional Logic
 
CMSC 56 | Lecture 1: Propositional Logic
CMSC 56 | Lecture 1: Propositional LogicCMSC 56 | Lecture 1: Propositional Logic
CMSC 56 | Lecture 1: Propositional Logic
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inference
 
Recurrence relations
Recurrence relationsRecurrence relations
Recurrence relations
 
Combinatorics
CombinatoricsCombinatorics
Combinatorics
 
Proof By Contradictions
Proof By ContradictionsProof By Contradictions
Proof By Contradictions
 
Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)
 
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
 
Logical equivalence, laws of logic
Logical equivalence, laws of logicLogical equivalence, laws of logic
Logical equivalence, laws of logic
 
Mathematical Logic - Part 1
Mathematical Logic - Part 1Mathematical Logic - Part 1
Mathematical Logic - Part 1
 
Binomial Theorem
Binomial TheoremBinomial Theorem
Binomial Theorem
 
CMSC 56 | Lecture 2: Propositional Equivalences
CMSC 56 | Lecture 2: Propositional EquivalencesCMSC 56 | Lecture 2: Propositional Equivalences
CMSC 56 | Lecture 2: Propositional Equivalences
 
Truth tables
Truth tablesTruth tables
Truth tables
 

Similar to Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation

logic, preposition etc
logic, preposition etclogic, preposition etc
logic, preposition etc
Abdur Rehman
 
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
Adeel Saifee
 
logicj-160412050513.pptx
logicj-160412050513.pptxlogicj-160412050513.pptx
logicj-160412050513.pptx
NathanielRapanut2
 
discrete structures and their introduction
discrete structures and their introductiondiscrete structures and their introduction
discrete structures and their introduction
ZenLooper
 
DM 1.pptx
DM 1.pptxDM 1.pptx
CS202Ch1.ppt
CS202Ch1.pptCS202Ch1.ppt
CS202Ch1.ppt
RuchiTuliWadhwa
 
CSE-203 Lec_1.pptx
CSE-203 Lec_1.pptxCSE-203 Lec_1.pptx
CSE-203 Lec_1.pptx
MahdiHasan86
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
jayarao21
 
Introduction to mathematical analysis
Introduction to mathematical analysisIntroduction to mathematical analysis
Introduction to mathematical analysis
AnoojaI
 
lecture011712 (1).ppt
lecture011712 (1).pptlecture011712 (1).ppt
lecture011712 (1).ppt
abdulali6457
 
unit1rulesofinference-170113152312.pdf
unit1rulesofinference-170113152312.pdfunit1rulesofinference-170113152312.pdf
unit1rulesofinference-170113152312.pdf
BhanuCharan9
 
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
 
L01.ppt
L01.pptL01.ppt
Logic
LogicLogic
Logic
H K
 
Lecture # 2 discrete for beginners.ppt
Lecture # 2 discrete for beginners.pptLecture # 2 discrete for beginners.ppt
Lecture # 2 discrete for beginners.ppt
faizahanif618
 
Laws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applicationsLaws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applications
ZenLooper
 
Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
Ravind8
 
Discrete Structure vs Discrete Mathematics
Discrete Structure vs Discrete MathematicsDiscrete Structure vs Discrete Mathematics
Discrete Structure vs Discrete Mathematics
AbdulRehman378540
 
Propositional logic sneha-mam
Propositional logic sneha-mam Propositional logic sneha-mam
Propositional logic sneha-mam
nitesh9353
 
Disc Week 1.pdf
Disc Week 1.pdfDisc Week 1.pdf
Disc Week 1.pdf
MishiRana5
 

Similar to Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation (20)

logic, preposition etc
logic, preposition etclogic, preposition etc
logic, preposition etc
 
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
 
logicj-160412050513.pptx
logicj-160412050513.pptxlogicj-160412050513.pptx
logicj-160412050513.pptx
 
discrete structures and their introduction
discrete structures and their introductiondiscrete structures and their introduction
discrete structures and their introduction
 
DM 1.pptx
DM 1.pptxDM 1.pptx
DM 1.pptx
 
CS202Ch1.ppt
CS202Ch1.pptCS202Ch1.ppt
CS202Ch1.ppt
 
CSE-203 Lec_1.pptx
CSE-203 Lec_1.pptxCSE-203 Lec_1.pptx
CSE-203 Lec_1.pptx
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
 
Introduction to mathematical analysis
Introduction to mathematical analysisIntroduction to mathematical analysis
Introduction to mathematical analysis
 
lecture011712 (1).ppt
lecture011712 (1).pptlecture011712 (1).ppt
lecture011712 (1).ppt
 
unit1rulesofinference-170113152312.pdf
unit1rulesofinference-170113152312.pdfunit1rulesofinference-170113152312.pdf
unit1rulesofinference-170113152312.pdf
 
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
 
L01.ppt
L01.pptL01.ppt
L01.ppt
 
Logic
LogicLogic
Logic
 
Lecture # 2 discrete for beginners.ppt
Lecture # 2 discrete for beginners.pptLecture # 2 discrete for beginners.ppt
Lecture # 2 discrete for beginners.ppt
 
Laws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applicationsLaws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applications
 
Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
 
Discrete Structure vs Discrete Mathematics
Discrete Structure vs Discrete MathematicsDiscrete Structure vs Discrete Mathematics
Discrete Structure vs Discrete Mathematics
 
Propositional logic sneha-mam
Propositional logic sneha-mam Propositional logic sneha-mam
Propositional logic sneha-mam
 
Disc Week 1.pdf
Disc Week 1.pdfDisc Week 1.pdf
Disc Week 1.pdf
 

Recently uploaded

一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
bmucuha
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
dataschool1
 
Data Scientist Machine Learning Profiles .pdf
Data Scientist Machine Learning  Profiles .pdfData Scientist Machine Learning  Profiles .pdf
Data Scientist Machine Learning Profiles .pdf
Vineet
 
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
nyvan3
 
一比一原版加拿大麦吉尔大学毕业证(mcgill毕业证书)如何办理
一比一原版加拿大麦吉尔大学毕业证(mcgill毕业证书)如何办理一比一原版加拿大麦吉尔大学毕业证(mcgill毕业证书)如何办理
一比一原版加拿大麦吉尔大学毕业证(mcgill毕业证书)如何办理
agdhot
 
Drownings spike from May to August in children
Drownings spike from May to August in childrenDrownings spike from May to August in children
Drownings spike from May to August in children
Bisnar Chase Personal Injury Attorneys
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
eoxhsaa
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
blueshagoo1
 
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
asyed10
 
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
eudsoh
 
一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理
zsafxbf
 
Senior Engineering Sample EM DOE - Sheet1.pdf
Senior Engineering Sample EM DOE  - Sheet1.pdfSenior Engineering Sample EM DOE  - Sheet1.pdf
Senior Engineering Sample EM DOE - Sheet1.pdf
Vineet
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
uevausa
 
Q4FY24 Investor-Presentation.pdf bank slide
Q4FY24 Investor-Presentation.pdf bank slideQ4FY24 Investor-Presentation.pdf bank slide
Q4FY24 Investor-Presentation.pdf bank slide
mukulupadhayay1
 
社内勉強会資料_Hallucination of LLMs               .
社内勉強会資料_Hallucination of LLMs               .社内勉強会資料_Hallucination of LLMs               .
社内勉強会資料_Hallucination of LLMs               .
NABLAS株式会社
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
TeukuEriSyahputra
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
hyfjgavov
 
Sid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.pptSid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.ppt
ArshadAyub49
 
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
Rebecca Bilbro
 

Recently uploaded (20)

一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
 
Data Scientist Machine Learning Profiles .pdf
Data Scientist Machine Learning  Profiles .pdfData Scientist Machine Learning  Profiles .pdf
Data Scientist Machine Learning Profiles .pdf
 
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
 
一比一原版加拿大麦吉尔大学毕业证(mcgill毕业证书)如何办理
一比一原版加拿大麦吉尔大学毕业证(mcgill毕业证书)如何办理一比一原版加拿大麦吉尔大学毕业证(mcgill毕业证书)如何办理
一比一原版加拿大麦吉尔大学毕业证(mcgill毕业证书)如何办理
 
Drownings spike from May to August in children
Drownings spike from May to August in childrenDrownings spike from May to August in children
Drownings spike from May to August in children
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
 
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
 
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
 
一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理
 
Senior Engineering Sample EM DOE - Sheet1.pdf
Senior Engineering Sample EM DOE  - Sheet1.pdfSenior Engineering Sample EM DOE  - Sheet1.pdf
Senior Engineering Sample EM DOE - Sheet1.pdf
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
 
Q4FY24 Investor-Presentation.pdf bank slide
Q4FY24 Investor-Presentation.pdf bank slideQ4FY24 Investor-Presentation.pdf bank slide
Q4FY24 Investor-Presentation.pdf bank slide
 
社内勉強会資料_Hallucination of LLMs               .
社内勉強会資料_Hallucination of LLMs               .社内勉強会資料_Hallucination of LLMs               .
社内勉強会資料_Hallucination of LLMs               .
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
 
Sid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.pptSid Sigma educational and problem solving power point- Six Sigma.ppt
Sid Sigma educational and problem solving power point- Six Sigma.ppt
 
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
PyData London 2024: Mistakes were made (Dr. Rebecca Bilbro)
 

Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation

  • 1. Discrete Structures or Mathematics Muhammad Nawaz, (PhD, UK) Assistant Professor (Multimedia Systems) PhD and MS-Computer Science Programs Coordinator Centre for Excellence in Information Technology IMSciences Peshawar- Pakistan
  • 2. Introduction • Discrete mathematics is the part of mathematics devoted to the study of discrete objects. • Here “Discrete” means consisting of unconnected elements. • Examples • How many ways are there to choose a valid password on a computer system? • What is the probability of winning a lottery? • Is there a link between two computers in a network? • How can I identify spam email messages?
  • 3. • How can I encrypt a messages so that no unintended recipient can read it? • What is the shortest path between two cities using a transportation system? • How can a list of integers be sorted so that the integers are in increasing order? • How many steps are required to do such a sorting? • How can it be proved that a sorting algorithm correctly sorts a list? • How can a circuit that adds two integers be designed? • How many valid Internet addresses are there?
  • 4. • More generally, discrete mathematics is used whenever objects are counted, when relationships between finite (or countable) sets are studied, and when processes involving a finite number of steps are analyzed.
  • 5. Why Study Discrete Mathematics? • There are several important reasons for studying discrete mathematics. • First, through this course you can develop your mathematical maturity: that is, your ability to understand and create mathematical arguments. • Second, discrete mathematics is the gate way to more advanced courses in all parts of the mathematical sciences i.e. data structures, algorithms, database theory, automata theory, formal languages, compiler theory, computer security, and operating systems.
  • 6. • Also, discrete mathematics contains the necessary mathematical background for solving problems in operations research ( including many discrete optimization techniques), chemistry, engineering, biology, and soon.
  • 7. Logic????? • Logic is the study of the principles and methods that distinguish between a valid and invalid argument.
  • 8. Propositions • A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both. • Examples 1. Islamabad is the capital of Pakistan. 2. Madras is the capital of India. 3. 1+1=2. 4. 2+2=3. • Note that sentences 1 and 3 are true but 2 an 4 are false but in any case all the four sentences are proposition according to the definition
  • 9. • Some sentences that are not propositions are given as follows. 1. What time is it? 2. Read this carefully. 3. x+1=2. 4. x+y=z. • Sentences 1 and 2 are not propositions because they are not declarative sentences. Sentences 3 and 4 are not propositions because they are neither true nor false. • Note that each of sentences 3 and 4 can be turned into a proposition if we assign values to the variables.
  • 10. Proposition Variables • Propositions are denoted by letters i.e. p, q, r, s. • The truth value of proposition is denoted by T and False values are denoted by F.
  • 11. Atomic Propositions • Atomic proposition is the proposition that cannot be divided into more simpler propositions. • For example • “Dr. Sajid Anwar is the assistant professor in IMS. • 50>40 • Ali is rich
  • 12. Molecular Proposition • When atomic propositions are combined with the help of connective, molecular propositions are formed. (and, or, not). • For example consider the following propositions • p: Pakistan is situated in South Asia • q: Islamabad is the capital of Pakistan • By using connective “and” a molecular proposition can be formed as; • r: Pakistan is situated in South Asia and Islamabad is the capital of Pakistan.
  • 13. Truth Table • A truth table displays the relationship between the truth values of propositions. • It is constructed from simpler propositions. • Let see how to construct a truth tables for different forms of propositions???
  • 14. Negation • Let p be a proposition. The negation of p, denoted by ~p (also denoted by p), is the statement “It is not the case that 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. • For example • “Today is Friday” • The negation of the given sentence would be • “Today is not Friday”
  • 15. • “Ali’s smart phone has at least 32GB of memory” • The negation of this sentence would be • “Ali’s smart phone does not have at least 32GB of memory” • Or simply • “Ali’s smart phone has less than 32GB of memory”
  • 16. Truth table for Negation • Truth table for negation is given in the table shown. • T represents true value and F represents false value.
  • 17. Conjunction () • If p and q are statements, then the conjunction of p and q is “p and q”, denoted as “p  q”. • It is true when, and only when, both p and q are true. If either p or q is false, or if both are false, p  q is false. • Truth table for conjunction can be shown as;
  • 18. Disjunction () • If p & q are statements, then the disjunction of p and q is “p or q”, denoted as “p  q”. • It is true when at least one of p or q is true and is false only when both p and q are false. • Truth table for disjunction is shown as;
  • 19. Conditional statements or Implications • Let p and q be propositions. The conditional statement p → q is the proposition “if p, then q.” The conditional statement p → q 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). • Truth table for implication is shown as; p q p q T T T T F F F T T F F T
  • 20. Implication Examples • If there is flood then the crops will destroy. • Hassan will pass the exam if he studies hard. • If it rains then the streets get wet. • If It snows then we will go on skiing. • “If 1 = 1, then 3 = 3.” TRUE • “If 1 = 1, then 2 = 3.” FALSE • “If 1 = 0, then 3 = 3.” TRUE • “If 1 = 2, then 2 = 3.” TRUE • “If 1 = 1, then 1 = 2 and 2 = 3.” FALSE • “If 1 = 3 or 1 = 2 then 3 = 3.” TRUE
  • 21. Inverse of a Conditional Statement • The inverse of the conditional statement p  q is ~p  ~q • A conditional and its inverse are not equivalent as could be seen from the truth table.
  • 22. Examples 1. If today is Friday, then 2 + 3 = 5. If today is not Friday, then 2 + 3  5. 2. If it snows today, I will ski tomorrow. If it does not snow today I will not ski tomorrow. 3. If P is a square, then P is a rectangle. If P is not a square then P is not a rectangle. 4. If my car is in the repair shop, then I cannot get to class. If my car is not in the repair shop, then I shall get to the class.
  • 23. Converse of a conditional statement • The converse of the conditional statement p  q is q p • A conditional and its converse are not equivalent i.e.,  is not a commutative operator.
  • 24. Examples 1. If today is Friday, then 2 + 3 = 5. If 2 + 3 = 5, then today is Friday. 2. If it snows today, I will ski tomorrow. I will ski tomorrow only if it snows today. 3. If P is a square, then P is a rectangle. If P is a rectangle then P is a square. 4. If my car is in the repair shop, then I cannot get to class. If I cannot get to the class, then my car is in the repair shop.
  • 25. Contrapositive of a conditional statement • The contrapositive of the conditional statement p  q is ~ q  ~ p • A conditional and its contrapositive are equivalent. 1. If today is Friday, then 2 + 3 = 5. If 2 + 3  5, then today is not Friday. 2. If it snows today, I will ski tomorrow. I will not ski tomorrow only if it does not snow today. 3. If P is a square, then P is a rectangle. If P is not a rectangle then P is not a square. 4. If my car is in the repair shop, then I cannot get to class. If I get to the class, then my car is not in the repair shop.
  • 26. Biconditional • If p and q are statement variables, the biconditional of p and q is • “p if and only if, q” and is denoted p  q. if and only if abbreviated iff. • The double headed arrow " " is the biconditional operator. • Truth table for biconditional statement is shown as;
  • 27. Examples • True or false? 1. “1+1 = 3 if and only if earth is flat” TRUE 2. “Sky is blue iff 1 = 0” FALSE 3. “Milk is white iff birds lay eggs” TRUE 4. “33 is divisible by 4 if and only if horse has four legs” FALSE
  • 28. Compound Propositions • A string consisting of variables, parenthesis and connectives is called a compound proposition. • Example • ~(p  q), ~(p Ʌ q), (p(p  q  r)) Note: “2n” is used to create a truth table for the given expression. Where n is the number of variable used in the expression.
  • 29. Tautology • A tautology is a statement form that is always true regardless of the truth values of the statement variables. • A tautology is represented by the symbol “T”. • EXAMPLE: The statement form p  ~ p is tautology
  • 30. Contradiction • A contradiction is a statement form that is always false regardless of the truth values of the statement variables. • A contradiction is represented by the symbol “c”. • EXAMPLE: • The statement form p  ~ p is a contradiction. p ~ p p  ~ p T F F F T F
  • 31. Exclusive Or • When or is used in its exclusive sense, the statement “p or q” means “p or q but not both” or “p or q and not p and q” which translates into symbols as: • (p  q)  ~ (p  q) • Which is abbreviated as: • p  q • or p XOR q
  • 32. • Basically • p  q ≡ (p Ʌ ~q) v (~p Ʌ q) • ≡ [p Ʌ ~q) v ~p] Ʌ [(p Ʌ ~q) v q] • ≡ (p v q) Ʌ ~(p Ʌ q) • ≡ (p v q) Ʌ (~p v ~q) • p q pq pq ~ (pq) (pq)  ~ (pq) T T T T F F T F T F T T F T T F T T F F F F T F TRUTH TABLE FOR EXCLUSIVE OR:
  • 33. Logical Equivalence • Two compound propositions A, B are regarded as logically equivalent, if they have the same truth values. OR • Two compound propositions A, B are logically equivalent if and only if A  B is a tautology. • Examples
  • 34. • p Ʌ T  p Laws of identity • p v F  p • p Ʌ p  p Idempotent Law • p v p  p • ~(~p)  p Double Negative • p v q  q v p • p Ʌ q  q Ʌ p • Commutative Law • ((p v q) Ʌ r)  ((p v (q v r)) • ((p v (q Ʌ r)  ((p v q) Ʌ (p v r)) • Distributive Laws • ((p v q) v r)  ((p v (q v r)) • ((p Ʌ q) Ʌ r)  ((p Ʌ (q Ʌ r)) • Associative Laws • ~(p v q)  ~p Ʌ ~q • ~(p Ʌ q)  ~p v ~q • Demargan’s Laws • p  q  ~q  ~p Contrapositive
  • 35. Applying Laws Of Logic • Using law of logic, simplify the statement form • p  [~(~p  q)] • Solution: • p  [~(~p  q)]  p  [~(~p)  (~q)] DeMorgan’s Law • p  [p(~q)] Double Negative Law •  [p  p](~q) Associative Law for  • p  (~q) Indempotent Law
  • 36. • Using Laws of Logic, verify the logical equivalence • ~ (~ p  q)  (p  q) p • Solution: • ~(~p  q)  (pq)  (~(~p)  ~q) (p  q) DeMorgan’s Law •  (p  ~q)  (p  q) Double Negative Law  p  (~q  q) Distributive Law •  p  c Negation Law •  p Identity Law
  • 37. Translating From English To Symbols • Let p = “It is hot”, and q = “It is sunny” • SENTENCE SYMBOLIC FORM • It is not hot. ~ p • It is hot and sunny. p q • It is hot or sunny. p  q • It is not hot but sunny. ~ p q • It is neither hot nor sunny. ~ p  ~ q
  • 38. • p = “Islamabad is the capital of Pakistan” • q = “17 is divisible by 3” • p Ʌ q = “Islamabad is the capital of Pakistan and 17 is divisible by 3” • p v q = “Islamabad is the capital of Pakistan or 17 is divisible by 3” • ~p = “It is not the case that Islamabad is the capital of Pakistan” or simply • “Islamabad is not the capital of Pakistan”
  • 39. • Let h = “Zia is healthy” • w = “Zia is wealthy” • s = “Zia is wise” • Translate the compound statements to symbolic form: 1. Zia is healthy and wealthy but not wise. (h  w)  (~s) 2. Zia is not wealthy but he is healthy and wise. ~w  (h  s) 3. Zia is neither healthy, wealthy nor wise. ~h  ~w  ~s
  • 40. Translating From Symbols To English • Let m = “Ali is good in Mathematics” • c = “Ali is a Computer Science student” • Translate the following statement forms into plain English: • ~ c Ali is not a Computer Science student • c  m Ali is a Computer Science student or good in Maths. • m  ~c Ali is good in Maths but not a Computer Science student • A convenient method for analyzing a compound statement is to make a truth table for it.
  • 41. Rules of Inference • In propositional logic there are certain statements that are accepted as axioms- statements that do not need to be proved. An axiom is therefore a statement whose truth is self evident. • On the other hand a theorem is a statement that is shown to be true. It can be demonstrated that a theorem is true with the sequence of statements that form an argument, called a proof. • To construct proofs, methods are needed to derive new statements from the old ones. Here axioms are used. • The rules of inference tie together the step of a proof.
  • 42. Rules of Inference • Let P an Q are two compound propositions. P logically implies Q (i.e. P => Q) if and only if P  Q is tautology. • Example • p  (p v q) Addition • p Ʌ q  p Simplification • (p c)  ~p Absurdity • (p Ʌ (p  q))  q Modus ponens • ((p  q) Ʌ ~q => ~p • Modus tollens • ((p q) Ʌ (q  r)) => p  r • Transitivity of Implication • ((p  q) Ʌ (q  r)) (p  r) • Hypothetical syllogism • ((p v q) Ʌ ~p)  q • Disjunctive syllogism
  • 43. Argument • An argument is a list of statements called premises (or assumptions or hypotheses) followed by a statement called the conclusion. • P1 Premise • P2 Premise • P3 Premise • . . . . .. . . . . • Pn Premise • ______________ • C Conclusion • NOTE The symbol  read “therefore,” is normally placed just before the conclusion.
  • 44. Valid argument • An argument is valid if the conclusion is true when all the premises are true. • Alternatively, an argument is valid if conjunction of its premises imply conclusion. That is (P1 P2  P3  . . .  Pn)  C is a tautology. EXAMPLE: Show that the following argument form is valid: pq p  q SOLUTION premises conclusion FFTFF TFTTF FTFFT TTTTT qppqqp critical row
  • 45. Invalid argument • An argument is invalid if the conclusion is false when all the premises are true. • Alternatively, an argument is invalid if conjunction of its premises does not imply conclusion. • EXAMPLE Show that the following argument form is invalid: • p  q • q •  p SOLUTION premises conclusion FFTFF FTTTF TFFFT TTTTT pqpqqp critical row
  • 46. Example • Use truth table to determine the argument form • p  q • p  ~q • p  r •  r • is valid or invalid. premises conclusion FTTFFFF TTTFTFF FTTTFTF TTTTTTF FFTTFFT TTTTTFT FFFTFTT TTFTTTT rprp~qpqrqp Critical rows
  • 47. Word Form Example • If Tariq is not on team A, then Hameed is on team B. • If Hameed is not on team B, then Tariq is on team A. Tariq is not on team A or Hameed is not on team B. • SOLUTION • Let • p = Tariq is on team A • q = Hameed is on team B • Then the argument is • ~ p  q • ~ q  p •  ~ p  ~ q p q ~p  q ~p  q ~p ~q T T T T F T F T T T F T T T T F F F F T
  • 48. • Argument is invalid. Because there are three critical rows ( Remember that the critical rows are those rows where the premises have truth value T) and in the first critical row conclusion has truth value F. (Also remember that we say an argument is valid if in all critical rows conclusion has truth value T).
  • 49. • If at least one of these two numbers is divisible by 6, then the product of these two numbers is divisible by 6. • Neither of these two numbers is divisible by 6. •  The product of these two numbers is not divisible by 6. • SOLUTION • Let p = at least one of these two numbers is divisible by 6. • q = product of these two numbers is divisible by 6. • Then the argument become in these symbols • p  q • ~ p •  ~ q
  • 50. p q p  q ~p ~q T T T F F T F F F T F T T T F F F T T T • Here there are two critical rows the 3rd and 4th rows. The conclusion of the third row is F. This shows that the given argument is invalid.
  • 51. • If I got an Eid bonus, I’ll buy a stereo. • If I sell my motorcycle, I’ll buy a stereo. •  If I get an Eid bonus or I sell my motorcycle, then I’ll buy a stereo. • SOLUTION: • Let • e = I got an Eid bonus • s = I’ll buy a stereo • m = I sell my motorcycle • The argument is • e  s • m  s • e  m  s
  • 52. e s me sm s emem s T T T T T T T T T F T T T T T F T F F T F T F F F T T F F T T T T T T F T F T T F T F F T T F T F F F F T T F T • The argument is valid. Because there are five critical rows ( Remember that the critical rows are those rows where the premises have truth value T) and in all critical row conclusion has truth value T. (Also remember that we say an argument is valid if in all critical rows conclusion has truth value T).
  • 53. • An interesting teacher keeps me awake. I stay awake in Discrete Mathematics class. Therefore, my Discrete Mathematics teacher is interesting. • Solution: • t: my teacher is interesting a: I stay awake • m: I am in Discrete Mathematics class the argument to be tested is • t  a, • a  m •  m  t t a m t  a a  m m  t T T T T T T T T F T F F T F T F F T T F F F F F F T T T T F F T F T F F F F T T F F F F F T F F