Logic 2019
Logic 2019
Enrolment Key :
Logic
The connectives if-then and if-and-only-if are also known as implies and is-
equivalent-to respectively.
CONJUNCTION
DEFINITION :
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.
Only the last statement (iv) is false. Each of the others is true
since at least one of its sub-statements is true..
Compound Proposition..
Exercise:
Consider the following propositions
p : It is Friday
q : It is raining
A. Construct the propositions p ∧ q and p ∨ q:
B. Construct the Truth Table for p ∧ q and p ∨ q:
Compound Proposition..
Solution.
A)
The conjunction of the propositions p and q is the proposition
p Ʌ q : It is Friday and it is raining:
The disjunction of the propositions p and q is the proposition
p V q : It is Friday or It is raining
Compound Proposition..
Solution.
B)
NEGATION
DEFINITION :
Let p be a proposition. The negation of p, denoted by ¬ p (also
denoted by p), is the statement “It is not the case that p.”
P can be formed by writing “It is not true that . . .” or “It is false that . . .”
Example
(a1) Ice floats in water.
(a2) It is false that ice floats in water.
(a3) Ice does not float in water.
(b1) 2 + 2 =5
(b2) It is false that 2 + 2 = 5.
(b3) 2 + 2 ≠ 5
STEPS:
1) Calculate Number of Possible T/F combinations for the given variables
using 2n where n is the number of variables.
2)
(a) It is not cold. (b) It is cold and raining.
(c) It is cold or it is raining. (d) It is raining or it is not cold.
Exercise:
1. What is the negation of each of these propositions?
a) Juan has an MP3 player.
b) There is no pollution in Kandy.
c) 2 + 1 = 3.
d) The first semester in MIT is hard.
2. Let p and q be the propositions “chatting is not allowed in the class room” and
“Students have been spotted near the shore,” respectively. Express each of these
compound propositions as an English sentence.
a) p ∧ q b) pV q c) ¬p ∨ q
d) p → ¬q e) ¬q → p f) ¬p → ¬q
g) p ↔ ¬q h) ¬p ∧ (p ∨ ¬q)
LOGICAL EQUIVALENCE
Two propositions X(p, q, . . .) and Y(p, q, . . .) are said to be logically equivalent, or simply
equivalent or equal, denoted by
X(p, q, . . .) Ξ Y(p, q, . . .)
if they have identical truth tables.
Consider, for example, the truth tables of ¬(p ∧ q) and ¬p V ¬q.
LOGICAL EQUIVALENCE..
Observe that both truth tables are the same, that is, both propositions are
false in the first case and true in the other three cases. Accordingly, we can
write ¬(p ∧ q) Ξ ¬p V ¬q
In other words, the propositions are logically equivalent.
ALGEBRA OF PROPOSITIONS
(Negation Law)
Use the laws Table to show that ¬(p V q) V
(¬p ∧ q) Ξ ¬p.
CONDITIONAL AND BICONDITIONAL
STATEMENTS
CONDITIONAL STATEMENT
Let p and q be propositions. The conditional statement p → q is
the proposition “if p, then q.” The conditional statement p → q
is false when p is true and q is false, and true otherwise.
2
DeMorgan’s Law
Involution Law
1. Using Truth Table
2. Using Laws
1. Using Truth Table
2. Using Laws
1. Using Truth Table
2. Using Laws
CONDITIONAL AND BICONDITIONAL
STATEMENTS..
CONDITIONAL STATEMENT..
CONDITIONAL AND BICONDITIONAL
STATEMENTS..
CONDITIONAL STATEMENT..
Consider following two statements
1) “If John has a smartphone, then 2 +
3 = 5”
2) “If John has a smartphone, then 2 +
3 = 6”
Exercise:
Determine whether each of these conditional statements is
.
true or false.
a) If 1 + 1 = 2, then 2 + 2 = 5.
b) If 1 + 1 = 3, then 2 + 2 = 4.
c) If 1 + 1 = 3, then 2 + 2 = 5.
d) If monkeys can fly, then 1 + 1 = 3.
BICONDITIONAL STATEMENTS
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.
The statement p ↔ q is true
when both the conditional
statements p → q and q → p
are true and is false
otherwise.
Note that p ↔ q has exactly the
same truth value as
BICONDITIONAL STATEMENTS
There
. are some other common ways to express p ↔ q:
“p is necessary and sufficient for q”
“if p then q, and conversely”
“p iff q.”
Eg: Let p be the statement “You can take the flight,” and let q
be the statement “You buy a ticket.”
Then p ↔ q is the statement
“You can take the flight if and only if you buy a ticket.”
BICONDITIONAL STATEMENTS
Eg:. Let p be the statement “You can take the flight,” and let q
be the statement “You buy a ticket.”
Then p ↔ q is the statement
“You can take the flight if and only if you buy a ticket.”
This statement is true if p and q are either both true or both
false,
that is, if you buy a ticket and can take the flight or if you do
not buy a ticket and you cannot take the flight.
It is false when p and q have opposite truth values.
Arguments
An argument is an assertion that a given set of propositions P1, P2, .
. . , Pn, called premises, yields (has a consequence) another
proposition Q, called the conclusion. Such an argument is denoted
by P1, P2, . . ., Pn Q
The notion of a “logical argument” or “valid argument” is formalized
as follows:
Definition : An argument P1, P2, . . ., Pn Q is said to be valid if Q is
true whenever all the premises P1, P2, . . . , Pn are true.
Premises:
p1: If Roger studies, then he will pass discrete math.
p2: If Roger doesn't play tennis, then he'll study.
p3: Roger failed discrete mathematics.
Determine whether the argument p1,p2,p3 q is valid.
p1: p r , p 2 : q p , p 3 : r which is a tautology,
the original argument
( p1 p 2 p 3 ) q is valid
[( p r ) ( q p ) r ] q
Arguments…
Statements: p: Roger studies. | q: Roger plays tennis. | r: Roger passes discrete mathematics.
Premises: p1: If Roger studies, then he will pass discrete math. | p2: If Roger doesn't play tennis, then he'll study.
p3: Roger failed discrete mathematics.
Law of Syllogism:
This fact is verified by the following truth table which shows that the proposition is a tautology:
Equivalently, the argument is valid since the premises p q and q r are true simultaneously only
in Cases (rows) 1, 5, 7, and 8, and in these cases the conclusion p r is also true.
Arguments…
The propositions P1, P2, . . . , Pn are true simultaneously if and only if
the. proposition P1 ∧ P2 ∧ . . . Pn is true.
Thus the argument P1, P2, . . . , Pn Q is valid if and only if Q is true
whenever P1 ∧ P2 ∧ . . . ∧ Pn is true or, equivalently, if the
proposition (P1 ∧ P2 ∧ . . . ∧ Pn) Q is a tautology.
We state this result formally.
Theorem : The argument P1, P2, . . ., Pn Q is valid if and only if the
proposition (P1 ∧ P2 . . . ∧ Pn) Q is a tautology.
Arguments…
Consider the following argument:
S1 : If a man is a bachelor, he is unhappy.
S2 : If a man is unhappy, he dies young.
________________________________
S : Bachelors die young
Here the statement S below the line denotes the conclusion of the
argument, and the statements S1 and S2 above the line denote the
premises. We claim that the argument S1, S2 S is valid. For the
argument is of the form p q, q r p r
Exercise
1. Determine the validity of the following argument: p → q, ¬ p ¬p.
2. Show that the following argument is a fallacy: p q, ¬p ¬q.
Hint :
I. Construct the truth table containing all premises and the conclusion
II. If the proposition (involving the argument) is tautology, then the argument
is valid otherwise fallacy
7 is a prime number.
Answer
3. Determine the validity of the following argument:
If 7 is less than 4, then 7 is not a prime number.
7 is not less than 4.
7 is a prime number.
First translate the argument into symbolic form.
Let p be “7 is less than 4” and
q be “7 is a prime number.” Then
the argument is of the form p ¬q, ¬p q
Now, we construct a truth table.
Remark: The fact that the conclusion of the argument happens to be a true statement is
irrelevant to the fact that the argument presented is a fallacy.
PREDICATE Logic
Predicate:
A Predicate is a declarative sentence whose true/false value depends on one or more
variables.
The statement “x is greater than 3” (x>3)has two parts:
The subject: x is the subject of the statement
The predicate: “is greater than 3” (a property that the subject can have).
We denote the statement “x is greater than 3” by P(x), where,
P is the predicate “is greater than 3” and
x is the variable.
The statement P(x) is also called the value of propositional function P at x.
Assign a value to x, so P(x) becomes a proposition and has a truth value:
P(5) is the statement “5 is greater than 3”, so P(5) is true.
P(2) is the statement “2 is greater than 3”, so P(2) is false.
Predicates: Examples
Given each propositional function determine its true/false value when variables are
set as below.
Prime(x) = “x is a prime number.” propositional function
Prime(2) is true, since the only numbers that divide 2 are 1 and itself.
Prime(9) is false, since 3 divides 9.
E(x, y, z) = “x + y = z”.
E(2, 3, 5) is ...
E(4, 4, 17) is ...
Quantifiers
Assign a value to x in P (x) =“x is an odd number”, so the resulting statement
becomes a proposition:
P (7) is true, P (2) is false.
Quantification is another way to create propositions from a propositional
functions:
Universal quantification: ∀ x P(x) says,
“The predicate P is true for every element under consideration.”
Under the domain of natural numbers, ∀ x P(x) is false.
Existencial quantification: ∃ x P(x) says,
“There is one or more element under consideration for which the predicate P is
true.”
Under the domain of natural numbers, ∃ x P(x) is true, since for instance P (7) is
true.
Domain / Domain of Discourse /
Universe of Discourse
The set of all related things we wish to talk about; that is, the set of all objects
that we can sensibly assign to a variable in a propositional function.
Eg:
1. Color(x) = “ x is my favourite”
The domain of x can be {Red,Blue,Green,Yellow,Brown}
2. P (x) =“x is an odd number”
∀xP (x) is false for the domain of integer numbers; but
∀xP (x) is true for the domain of prime numbers greater than 2.
Universal Quantifier
The universal quantification of P(x) is the statement
“P(x) for all values of x in the domain.”
The notation ∀xP(x) denotes the universal quantification of P(x).
Here ∀ is called the universal quantifier.
We read ∀xP(x) as “for all x P(x)” or “for every x P(x).”
Answer: False
The statement ∀xP(x) is the same as the conjunction
P(1) ∧ P(2) ∧ P(3) ∧ P(4),
because the domain consists of the integers 1, 2, 3, and 4.
Because P(4), which is the statement
“42 < 10,” is false, it follows that ∀xP(x) is false.
Exercise A
2. What does the statement ∀xN(x) mean if N(x) is “Computer x is
connected to the network” and the domain consists of all computers on
campus?
Answer : False
Solution: Since x and y are odd we can write x= (2m+1) and y= 2n+1
where m and n are integers
Then xy = (2m+1)(2n+1)
4mn+2m+2n+1
2(2mn+m+n) + 1
xy = 2p + 1 where p is an integer
Since mn, m and n are integers . Therefor xy is odd
Types of Proofs…
Proof by Mathematical Induction
Let p(n) be a statement that is either true or false for any positive integer n. suppose we have,
(i) P(i) is true
(ii) assuming P(r) is true, we can show that P(r+1) is also true
for all positive integers r