📘 Lecture 1 — Logic
📖 Overview: This lecture introduces the fundamental concepts of logic, which is the study of valid and invalid arguments. It defines simple statements (propositions) and how they can be combined using logical connectives to form compound statements. Understanding logic is essential for precise reasoning in mathematics and computer science.
🗂️ Topics Covered
The lecture begins with an overview of the Discrete Mathematics course, its objectives, and recommended books. It then defines what Discrete Mathematics is and introduces the core concept of logic. The main body covers simple statements (propositions), their truth values, and how to identify them. Finally, it explains compound statements formed using logical connectives (negation, conjunction, disjunction), symbolic representation, translation between English and symbols, and how to construct truth tables.
📝 Lecture Summary
Course Introduction
The course covers 12 main topics: Logic, Sets & Operations on sets, Relations & Their Properties, Functions, Sequences & Series, Recurrence Relations, Mathematical Induction, Loop Invariants, Combinatorics, Probability, and Graphs and Trees.
🔑 Definition — Discrete Mathematics: Discrete mathematics concerns processes that consist of a sequence of individual steps.
What is Logic?
Logic is the study of the principles and methods that distinguish between a valid and an invalid argument.
Simple Statement
A statement (or proposition) is a declarative sentence that is either true or false but not both. If a proposition is true, it has a truth value of "true" (denoted T). If false, its truth value is "false" (denoted F).
📌 Example: "Grass is green" (true). "4 + 2 = 7" (false). "Close the door" is NOT a proposition (it's a command). "x is greater than 2" is not a proposition unless x is defined.
Rule: If the sentence is preceded by other sentences that make the pronoun or variable reference clear, then the sentence is a statement.
📌 Example: If x = 1, then "x > 2" is a statement with truth value FALSE.
📌 Example: "Bill Gates is an American. He is very rich." — "He is very rich" is a statement with truth value TRUE.
Compound Statement
Simple statements can be used to build a compound statement using logical connectives.
The logical connectives are: AND (conjunction), OR (disjunction), and NOT (negation).
Symbolic Representation
Statements are symbolically represented by letters such as p, q, r...
| Connective | Meaning | Symbol | Called |
|---|---|---|---|
| Negation | not | ~ | Tilde |
| Conjunction | and | ∧ | Hat |
| Disjunction | or | ∨ | Vel |
| Conditional | if...then... | → | Arrow |
| Biconditional | if and only if | ↔ | Double arrow |
Translating from English to Symbols
Let p = "It is hot", and q = "It is sunny".
| Sentence | Symbolic Form |
|---|---|
| It is not hot. | ~ p |
| It is hot and sunny. | p ∧ q |
| It is hot or sunny. | p ∨ q |
| It is not hot but sunny. | ~ p ∧ q |
| It is neither hot nor sunny. | ~ p ∧ ~ q |
📌 Example: Let h = "Zia is healthy", w = "Zia is wealthy", s = "Zia is wise".
- "Zia is healthy and wealthy but not wise." → (h ∧ w) ∧ (~ s)
- "Zia is not wealthy but he is healthy and wise." → ~ w ∧ (h ∧ s)
- "Zia is neither healthy, wealthy nor wise." → ~ h ∧ ~ w ∧ ~ s
📌 Example: Let m = "Ali is good in Mathematics", c = "Ali is a Computer Science student".
- ~ c → "Ali is not a Computer Science student"
- c ∨ m → "Ali is a Computer Science student or good in Maths."
- m ∧ ~ c → "Ali is good in Maths but not a Computer Science student"
Truth Table
A truth table specifies the truth value of a compound proposition for all possible truth values of its constituent propositions.
Negation (~)
If p is a statement, then the negation of p, "not p", is denoted as "~p". It has the opposite truth value from p.
| p | ~p |
|---|---|
| T | F |
| F | T |
Conjunction (∧)
The conjunction of p and q is "p and q", denoted as "p ∧ q". p ∧ q is true only when both p and q are true; otherwise it is false.
| p | q | p ∧ q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
Disjunction (∨) or Inclusive OR
The disjunction of p and q is "p or q", denoted as "p ∨ q". p ∨ q is true when at least one of p or q is true; it is false only when both p and q are false.
| p | q | p ∨ q |
|---|---|---|
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
💡 Why this matters: For conjunction, you find T in both statements; for disjunction, you find F in both statements.
⭐ Key Takeaways
A statement (proposition) must be a declarative sentence that is either true or false, but not both. Logical connectives (negation, conjunction, disjunction) combine simple statements into compound statements. A truth table systematically shows the truth value of a compound statement for all possible truth values of its components. The negation (~p) flips the truth value of p. The conjunction (p ∧ q) is true only when both p and q are true, while the disjunction (p ∨ q) is false only when both p and q are false.
🧠 Quick Revision Questions
- What are the two essential properties a declarative sentence must have to be considered a statement (proposition)?
- What is the truth value of the conjunction p ∧ q when p is false and q is true?
- Translate the sentence "It is not hot but sunny" into symbolic form using p = "It is hot" and q = "It is sunny".
- For what combination of truth values of p and q is the disjunction p ∨ q false?
- What is the name and symbol for the logical connective that represents "if...then..."?
📘 Lecture 2 — Truth Tables
📖 Overview: This lecture introduces truth tables as a systematic method for determining the truth values of compound logical statements. It explores inclusive and exclusive OR, logical equivalence, De Morgan’s Laws, tautologies, contradictions, and the fundamental laws of logic that govern propositional reasoning.
🗂️ Topics Covered
The lecture covers truth table construction for statements involving negation, conjunction, disjunction, and exclusive OR. It then explains logical equivalence with the double negative property and De Morgan’s Laws applied to statements and inequalities. Finally, it defines tautologies, contradictions, and presents the complete set of laws of logic including commutative, associative, distributive, identity, negation, and absorption laws.
📝 Lecture Summary
Truth Tables for: ~ p ∧ q
A truth table lists all possible truth values for statement variables and shows the resulting truth value of a compound statement for each combination. For ~ p ∧ q, first compute the negation of p, then find the conjunction with q.
| p | q | ~p | ~p ∧ q |
|---|---|---|---|
| T | T | F | F |
| T | F | F | F |
| F | T | T | T |
| F | F | T | F |
🔑 Definition — Truth Table: A table showing all possible truth values of statement variables and the resulting truth values of a compound statement.
Truth Table for ~ p ∧ (q ∨ ~ r)
When constructing truth tables with three variables (p, q, r), there are 2³ = 8 rows. Compute ~r first, then q ∨ ~r, then ~p, and finally their conjunction.
| p | q | r | ~r | q ∨ ~r | ~p | ~p ∧ (q ∨ ~r) |
|---|---|---|---|---|---|---|
| T | T | T | F | T | F | F |
| T | T | F | T | T | F | F |
| T | F | T | F | F | F | F |
| T | F | F | T | T | F | F |
| F | T | T | F | T | T | T |
| F | T | F | T | T | T | T |
| F | F | T | F | F | T | F |
| F | F | F | T | T | T | T |
📌 Example: For p = F, q = T, r = F, we get ~p = T, q ∨ ~r = T ∨ T = T, so result = T ∧ T = T.
Truth Table for (p∨q) ∧ ~(p∧q) — Exclusive OR
The exclusive OR (XOR) means “p or q but not both.” It is symbolically written as p ⊕ q or (p∨q) ∧ ~(p∧q).
| p | q | p∨q | p∧q | ~(p∧q) | (p∨q) ∧ ~(p∧q) |
|---|---|---|---|---|---|
| T | T | T | T | F | F |
| T | F | T | F | T | T |
| F | T | T | F | T | T |
| F | F | F | F | T | F |
🔑 Definition — Exclusive OR (XOR): A logical operation that is true when exactly one of the two statements is true, and false otherwise.
USAGE OF “OR” IN ENGLISH
In English, “OR” is used in two senses:
- Inclusive OR (p or q or both) — e.g., “I shall buy a pen or a book” (true if you buy either or both)
- Exclusive OR (p or q but not both) — e.g., “Tomorrow at 9, I’ll be in Lahore or Islamabad” (false if you are in both places)
The symbol ∨ represents the inclusive OR.
💡 Why this matters: Understanding the difference between inclusive and exclusive OR prevents misinterpretation of logical statements in programming, mathematics, and everyday reasoning.
Truth Table for Exclusive OR
The exclusive OR can also be expressed as: p ⊕ q ≡ (p ∧ ~q) ∨ (~p ∧ q)
| p | q | p ⊕ q |
|---|---|---|
| T | T | F |
| T | F | T |
| F | T | T |
| F | F | F |
Note the equivalence: p ⊕ q ≡ (p ∧ ~q) ∨ (~p ∧ q) ≡ (p ∨ q) ∧ ~(p ∧ q) ≡ (p ∨ q) ∧ (~p ∨ ~q)
LOGICAL EQUIVALENCE
Logical equivalence means two statement forms have identical truth values for all possible truth assignments to their variables. The symbol ≡ denotes logical equivalence.
Double Negative Property: ~(~p) ≡ p
| p | ~p | ~(~p) |
|---|---|---|
| T | F | T |
| F | T | F |
📌 Example: Rewrite “It is not true that I am not happy.” Let p = “I am happy.” Then ~(~p) ≡ p, so the statement simplifies to “I am happy.”
📌 Example: Show that ~(p∧q) and ~p ∧ ~q are not logically equivalent.
| p | q | ~p | ~q | p∧q | ~(p∧q) | ~p ∧ ~q |
|---|---|---|---|---|---|---|
| T | T | F | F | T | F | F |
| T | F | F | T | F | T | F |
| F | T | T | F | F | T | F |
| F | F | T | T | F | T | T |
Different truth values in row 2 and row 3 prove they are NOT equivalent.
DE MORGAN’S LAWS
Law 1: The negation of an AND statement is logically equivalent to the OR statement with each component negated. ~ (p ∧ q) ≡ ~p ∨ ~q
Law 2: The negation of an OR statement is logically equivalent to the AND statement with each component negated. ~ (p ∨ q) ≡ ~p ∧ ~q
Truth table for ~(p ∨ q) ≡ ~p ∧ ~q:
| p | q | ~p | ~q | p ∨ q | ~(p ∨ q) | ~p ∧ ~q |
|---|---|---|---|---|---|---|
| T | T | F | F | T | F | F |
| T | F | F | T | T | F | F |
| F | T | T | F | T | F | F |
| F | F | T | T | F | T | T |
Same truth values confirm the equivalence.
APPLICATION of De Morgan’s Laws
📌 Example: Give negations for: a) “The fan is slow or it is very hot.” → Negation: “The fan is not slow and it is not very hot.” b) “Akram is unfit and Saleem is injured.” → Negation: “Akram is not unfit or Saleem is not injured.”
INEQUALITIES AND DEMORGAN’S LAWS
📌 Example: Write the negation of -1 < x ≤ 4 for some real number x. Here, -1 < x ≤ 4 means x > –1 AND x ≤ 4. Let p: x > –1, q: x ≤ 4. Then ~p: x ≤ –1, ~q: x > 4. Negation of (x > –1 AND x ≤ 4) = ~(p ∧ q) ≡ ~p ∨ ~q = x ≤ –1 OR x > 4.
TAUTOLOGY
🔑 Definition — Tautology: A statement form that is always true regardless of the truth values of its statement variables. Represented by the symbol t.
📌 Example: The statement form p ∨ ~p is a tautology.
| p | ~p | p ∨ ~p |
|---|---|---|
| T | F | T |
| F | T | T |
p ∨ ~p ≡ t
CONTRADICTION
🔑 Definition — Contradiction: A statement form that is always false regardless of the truth values of its statement variables. Represented by the symbol c.
📌 Example: The statement form p ∧ ~p is a contradiction.
| p | ~p | p ∧ ~p |
|---|---|---|
| T | F | F |
| F | T | F |
p ∧ ~p ≡ c
Remarks:
- Most statements are neither tautologies nor contradictions.
- The negation of a tautology is a contradiction and vice versa.
- Two statements are contradictory if their conjunction is a contradiction.
LOGICAL EQUIVALENCE INVOLVING TAUTOLOGY
📌 Example: Show that p ∧ t ≡ p
| p | t | p ∧ t |
|---|---|---|
| T | T | T |
| F | T | F |
The entries in the first and last columns are identical, so p ∧ t ≡ p.
LOGICAL EQUIVALENCE INVOLVING CONTRADICTION
📌 Example: Show that p ∧ c ≡ c
| p | c | p ∧ c |
|---|---|---|
| T | F | F |
| F | F | F |
Same truth values in indicated columns, so p ∧ c ≡ c.
📌 Example (Exercise): Show that (p ∧ q) ∨ (~p ∨ (p ∧ ~q)) is a tautology.
| p | q | p∧q | ~p | ~q | p∧~q | ~p ∨ (p∧~q) | (p∧q) ∨ (~p ∨ (p∧~q)) |
|---|---|---|---|---|---|---|---|
| T | T | T | F | F | F | F | T |
| T | F | F | F | T | T | T | T |
| F | T | F | T | F | F | T | T |
| F | F | F | T | T | F | T | T |
All entries in the last column are T, so it is a tautology.
📌 Example (Exercise): Show that (p ∧ ~q) ∧ (~p ∨ q) is a contradiction.
| p | q | ~q | p∧~q | ~p | ~p ∨ q | (p∧~q) ∧ (~p ∨ q) |
|---|---|---|---|---|---|---|
| T | T | F | F | F | T | F |
| T | F | T | T | F | F | F |
| F | T | F | F | T | T | F |
| F | F | T | F | T | T | F |
All entries in the last column are F, so it is a contradiction.
LAWS OF LOGIC
- Commutative Laws: p ∧ q ≡ q ∧ p, p ∨ q ≡ q ∨ p
- Associative Laws: (p ∧ q) ∧ r ≡ p ∧ (q ∧ r), (p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
- Distributive Laws: p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r), p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
- Identity Laws: p ∧ t ≡ p, p ∨ c ≡ p
- Negation Laws: p ∨ ~p ≡ t, p ∧ ~p ≡ c
- Double Negation Law: ~(~p) ≡ p
- Idempotent Laws: p ∧ p ≡ p, p ∨ p ≡ p
- De Morgan’s Laws: ~(p ∧ q) ≡ ~p ∨ ~q, ~(p ∨ q) ≡ ~p ∧ ~q
- Universal Bound Laws: p ∨ t ≡ t, p ∧ c ≡ c
- Absorption Laws: p ∨ (p ∧ q) ≡ p, p ∧ (p ∨ q) ≡ p
- Negation of t and c: ~t ≡ c, ~c ≡ t
⭐ Key Takeaways
- Truth tables systematically evaluate compound logical statements by listing all possible truth value combinations and computing results step-by-step following the order of operations (negation first, then conjunction/disjunction in parentheses).
- The exclusive OR (XOR) is true when exactly one operand is true, expressed as (p∨q)∧~(p∧q) or (p∧~q)∨(~p∧q), and differs from inclusive OR which is also true when both are true.
- De Morgan’s Laws are critical for negating complex statements: ~(p∧q) ≡ ~p ∨ ~q and ~(p∨q) ≡ ~p ∧ ~q, and they apply directly to inequalities involving AND/OR conditions.
- A tautology is always true (p ∨ ~p ≡ t) while a contradiction is always false (p ∧ ~p ≡ c); most everyday statements are neither, and the negation of a tautology is a contradiction.
- The eleven laws of logic (commutative, associative, distributive, identity, negation, double negation, idempotent, De Morgan’s, universal bound, absorption, and negation of t/c) form the foundation for simplifying and proving logical equivalences without constructing truth tables.
🧠 Quick Revision Questions
- Construct the truth table for ~p ∨ (q ∧ ~r) and determine its truth value when p = T, q = F, r = T.
- How does exclusive OR differ from inclusive OR, and what is the symbolic representation of each?
- Using De Morgan’s Laws, write the negation of the statement: “The temperature is below freezing and it is not snowing.”
- Is the statement form (p ∨ q) ∧ ~p logically equivalent to q? Justify with a truth table or laws of logic.
- Classify each of the following as a tautology, contradiction, or neither: (a) p ∧ (q ∨ ~p), (b) (p → q) ∨ (q → p), (c) p ∧ ~(p ∨ q).
📘 Lecture 3 — Laws of Logic
📖 Overview: This lecture introduces the fundamental laws of logic and demonstrates how to apply them for simplifying complex logical statements and verifying logical equivalences. It then transitions into conditional statements (implications), covering their truth tables, alternative expressions, and related concepts like inverse, converse, and contrapositive, which are essential for mathematical reasoning and proof construction.
🗂️ Topics Covered
The lecture begins with applying laws of logic (DeMorgan’s, Double Negative, Associative, Idempotent, Distributive, Negation, Identity) to simplify statement forms and verify equivalences. It then introduces conditional statements, their truth tables, alternative phrasing, and translations between English and symbolic logic. The hierarchy of operations for logical connectives is explained, followed by the implication law, negation of conditionals, and the definitions of inverse, converse, and contrapositive.
📝 Lecture Summary
APPLYING LAWS OF LOGIC
Using the laws of logic, we can simplify complex statement forms into equivalent but simpler forms. The process involves applying known logical equivalences step-by-step.
🔑 Definition — DeMorgan’s Law: ~(p ∧ q) ≡ ~p ∨ ~q and ~(p ∨ q) ≡ ~p ∧ ~q. Negation distributes and flips the connective.
📐 Formula: p ∨ [~(p ∧ q)] ≡ p ∨ [(~p) ∨ (~q)] (DeMorgan’s Law) ≡ p ∨ [p ∨ (~q)] (Double Negative Law) ≡ [p ∨ p] ∨ (~q) (Associative Law for ∨) ≡ p ∨ (~q) (Idempotent Law)
📌 Example: Simplify p ∨ [~(p ∧ q)]. Step 1: Apply DeMorgan’s Law to the inner negation: p ∨ [(~p) ∨ (~q)]. Step 2: Apply Double Negative Law: p ∨ [p ∨ (~q)]. Step 3: Apply Associative Law: [p ∨ p] ∨ (~q). Step 4: Apply Idempotent Law: p ∨ (~q). The simplified form is p ∨ (~q).
🔑 Definition — Double Negative Law: ~(~p) ≡ p. The negation of a negation returns the original statement.
🔑 Definition — Associative Law: (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) and (p ∧ q) ∧ r ≡ p ∧ (q ∧ r). Grouping does not matter for conjunction or disjunction.
🔑 Definition — Idempotent Law: p ∨ p ≡ p and p ∧ p ≡ p. A statement combined with itself yields the same statement.
📌 Example: Using Laws of Logic, verify ~(p ∧ q) ∧ (p ∨ q) ≡ p. Step 1: DeMorgan’s Law gives ((~p) ∨ ~q) ∧ (p ∨ q). Step 2: Double Negative Law gives (p ∨ ~q) ∧ (p ∨ q). Step 3: Distributive Law (reverse) gives p ∨ (~q ∧ q). Step 4: Negation Law gives p ∨ c. Step 5: Identity Law gives p. So the equivalence is verified.
🔑 Definition — Distributive Law: p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) and p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r).
🔑 Definition — Negation Law: p ∨ ~p ≡ t (tautology) and p ∧ ~p ≡ c (contradiction).
🔑 Definition — Identity Law: p ∨ c ≡ p and p ∧ t ≡ p.
SIMPLIFYING A STATEMENT
We can represent English sentences using logical symbols and then apply distributive law (in reverse) to simplify the condition.
📌 Example: “You will get an A if you are hardworking and the sun shines, or you are hardworking and it rains.” 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). Rephrased: “You will get an A if you are hardworking and the sun shines or it rains.”
📌 Example: Use logical equivalence to rewrite “It is not true that I am tired and you are smart.” This becomes “I am not tired or you are not smart.” (DeMorgan’s Law)
📌 Example: Use logical equivalence to rewrite “I forgot my pen or my bag and I forgot my pen or my glasses.” This simplifies to “I forgot my pen or I forgot my bag and glasses.” (Distributive Law)
CONDITIONAL STATEMENTS
A conditional statement, also called an implication, links a hypothesis to a conclusion.
🔑 Definition — Conditional Statement (Implication): If p and q are statement variables, the conditional of q by p is “If p then q” or “p implies q”, denoted p → q. p is the hypothesis (antecedent), q is the conclusion (consequent).
🔑 Definition — Truth Table for p → q: p → q is false only when p is true and q is false; in all other cases it is true.
| p | q | p → q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
📌 Example: Determine truth values: “If 1 = 1, then 3 = 3.” → TRUE. “If 1 = 1, then 2 = 3.” → FALSE. “If 1 = 0, then 3 = 3.” → TRUE (since hypothesis false). “If 1 = 2, then 2 = 3.” → TRUE. “If 1 = 1, then 1 = 2 and 2 = 3.” → FALSE. “If 1 = 3 or 1 = 2 then 3 = 3.” → TRUE.
ALTERNATIVE WAYS OF EXPRESSING IMPLICATIONS
The implication p → q can be expressed in many equivalent ways:
- “if p then q”
- “p implies q”
- “if p, q”
- “p only if q”
- “p is sufficient for q”
- “q is necessary for p”
- “not p unless q”
- “q follows from p”
- “q if p”
- “q whenever p”
📌 Example: “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.”
📌 Example: “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.”
📌 Example: “That you get the job implies that you have the best credentials.” → “If you get the job, then you have the best credentials.”
📌 Example: “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 = “you get an A on the final exam”, q = “you do every exercise in this book”, r = “you get an A in this class”.
📌 Example: “To get an A in this class it is necessary for you to get an A on the final.” → p → r
📌 Example: “You do every exercise in this book; You get an A on the final, implies, you get an A in the class.” → p ∧ q → r
📌 Example: “Getting an A on the final and doing every exercise in this book is sufficient for getting an A in this class.” → p ∧ q → r
TRANSLATING SYMBOLIC PROPOSITIONS TO ENGLISH
Let p = “you have the flu”, q = “you miss the final exam”, r = “you pass the course”.
📌 Example: p → q → “If you have flu, then you will miss the final exam.”
📌 Example: ~q → r → “If you don’t miss the final exam, you will pass the course.”
📌 Example: ~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
The order of operations for logical connectives, from highest to lowest precedence:
- ~ (negation)
- ∧ (conjunction), ∨ (disjunction) — equal precedence
- → (conditional)
📌 Example: Construct a truth table for p ∨ ~q → ~p.
| p | q | ~q | ~p | p ∨ ~q | p ∨ ~q → ~p |
|---|---|---|---|---|---|
| T | T | F | F | T | F |
| T | F | T | F | T | F |
| F | T | F | T | F | T |
| F | F | T | T | T | T |
LOGICAL EQUIVALENCE INVOLVING IMPLICATION
Truth tables can be used to show that p → q is logically equivalent to ~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 |
The two expressions have the same truth values for all combinations, so they are equivalent.
🔑 Definition — Contrapositive: The contrapositive of p → q is ~q → ~p. A conditional and its contrapositive are always logically equivalent.
🔑 Definition — Implication Law: p → q ≡ ~p ∨ q. This allows rewriting any implication as a disjunction.
| 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 |
NEGATION OF A CONDITIONAL STATEMENT
Since p → q ≡ ~p ∨ q, we can find the negation: ~(p → q) ≡ ~(~p ∨ q) ≡ ~(~p) ∧ ~q ≡ p ∧ ~q (by DeMorgan’s and Double Negative Laws).
Thus the negation of “if p then q” is logically equivalent to “p and not q”. The negation of an if-then statement does not start with the word “if”.
📌 Example: Negate “If Ali lives in Pakistan then he lives in Lahore.” → “Ali lives in Pakistan and he does not live in Lahore.”
📌 Example: Negate “If my car is in the repair shop, then I cannot get to class.” → “My car is in the repair shop and I can get to class.”
📌 Example: Negate “If x is prime then x is odd or x is 2.” → “x is prime but x is not odd and x is not 2.”
INVERSE OF A CONDITIONAL STATEMENT
🔑 Definition — Inverse: The inverse of p → q is ~p → ~q. A conditional and its inverse are NOT logically equivalent.
| 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 confirm they are not equivalent.
📌 Example: “If today is Friday, then 2 + 3 = 5.” Inverse: “If today is not Friday, then 2 + 3 ≠ 5.”
📌 Example: “If it snows today, I will ski tomorrow.” Inverse: “If it does not snow today I will not ski tomorrow.”
CONVERSE OF A CONDITIONAL STATEMENT
🔑 Definition — Converse: The converse of p → q is q → p. A conditional and its converse are NOT logically equivalent (→ is not a commutative operator).
| p | q | p → q | q → p |
|---|---|---|---|
| T | T | T | T |
| T | F | F | T |
| F | T | T | F |
| F | F | T | T |
Different truth values show they are not equivalent.
📌 Example: “If today is Friday, then 2 + 3 = 5.” Converse: “If 2 + 3 = 5, then today is Friday.”
📌 Example: “If P is a square, then P is a rectangle.” Converse: “If P is a rectangle then P is a square.”
CONTRAPOSITIVE OF A CONDITIONAL STATEMENT
🔑 Definition — Contrapositive: The contrapositive of p → q is ~q → ~p. A conditional and its contrapositive ARE logically equivalent: p → q ≡ ~q → ~p.
📌 Example: “If today is Friday, then 2 + 3 = 5.” Contrapositive: “If 2 + 3 ≠ 5, then today is not Friday.”
📌 Example: “If it snows today, I will ski tomorrow.” Contrapositive: “I will not ski tomorrow only if it does not snow today.”
📌 Example: “If P is a square, then P is a rectangle.” Contrapositive: “If P is not a rectangle then P is not a square.”
📌 Example: “If my car is in the repair shop, then I cannot get to class.” Contrapositive: “If I can get to the class, then my car is not in the repair shop.”
⭐ Key Takeaways
The most critical concepts to remember are the fundamental laws of logic (DeMorgan’s, Double Negative, Associative, Idempotent, Distributive, Negation, Identity) for simplifying compound statements. Conditional statements (p → q) are only false when p is true and q is false, and they can be expressed in many alternative forms. The implication law (p → q ≡ ~p ∨ q) is essential for rewriting and negating conditionals, where the negation is p ∧ ~q. Crucially, a conditional is logically equivalent to its contrapositive (~q → ~p) but NOT to its inverse (~p → q) or its converse (q → p). The hierarchy of logical connectives (, then ∧/∨, then →) must be followed when constructing truth tables.
🧠 Quick Revision Questions
- Use the laws of logic to simplify the statement form: ~(p ∨ ~q) ∨ (~p ∧ q).
- State the Implication Law and use it to find the negation of “If it rains, then the ground is wet.”
- Construct a truth table to verify that p → q is logically equivalent to its contrapositive.
- Translate the following English statement into symbols: “You will succeed only if you work hard and you are lucky.” Let s = “you will succeed”, h = “you work hard”, l = “you are lucky”.
- What is the difference between the inverse and the converse of a conditional statement? Provide an example showing they are not logically equivalent to the original statement.
📘 Lecture 4 — Biconditional
📖 Overview: This lecture introduces the biconditional logical connective “if and only if,” its truth table, notation, and meaning. It explores how to rephrase biconditional statements, demonstrates logical equivalences involving biconditional, and applies laws of logic to rewrite and simplify compound statements.
🗂️ Topics Covered
This lecture defines the biconditional operator (p ↔ q), presents its truth table, and provides examples evaluating biconditional statements as true or false. It covers ways to rephrase biconditional statements in English, shows the logical equivalence p ↔ q ≡ (p→q) ∧ (q→p), constructs truth tables for compound biconditional expressions, and logically shows equivalences like ~p ↔ q ≡ p ↔ ~q and ~(p⊕q) ≡ p↔q. Finally, it introduces key laws of logic (commutative, implication, exportation, equivalence, reductio ad absurdum) and applies them to rewrite statements without → or ↔, and to prove tautologies without truth tables.
📝 Lecture Summary
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.
🔑 Definition — Biconditional: A compound statement of the form “p if and only if q” that is true only when p and q have the same truth value.
📐 Formula: p ↔ q → “p if and only if q” — true when p and q are both true or both false.
TRUTH TABLE FOR p ↔ q
| p | q | p ↔ q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | T |
Remark:
- p ↔ q is true only when p and q both are true or both are false.
- p ↔ q is false when either p or q is false (i.e., when they have different truth values).
EXAMPLES: Identify which of the following are True or False?
- “1+1 = 3 if and only if earth is flat” → TRUE (both false)
- “Sky is blue iff 1 = 0” → FALSE (one true, one false)
- “Milk is white iff birds lay eggs” → TRUE (both true)
- “33 is divisible by 4 if and only if horse has four legs” → FALSE (one false, one true)
- “x > 5 iff x² > 25” → FALSE (counterexample: x = -6 makes x > 5 false but x² > 25 true)
💡 Why this matters: Biconditional statements express equivalence between conditions and are crucial for defining necessary and sufficient conditions in mathematics and logic.
REPHRASING BICONDITIONAL
p ↔ q is also expressed as:
- “p is necessary and sufficient for q”
- “If p then q, and conversely”
- “p is equivalent to q”
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 |
Since the columns for p↔q and (p→q)∧(q→p) have identical truth values, they are logically equivalent.
📌 Example: Rephrase statements in “p if and only if q” form:
- “If it is hot outside, you buy an ice cream cone, and if you buy an ice cream cone, it is hot outside.” → You buy an ice cream cone if and only if it is hot outside.
- “For you to win the contest it is necessary and sufficient that you have the only winning ticket.” → You win the contest if and only if you hold the only winning ticket.
- “If you read the newspaper every day, you will be informed and conversely.” → You will be informed if and only if you read the newspaper every day.
- “It rains if it is a weekend day, and it is a weekend day if it rains.” → It rains if and only if it is a weekend day.
- “The train runs late on exactly those days when I take it.” → The train runs late if and only if it is a day I take the train.
- “This number is divisible by 6 precisely when it is divisible by both 2 and 3.” → 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 |
The columns for p→q and ~q→~p have the same truth values, showing the biconditional is always true (a tautology).
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 |
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 |
Hence ~p ↔ q ≡ p ↔ ~q (identical truth values).
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 |
Hence ~(p⊕q) ≡ p↔q (identical truth values).
LAWS OF LOGIC:
- Commutative Law: p ↔ q ≡ q ↔ p
- Implication Laws: p → q ≡ ~p ∨ q ≡ ~(p ∧ ~q)
- Exportation Law: (p ∧ q) → r ≡ p → (q → r)
- Equivalence: p ↔ q ≡ (p→q) ∧ (q→p)
- Reductio ad absurdum: p → q ≡ (p ∧ ~q) → c
APPLICATION:
Example: Rewrite the statement forms without using the symbols → or ↔.
- p ∧ ~q → r
- (p → r) ↔ (q → r)
Solution:
-
p∧~q→r ≡ (p ∧ ~q) → r (Order of operations) ≡ ~(p ∧ ~q) ∨ r (Implication law)
-
(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) |
| ≡ | 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 |
| ≡ | 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:
- ~p → q
- p ∨ q
- q ↔ p
SOLUTION Hint: (p→q is false when p is true and q is false.)
- TRUE (p=T, q=F → ~p=F, so F→F is T)
- TRUE (p=T ∨ q=F → T)
- FALSE (p=T, q=F have different truth values)
⭐ Key Takeaways
The biconditional p↔q is true only when p and q share the same truth value (both true or both false), and it is logically equivalent to the conjunction of two conditionals: (p→q)∧(q→p). Biconditional statements can be rephrased as “p is necessary and sufficient for q” or “p is equivalent to q.” The negation of exclusive OR (⊕) yields the biconditional: ~(p⊕q) ≡ p↔q. Using logical equivalence laws (implication, De Morgan’s, double negation, commutative, associative, negation, and universal bound), any compound statement can be rewritten in forms using only ~ and ∧, or proven to be a tautology without constructing truth tables.
🧠 Quick Revision Questions
- Under what truth conditions is a biconditional statement p↔q true?
- Show that p↔q is logically equivalent to which conjunction of conditionals?
- Express “The train runs late on exactly those days when I take it” in “if and only if” form.
- Using logical laws (without truth tables), prove that ~(p→q) → p is a tautology.
- If p→q is false, what are the truth values of ~p→q, p∨q, and q↔p?
📘 Lecture 5 — Argument
📖 Overview: This lecture introduces the formal concept of an argument in logic, defining premises and conclusions, and establishing the criteria for validity and invalidity. It demonstrates how to use truth tables to test argument forms and applies these methods to word problems drawn from everyday reasoning, showing that even plausible-sounding arguments can be logically invalid.
🗂️ Topics Covered
The lecture begins with a motivating example about an interesting teacher. It then formally defines an argument, premises, and conclusion, followed by definitions of valid and invalid arguments and the concept of critical rows. Several examples of argument testing with truth tables are provided, including a demonstration of a valid argument form (modus ponens) and an invalid one (converse error). The remainder of the lecture is dedicated to applying this truth table method to a series of word problems, concluding with the analysis of the initial “interesting teacher” example.
📝 Lecture Summary
ARGUMENT
An argument is a list of statements called premises (or assumptions or hypotheses) followed by a statement called the conclusion.
P₁ Premise P₂ Premise P₃ Premise . . . . .. . . . . Pₙ Premise ∴ C Conclusion
The symbol ∴ is read “therefore” and is normally placed just before the conclusion.
🔑 Definition — Argument: A list of statements (premises) followed by a statement (the conclusion).
VALID AND INVALID ARGUMENT
An argument is valid if the conclusion is true when all the premises are true. Alternatively, an argument is valid if the conjunction of its premises implies the conclusion. That is, (P₁ ∧ P₂ ∧ P₃ ∧ . . . ∧ Pₙ) → C is a tautology.
An argument is invalid if the conclusion is false when all the premises are true. Alternatively, an argument is invalid if the conjunction of its premises does not imply the conclusion.
Critical Rows: The critical rows are those rows in a truth table where the premises have truth value T.
🔑 Definition — Valid Argument: An argument form where the conclusion is true in every critical row (rows where all premises are true). 🔑 Definition — Invalid Argument: An argument form where there is at least one critical row in which the conclusion is false. 🔑 Definition — Critical Rows: The rows in a truth table where all premises are true.
EXAMPLE: Show that the following argument form is valid:
p→q p ∴ q
p q | p→q | p | q T T | T | T | T ← critical row T F | F | T | F F T | T | F | T F F | T | F | F
Since the conclusion q is true when the premises p→q and p are true, it is a valid argument.
📐 Formula: (p→q) ∧ p → q is a tautology. 📌 Example: This is the classic valid argument form known as modus ponens (affirming the antecedent).
EXAMPLE: Show that the following argument form is invalid:
p→q q ∴ p
p q | p→q | q | p T T | T | T | T T F | F | F | T F T | T | T | F ← critical row F F | T | F | F
In the second critical row, the conclusion is false when the premises p→q and q are true. Therefore, the argument is invalid.
📌 Example: This is the classic invalid argument form known as the fallacy of the converse or converse error.
EXERCISE: Use truth table to determine the argument form
p ∨ q p → ~q p → r ∴ r
p q r | p∨q | p→~q | p→r | r T T T | T | F | T | T T T F | T | F | F | F T F T | T | T | T | T T F F | T | T | F | F ← critical row F T T | T | T | T | T F T F | T | T | T | F F F T | F | T | T | T F F F | F | T | T | F
In the third critical row, the conclusion is false when all the premises are true. Therefore, the argument is invalid.
WORD PROBLEM: Tariq and Hameed
If Tariq is not on team A, then Hameed is on team B. If Hameed is not on team B, then Tariq is on team A. ∴ Tariq is not on team A or Hameed is not on team B.
Let t = Tariq is on team A, h = Hameed is on team B.
The argument is: ~t → h ~h → t ∴ ~t ∨ ~h
t h | ~t→h | ~h→t | ~t∨~h T T | T | T | F ← critical row T F | T | T | T F T | T | T | T F F | F | F | T
The argument is invalid because there are three critical rows, and in the first critical row the conclusion has truth value F.
EXERCISE: Divisibility
If at least one of these two numbers is divisible by 6, then the product of these two numbers is divisible by 6. Neither of these two numbers is divisible by 6. ∴ The product of these two numbers is not divisible by 6.
Let d = at least one of these two numbers is divisible by 6, p = product of these two numbers is divisible by 6.
d p | d→p | ~d | ~p T T | T | F | F T F | F | F | T F T | T | T | F ← critical row F F | T | T | T
In the first critical row, the conclusion is false when the premises are true. Therefore, the argument is invalid.
📌 Example: The argument commits the fallacy of denying the antecedent. Even though the product might not be divisible by 6, it is not logically guaranteed by the premises.
EXERCISE: Stereo Purchase
If I got an Eid bonus, I’ll buy a stereo. If I sell my motorcycle, I’ll buy a stereo. ∴ If I get an Eid bonus or I sell my motorcycle, then I’ll buy a stereo.
Let e = I got an Eid bonus, s = I’ll buy a stereo, m = I sell my motorcycle.
e s m | e→s | m→s | e∨m | e∨m→s T T T | T | T | T | T T T F | T | T | T | T T F T | F | F | T | F T F F | F | T | T | F F T T | T | T | T | T F T F | T | T | F | T F F T | T | F | T | F F F F | T | T | F | T
The argument is valid because in the five critical rows, the conclusion is true.
📌 Example: This is a valid argument form known as proof by cases or constructive dilemma. Since either e or m is true (the disjunction), and each individually leads to s, the conclusion that e∨m implies s holds.
EXERCISE: The Interesting Teacher
An interesting teacher keeps me awake. I stay awake in Discrete Mathematics class. Therefore, my Discrete Mathematics teacher is interesting.
Let t = My teacher is interesting, a = I stay awake, m = I am in Discrete Mathematics class.
The argument to be tested is: t → a, a ∧ m ∴ m ∧ t
t a m | t→a | a∧m | m∧t T T T | T | T | T T T F | T | F | F T F T | F | F | T T F F | F | F | F F T T | T | T | F ← critical row F T F | T | F | F F F T | T | F | F F F F | T | F | F
In the second critical row, the conclusion is false when the premises are true. Therefore, the argument is invalid.
💡 Why this matters: This example shows that a convincing-sounding argument can be logically invalid. Even if an interesting teacher keeps you awake, and you are awake in class, the teacher of that class could be boring! You might be awake for another reason (e.g., you had coffee). Understanding logical validity helps us distinguish between good reasoning and plausible-sounding fallacies.
⭐ Key Takeaways
An argument consists of premises and a conclusion, and its validity depends not on the truth of the individual statements but on the logical structure connecting them. A valid argument guarantees that if all premises are true, the conclusion must be true; this is tested by checking that in every critical row of the truth table (where all premises are true), the conclusion is also true. An invalid argument fails this test — there is at least one situation where all premises are true but the conclusion is false. Identifying critical rows and carefully checking the conclusion’s truth value in each one is the fundamental method for determining validity. Many common reasoning errors, like the converse error (fallacy of the converse) and the inverse error (denying the antecedent), create plausible but invalid argument forms.
🧠 Quick Revision Questions
- Define an argument, a premise, and a conclusion in the context of formal logic.
- What are critical rows, and why are they essential for determining the validity of an argument?
- Explain the difference between a valid argument and an invalid argument. Can a valid argument have a false conclusion? Explain.
- Use a truth table to test the validity of the argument form: p → q, ~p ∴ ~q. Is it valid or invalid? What is this fallacy called?
- In the “Interesting Teacher” example, why is the argument invalid? Can you give a counterexample (a situation where the premises are true but the conclusion is false)?