0% found this document useful (0 votes)
31 views

Lecture Week1

This document provides an introduction to logic and propositions in a discrete mathematics course. It defines key logic terms like proposition, truth value, and logical connectives. Examples are given to distinguish statements from propositions and to illustrate logical operators like negation, conjunction, disjunction, implication, and biconditional. Truth tables are presented to show the truth values of simple and compound propositions. The document concludes with examples applying logical reasoning to problems involving knights and knaves.

Uploaded by

Mr GaMeR SM
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Lecture Week1

This document provides an introduction to logic and propositions in a discrete mathematics course. It defines key logic terms like proposition, truth value, and logical connectives. Examples are given to distinguish statements from propositions and to illustrate logical operators like negation, conjunction, disjunction, implication, and biconditional. Truth tables are presented to show the truth values of simple and compound propositions. The document concludes with examples applying logical reasoning to problems involving knights and knaves.

Uploaded by

Mr GaMeR SM
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

CSE 1101

DISCRETE MATHEMATICS

Week 1
Introduction

 Logic

09/17/2023 2
Logic
 Crucial for mathematical reasoning
 Important for program design
 Used for designing electronic circuitry
 Logic is a system based on propositions.
 A proposition is a (declarative) statement that
is either true or false (not both).
 We say that the truth value of a proposition is
either true (T) or false (F).
 Corresponds to 1 and 0 in digital circuits

09/17/2023 3
The Statement/Proposition Game
 “Elephants are bigger than mice.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? true

09/17/2023 4
The Statement/Proposition Game
 “520 < 111”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? false

09/17/2023 5
The Statement/Proposition Game
 “y > 5”

Is this a statement? yes


Is this a proposition? no

Its truth value depends on the value of y,


but this value is not specified.
We call this type of statement a
propositional function or open sentence.

09/17/2023 6
The Statement/Proposition Game
 “Today is January 27 and 99 < 5.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? false

09/17/2023 7
The Statement/Proposition Game
 “Please do not fall asleep.”

Is this a statement? no
It’s a request.

Is this a proposition? no

Only statements can be propositions.

09/17/2023 8
The Statement/Proposition Game
 “If the moon is made of cheese,
 then I will be rich.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? probably true

09/17/2023 9
The Statement/Proposition Game
 “x < y if and only if y > x.”
Is this a statement? yes
Is this a proposition? yes
… because its truth value
does not depend on
specific values of x and y.
What is the truth value
of the proposition? true

09/17/2023 10
Combining Propositions

As we have seen in the previous examples,


one or more propositions can be combined to
form a single compound proposition.

We formalize this by denoting propositions


with letters such as p, q, r, s, and introducing
several logical operators or logical
connectives.

09/17/2023 CSE 103 - Discrete Mathematics 11


Logical Operators (Connectives)
We will examine the following logical operators:
 Negation (NOT, )
 Conjunction (AND, )

 Disjunction (OR, )

 Exclusive-or (XOR,  )

 Implication (if – then,  )


 Biconditional (if and only if,  )
Truthtables can be used to show how these
operators can combine propositions to compound
propositions.

09/17/2023 12
Negation (NOT)

 Unary Operator, Symbol: 

P  P
true (T) false (F)
false (F) true (T)

09/17/2023 13
Conjunction (AND)
 Binary Operator, Symbol: 
P Q P Q
T T T
T F F
F T F
F F F

09/17/2023 14
Disjunction (OR)
 Binary Operator, Symbol: 

P Q P Q
T T T
T F T
F T T
F F F

09/17/2023 15
Exclusive Or (XOR)
 Binary Operator, Symbol: 

P Q P Q
T T F
T F T
F T T
F F F

09/17/2023 16
Implication (if - then)
 Binary Operator, Symbol: 

P Q P Q
T T T
T F F
F T T
F F T

09/17/2023 17
Biconditional (if and only if)
 Binary Operator, Symbol: 

P Q P Q
T T T
T F F
F T F
F F T

09/17/2023 18
Statements and Operators
 Statements and operators can be combined in any
way to form new statements.

(P)(
P Q P Q
Q)
T T F F F
T F F T T
F T T F T
F F T T T
09/17/2023 19
Statements and Operations
 Statements and operators can be combined in any
way to form new statements.

 (P)(
P Q PQ
(PQ) Q)
T T T F F
T F F T T
F T F T T
F F F T T
09/17/2023 20
Equivalent Statements
 (P)(Q (PQ) ( P)(
P Q
(PQ) ) Q)

T T F F T
T F T T T
F T T T T
F F T T T
 The statements  (PQ) and ( P)  ( Q) are logically equivalent, since they have the
same truth table, or put it in another way, (PQ)  ( P)  ( Q) is always true.

09/17/2023 21
Example
 Ellen reached an island where knight and knaves reside. A
knight always speaks the truth. A knave always speaks lie.
 Ellen meet A and B in two roads intersection. She asked the
way to go to the capital
 A says to her: “The capital is in mountains, or the road on
the right goes to the capital”
 B says to her: The capital is in mountains, and the road on
the right goes to the capital”
 A shouted,” The person is liar”
 B then added, “If the capital is in the mountains, the road to
the right goes to the capital”
 Ellen computed and took the left road. Did she reached the
capital?

09/17/2023 22
Example (contd.)
 c : the capital is in the mountains
 r : the road on the right goes to the capital

A: c.or. B:
c r B:c->r
r c .and.r
F F F F T
F T T F T
T F T F F
T T T T T
09/17/2023 23
Computation
 Truth Tables for Ellen’s Computation
 A is a Knight and telling the truth

A: c.or. B:
c r B:c->r
r c .and.r
F F F F T
F T T F T
T F T F F
T T T T T
09/17/2023 24
Example 2
 Ellen met 3 people C, D, E on the way. A knight always speaks the
truth. A knave always speaks lie. She asked, whether the road went
to the capital and where
 Ellen meet A and B in two roads intersection. She asked the way to
go to the capital and whether the location is bus stop.
 C says to her: “The road goes to the capital and the bus stop is not
here”
 D says to her: “The road does not go to the capital and the bus stop is
here”
 E says to her: “The road does not go to the capital and the bus stop is
not here”
 Ellen asked whether they are knights or knaves, three gave same
answers, “2 of us are knights, 1 is knave”
 Does the road go to the capital? How many were knights? Was the
location near bus stop?

09/17/2023 25
Example (contd.)
 g : the road goes to the capital
 b : the bus stop is here

D:~g.and. E:~g.and
g b C: g.and. ~r
b . ~r
F F F F F
F T F F F
T F T T F
T T F F T
09/17/2023 CSE 103 - Discrete Mathematics 26
Example (contd.)
 g : the road goes to the capital
 b : the bus stop is here

D:~g.and. E:~g.and
g b C: g.and. ~r
b . ~r
F F F F T
F T F T F
T F T F F
T T F F F
09/17/2023 27
Tautologies and Contradictions
 A tautology is a statement that is always true.
 Examples:
 R (R)
  (PQ)  (P)( Q)
 A contradiction is a statement that is always false.
 Examples:
 R(R)
  ( (P  Q)  ( P)  ( Q))
 The negation of any tautology is a contradiction, and
the negation of any contradiction is a tautology.

09/17/2023 CSE 103 - Discrete Mathematics 28


Equivalence
 Definition: two propositional statements
S1 and S2 are said to be (logically)
equivalent, denoted S1  S2 if
 They have the same truth table, or
 S1  S2 is a tautology

 Equivalence can be established by


 Constructing truth tables
 Using equivalence laws

09/17/2023 29
Logical Equivalence
 Equivalence laws
 Identitylaws, P  T  P, P  F  P,
 Domination laws, P  F  F, P  T  T,
 Idempotent laws, P  P  P, P  P  P,
 Double negation law,  ( P)  P
 Commutative laws, P  Q  Q  P, same for 
 Associative laws, P  (Q  R) (P  Q)  R, same for 
 Distributive laws, P  (Q  R) (P  Q)  (P  R),

 distributed over ,  distributed over 


 De Morgan’s laws,  (PQ)  ( P)  ( Q), same for 
 Law with implication P QPQ
 Contrapositive Law P QQ P

09/17/2023 30
Summary So Far
Proposition

Truth value
Truth table

Operatorsand their truth tables


Equivalence of propositional statements

 Definition
 Proving equivalence (by truth table or equivalence
laws)

09/17/2023 CSE 103 - Discrete Mathematics 31

You might also like