0% found this document useful (0 votes)
10 views12 pages

Lecture 03 - 04

The document discusses the laws of logic, including simplification of logical statements, conditional statements, and their implications. It covers truth tables, logical equivalences, and exercises for practice. Additionally, it introduces biconditional statements and their truth conditions.

Uploaded by

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

Lecture 03 - 04

The document discusses the laws of logic, including simplification of logical statements, conditional statements, and their implications. It covers truth tables, logical equivalences, and exercises for practice. Additionally, it introduces biconditional statements and their truth conditions.

Uploaded by

programmerzaid2
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

3-Laws of logic IU

Lecture No.3 Laws of Logic

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
 [p  p](~q) Associative Law for 
 p  (~q) Idempotent Law: p  p  p
That is the simplified statement form.

Example: 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

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 (p  q)  (p  r)
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.

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.

Iqra University
3-Laws of Logic IU

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

CONDITIONAL STATEMENTS:
Introduction
Consider the statement:
"If you earn an A in Math, then I'll buy you a computer."
This statement is made up of two simpler statements:
p: "You earn an A in Math"
q: "I will buy you a computer."

The original statement is then saying :


if p is true, then q is true, or, more simply, if p, then q.
We can also phrase this as p implies q. It is denoted by p  q.

CONDITIONAL STATEMENTS OR IMPLICATIONS:

If p and q are statement variables, the conditional of q by p is “If p then q”


or “p implies q” and is denoted p  q.

p  q is false when p is true and q is false; otherwise it is true.


The arrow " " is the conditional operator.
In p  q, the statement p is called the hypothesis (or antecedent) and q is called the
conclusion (or consequent).

TRUTH TABLE:
p q pq
T T T
T F F
F T T
F F T

PRACTICE WITH CONDITIONAL STATEMENTS:

Determine the truth value of each of the following conditional statements:


1. “If 1 = 1, then 3 = 3.” TRUE
2. “If 1 = 1, then 2 = 3.” FALSE
3. “If 1 = 0, then 3 = 3.” TRUE
4. “If 1 = 2, then 2 = 3.” TRUE
5. “If 1 = 1,then 1 = 2 and 2 = 3.” FALSE
6. “If 1 = 3 or 1 = 2 then 3 = 3.” TRUE

18
Iqra University
3-Laws of Logic IU

ALTERNATIVE WAYS OF EXPRESSING IMPLICATIONS:


The implication p  q could be expressed in many alternative ways as:
•“if p then q” •“not p unless q”
•“p implies q” •“q follows from p”
•“if p, q” •“q if p”
•“p only if q” •“q whenever p”
•“p is sufficient for q” •“q is necessary for p”

EXERCISE:
Write the following statements in the form “if p, then q” in English.
a) Your guarantee is good only if you bought your CD less than 90 days ago.
If your guarantee is good, then you must have bought your CD player less
than 90 days ago.
b) To get tenure as a professor, it is sufficient to be world-famous.
If you are world-famous, then you will get tenure as a professor.
c) That you get the job implies that you have the best credentials.
If you get the job, then you have the best credentials.
d) It is necessary to walk 8 miles to get to the top of the Peak.
If you get to the top of the peak, then you must have walked 8 miles.

TRANSLATING ENGLISH SENTENCES TO SYMBOLS:


Let p and q be propositions:
p = “you get an A on the final exam”
q = “you do every exercise in this book”
r = “you get an A in this class”

Write the following propositions using p, q, and r and logical connectives.

1. To get an A in this class it is necessary for you to get an A on the final.


SOLUTION pr

2. You do every exercise in this book; You get an A on the final, implies,
you get an A in the class.
SOLUTION pqr

3. Getting an A on the final and doing every exercise in this book is sufficient
For getting an A in this class.
SOLUTION pqr

TRANSLATING SYMBOLIC PROPOSITIONS TO ENGLISH:


Let p, q, and r be the propositions:
p = “you have the flu”
q = “you miss the final exam”
r = “you pass the course”
Express the following propositions as an English sentence.
1. p  q
If you have flu, then you will miss the final exam.

2. ~q  r

19
Iqra University
3-Laws of Logic IU

If you don’t miss the final exam, you will pass the course.
3. ~p  ~q r
If you neither have flu nor miss the final exam, then you will pass the course.

HIERARCHY OF OPERATIONS
FOR LOGICAL CONNECTIVES
•~ (negation)
•  (conjunction),  (disjunction)
•  (conditional)

Example: Construct a truth table for the statement form p  ~ q  ~ p

p q ~ ~p p  ~q p~q ~p
q
T T F F T F
T F T F T F
F T F T F T
F F T T T T

Example: Construct a truth table for the statement form (p q)(~ p  r)

p q r pq ~p ~pr (pq)(~ p r)


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

20
Iqra University
3-Laws of Logic IU

LOGICAL EQUIVALENCE INVOLVING IMPLICATION


Use truth table to show pq  ~q  ~p

p q ~q ~p pq ~q  ~p

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

same truth values


Hence the given two expressions are equivalent.

IMPLICATION LAW
pq  ~pq

p q pq ~p ~pq
T T T F T
T F F F F
F T T T T
F F T T T

same truth values


NEGATION OF A CONDITIONAL STATEMENT:
Since pq  ~ pq
So ~ (p  q)  ~ (~ p  q)
 ~ (~ p)  (~ q) by De Morgan’s law
 p~q by the Double Negative law

Thus the negation of “if p then q” is logically equivalent to “p and not q”.
Accordingly, the negation of an if-then statement does not start with the word if.

EXAMPLES
Write negations of each of the following statements:
1. If Ali lives in Pakistan then he lives in Lahore.
2. If my car is in the repair shop, then I cannot get to class.
3. If x is prime then x is odd or x is 2.
4. If n is divisible by 6, then n is divisible by 2 and n is divisible by 3.

21
Iqra University
3-Laws of Logic IU

SOLUTIONS:
1. Ali lives in Pakistan and he does not live in Lahore.
2. My car is in the repair shop and I can get to class.
3. x is prime but x is not odd and x is not 2.
4. n is divisible by 6 but n is not divisible by 2 or by 3.

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.

p q pq ~p ~q ~p ~q
T T T F F T
T F F F T T
F T T T F F
F F T T T T

different truth values in rows 2 and 3


WRITING INVERSE:

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.

22
Iqra University
3-Laws of Logic IU

p q pq qp
T T T T

T F F T

F T T F

F F T T

not the same


WRITING CONVERSE:

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 contra-positive of the conditional statement p  q is ~ q  ~ p
A conditional and its contra-positive are equivalent.
Symbolically pq  ~q  ~p
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 can get to the class, then my car is not in the repair shop.

EXERCISE:
1. Show that pq  ~ q  ~ p ( Use the truth table. )
2. Show that q p  ~ p  ~ q ( Use the truth table. )

23
Iqra University
4-Biconditional IU

Lecture No.4 Biconditional

BICONDITIONAL

If p and q are statement variables, the biconditional of p and q is “p if and only if q”.
It is denoted pq. “if and only if” is abbreviated as iff.
The double headed arrow " " is the biconditional operator.

TRUTH TABLE FOR pq.


p q p q
T T T
T F F
F T F
F F T

Remark:
o p  q is true only when p and q both are true or both are false.
o p  q is false when either p or q is false.

EXAMPLES:
Identify which of the following are 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
5. “x > 5 iff x 2 > 25”
FALSE

REPHRASING BICONDITIONAL:

pq is also expressed as:

o “p is necessary and sufficient for q”


o “If p then q, and conversely”
o “p is equivalent to q”

Iqra University
4-Biconditional IU

Example: Show that p  q  (pq)  (q p)

p q pq pq qp (pq)(qp)

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

same truth values

EXERCISE:
Rephrase the following propositions in the form “p if and only if q” in English.

1. If it is hot outside, you buy an ice cream cone, and if you buy an ice cream
cone, it is hot outside.
Sol You buy an ice cream cone if and only if it is hot outside.

2. For you to win the contest it is necessary and sufficient that you have the
only winning ticket.
Sol You win the contest if and only if you hold the only winning ticket.

3. If you read the news paper every day, you will be informed and conversely.
Sol You will be informed if and only if you read the news paper every day.

4. It rains if it is a weekend day, and it is a weekend day if it rains.


Sol It rains if and only if it is a weekend day.

5. The train runs late on exactly those days when I take it.
Sol The train runs late if and only if it is a day I take the train.

6. This number is divisible by 6 precisely when it is divisible by both 2 and 3.


Sol This number is divisible by 6 if and only if it is divisible by both 2 and 3.

TRUTH TABLE FOR (pq)  (~ q ~ p)

p q pq ~q ~p ~ q ~ p (pq)  (~ q ~ p)
T T T F F T T
T F F T F F T
F T T F T T T
F F T T T T T

25
Iqra University
4-Biconditional IU

TRUTH TABLE FOR ( pq )  ( r  q )

p q r pq rq (p q)( r q)


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

TRUTH TABLE FOR p  ~r  q  r

Here p  ~ r q  r means (p  (~ r)) (q  r)

p q r ~r p~r qr p  ~r qr


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

26
Iqra University
4-Biconditional IU

LOGICAL EQUIVALENCE INVOLVING BICONDITIONAL

Example: Show that ~p  q and p  ~q are logically equivalent.

p q ~p ~q ~pq p  ~q
T T F F F F
T F F T T T
F T T F T T
F F T T F F

same truth values


Hence ~p  q  p  ~q

EXERCISE:
Show that ~(pq) and pq are logically equivalent.

p q pq ~(pq) pq


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

same truth values


Hence ~(pq)  pq

LAWS OF LOGIC:
1. Commutative Law: pq qp
2. Implication Laws: pq~pq
 ~ ( p  ~ q)
3. Exportation Law: (p  q)r  p (q r)
4. Equivalence: p  q  (p q)(q p)
5. Reductio ad absurdum p q  (p  ~q) c

APPLICATION:
Example: Rewrite the statement forms without using the symbols  or 
1. p  ~ q r
2. ( p r )  ( q  r )
27
Iqra University
4-Biconditional IU

Solution:
1. p~qr  (p  ~q) r Order of operations
 ~ (p  ~ q)  r Implication law

2. (pr)(q r)  (~p  r)  (~q  r) Implication law


 [(~p  r) (~q  r)]  [(~q  r) (~p  r)]
Equivalence of biconditional
 [~(~p  r)  (~q  r)]  [~(~q  r)  (~p  r)]
Implication law
Example: Rewrite the statement form ~p  q  r  ~q to a logically equivalent form
that uses only ~ and .
Solution:

STATEMENT REASON
~p  q  r  ~q Given statement form
 (~p  q)  (r  ~q) Order of operations
 ~[(~p  q)  ~ (r  ~q)] Implication law pq  ~(p~ q)
 ~[~(p  ~q)  (~r  q)] De Morgan’s law

Example: Show that ~(pq)  p is a tautology without using truth tables.

Solution:

STATEMENT REASON
~(pq)  p Given statement form
 ~[~(p  ~q)]  p Implication law pq  ~(p  ~q)
 (p  ~q)  p Double negation law
 ~(p  ~q)  p Implication law pq  ~p  q
 (~p  q)  p De Morgan’s law
 (q  ~p)  p Commutative law of 
 q  (~p  p) Associative law of 
qt Negation law
t Universal bound law

EXERCISE:
Suppose that p and q are statements so that pq is false. Find the truth values
of each of the following:
1.~ p  q
2.p  q
3.q  p
SOLUTION
Hint: ( pq is false when p is true and q is false.)
[Link]
2. TRUE

3. FAL

28
Iqra University

Common questions

Powered by AI

The idempotent law, which states that p ∨ p ≡ p and p ∧ p ≡ p, is vital for simplifying logical statements by removing redundancy. When a logical operation is performed on the same operand in a disjunction or conjunction, the operation has no additional effect, allowing simplification .

Truth tables list all possible truth values of involved variables and the resulting truth value of the logical statements. By showing identical outcomes for each possibility, they verify logical equivalences. For example, both p → q and its contrapositive ~q → ~p display identical truth values across all combinations of p and q, thereby proving their logical equivalence .

DeMorgan's Law states that the negation of a conjunction is equivalent to the disjunction of the negations. Formally, it is expressed as ~(p  q) ≡ ~p  ~q. Similarly, the negation of a disjunction is equivalent to the conjunction of the negations: ~(p  q) ≡ ~p  ~q .

The converse q → p and the inverse ~p → ~q of a conditional statement p → q are not logically equivalent because they do not consistently produce the same truth values. For example, using a truth table, p → q is true when both p and q are true or when p is false. In contrast, the converse q → p and inverse ~p → ~q have different truth values in cases not covered by the original implication, such as when p is false and q is true .

To show that the contrapositive `~q → ~p` is equivalent to the original `p → q`, construct a truth table with columns for p, q, ~q, ~p, p → q, and ~q → ~p. For both `p → q` and `~q → ~p`, the table shows that these expressions have identical truth values in all possible cases, confirming their logical equivalence .

The statement is initially represented as (p ∧ q) ∨ (p ∧ r), where p is 'You are hardworking', q is 'The sun shines', and r is 'It rains'. Using the distributive law in reverse, it becomes p ∧ (q ∨ r). This rephrasing simplifies the compound conditions into a singular requirement where being hardworking is a constant necessity while either weather condition fulfills the second requirement .

Logical equivalences can simplify everyday language by refining complex conditions. For instance, 'It is raining and I have forgotten my umbrella, or it is raining and I have forgotten my hat' simplifies to 'It is raining and I have forgotten my umbrella or my hat' using the distributive law. Similarly, 'It is not true that I am tired and you are smart' becomes 'I am not tired or you are not smart' using DeMorgan's Law .

Expressing p → q as 'q whenever p' implies that q is guaranteed each time p occurs, maintaining the same logical connection where p is the antecedent and q is the consequent. This phrasing underscores the dependence of q on p, with no change to the logical structure but offering a more time-sensitive interpretation .

Negating a conditional statement p → q changes it to p ∧ ~q, meaning the original condition p is true, but the consequent q is false. This transformation is demonstrated using De Morgan's Law and double negation: ~ (p → q) ≡ ~(~p ∨ q) ≡ p ∧ ~q. It shows that the negation does not start with 'if', reflecting an outright failure of the original implication .

The biconditional statement 'p if and only if q' is symbolically represented by p ↔ q. Its truth table shows that it is true only when both p and q have the same truth values, either both true or both false; otherwise, it is false .

You might also like