Lesson 2 +25 XP

Propositional Logic, Connectives & Translation

Propositional Logic, Connectives & Translation

Logic gives us a precise way to decide whether an argument is correct. It is the foundation of circuit design, program verification and database queries.

1. Propositions

A proposition is a declarative sentence that is either true (T) or false (F), but not both.

SentenceProposition?Truth value
4 is even.✅T
5 ∈ {1, 6, 7}✅F
5 + 7 = 13✅F
Sheetal is my name.✅T or F (definite for the speaker)
Is this true?❌ question-
Buy two tickets.❌ command-
x + y > 2❌ value depends on x, y (a predicate)-

Propositions are named with variables p, q, r, …. A proposition built from others with connectives is compound.

2. Logical Connectives

ConnectiveSymbolRead asTrue when
Negation¬pnot pp is F
Conjunctionp ∧ qp and qboth T
Disjunctionp ∨ qp or qat least one T
Exclusive orp ⊕ qp xor qexactly one T
Conditionalp → qif p then qF only when p = T, q = F
Biconditionalp ↔ qp iff qp and q have the same value

Truth tables of the five basic connectivesTruth tables of the five basic connectives

pq¬pp ∧ qp ∨ qp → qp ↔ q
TTFTTTT
TFFFTFF
FTTFTTF
FFTFFTT

Examples.

  • "6 + 2 = 7 and 4 + 4 = 8" → F ∧ T = F
  • "A cow is an animal and can fly" → T ∧ F = F
  • "5 < 5 or 5 < 6" → F ∨ T = T
💡 Tip

p → q is vacuously true whenever p is false. "If pigs fly, I am the king" is a true proposition.

3. Operator Precedence

¬ (highest) → ∧ → ∨ → → → ↔ (lowest). So ¬p ∧ q → r means ((¬p) ∧ q) → r. The conditional is right-associative: p → q → r means p → (q → r).

4. Ways to Read p → q

if p then q · p implies q · q if p · q whenever p · p only if q · p is sufficient for q · q is necessary for p · q follows from p.

Converse, Inverse, Contrapositive

NameFormEquivalent to p → q?
Converseq → p❌
Inverse¬p → ¬q❌
Contrapositive¬q → ¬p✅

The converse and inverse are equivalent to each other.

Example. "If a quadrilateral is a square, then it is a rectangle."

  • Converse: If it is a rectangle, then it is a square. (False)
  • Inverse: If it is not a square, then it is not a rectangle. (False)
  • Contrapositive: If it is not a rectangle, then it is not a square. (True)

5. Translating English to Logic

EnglishSymbolic
p and q, p but qp ∧ q
either p or qp ∨ q
neither p nor q¬p ∧ ¬q
q whenever p, q when pp → q
p only if qp → q
p unless q¬q → p (equivalently p ∨ q)
p is necessary but not sufficient for q(q → p) ∧ ¬(p → q)

> "Unless" means "if not". Replace "unless" by "if not" and translate.

Solved 1. "I will go for a run unless it rains." Let p: It rains, q: I will go for a run. "q if not p" → ¬p → q.

Solved 2. "The election is not decided unless the votes have been counted." Let p: The election is decided, q: The votes have been counted. "¬p if not q" → ¬q → ¬p (whose contrapositive is p → q: a decided election implies counted votes).

Solved 3. "Only if Mohan works hard will he pass the test." p: Mohan works hard, q: Mohan passes → q → p.

6. Negating Statements

  • ¬(p → q) ≡ p ∧ ¬q. Negation of "If she studies, she will pass" is "She studies and she does not pass."
  • Quantifier words: negation of "All students are good" is "Some students are not good"; negation of "Some animals can fly" is "No animal can fly".

7. Building Truth Tables

For n variables there are 2ⁿ rows. Example: (¬q → ¬p) → (p → q)

pq¬q → ¬pp → qwhole
TTTTT
TFFFT
FTTTT
FFTTT

Every row is T, so the statement is a tautology (it says "the contrapositive implies the original").

🎯 END-TERM EXAM PREP

📝 IPU End-Term Exam Corner (5-10 Marks)

  • Q1. Write the converse, inverse and contrapositive of "If n is prime then n is odd or n = 2". (5 Marks)
  • Write: converse: odd or 2 → prime; inverse: not prime → not odd and n ≠ 2; contrapositive: n even and n ≠ 2 → not prime. Only the contrapositive is equivalent.
  • Q2. Translate using "unless": "I will go for a run unless it rains". (2.5 Marks)
  • Write: define p, q; unless = if not; answer ¬p → q.
  • Q3. Construct the truth table for (p ∧ q) → (p ∨ q). (5 Marks)
  • Write: 4 rows, all T → tautology.