Chapter-1.1
Chapter-1.1
1
1.1 Propositional Logic
Introduction
⚫A proposition is a declarative sentence (a
sentence that declares a fact) that is either
true or false, but not both.
⚫Are the following sentences propositions?
Toronto is the capital of Canada. (Yes)
Read this carefully. (No)
1+2=3 (Yes)
x+1=2 (No)
What time is it? (No)
2
1.1 Propositional Logic
3
1.1 Propositional Logic
DEFINITION 1
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.” and
express this in simple English.
Solution: The negation is “It is not the case that today is Friday.”
In simple English, “Today is not Friday.” or “It is not
Friday today.”
Find the negation of the proposition “Michael’s PC runs Linux.”
and express this in simple English.
Solution: The negation is “It is not the case that Michael’s PC runs
Linux.”
In simple English, “Michael’s PC does not run Linux.” 4
1.1 Propositional Logic
⚫ Note: Always assume fixed times, fixed places, and
particular people unless otherwise noted.
⚫ Truth table:
The Truth Table for the
Negation of a Proposition.
p ¬p
T F
F T
⚫ Note:
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. Only one
E.g. “Students who have taken calculus or computer science, but not
both, can take this class.” – only those who take one of them.
⚫ Definition 3 uses inclusive or. (One or both)
7
1.1 Propositional Logic
DEFINITION 4
Let p and q be propositions. The exclusive or of p and q, denoted by p q,
is the proposition that is true when exactly one of p and q is true and is
false otherwise.
The Truth Table for The Truth Table for The Truth Table for the
the Conjunction of the Disjunction of Exclusive Or (XOR) of
Two Propositions. Two Propositions. Two Propositions.
p q pΛq p q pνq p q p q
T T T T T T T T F
T F F T F T T F T
F T F F T T F T T
F F F F F F F F F
8
1.1 Propositional Logic
Conditional Statements
DEFINITION 5
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).
⚫ A conditional statement is also called an implication.
⚫ Example: “If I am elected, then I will lower taxes.” p→q
implication:
elected, lower taxes. T T |T
not elected, lower taxes. F T |T
not elected, not lower taxes. F F |T
elected, not lower taxes. T F |F
9
1.1 Propositional Logic
⚫ Example:
Let p be the statement “Maria learns discrete mathematics.” and
q the statement “Maria will find a good job.” Express the
statement p → q as a statement in English.
Solution: Any of the following -
“If Maria learns discrete mathematics, then she will find a
good job.
“Maria will find a good job when she learns discrete
mathematics.”
“For Maria to get a good job, it is sufficient for her to
learn discrete mathematics.”
“Maria will find a good job unless she does not learn
discrete mathematics.”
10
1.1 Propositional Logic
in = not()
conv = 1/()
contra=1/not()
11
1.1 Propositional Logic
⚫ Find the contrapositive, the converse, and the inverse of the
conditional statement: q whenever p. means p->q
“The home team wins whenever it is raining.”
Converse “If the home team wins, then it is raining.
Contrapositive If the home team does not win, then it is
not raining.
Inverse If it is not raining, then the home team does not
win.
12
1.1 Propositional Logic
DEFINITION 6
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.
14
1.1 Propositional Logic
Truth Tables of Compound Propositions
⚫ We can use connectives to build up complicated compound
propositions involving any number of propositional variables, then
use truth tables to determine the truth value of these compound
propositions.
⚫ Example: Construct the truth table of the compound proposition
(p ν ¬q) → (p Λ q).
T T F T T T
T F T T F F
F T F F F T
F F T T F F 15
1.1 Propositional Logic
Precedence of Logical Operators
⚫ We can use parentheses to specify the order in which logical
operators in a compound proposition are to be applied.
⚫ To reduce the number of parentheses, the precedence order is
defined for logical operators.
⚫ Example: Find the bitwise OR, bitwise AND, and bitwise XOR of the
bit string 01 1011 0110 and 11 0001 1101.
Solution:
01 1011 0110
11 0001 1101
------------------- xor
11 1011 1111 bitwise OR bijor sonkhok 1 thakle
01 0001 0100 bitwise AND output 1
10 1010 1011 bitwise XOR
18