Mathematical Logic
Easy Overview
Let's start with something that's basically the grammar of mathematics — mathematical logic. You know how every sentence in English can be true, false, or somewhere in between? In maths, we only care about sentences that are definitively true or false. No grey areas. No opinions. Just cold, hard truth values. And then we combine those sentences using words like 'and', 'or', 'not', 'if...then', and 'if and only if' to build more complex statements. Now, you might be thinking — why does this matter? Well, mathematical logic is the foundation of everything in computer science. Every time you type a condition in code — if (x > 5 && y < 10) — you're using logic. Every search engine, every AI model, every digital circuit — it all runs on logic gates that are built from these same principles. In fact, the computer you're reading this on uses millions of tiny logic gates that implement exactly the operations we're about to study. So when you master this chapter, you're not just learning maths — you're learning how computers think. The syllabus starts with understanding what a statement actually is, because not every sentence qualifies. Then we move to logical connectives — the glue that joins simple statements into compound ones. You'll meet the five main operators: conjunction (AND, written as ∧), disjunction (OR, ∨), negation (NOT, ∼), implication (IF...THEN, →), and biconditional (IF AND ONLY IF, ↔). Each has its own truth table — a systematic way to list every possible combination of truth values and see what the result is. Truth tables are your best friend in this chapter. They're predictable, logical, and once you understand the pattern, you can handle any compound statement. Then comes the fun part — tautologies (statements that are always true, like 'it is raining or it is not raining'), contradictions (always false), and contingencies (sometimes true, sometimes false). You'll also learn about logical equivalence — two statements that have the same truth table. This is incredibly powerful because it lets you replace a complicated statement with a simpler one that means the same thing. De Morgan's laws are the star players here: ∼(p ∧ q) ≡ ∼p ∨ ∼q and ∼(p ∨ q) ≡ ∼p ∧ ∼q. Think of them as the 'distribution of negation' rules. Then there's the algebra of statements — commutative, associative, distributive, identity, complement laws — it's like the algebra you already know, but with logic operators instead of plus and times. You'll also encounter quantifiers: 'for all' (∀) and 'there exists' (∃). These let you make statements about entire sets of objects. 'All humans are mortal' uses the universal quantifier. 'There exists a prime number greater than 100' uses the existential quantifier. Negating quantifiers can be tricky — the negation of 'all are' is 'some are not', and vice versa. Converse, inverse, and contrapositive are about flipping implications around. If the original statement is 'if p then q', the converse is 'if q then p', the inverse is 'if not p then not q', and the contrapositive is 'if not q then not p'. Here's a cool trick: a statement and its contrapositive are logically equivalent. So if you're stuck proving something, try proving its contrapositive instead. We also cover duality — where you swap ∧ with ∨ and T with F — and the principle of duality says that if a statement is a tautology, its dual is also a tautology. Finally, you'll see how all of this applies to switching circuits. Every logic gate in a circuit corresponds to a logical operation. AND gates, OR gates, NOT gates — they're the hardware implementation of what we're studying here. By the end of this chapter, you'll be able to take a real-world condition, translate it into symbolic logic, simplify it, and even design a circuit for it. That's not just maths — that's engineering.
What Is a Statement?
A statement (or proposition) is a declarative sentence that is either true or false, but not both. 'Mumbai is the capital of Maharashtra' is a statement (true). '7 is an even number' is a statement (false). 'Hello!' is not a statement — it's an exclamation. 'x > 5' is not a statement because it depends on x. But 'There exists an x such that x > 5' is a statement (true). Every statement has a truth value — either T (true) or F (false). No maybes allowed.
Logical Connectives — The Five Operators
Connectives join simple statements to make compound ones. There are five: Negation (∼) flips the truth — if p is T, ∼p is F. Conjunction (∧) means AND — p ∧ q is T only when both are T. Disjunction (∨) means OR — p ∨ q is T when at least one is T. Implication (→) means IF...THEN — p → q is F only when p is T and q is F. Biconditional (↔) means IF AND ONLY IF — p ↔ q is T when both have the same truth value. Each has its own truth table pattern.
Truth Tables — The Systematic Approach
A truth table lists all possible truth value combinations for the variables and shows the result. For n variables, you need 2ⁿ rows. Start with columns for each variable, then build up the compound expression step by step. For two variables p and q, the rows are: (T,T), (T,F), (F,T), (F,F). Fill in intermediate columns, then the final column. Truth tables can prove equivalence, identify tautologies, and check validity.
Tautology, Contradiction, and Contingency
A tautology is a statement that is always true regardless of the truth values of its components. Example: p ∨ ∼p — 'it is raining or it is not raining'. Always T. A contradiction is always false. Example: p ∧ ∼p. A contingency is neither — it's sometimes T, sometimes F depending on the variables. In exams, you'll often be asked to check which category a given compound statement falls into using truth tables.
Logical Equivalence
Two statements are logically equivalent if they have the same truth value in every possible scenario — i.e., their truth table columns match exactly. We write p ≡ q. This is powerful because you can replace a complex statement with a simpler equivalent one. For example, p → q ≡ ∼p ∨ q. The implication can be rewritten using OR and NOT. This equivalence is how computers implement 'if-then' without needing a special gate.
De Morgan's Laws
These are the most famous equivalences in logic: ∼(p ∧ q) ≡ ∼p ∨ ∼q and ∼(p ∨ q) ≡ ∼p ∧ ∼q. In words: the negation of 'p and q' is 'not p or not q'. The negation of 'p or q' is 'not p and not q'. Think of it as negation 'distributing' over the connective and flipping it. These are used constantly in programming, circuit design, and mathematical proofs. Memorise them — they're gold.
Algebra of Statements — The Laws
Just like numbers obey algebraic laws, logical statements do too. Commutative: p ∧ q ≡ q ∧ p, p ∨ q ≡ q ∨ p. Associative: (p ∧ q) ∧ r ≡ p ∧ (q ∧ r), same for ∨. Distributive: p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) and p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r). Identity: p ∧ T ≡ p, p ∨ F ≡ p. Complement: p ∧ ∼p ≡ F, p ∨ ∼p ≡ T. Idempotent: p ∧ p ≡ p, p ∨ p ≡ p. Absorption: p ∧ (p ∨ q) ≡ p. Use these to simplify compound statements.
Quantifiers — ∀ and ∃
Quantifiers turn open sentences (like 'x > 3') into statements. The universal quantifier ∀ means 'for all'. '∀x ∈ N, x > 0' means 'all natural numbers are positive' — true. The existential quantifier ∃ means 'there exists'. '∃x ∈ N, x < 0' means 'there exists a negative natural number' — false. Negating quantified statements: ∼(∀x, p(x)) ≡ ∃x, ∼p(x). The negation of 'all are' is 'some are not'. And ∼(∃x, p(x)) ≡ ∀x, ∼p(x). The negation of 'there exists' is 'none are'.
Converse, Inverse, and Contrapositive
Given an implication p → q: the converse is q → p, the inverse is ∼p → ∼q, and the contrapositive is ∼q → ∼p. Here's the key fact: p → q is logically equivalent to its contrapositive ∼q → ∼p. So if you need to prove 'if it rains, the ground gets wet', you can instead prove 'if the ground is dry, it did not rain'. The converse and inverse are NOT equivalent to the original — they're actually equivalent to each other (q → p ≡ ∼p → ∼q).
Duality
The dual of a compound statement is formed by swapping ∧ with ∨ and swapping T with F, but leaving ∼ unchanged. For example, the dual of p ∧ (q ∨ ∼p) is p ∨ (q ∧ ∼p). The principle of duality states: if a statement is a tautology, its dual is also a tautology. This means every logical law comes in a pair. If you know p ∧ T ≡ p, then by duality p ∨ F ≡ p is automatically true. It's like symmetry for logic.
Negation of Compound Statements
Negating compound statements follows patterns. ∼(∼p) ≡ p (double negation). ∼(p ∧ q) ≡ ∼p ∨ ∼q. ∼(p ∨ q) ≡ ∼p ∧ ∼q. ∼(p → q) ≡ p ∧ ∼q (the only time an implication fails is when the condition is true but the result is false). ∼(p ↔ q) ≡ (p ∧ ∼q) ∨ (∼p ∧ q) — which means 'one is true and the other is false'. Watch out for these in exams — they love asking 'what is the negation of this statement?'
Implication in Everyday Language
Implications hide in everyday language in many forms. 'If you study, you will pass' → p → q. 'You will pass only if you study' → also p → q (where p = 'you study', q = 'you pass' — careful with 'only if'). 'Unless you study, you will not pass' → ∼p → ∼q, which is equivalent to q → p or 'if you pass, you studied'. Translating English to logic is a key skill — look for trigger words like 'if', 'only if', 'unless', 'whenever'.
Validity of Arguments
An argument is valid if whenever the premises (given statements) are true, the conclusion must also be true. In logic terms: (p₁ ∧ p₂ ∧ ... ∧ pₙ) → c should be a tautology. If the implication is a tautology, the argument is valid. If not, it's invalid. Common valid argument forms: Modus Ponens (p → q, p, therefore q), Modus Tollens (p → q, ∼q, therefore ∼p), Hypothetical Syllogism (p → q, q → r, therefore p → r).
Switching Circuits and Logic Gates
Logic meets hardware here. In a switching circuit, switches can be open (0/F) or closed (1/T). Series connection = AND (both must be closed for current to flow). Parallel connection = OR (at least one closed). A closed switch with a ∼ is a NOT operation. You can represent any circuit symbolically, simplify using logical laws, and then draw an equivalent simpler circuit. This is literally how computer processors are designed at the gate level.
Application — Simplifying Circuits
Given a real-world switching circuit with multiple switches, you can write its symbolic form, simplify using De Morgan's, distributive law, etc., and then redraw a simpler circuit that does the same job. Fewer switches means less cost, less power, and higher reliability. This is the same optimisation that chip designers do when laying out billions of transistors on a processor.
Key Points
- •A statement must be objectively true or false — opinions, questions, and commands don't qualify
- •Five connectives: ∼ (not), ∧ (and), ∨ (or), → (if-then), ↔ (iff)
- •Truth tables list all 2ⁿ possible combinations — one row per combination
- •p → q is false ONLY when p is T and q is F — otherwise it's true
- •p ↔ q is true when p and q have the SAME truth value
- •Tautology = always true; Contradiction = always false; Contingency = neither
- •Two statements are logically equivalent if their truth table columns match exactly
- •De Morgan's Laws: ∼(p∧q) ≡ ∼p∨∼q and ∼(p∨q) ≡ ∼p∧∼q — memorize these
- •p → q ≡ ∼p ∨ q — implication can be rewritten using OR and NOT
- •∼(p → q) ≡ p ∧ ∼q — useful for negating 'if-then' statements
- •A statement and its contrapositive (∼q → ∼p) are logically equivalent
- •Converse (q → p) and inverse (∼p → ∼q) are equivalent to each other, NOT to the original
- •∀ = 'for all', ∃ = 'there exists'; ∼(∀x, p(x)) ≡ ∃x, ∼p(x)
- •Duality: swap ∧↔∨ and T↔F; if a statement is a tautology, its dual is too
- •Algebraic laws: commutative, associative, distributive, identity, complement, idempotent, absorption
- •In switching circuits: series = AND, parallel = OR, switch with bar = NOT
- •Modus Ponens: p→q, p ⇒ q; Modus Tollens: p→q, ∼q ⇒ ∼p
- •An argument is valid if (premises → conclusion) is a tautology
Practice Questions
- Prepare a truth table for (p → q) ∧ (q → p) and identify whether it is a tautology, contradiction, or contingency.
- Using logical equivalences, show that ∼(p → q) ≡ p ∧ ∼q.
- Write the negation of: 'If it rains, then the match will be cancelled'.
- Express the following in symbolic form and find its negation: 'All students are hardworking'.
- Simplify the switching circuit represented by (p ∧ q) ∨ (p ∧ ∼q) using logical laws and draw the equivalent circuit.
- Prove that p → (q ∨ r) ≡ (p → q) ∨ (p → r) using truth tables.
- State whether the following argument is valid: If I study, I will pass. I did not study. Therefore, I will not pass.
- Using duality, write the dual of: (p ∧ T) ∨ (q ∨ F) ≡ p ∨ q.