Discrete Mathematics
1. Propositional and Predicate Logic
1.1 Propositional Logic
A proposition is a statement that is either true or false. Propositional logic deals with propositions and their combinations using logical connectives.
Basic connectives:
| Symbol | Name | Meaning |
|---|---|---|
| Negation | NOT | |
| Conjunction | AND | |
| Disjunction | OR | |
| Implication | IF...THEN | |
| Biconditional | IF AND ONLY IF |
Truth tables. The implication is false only when is true and is false.
Logical equivalence. Two propositions are logically equivalent () if they have the same truth value for all assignments.
Important equivalences:
- (De Morgan)
- (De Morgan)
1.2 Predicate Logic
Predicates extend propositional logic with variables and quantifiers.
- Universal quantifier: -- " holds for all ."
- Existential quantifier: -- "there exists such that holds."
Negation of quantifiers:
Nested quantifiers must be read carefully. The order matters:
The first says "for every there is a (possibly different) ." The second says "there exists a single that works for all ."
1.3 Validity and Satisfiability
A formula is valid (a tautology) if it is true under all interpretations. A formula is satisfiable if it is true under at least one interpretation.
Theorem 1.1. A formula is valid if and only if its negation is unsatisfiable.
2. Sets, Relations, and Functions
2.1 Sets
Basic operations:
- Union:
- Intersection:
- Difference:
- Complement: (where is the universal set)
De Morgan's Laws:
Power set: . If , then .
2.2 Relations
A binary relation from set to set is a subset of .
A relation on is:
- Reflexive: , .
- Symmetric: .
- Antisymmetric: and .
- Transitive: and .
Equivalence relation: reflexive, symmetric, transitive. Partitions the set into equivalence classes.
Partial order: reflexive, antisymmetric, transitive. Written .
2.3 Functions
A function is a relation where each appears exactly once as a first element.
- Injective (one-to-one): .
- Surjective (onto): for every , there exists with .
- Bijective: both injective and surjective.
Theorem 2.1. If and are finite sets, is:
- Injective if and only if .
- Surjective if and only if .
- Bijective if and only if .
Theorem 2.2 (Pigeonhole Principle). If , then no function is injective. Equivalently, placing items into boxes with forces at least one box to contain at least items.
3. Proof Techniques
3.1 Direct Proof
To prove : assume , derive by a chain of logical deductions.
Example. Prove: if is odd, then is odd.
Proof. Let . Then , which is odd.
3.2 Proof by Contrapositive
To prove : prove instead.
Example. Prove: if is even, then is even.
Proof. Contrapositive: if is odd, then is odd. This was proved above.
3.3 Proof by Contradiction
To prove : assume and derive a contradiction.
Example (Euclid). There are infinitely many primes.
Proof. Suppose there are finitely many primes . Consider . is not divisible by any (it leaves remainder 1). So is either prime itself or has a prime factor not in the list. Either way, the list was incomplete. Contradiction.
3.4 Mathematical Induction
Principle of Mathematical Induction. To prove for all :
- Base case: Prove .
- Inductive step: Prove for all .
Strong Induction. The inductive step uses to prove .
Example. Prove: for all .
Proof. Base case: : . True.
Inductive step: Assume . Then
3.5 Structural Induction
For recursively defined structures (lists, trees, formulas), prove a property by induction on the structure:
- Base cases (empty list, leaf node, atomic formula).
- Inductive cases (cons, node with children, compound formula).
4. Combinatorics
4.1 Counting Principles
Rule of Sum. If task can be done in ways and task in ways, and they cannot both be done, then or can be done in ways.
Rule of Product. If task can be done in ways and task in ways independently, then and together can be done in ways.
4.2 Permutations and Combinations
Permutations: -- ordered arrangements of items from .
Combinations: -- unordered selections of items from .
Theorem 4.1 (Binomial Theorem).
Theorem 4.2 (Pascal's Identity).
Proof. Every -subset of either contains (giving ways to choose the remaining ) or does not contain (giving ways to choose all from ).
4.3 Inclusion-Exclusion Principle
Theorem 4.3 (Inclusion-Exclusion). For finite sets :
Worked Example. How many integers from 1 to 1000 are not divisible by 2, 3, or 5?
Let = multiples of 2, = multiples of 3, = multiples of 5.
, , .
, , .
.
.
Not divisible by 2, 3, or 5: .
4.4 Stars and Bars
Theorem 4.4. The number of ways to distribute identical objects into distinct bins is .
Proof. The problem is equivalent to placing dividers among objects, giving arrangements.
5. Graph Theory
5.1 Definitions
A graph consists of a set of vertices and a set of edges .
- Simple graph: no loops, no multiple edges.
- Directed graph (digraph): edges have direction.
- Weighted graph: edges have weights.
The degree of a vertex , , is the number of edges incident to .
Theorem 5.1 (Handshaking Lemma). .
Proof. Each edge contributes 1 to the degree of each of its two endpoints.
Corollary 5.2. The number of vertices of odd degree is even.
5.2 Paths, Cycles, and Connectivity
A walk is a sequence of vertices where consecutive vertices are adjacent. A path is a walk with no repeated vertices. A cycle is a path that returns to its starting vertex.
A graph is connected if there is a path between every pair of vertices. A connected component is a maximal connected subgraph.
Theorem 5.3. A graph with vertices and more than edges is connected.
5.3 Trees
A tree is a connected acyclic graph. A forest is a disjoint union of trees.
Theorem 5.4. For a graph with vertices, the following are equivalent:
- is a tree.
- is connected and has edges.
- is acyclic and has edges.
- Between any two vertices, there is exactly one path.
Cayley's Formula. The number of labelled trees on vertices is .
5.4 Planarity
A graph is planar if it can be drawn in the plane with no edge crossings.
Theorem 5.5 (Euler's Formula for Planar Graphs). For a connected planar graph drawn in the plane with vertices, edges, and faces:
Corollary 5.6. For a simple planar graph with : .
Corollary 5.7. and are not planar.
Theorem 5.8 (Kuratowski's Theorem). A graph is planar if and only if it does not contain a subdivision of or as a subgraph.
5.5 Graph Colouring
A proper -colouring assigns one of colours to each vertex such that adjacent vertices have different colours. The chromatic number is the minimum for which a proper -colouring exists.
Theorem 5.9 (Four Colour Theorem). Every planar graph is 4-colourable.
Theorem 5.10 (Five Colour Theorem). Every planar graph is 5-colourable. (Easier to prove.)
Theorem 5.11 (Greedy Colouring Bound). where is the maximum degree.
5.6 Euler and Hamilton Paths
An Euler path visits every edge exactly once. An Euler circuit is an Euler path that starts and ends at the same vertex.
Theorem 5.12. A connected graph has an Euler circuit if and only if every vertex has even degree. It has an Euler path (but not circuit) if and only if exactly two vertices have odd degree.
A Hamilton path visits every vertex exactly once. A Hamilton circuit is a Hamilton path that returns to the start.
Theorem 5.13 (Dirac's Theorem). If is a simple graph with vertices and for every vertex, then has a Hamilton circuit.
Determining whether a graph has a Hamilton path/circuit is NP-complete in general, whereas Euler paths/circuits can be determined in polynomial time using the degree condition. Do not confuse the two.
6. Recurrence Relations
6.1 Definition
A recurrence relation defines a sequence by expressing in terms of previous terms.
Example. Fibonacci: , with , .
6.2 Linear Homogeneous Recurrences with Constant Coefficients
Solution method. Form the characteristic equation:
Case 1 (distinct roots). If are distinct, then .
Case 2 (repeated roots). If has multiplicity , the contribution is .
6.3 Worked Example
Problem. Solve with , .
Solution. Characteristic equation: , giving , .
.
From initial conditions:
Solving: , . So .
6.4 Generating Functions
The generating function of a sequence is
Example. The generating function for (all ones) is .
Example. The generating function for is .
Generating functions can solve recurrences by converting them to algebraic equations in , then extracting coefficients.
Generating functions are formal power series; they may not converge for any . Convergence is irrelevant for combinatorial applications -- the series is manipulated algebraically.