0% found this document useful (0 votes)
8 views31 pages

Unit II

Uploaded by

ksaryan08
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)
8 views31 pages

Unit II

Uploaded by

ksaryan08
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/ 31

Mathematical Logic

1
Logic
• Logic is a system based on propositions.
• A proposition is a 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

2
The Statement/Proposition Game

“Jupiter is a planet and Mars is a Star.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? False-0

3
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

4
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.
5
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.

6
The Statement/Proposition Game
“If elephants were red,
they could hide in cherry trees.”

Is this a statement? yes

Is this a proposition? yes

What is the truth value


of the proposition? probably false

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

9
Logical Operators (Connectives)
We will examine the following logical operators:
•Conjunction (AND) Symbol: 
•Disjunction (OR) Symbol: 
•Negation (NOT) Symbol: 
•Conditional(Implication) (if – then) Symbol:

•Biconditional (if and only if) Symbol: 
Truth tables can be used to show how these
operators can combine propositions to
compound propositions.
10
Conjunction (AND)
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.

Example: Find the conjunction of the propositions


p and q where p is the proposition “Today is
Friday.” and q is the proposition “It is raining
today.”, and the truth value of the conjunction
Solution: The conjunction is the proposition
“Today is Friday and it is raining today.” The
proposition is true on rainy Fridays.
11
Conjunction (AND)
Binary Operator, Symbol: 
P Q PQ
T T T
T F F
F T F
F F F

12
Disjunction (OR)
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.

inclusive or : The disjunction is true when at least one of the two


propositions is true.
E.g. “Students who have taken calculus or computer science can take this class.” –
those who take one or both classes.
exclusive or : The disjunction is true only when one of the
proposition is true.
E.g. “Students who have taken calculus or computer science, but not both, can take
this class.” – only those who take one of them.

13
Disjunction (OR)
Binary Operator, Symbol: 
P Q P Q
T T T
T F T
F T T
F F F

14
Negation (NOT)
– Let p be a proposition. The negation of p,
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.
Examples: Find the negation of the proposition “Today is Friday.”
Solution: The negation is “It is not the case that today is
Friday.”
Example: Find the negation of the proposition “At least 10
inches of rain fell today in Miami.”
Solution: The negation is “It is not the case that at least 10
inches of rain fell today in Miami.”
15
Negation (NOT)
Unary Operator, Symbol: 

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

Q:6 is an even number or 36 is a perfect square


Ans: 6 is not an even number or 36 is not a perfect
square
Implication (if - then)
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).
Fall 2002 CMSC 203 - Discrete Structures 17
Implication (if - then)
Binary Operator, Symbol: 
P Q P Q
T T T
T F F
F T T
F F T

18
Biconditional (if and only if)
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.

19
Biconditional (if and only if)
Binary Operator, Symbol: 
P Q P Q
T T T
T F F
F T F
F F T

20
21
Q: If a function is differentiable then it
is continuous.
Converse: If a function is continuous then it is
differentiable
Inverse: If a function is not differentiable then it is
not continuous
Contra Positive: If it is not a continuous function then
it is not differentiable.

22
Statements and Operators
Statements and operators can be combined in any way to form new statements.
Find (P)(Q)

P Q P Q (P)(Q)
T T F F F
T F F T T
F T T F T
F F T T T
23
Find (P)(Q)
P Q P Q (P)(Q)

T T F F F
T F F T T
F T T F T
F F T T T

24
Statements and Operations
Statements and operators can be combined in any
way to form new statements.
(P)(
P Q PQ  (PQ) P Q
Q)
T T T F F F F
T F F T F T T
F T F T T F T
F F F T T T T

25
Equivalent Statements
P Q (PQ) (P)(Q) (PQ)(P)(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 (PQ)  (P)  (Q) is always true.

26
Tautologies and Contradictions

A tautology is a statement that is always true.


Examples:
• R(R)
 (PQ)(P)(Q)

If ST is a tautology, we write ST.


If ST is a tautology, we write ST.

27
Tautologies and Contradictions
A contradiction is a statement that is always
false.
Examples:
• R(R)
 ((PQ)(P)(Q))
The negation of any tautology is a contra-
diction, and the negation of any contradiction is
a tautology.

28
Logical Equivalence
A logical equivalence means that
the two sides always have the
same truth values
– Symbol is ≡or  (we’ll use ≡)

29
DeMorgan’s Law

30
How to prove two propositions are equivalent?
Show that: ( p  r )  (q  r )  ( p  q )  r

31

You might also like