The whole, before the parts

Discrete mathematics is what is left of mathematics when continuity is removed: finite and countable structures, counted and proved about rather than measured. It is the native mathematics of computation, because a computer's states are discrete, and it is the first place where proof becomes a working tool rather than a school exercise — induction in particular, which is the only way to say something about infinitely many cases in finite space. The subject divides into three jobs: proving, counting, and representing structure as a graph. Citation needed

Terminology and core concepts

  1. Sets, relations, functions

    The common vocabulary of the subject: a relation is a set of pairs, and a function is a relation that assigns exactly one output per input. Citation needed

    What is the cardinality of the power set of an n-element set?
    2ⁿ Citation needed
    What makes a function injective?
    distinct inputs give distinct outputs Citation needed
    What makes a function surjective?
    every element of the codomain is hit Citation needed
    What is a bijection?
    injective and surjective at once Citation needed
    What three properties define an equivalence relation?
    reflexive, symmetric, transitive Citation needed
    What does an equivalence relation induce on its set?
    a partition into classes Citation needed
  2. Proof techniques

    Three methods carry nearly every proof here: direct, contradiction, and induction — and knowing which to reach for is most of the skill. Citation needed

    What does a proof by contradiction assume?
    the negation of the claim, then derives an absurdity Citation needed
    What is the contrapositive of "if P then Q"?
    if not Q then not P Citation needed
    Is the contrapositive logically equivalent to the original?
    yes Citation needed
    Which part of induction establishes the first case?
    the base case Citation needed
    What must the inductive step prove?
    if the claim holds for n, it holds for n + 1 Citation needed
    What does the inductive step prove?
    that the claim at n forces it at n+1 Citation needed
    What does strong induction assume in the step?
    the claim for all smaller cases, not just the previous one Citation needed
    What is a counterexample enough to do?
    refute a universal claim outright Citation needed
  3. Counting

    Two rules — multiply independent choices, add exclusive cases — generate permutations and combinations; the hard part is deciding whether order matters. Citation needed

    What does the product rule count?
    sequences of independent choices, multiplied Citation needed
    How many ways to order n distinct items?
    n! Citation needed
    What does C(n,k) count?
    unordered k-subsets of n items Citation needed
    What is the formula for C(n,k)?
    n! / (k!(n-k)!) Citation needed
    Why is C(n,k) = C(n,n-k)?
    choosing what to keep is choosing what to leave Citation needed
    When do you use permutations rather than combinations?
    when order distinguishes the outcomes Citation needed
    How many binary strings of length n are there?
    2ⁿ Citation needed
  4. Inclusion–exclusion and pigeonhole

    Two counting arguments with outsized reach: one corrects for double-counting, the other proves existence without constructing anything. Citation needed

    What is the inclusion–exclusion formula for two sets?
    |A ∪ B| = |A| + |B| - |A ∩ B| Citation needed
    What does the pigeonhole principle state?
    n+1 items in n boxes force a box with two Citation needed
    What kind of conclusion does pigeonhole give?
    existence, with no construction Citation needed
    Why must 13 people share a birth month?
    13 items, 12 boxes Citation needed
  5. Recurrences

    A recurrence defines a sequence by its own earlier terms, which is what a recursive algorithm's cost looks like written down. Citation needed

    What is a recurrence relation?
    a definition of each term from earlier ones Citation needed
    What recurrence defines the Fibonacci sequence?
    F(n) = F(n-1) + F(n-2) Citation needed
    What does a closed form give you that a recurrence does not?
    the term without computing all the earlier ones Citation needed
    What is the recurrence for binary search's comparison count?
    T(n) = T(n/2) + 1 Citation needed
  6. Graphs

    A graph is vertices plus edges, and that is enough to model roads, dependencies, friendships, and circuits — which is why graph theorems pay off far outside mathematics. Citation needed

    What is the degree of a vertex?
    the number of edges meeting it Citation needed
    What does the handshake lemma state?
    the degrees sum to twice the number of edges Citation needed
    What is a tree?
    a connected graph with no cycles Citation needed
    How many edges does a tree on n vertices have?
    n - 1 Citation needed
    When does a connected graph have an Euler circuit?
    when every vertex has even degree Citation needed
    What is a bipartite graph?
    one whose vertices split into two sides with no edge inside a side Citation needed
    What does a topological order require of a graph?
    that it be directed and acyclic Citation needed
  7. Modular arithmetic

    Arithmetic on remainders is a consistent system in its own right, and it is the arithmetic hashing, checksums, and public-key cryptography run on. Citation needed

    What does a ≡ b (mod n) mean?
    n divides a - b Citation needed
    What is 17 mod 5?
    2 Citation needed
    When does a have a multiplicative inverse mod n?
    when gcd(a,n) = 1 Citation needed
    What does Fermat's little theorem state for prime p?
    ap-1 ≡ 1 (mod p) when p does not divide a Citation needed
    What does the Euclidean algorithm compute?
    the GCD, by repeated remainder Citation needed
  8. Boolean algebra

    The algebra of true and false, identical in structure to propositional logic and to the gates in a circuit. Citation needed

    What does De Morgan's law say about ¬(A ∧ B)?
    it equals ¬A ∨ ¬B Citation needed
    Which Boolean operation is equivalent to implication?
    ¬A ∨ B Citation needed
    How many rows does a truth table with n variables have?
    2ⁿ Citation needed
    What is a tautology?
    a formula true under every assignment Citation needed
  9. Asymptotic growth

    Big-O discards constants to compare how cost grows, which is the only comparison that survives faster hardware. Citation needed

    What does O(f) bound?
    growth from above, up to a constant factor Citation needed
    Which grows faster, n log n or n²?
    n² Citation needed
    What is the complexity of binary search?
    O(log n) Citation needed
    Why are constant factors dropped?
    they do not change which function eventually dominates Citation needed

Problems that prove it

  1. Prove by induction that 1 + 2 + … + n = n(n+1)/2.

    Drills: the shape of an induction proof, which never varies.

    Derivation steps
    1. Base case n = 1: left side 1, right side 1(2)/2 = 1. ✓
    2. Assume it holds for n = k: 1 + … + k = k(k+1)/2.
    3. Add k+1 to both sides: k(k+1)/2 + (k+1).
    4. Factor: (k+1)(k/2 + 1) = (k+1)(k+2)/2.
    5. That is the formula at n = k+1, so it holds for all n ≥ 1.

    Citation needed

  2. Prove that √2 is irrational.

    Drills: contradiction, plus unique factorisation doing real work.

    Derivation steps
    1. Suppose √2 = p/q in lowest terms.
    2. Then p² = 2q², so p² is even, so p is even.
    3. Write p = 2m: then 4m² = 2q², so q² = 2m², so q is even too.
    4. But p/q was in lowest terms — contradiction.
    5. So no such fraction exists.

    Citation needed

  3. How many five-card hands from a 52-card deck contain exactly two aces?

    Drills: splitting a count into independent choices, order not mattering.

    Derivation steps
    1. Choose 2 of the 4 aces: C(4,2) = 6.
    2. Choose 3 of the 48 non-aces: C(48,3) = 17,296.
    3. The choices are independent, so multiply: 6 × 17,296 = 103,776.
    4. Sanity check: it is a small fraction of C(52,5) = 2,598,960, about 4%. ✓

    Citation needed

  4. Of 100 students, 60 study French, 45 study German, and 20 study both. How many study neither?

    Drills: inclusion–exclusion, then complementing.

    Derivation steps
    1. Either language: 60 + 45 - 20 = 85.
    2. Neither: 100 - 85 = 15.
    3. The subtraction of 20 is the whole point — without it the 20 are counted twice.

    Citation needed

  5. Prove that in any group of six people, some three are mutual acquaintances or some three are mutual strangers.

    Drills: pigeonhole on a graph — existence without construction.

    Derivation steps
    1. Model people as vertices, acquaintance as a red edge, strangeness as blue; every pair gets one colour.
    2. Pick a person; they have five edges, so by pigeonhole at least three share a colour — say red, to A, B, C.
    3. If any pair among A, B, C is red, that pair plus the original person is a red triangle.
    4. If no pair among them is red, then A, B, C form a blue triangle.
    5. Either way a monochromatic triangle exists. (This is the Ramsey number R(3,3) = 6.)

    Citation needed

  6. Show that the Königsberg bridge walk is impossible, given the degrees 3, 3, 3, 5.

    Drills: applying the Euler condition instead of searching for a route.

    Derivation steps
    1. An Euler circuit needs every vertex even; an Euler path allows exactly two odd.
    2. Each visit to a landmass uses one edge in and one out, pairing its edges.
    3. Here all four vertices are odd, which is more than two.
    4. So no walk crosses every bridge exactly once — no case-by-case search needed.

    Citation needed

  7. Find the multiplicative inverse of 7 modulo 26.

    Drills: the Euclidean algorithm run backwards, the step behind RSA key generation.

    Derivation steps
    1. gcd(7,26) = 1, so an inverse exists.
    2. Euclid: 26 = 3(7) + 5; 7 = 1(5) + 2; 5 = 2(2) + 1.
    3. Back-substitute: 1 = 5 - 2(2) = 5 - 2(7 - 5) = 3(5) - 2(7).
    4. And 5 = 26 - 3(7), so 1 = 3(26) - 11(7).
    5. So -11 × 7 ≡ 1 (mod 26), and -11 ≡ 15. Check: 7 × 15 = 105 = 4(26) + 1. ✓

    Citation needed

  8. Solve T(n) = 2T(n/2) + n with T(1) = 1, and name the algorithm it describes.

    Drills: unrolling a recurrence into a closed form.

    Derivation steps
    1. Unroll once: T(n) = 2[2T(n/4) + n/2] + n = 4T(n/4) + 2n.
    2. After k levels: T(n) = 2ᵏT(n/2ᵏ) + kn.
    3. Recursion bottoms out at k = log₂n, where 2ᵏ = n.
    4. So T(n) = n + n log₂n, which is O(n log n).
    5. That is merge sort: each level does n work and there are log n levels.

    Citation needed

Sources

  • Kenneth Rosen, Discrete Mathematics and Its Applications — the standard reference for the counting and graph material.
  • Lehman, Leighton and Meyer, Mathematics for Computer Science (MIT 6.042, free) — proof technique taught as a craft.
  • Graham, Knuth and Patashnik, Concrete Mathematics — recurrences and sums, well past this level.

Learning path

Continue through Mathematics in order, using the concepts above to connect this topic to the next.