Lecture 1 (Logic)
Lecture 1 (Logic)
Compound Proposition:
• A proposition formed by combining two or more propositions using logical
connectives.
• Example: "3 is a prime number and 2 is an even number."
Tautology:
• A proposition that is always true, regardless of the truth values of its
components.
• Example: "P ∨ ¬P" (Either P is true, or P is not true).
Contradiction:
• A proposition that is always false, regardless of the truth values of its
components.
• Example: "P ∧ ¬P" (P cannot be true and false simultaneously).
Types of Propositions
Contingent Proposition:
• A proposition whose truth value depends on the truth values of its
components; it can be either true or false.
• Example: "It is raining" (This statement can be true or false depending on the
weather).
Universal Proposition:
• A proposition that asserts something about all elements in a given set.
• Example: "For all x in ℕ, x + 1 > x."
Existential Proposition:
• A proposition that asserts the existence of at least one element in a given set
that satisfies a certain condition.
• Example: "There exists an x in ℕ such that x is even."
Biconditional Proposition:
• A proposition where two statements are true or false simultaneously;
expressed as "P if and only if Q."
• Example: "x is even if and only if x is divisible by 2."
Types of Propositions
Atomic Proposition:
• Propositions that cannot be expressed in terms of simpler propositions are
called atomic propositions.
• An atomic proposition is a basic statement or proposition that cannot be
broken down into simpler components.
• It is indivisible and does not contain any logical connectives (such as AND,
OR, NOT, etc.).
• In other words, an atomic proposition is a simple statement that asserts a
single fact.
Example:
"The sky is blue.“
This statement is a single, simple assertion without any further logical structure.
"5 is a prime number.“
This is an atomic proposition because it asserts a specific fact about the
number 5.
"The Earth orbits the Sun.“
This statement is an indivisible assertion regarding a specific physical
phenomenon
Propositional calculus
• The area of logic that deals with propositions is called the
propositional calculus or propositional logic.
• It was first developed systematically by the Greek philosopher
Aristotle more than 2300 years ago.
• Methods for producing new propositions were discussed by the
English mathematician George Boole in 1854 in his book “The Laws
of Thought.”
Logical Connectives
Basic Logical Operations
Compound Propositions: Negation
⚫ Reverses the truth value of a single proposition.
⚫ The negation of a proposition p is denoted by ¬p and has
this truth table:
p ¬p
T F
F T
p q p ∨q
T T T
T F T
F T T
F F F
p q p ⊕q
T T F
T F T
F T T
F F F
Tautologies and contradictions
• A tautology is an assertion of Propositional Logic
that is true in all situations; that is, it is true for all
possible values of its variables.
• A contradiction is an assertion of Propositional
Logic that is false in all situations; that is, it is false
for all possible values of its variables.
• A contingency is and assertion is sometimes true
and sometimes false, so it is neither a tautology nor
a contradiction.
Determine weather the following condition is
Tautology or contradiction p ∨ ¬(p ∧ q)
if p, then q p implies q
if p, q p only if q
q unless ¬p q when p
q if p q when p
q whenever p p is sufficient for q
q follows from p q is necessary for p
p q p q
T T T
T F F
F T F
F F T
p →q ¬q → ¬ p
Using a Truth Table to Show Non-
Equivalence
Example: Show using truth tables that neither the
converse nor inverse of an implication are not equivalent
to the implication.
Using a Truth Table to Show Non-
Equivalence
Example: Show using truth tables that neither the
converse nor inverse of an implication are not equivalent
to the implication.
Solution:
p q ¬p ¬q p →q q→p ¬ p →¬ q
T T F F T T T
T F F T F T T
F T T F T F F
F F T T T T T
(p →q) 𝖠 (q → p ) p q
Problem
⚫ How many rows are there in a truth table with n
propositional variables?
Problem
⚫ How many rows are there in a truth table with n
propositional variables?
⚫ The inverter (NOT gate)takes an input bit and produces the negation of that bit.
⚫ The OR gate takes two input bits and produces the value equivalent to the disjunction of the two
bits.
⚫ The AND gate takes two input bits and produces the value equivalent to the conjunction of the
two bits.
⚫ More complicated digital circuits can be constructed by combining these basic circuits to
produce the desired output given the input signals by building a circuit for each piece of
the output expression and then combining them. For example:
Section 1.3
Section Summary
⚫ Tautologies, Contradictions, and Contingencies.
⚫ Logical Equivalence
⚫ Important Logical Equivalences
⚫ Showing Logical Equivalence
⚫ Propositional Satisfiability
Tautologies, Contradictions, and Contingencies
p ¬p p ∨¬p p 𝖠¬p
T F T F
F T T F
Logically Equivalent
⚫ Two compound propositions p and q are logically equivalent if p q
is a tautology.
⚫ We write this as p ⇔ q or as p ≡ q where p and q are compound
propositions.
⚫ Twocompound propositions p and q are equivalent if and only if the
columns in a truth table giving their truth values agree.
⚫ This truth table show ¬p ∨ q is equivalent to p → q.
p q ¬p ¬p ∨ q p→ q
T T F T T
T F F F F
F T T T T
F F T T T
De Morgan’s Laws
Augustus De Morgan
1806-1871
De Morgan’s Laws
Augustus De Morgan
1806-1871
⚫ Domination Laws: ,
⚫ Idempotent laws: ,
⚫ Negation Laws: ,
Key Logical Equivalences (cont)
⚫ Commutative Laws: ,
⚫ Associative Laws:
⚫ Distributive Laws:
⚫ Absorption Laws:
More Logical Equivalences
These valid logical equivalences could be used as a valid argument form in proofs (later)
More Logical Equivalences
The tautology above is known as “Modus Podens” (one of the rules of inference)
It establishes validity of the following argument form:
if p and p→ q then q
(see other standard rules of inference in Table 1 on p.72)
Constructing New Logical Equivalences