Discrete Mathematics and Combinatorics

What Discrete Mathematics Covers and Why It Matters

A plain map of discrete mathematics: counting, logic, graphs, recursion and algorithms, with examples of where each one earns its keep.

Key takeaways

  • Discrete mathematics deals with separate, countable objects, while calculus deals with quantities that can change smoothly.
  • Its core areas are logic and proof, sets and relations, counting, graph theory, recursion and algorithms, with number theory close by.
  • Counting problems grow explosively, so a clever argument often replaces a list that no computer could finish.
  • Proof is central because a procedure must work for every input, including ones nobody has tested.

Discrete mathematics studies things that come in separate, distinct pieces: whole numbers, true or false statements, finite sets, networks of points and links, and step-by-step procedures. Its typical questions are "how many?", "is it possible?", "which arrangement is best?" and "will this procedure always finish with the right answer?"

It matters because a great deal of the modern world is built from separate pieces. A computer stores bits, a delivery route visits a list of addresses, and a timetable assigns classes to rooms. None of these can be halved smoothly forever, so they need their own tools.

Discrete versus continuous

A quantity is continuous when between any two of its values there are always more. The height of a growing plant or the temperature of a cooling cup behaves this way, at least in the usual mathematical model. Calculus is the main language for such quantities.

A quantity is discrete when its values are separated by gaps. The number of students in a room can be 30 or 31, with nothing in between. A light switch is on or off.

The boundary is not a wall. A digital photograph is a discrete grid of pixels that stands in for a smooth scene. Going the other way, mathematicians use calculus to estimate huge counts, and use counting to define probabilities that later feed into integrals.

Question Continuous version Discrete version
How fast does it change? Derivative Difference between neighboring terms
How much in total? Integral Sum over a list
What rule governs it? Differential equation Recurrence relation
What is the shortest way? Curve of least length Path through a network

Counting without listing

Combinatorics is the branch concerned with counting arrangements and selections. Say 20 people each shake hands once with everyone else. You could try to list the handshakes, or you could notice that each of the 20 people shakes 19 hands, and that this counts every handshake twice. The total is 20 × 19 ÷ 2 = 190.

The same habit of thought scales up. A password of 8 lowercase letters can be chosen in 26⁸ ways, which is 208,827,064,576, or about 2.1 × 10¹¹. You get that number from the multiplication rule in one line.

From there the subject branches into selections where order matters or does not, the sharing of identical objects among people, and methods for correcting double counts. A good starting point is permutations and combinations.

Combinatorics also proves that things exist. The pigeonhole principle guarantees that some box holds two objects whenever there are more objects than boxes, without saying which box.

The main areas of discrete mathematics
Separate objects Finite or countable things Algorithms Procedures and their cost Recursion Rules built on earlier cases Graphs Points joined by links Logic and proof What follows from what Sets Collections and relations Counting How many arrangements Separate objects Finite or countable things Logic and proof What follows from what Sets Collections and relations Counting How many arrangements Graphs Points joined by links Recursion Rules built on earlier cases Algorithms Procedures and their cost

Logic, sets and proof

Logic supplies the grammar. It studies statements that are true or false and the ways to combine them with "and", "or", "not" and "if ... then". The same operations describe the circuits inside a processor.

Sets are collections of objects, and a relation records which objects are connected in some way, such as "divides" among whole numbers or "is a prerequisite of" among courses. Functions are a special kind of relation that gives each input exactly one output. If these ideas are new, start with set theory basics.

Proof ties it together. Testing a claim on the first million whole numbers does not show it holds for all of them. Mathematical induction closes the gap: show the claim for a starting case, then show that each case forces the next.

Graphs and networks

In discrete mathematics a graph is a set of points, called vertices, together with links between pairs of them, called edges. It is a different thing from the graph of a function on coordinate axes.

Graphs model road maps, friendships, molecules, web pages and the order of tasks in a project. In 1736 Leonhard Euler showed that no walk could cross each of the seven bridges of Königsberg exactly once. His argument ignored distances and angles and looked only at what connected to what.

Typical graph questions include finding a shortest route, wiring a set of sites with the least cable, and coloring a map so neighboring regions differ. Some have fast methods. Others, though they sound just as simple, appear to be very hard. You can explore the basics in graph theory through familiar networks.

Recursion and algorithms

Recursion means defining or solving something in terms of smaller versions of itself. The factorial n!, the product of the whole numbers from 1 to n, can be defined by 0! = 1 and n! = n × (n − 1)!.

When a count satisfies a rule of this kind, you have a recurrence relation. Solving it gives a direct formula, and a tool called a generating function often does the job.

An algorithm is a finite list of precise steps that solves a problem. Discrete mathematics asks two things about it. Is it correct on every allowed input? How does its running time grow as the input gets larger? The second question is usually answered with big O notation.

Consider searching a sorted list of 1,000,000 names. Checking one at a time may need a million looks. Repeatedly halving the list needs about 20, because 2²⁰ is 1,048,576.

A worked example: the damaged chessboard

Here is a problem that shows the flavor of the subject. Remove two diagonally opposite corner squares from an ordinary 8 by 8 chessboard, leaving 62 squares. Can you cover them exactly with 31 dominoes, each covering two neighboring squares?

You could spend an afternoon trying, and a computer could search an enormous number of placements. A short argument settles it. Every domino covers one light square and one dark square, so 31 dominoes cover 31 of each.

Opposite corners have the same color. After removing them, the board has 32 squares of one color and 30 of the other. The covering is therefore impossible, however cleverly you arrange the pieces.

The coloring is an invariant, a feature that every legal move respects. Looking for one is among the most useful habits in discrete mathematics, and it is explored further in the trick of finding what never changes.

Arithmetic with whole numbers

Number theory overlaps heavily with discrete mathematics. Divisibility, prime numbers and remainders all concern whole numbers, with no values in between.

Modular arithmetic is the arithmetic of remainders. On a 12-hour clock, 5 hours after 9 o'clock is 2 o'clock, because 14 leaves a remainder of 2 on division by 12. The same wrap-around arithmetic underlies the check digits on book numbers and payment cards, which catch many typing errors.

It also drives hashing, a way of turning a long record into a short label that a program can use to decide where to store it. The pigeonhole principle explains why two different records must sometimes receive the same label, and why good software has to plan for that.

Where it shows up

Computer science leans on discrete mathematics at nearly every level, from circuit design to databases and compilers. Public-key cryptography rests on number theory, the study of whole numbers, and especially on arithmetic with remainders.

Operations research uses graphs and counting to plan routes, schedules and assignments. Biology uses them to compare genetic sequences and to draw family trees of species. Experimental scientists use combinatorial designs to arrange trials fairly.

Probability starts here too. When all outcomes are equally likely, a probability is a count of favorable outcomes divided by a count of all outcomes. Getting the two counts right is most of the work.

Common misconceptions

One mistake is to think that finite problems are easy because you could just check every case. The number of ways to order 20 distinct books is 20!, about 2.4 × 10¹⁸. Even at a billion orderings per second, listing them would take roughly 77 years. At 30 books the list becomes hopeless on any realistic timescale.

Another is to think that discrete mathematics is a grab bag of puzzles. The puzzles are real, and they are fun, but the methods behind them recur everywhere: matching two collections one for one, finding a quantity that never changes, or counting the same thing in two ways.

A third is that it requires heavy background. Much of it needs only arithmetic, some algebra and patience with careful reasoning. The difficulty lies in the thinking, which makes it a good first place to learn proof.

A sensible order of study

  1. Learn basic logic and set notation, so you can state claims precisely.
  2. Practice simple proofs, including induction and proof by contradiction.
  3. Work through counting rules with small examples you can check by listing.
  4. Move to graphs, drawing every example by hand.
  5. Study recurrences and algorithm growth, ideally while writing a few short programs.

At each stage, test your formulas on tiny cases. A formula that predicts 6 when you can list only 5 arrangements has told you something useful, and finding the missing assumption is how the subject sinks in.

Common questions

Is discrete mathematics harder than calculus?

It is different more than harder. Calculus courses often reward fluency with a set of techniques. Discrete courses ask you to read a problem closely, choose a method and justify it. Students who like puzzles often take to it quickly, while others need a few weeks to get used to writing arguments.

Do I need to know how to program?

No. Every core idea can be learned with pencil and paper. Programming helps you experiment, for instance by listing all the cases for small sizes and comparing them with a formula you have guessed.

Is all of it about finite things?

Not quite. It also treats infinite collections whose members can be listed one after another, such as the whole numbers. A statement proved by induction covers infinitely many cases, and generating functions pack an endless sequence into a single expression.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 45 articles in Discrete Mathematics and Combinatorics →

Latest news on this topic