Loading lessons...
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.
| Sentence | Proposition? | 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
| Connective | Symbol | Read as | True when |
|---|---|---|---|
| Negation | ¬p | not p | p is F |
| Conjunction | p ∧ q | p and q | both T |
| Disjunction | p ∨ q | p or q | at least one T |
| Exclusive or | p ⊕ q | p xor q | exactly one T |
| Conditional | p → q | if p then q | F only when p = T, q = F |
| Biconditional | p ↔ q | p iff q | p and q have the same value |
Truth tables of the five basic connectives
| p | q | ¬p | p ∧ q | p ∨ q | p → q | p ↔ q |
|---|---|---|---|---|---|---|
| T | T | F | T | T | T | T |
| T | F | F | F | T | F | F |
| F | T | T | F | T | T | F |
| F | F | T | F | F | T | T |
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
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
| Name | Form | Equivalent to p → q? |
|---|---|---|
| Converse | q → 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
| English | Symbolic |
|---|---|
| p and q, p but q | p ∧ q |
| either p or q | p ∨ q |
| neither p nor q | ¬p ∧ ¬q |
| q whenever p, q when p | p → q |
| p only if q | p → 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)
| p | q | ¬q → ¬p | p → q | whole |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | F | F | T |
| F | T | T | T | T |
| F | F | T | T | T |
Every row is T, so the statement is a tautology (it says "the contrapositive implies the original").
📝 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.