0% found this document useful (0 votes)
7 views25 pages

Lecture No. 3

Uploaded by

seharamjadnuml
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views25 pages

Lecture No. 3

Uploaded by

seharamjadnuml
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

DISCRETE STRUCTURES

SEDS 116

1
Double Negative Property ~(~p)
p
Example
“It is not true that I am not
happy”

Solution:
Let p = “I am happy”
then ~ p = “I am not happy

and ~(~ p) = “It is not true that I
am not happy”
Since ~ (~p)  p
Hence the given statement is
equivalent to:
Spring 20234 “I am happy”
SEDS 116 - Discrete Structures 2
~ (pq) and ~p  ~q are not logically
equivalent

3
DE MORGAN’S LAWS

1) The negation of an and statement is logically


equivalent to the or statement in which each
component is negated.
Symbolically ~(p  q)  ~p  ~q.
2) The negation of an or statement is logically
equivalent to the and statement in which each
component is negated.
Symbolically: ~(p  q)  ~p  ~q.

4
DE MORGAN’S LAWS

5
Example:
Give negations for each of the following
statements:
a.The fan is slow or it is very hot.

b. Akram is unfit and Saleem is injured.

Solution
a. The fan is not slow and it is not very hot.
b. Akram is not unfit or Saleem is not
injured. 6
Precedence of Logical
Operators
p ∧ q ∨ r means (p ∧ q) ∨ r
rather than p ∧ (q ∨ r).

p ∨ q → r is the same as
(p ∨ q) → r.

7
Truth Tables of
Compound Propositions
Construct the truth table of the compound
proposition
(p ∨ ¬ q) → (p ∧ q).
Two positional variables p , q
Number of rows: 2n

8
Logic and Bit
Operations

9
Spring 2024 SEDS 116 - Discrete Structures 10
Propositional
Equivalences
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”..

11
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”.

12
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.

Spring 2024 SEDS 116 - Discrete Structures 13


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 (Table 5 in Section
1.2)

Spring 2024 SEDS 116 - Discrete Structures 14


Equivalence
Equivalence laws
– Identity laws, P  T  P,
– Domination laws, P  F  F,
– Idempotent laws, P  P  P,
– Double negation law,  ( P)  P
– Commutative laws, P  Q  Q  P,
– Associative laws, P  (Q  R) (P  Q)  R,
– Distributive laws, P  (Q  R) (P  Q)  (P  R),
– De Morgan’s laws,  (PQ)  ( P)  ( Q)
– Law with implication PQPQ

Spring 2024 SEDS 116 - Discrete Structures 15


APPLYING LAWS OF LOGIC
Using law of logic, simplify the
statement form
p  [~(~p  q)]

16
APPLYING LAWS OF
LOGIC

17
APPLYING LAWS OF LOGIC
SIMPLIFYING A STATEMENT:

“You will get an A if you are hardworking and the sun


shines, or you are hardworking and it rains.”

Rephrase the condition more simply.


Solution:
Let p = “You are hardworking’
q = “The sun shines”
r = “It rains”
The condition is then (p  q)  (p  r)

18
APPLYING LAWS OF LOGIC
SIMPLIFYING A STATEMENT:

And using distributive law in reverse,


(p  q)  (p  r)  p  (q  r)
Putting p  (q  r) back into English, we can rephrase
the given sentence as

“You will get an A if you are hardworking


and the sun shines or it rains.

19
EXERCISE
Use Logical Equivalence to rewrite each of the following
sentences more simply.
1. It is not true that I am tired and you are smart.
{I am not tired or you are not smart.}
2. It is not true that I am tired or you are smart.
{I am not tired and you are not smart.}
3. I forgot my pen or my bag and I forgot my pen or
my glasses.
{I forgot my pen or I forgot my bag and glasses.
4. It is raining and I have forgotten my umbrella, or
it is raining and I have forgotten my hat.
{It is raining and I have forgotten my umbrella or my
hat.}

20
Exercises
• Show that P  Q   P  Q: by truth table
• Show that (P  Q)  (P  R)  P  (Q  R):
by equivalence laws (q20, p27):
– Law with implication on both sides
– Distribution law on LHS

Spring 2024 SEDS 116- Discrete Structures 21


Summary, Sections 1.1, 1.2
•Proposition
– Statement, Truth value,
– Proposition, Propositional symbol, Open proposition
•Operators
– Define by truth tables
– Composite propositions
– Tautology and contradiction
•Equivalence of propositional statements
– Definition
– Proving equivalence (by truth table or equivalence
laws)

Spring 2024 SEDS 116 - Discrete Structures 22


Propositional Functions &
Predicates
Propositional function (open sentence):
statement involving one or more variables,
e.g.: x-3 > 5.
Let us call this propositional function P(x),
where P is the predicate and x is the
variable
What is .the truth value of P(2) ? false
What is the truth value of P(8) ? false
What is the truth value of P(9) ? true
When a variable is given a value, it is said to
be instantiated
Truth value depends on value of variable
Spring 2024 SEDS 116 - Discrete Structures 23
Propositional Functions
Let us consider the propositional function
Q(x, y, z) defined as:
x + y = z.
Here, Q is the predicate and x, y, and z are
the variables.
What is the truth value of Q(2, 3, 5) ? true
What is the truth value of Q(0, 1, 2) ? false
What is the truth value of Q(9, -9, 0) ? true
A propositional function (predicate) becomes a proposition
when all its variables are instantiated.

Spring 2024 SEDS 116 - Discrete Structures 24


Propositional Functions
Other examples of propositional functions

Person(x), which is true if x is a person


Person(Socrates) = T
Person(dolly-the-sheep) = F
SECourse(x), which is true if x is a Software
Engineering course

SECourse(SEDS116) = T
SECourse(MATH155) = F
How do we say
All humans are mortal
One SE course
Spring 2024 SEDS 116 - Discrete Structures 25

You might also like