Chapter 12
Discrete Mathematics
Binary operations and mathematical logic.
1. What discrete mathematics studies
Continuous mathematics deals with the real line, where between any two numbers there are uncountably many more. Discrete mathematics instead works with sets whose elements are separated — finite sets, or countably infinite ones like . Its elements can be listed as a sequence with gaps between them, which is exactly why it underpins computer science and logic.
This chapter covers two pillars of discrete mathematics: binary operations (the abstract study of "combining two things to get a third") and mathematical logic (the abstract study of true/false reasoning).
2. Binary operations and closure
Addition, subtraction and multiplication all share a common shape: you feed in two elements of a set and get back a single element. Discrete mathematics makes this idea precise with the notion of a binary operation.
A binary operation on a non-empty set is a rule that assigns to every ordered pair with exactly one element , and crucially that result again lies in .
The requirement that stays inside is called closure. It is built into the definition — if the output ever escapes , then is simply not a binary operation on . So the very first thing to check is always: does the output land back in the set?
- and are binary on — sums and products never leave these sets.
- is binary on but NOT on : .
- is NOT binary on (e.g. ); it is binary on , since dividing by is undefined.
- Matrix addition and multiplication are binary on the set of all real matrices.
3. Commutative and associative properties
Once is a binary operation on , we ask what algebraic laws it obeys. The first two are about the order and grouping of the inputs.
is commutative if for all — the order of the two inputs does not matter.
is associative if for all — when combining three elements, how you bracket them does not matter.
4. Identity and inverse elements
The next two properties are about special elements — one that does nothing, and, for each element, one that undoes it.
An element is an identity for if for every . For example is the identity for and is the identity for .
If an identity exists, then is an inverse of when , written . Under the inverse of is ; under the inverse of is .
5. Operation tables and modular arithmetic
When a set is finite, a binary operation can be displayed completely as a Cayley table (operation table): the entry in row , column is . The table lets us read off every property by eye.
Fix a modulus . We write when is a multiple of ; here is the remainder when is divided by . On define as the remainder of on division by .
For example, and . Here is the full Cayley table for on :
| +₅ | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 2 | 3 | 4 |
| 1 | 1 | 2 | 3 | 4 | 0 |
| 2 | 2 | 3 | 4 | 0 | 1 |
| 3 | 3 | 4 | 0 | 1 | 2 |
| 4 | 4 | 0 | 1 | 2 | 3 |
6. Mathematical logic: statements
Logic studies reasoning through symbols. Its atoms are statements (also called propositions).
A statement is a declarative sentence that is either true or false, but not both. Its truth value is (true) or (false).
- "" is a statement (true). " is even" is a statement (false).
- "Chennai is in Tamil Nadu" is a statement (true). "Peacock is our national bird" is a statement (true).
- "Close the door." (a command), "What time is it?" (a question) and "" (depends on ) are NOT statements.
A statement built from a single idea is a simple statement; combining simple statements with connectives gives a compound statement. We name simple statements with propositional variables
7. Logical connectives and their truth tables
Connectives let us build every compound statement, and each is defined completely by a truth table listing the output for every combination of inputs. A formula with variables needs rows.
- Negation ("not ") — reverses the truth value.
- Conjunction (" and ") — true only when both are true.
- Disjunction (" or ") — false only when both are false (inclusive or).
- Conditional ("if then ") — false only when is true and is false.
- Biconditional (" if and only if ") — true exactly when and have the same truth value.
- Exclusive or — true when exactly one of is true (not both).
8. Constructing truth tables for compound statements
To evaluate a compound statement, add one column per sub-expression, working outward from the innermost pieces, and fill each column using the connective definitions.
9. Conditional: converse, inverse, contrapositive
From a conditional we derive three related statements. Only one of them is always logically equivalent to the original.
- Converse: (swap hypothesis and conclusion).
- Inverse: (negate both).
- Contrapositive: (swap AND negate) — this one is equivalent to .
10. Tautology, contradiction, contingency
Look at the final column of a compound statement's truth table. Exactly three cases can occur.
True for every assignment of truth values — the whole final column is . Denoted . Example: .
False for every assignment — the whole final column is . Denoted . Example: .
Neither a tautology nor a contradiction — the final column mixes and . Example: .
11. Logical equivalences and De Morgan's laws
Two statements are logically equivalent, written , when their truth-table columns are identical in every row. Equivalently, means is a tautology.
The equivalences worth memorising:
12. The duality principle
Many logical equivalences come in mirror-image pairs. The duality principle explains why.
The dual of a compound statement is obtained by interchanging with , and with , while leaving negations and the variables unchanged.
Principle: if two statements are logically equivalent, then so are their duals. This is exactly why De Morgan's two laws, and the two distributive laws, always appear together — each is the dual of the other. Also, the dual of a dual returns the original statement.
- The dual of is .
- The dual of is .
- The dual of is — note is untouched.