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

1 Propositional Logic

Let's break this down step-by-step: (¬p  ¬q)  (q  r) ≡ ((¬p → ¬q) ∧ (¬q → ¬p)) → ((q → r) ∧ (r → q)) (using logical equivalences) ≡ (¬¬p ∨ ¬q) ∧ (¬¬q ∨ ¬p) → (¬q ∨ r) ∧ (¬r ∨ q) ≡ (p ∨ ¬q) ∧ (q ∨ ¬p) → (

Uploaded by

kopok98011
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

1 Propositional Logic

Let's break this down step-by-step: (¬p  ¬q)  (q  r) ≡ ((¬p → ¬q) ∧ (¬q → ¬p)) → ((q → r) ∧ (r → q)) (using logical equivalences) ≡ (¬¬p ∨ ¬q) ∧ (¬¬q ∨ ¬p) → (¬q ∨ r) ∧ (¬r ∨ q) ≡ (p ∨ ¬q) ∧ (q ∨ ¬p) → (

Uploaded by

kopok98011
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Propositions

Slides are prepared by using Discrete Mathematics and Its


Applications by K. H. rosen
Propositions
• A proposition is a statement that is either true or
false, but not both.
• p: Ankara is the capital city of Turkey : True - T .
• q: 1+1=2 – True - T
• r: 2+2=3 – False - F
• Not proposition
• What time is it?
• Read this carefully!
• x+1=2
• x+y=z
Representations
• Letters are used to denote propositions
• p, q, r, s, ...
• If the proposition is true, denoted by true (T - D).
• If the proposition is false, denoted by false(F - Y).

• A proposition can be
• A single variable ,p
• Compound, combination of one or more propositions.
pvq
Truth Table
• Truth table displays the relationships between the
truth values of propositions.
• Valueable in determination of the truth values of
propositions constructed by simple propositions.
Logical Operators
• Negation (Not)
• Or
• And
• XOR
• If
• Iff if and only if – ancak ve ancak
• ...
• Example propositions
• p1: Today is Friday.
• p2: It is raining today.
Negation Operator: NOT
• Negates the truth value
• Denoted by ¬ (not sign) or ~ (tilda)

• ¬p1: It is not the case that today is Friday


• ¬p1: Today is not Friday.
• ¬T : F p ¬p
T F
• ¬F : T
F T
Conjunction Operator : And
• True if both of the operands are true and false
otherwise
• Denoted by 

• p1  p2 : Today is Friday and it is raining today.


• TF:F p q pq
• TT:T T T T
T F F
F T F
F F F
Disjunction Operator: Or
• True if either of the operands are true and false if
both of the operands false.
• Denoted by 

• p1  p2 : Today is Friday or it is raining today.


• TF:T p q pq
• TT:T T T T
T F T
F T T
F F F
Disjunction Operator : XOR
• True if one of the operands are true and false
othewise.
• Denoted by 
• Exclusive Or (Dışlayıcı Or)
• p1  p2 : Either today is Friday or it is raining today.
• TF:T p q pq
• TT:F T T F
T F T
F T T
F F F
Implication Operator: IF
• False when p is true and q is false and true otherwise
• Denoted by  Example: p  q
• p is called hypothesis (or antecedent or premise)
• q is called coclusion (or consequence)
• If p then q
• p implies q
p q pq ¬pq
• p only if q
T T T T
• q whenever p T F F F
• q is necessary for p F T T T
F F T T
Biconditional Operator: IFF
• True when p and q have the same truth values and
false otherwise.
• Denoted by 

• p if and only if q
• p is necessary and suffiecient for q p q pq
• pq  pq  qp T T T
T F F
F T F
F F T
Example 1
• You can access the internet from campus only if you
are a computer science major or you are not a
freshman. Write the statement in proposition
letters?
• a: You can access the internet from campus.
• c: You are a computer science major
• f: You are a freshman.

• a  (c  ¬f)
Example 2
• You cannot ride the roller coaster if you are under 4 feet tall unless
you are older than 16 years old. Write the sentence in a logical
expression?
• If you are under 4 feet tall and you are not older than 16 years old,
you cannot ride the roller coaster.
• q: You can ride the roller coaster
• r: You are under 4 feet tall
• s: You are older than 16 years old

• The result will be implication : if


• Condition (antecedent)  conclusion (or consequence)

• (r  ¬s)  ¬q
Logic and Bit Operators
• A bit string is sentence of zero or more bits. The length of
this string is the number of bits in the string.
• 0 represents F (false)
• 1 represents T (true)

01 1011 0110
11 0001 1101 x y xy
11 1011 1111 bitwise OR 0 0 0
01 0001 0100 bitwise AND 0 1 1
10 1010 1011 bitwise XOR 1 0 1
1 1 1
Operator Precedence
• NOT
• AND
• OR
• IF
• IFF
Propositional Equvalences
• Tautology: A compound proposition that is always
true, no matter what the truth values of the
propositions that occur in it, is called tautology.

• Contradiction: A compound proposition that is


always false is contradiction.

• Contingencey: A proposition that is neither a


tatutology nor a contradiction is called contingency.
Tautology vs Contradiction

p ¬p tautology contradiction
p¬p p¬p
T F T F
F T T F
Logical Equivalences
• p and q are logically equivalent if pq is tautology.
• pq denotes tha p and q are logically equivalent.
•  yerine  kullanılabiliyor.
Example 1
• Show that ¬(pq) and ¬p¬q are logically
equivalent?
• ¬(pq)  ¬p¬q is tautology ? Yes

p q pvq ¬(pq) ¬p ¬q ¬p¬q ¬(pq)  ¬p¬q


T T T F F F F T
T F T F F T F T
F T T F T F F T
F F F T T T T T
Example 2
• Show that pq and ¬pq are logically equivalent?
• (pq)  (¬pq) is tautology ?

p q pq ¬p ¬pq (pq)  (¬pq)


T T T F T T
T F F F F T
F T T T T T
F F T T T T
Example 3
• Show that p(qr) and (pq)(pr) are logically
equivalent?
p q r p(qr) (pq) (pr) (pq)(pr)
T T T T T T T
T T F T T T T
T F T T T T T
T F F T T T T
F T T T T T T
F T F F T F F
F F T F F T F
F F F F F F F
Logical Equivalences -1
• Identity laws
• pT p
• pF  p
• Domination laws
• pT  T
• pF  F
• Idempotent laws
• pp  p
• pp  p
Logical Equivalences -2
• Double negation laws
• ¬(¬p)  p
• Cummutative laws
• pq  qp
• pq  qp
• Associative laws
• (pq)r  p(qr)
• (pq)r  p(qr)
Logical Equivalences -3
• Distributive laws
• p(qr)  (pq)(pr)
• p(qr)  (pq)(pr)
• De Morgan’s laws
• ¬(pq)  ¬p¬q
• ¬(pq)  ¬p¬q
• Some useful logical equivalances
• p¬p  T
• p¬p  F
• (pq)  (¬pq)
Example
• Show that ¬(p(¬pq)) and (¬p¬q) are logically
equivalent?
¬(p(¬pq))  ¬p  ¬(¬pq) De morgan’s law
 ¬p  ¬(¬pq) De morgan’s law
 ¬p  [¬(¬p)  ¬q] Double negation
 ¬p  ( p  ¬q) Distributive law
 (¬p  p)  (¬p  ¬q)
 F  (¬p  ¬q) Identity law
 (¬p  ¬q)
They are logically equivalent
Example
• Show that (pq) (pq) is a tautology.
• (pq)  (¬pq)

(pq) (pq)  ¬(pq) (pq)


 (¬p  ¬q) (pq) De morgan’s law
 ¬p¬qpq
 (¬pp)  (¬qq) Associative law
TT
 T expressions are tautology.
Additional Examples
• Show that if (pq) (p q) is tautology?

• Solution
(pq) (p q)  (pq) (¬p  q) get rid of if
 ¬(pq)  (¬p  q) get rid of if
 (¬p  ¬q)  (¬p  q) De Morgan’s rule
 (¬p  ¬p)  (¬q q) Cumm. and Assoc.
 (¬p  ¬p)  T
T Domination law
Additional Examples
• Show that if (p  q)(¬q  r) is tautology?

Note: pq  (pq)  (qp) use this logical equivalence


for solving the question.
Solution:
(p  q)  (¬q  r)
 ( (pq)  (qp) )  ( (¬qr)  (r ¬q))
 ( (¬p  q)  (¬q  p) )  ( (¬(¬q)  r)  (¬r  ¬q))
 ( ((¬p  q)  ¬q)  ((¬p  q)  p)) ) 
(( (q  r)  ¬r)  ((q  r)  ¬q)))
....
Additional Examples
• Show that if (¬p  ¬q)  (q  r) is tautology?

You might also like