Search topics and sections

Discrete mathematics is the branch of mathematics that studies objects with separate, distinct values. Examples are whole numbers, networks of dots and lines, and statements that are either true or false.[1][2] It stands in contrast to continuous mathematics, such as Calculus, which deals with quantities that can vary smoothly.[1]

The field includes counting (Combinatorics), networks (graph theory), Logic, parts of number theory, and the theory of computation.[1][3] Digital computers store and process data in separate units, so discrete mathematics has become the mathematical language of computer science.[1][3]

Discrete and continuous

Discrete objects come in separate pieces with gaps between them. Between any two numbers in an interval of real numbers there are infinitely many more, but between neighboring integers such as 2 and 3 there is no other integer.[4][1] Discrete objects can often be described by integers, while continuous objects need real numbers.[1]

Continuous versus discrete number linesContinuous (real numbers)012345Discrete (integers)012345nothing between 2 and 3
A continuous set such as the real numbers fills every point of an interval, while a discrete set such as the integers has separate values with gaps between them.

Everyday examples show the difference. The number of children a person has can be 0, 1, 2, or 3, but never 1.32419.[4] A digital clock jumps from 12:00 to 12:01 with no time in between, while the hands of an analog clock sweep through every value.[3]

Countable sets

In more precise terms, discrete mathematics deals with countable sets.[5] A set is countable if it is finite or countably infinite, which means its elements can be counted one at a time, even if the counting never ends.[5] The size of a set, finite or infinite, is called its Cardinality.[6]

Being countable does not require gaps. Between any two rational numbers there is always another rational number, yet the rational numbers can still be counted one at a time.[7] The integers and the rational numbers are both countably infinite, so discrete mathematics studies infinite sets as well as finite ones.[5]

Main areas

Discrete mathematics is not one subject but a broad group of related ones, with no single agreed definition.[3][4] Common areas include:

  • Logic: statements that are either true or false, and the rules for combining them.[2]
  • Sets, relations, and functions, the basic objects listed first in the standard computer science curriculum.[8]
  • Combinatorics: how discrete objects combine, and how to count the ways they can do so.[1][4]
  • Graph theory: networks of points (vertices) joined by lines (edges).[9]
  • Number theory topics such as recurrence relations and congruences.[1] Congruences belong to modular arithmetic, the arithmetic of remainders after division.[10] Two integers are congruent modulo mm when their difference is divisible by mm; on a 12-hour clock, for example, 10+5≡3(mod12)10 + 5 \equiv 3 \pmod{12}.[11]
  • Sequences of numbers and how to describe them.[4]
  • Discrete probability, where outcomes can be listed one by one (see discrete probability distribution).[8]
  • The theory of computation, including algorithms and abstract machines called automata.[1]

Other subjects, including abstract algebra, game theory, probability, and geometry, have discrete parts. Probability and geometry also have continuous versions; discrete geometry is the discrete side of geometry.[4]

Three kinds of problems

Problems in the field fall roughly into three kinds.[3]

Kind Question it asks Example
Existence Is there a solution at all? Can a walk cross each bridge of a city exactly once?
Counting How many solutions are there? How many handshakes happen when 10 people each shake hands once?
Optimization Which solution is best? Which of many possible routes is shortest?

The study of optimization over discrete choices is called combinatorial optimization.

Basic tools

A few methods appear throughout the field. They are the logic of true-or-false statements, rules for counting, proof methods built for whole numbers, and recurrence relations.

Logic

A statement is a sentence that is either true or false.[2] Words such as "and", "or", "not", and "if ... then", called connectives, join statements into larger ones.[2] The truth of the larger statement depends only on whether its parts are true, not on what they say.[2]

The truth table below lists every case for two statements PP and QQ, with T for true and F for false.[2]

PP QQ PP and QQ PP or QQ if PP then QQ not PP
T T T T T F
T F F T F F
F T F T T T
F F F F T T

In mathematics "or" is inclusive, so "PP or QQ" is true when both parts are true.[2] An "if PP then QQ" statement is false in only one case, when PP is true and QQ is false.[2] Rules like these underlie Boolean algebra.

Counting

Many problems ask how many ways something can happen. The number of ways to choose kk objects from nn different objects, ignoring order, is the binomial coefficient:[12]

(nk)=n!k! (n−k)!\binom{n}{k} = \frac{n!}{k!\,(n-k)!}

Here nn and kk are integers with 0≤k≤n0 \le k \le n, and n!n! ("nn factorial") is the product n×(n−1)×⋯×1n \times (n-1) \times \cdots \times 1, with 0!=10! = 1.[12] For example, if 10 people each shake hands once with every other person, there are (102)=45\binom{10}{2} = 45 handshakes.[9]

Counts grow very fast. The number of ways to choose 100 students from 400 is greater than the number of atoms in the known universe, so checking every choice one by one is hopeless.[13]

Pigeonhole principle

The pigeonhole principle says that if more than nn pigeons go into nn holes, at least one hole holds at least two pigeons.[14][15] It proves that something must exist without saying where. For example, among any 13 people, at least two were born in the same month, because there are only 12 months.[15]

Pigeonhole principle with four pigeons and three holes12344 pigeons, 3 holeshole 1hole 2hole 3
The pigeonhole principle with n=3n = 3: when n+1=4n + 1 = 4 pigeons go into 33 holes, at least one hole holds two pigeons.

Mathematical induction

Mathematical induction proves that a statement P(n)P(n) is true for every whole number nn from some starting point on.[16] A proof has two parts and a conclusion:[16]

  1. Base case: show that P(0)P(0) is true.
  2. Inductive step: show that for every k≥0k \ge 0, if P(k)P(k) is true, then P(k+1)P(k+1) is true. The assumption that P(k)P(k) is true is called the inductive hypothesis.
  3. Conclude that P(n)P(n) is true for all n≥0n \ge 0.

If a statement only holds from some later value, such as 4, the proof starts there instead.[16] For example, induction shows that any postage of 28 cents or more can be made exactly with 5-cent and 8-cent stamps.[16]

Mathematical induction as falling dominoesbase case: push the firstP(k) true ⇒ P(k+1) trueP(0)P(1)P(2)P(3)P(4)...
Mathematical induction pictured as a row of dominoes. Proving the base case P(0)P(0) knocks over the first domino, and the inductive step P(k)⇒P(k+1)P(k) \Rightarrow P(k+1) makes each domino knock over the next, so every P(n)P(n) falls.

The method works like a row of dominoes. Pushing the first domino is the base case, and each domino knocking over the next is the inductive step, so every domino falls.[16]

Recurrence relations

A recurrence relation defines each term of a sequence from earlier terms.[17] The best-known example is the Fibonacci sequence:[17]

Fn=Fn−1+Fn−2,F0=0, F1=1F_n = F_{n-1} + F_{n-2}, \qquad F_0 = 0,\ F_1 = 1

The values F0F_0 and F1F_1 are the initial conditions, which start the sequence: 0, 1, 1, 2, 3, 5, 8, and so on. Solving a recurrence means finding a closed formula that gives the nnth term directly, without computing all earlier terms.[17]

For a recurrence of the form an=c1an−1+c2an−2a_n = c_1 a_{n-1} + c_2 a_{n-2}, the characteristic root technique finds the roots of the characteristic equation x2=c1x+c2x^2 = c_1 x + c_2.[17] If the equation has two distinct roots r1r_1 and r2r_2, then an=ar1n+br2na_n = a r_1^n + b r_2^n, where the constants aa and bb come from the initial conditions.[17] For the Fibonacci sequence the equation is x2=x+1x^2 = x + 1, and its roots involve the golden ratio φ\varphi:[17]

Fn=φn−ψn5,φ=1+52,ψ=1−52F_n = \frac{\varphi^n - \psi^n}{\sqrt{5}}, \qquad \varphi = \frac{1+\sqrt{5}}{2},\quad \psi = \frac{1-\sqrt{5}}{2}

Here φ\varphi and ψ\psi are the two roots, and the factor 1/51/\sqrt{5} comes from fitting F0=0F_0 = 0 and F1=1F_1 = 1.

Graphs

Graphs model anything made of objects and links between them, such as people and friendships or cities and roads.

Vertices, edges, and degree

A graph is a set of vertices together with a set of edges, where each edge joins two vertices.[9] The degree of a vertex is the number of edges that meet it.[9] Because every edge adds 1 to the degree of each of its two ends, the degrees always add up to twice the number of edges:[9]

∑v∈Vdeg⁡(v)=2 ∣E∣\sum_{v \in V} \deg(v) = 2\,|E|

Here VV is the set of vertices, deg⁡(v)\deg(v) is the degree of vertex vv, and ∣E∣|E| is the number of edges. This fact is the handshaking lemma.

Complete graph K5deg 4deg 4deg 4deg 4deg 45 vertices × degree 4 = 20= 2 × 10 edges
The complete graph K5K_5 has 5 vertices, each of degree 4, and 10 edges. The degree sum 5×4=205 \times 4 = 20 equals 2×102 \times 10, as the handshaking lemma requires.

The lemma settles some problems at once. Nine people cannot each shake hands with exactly 7 others, because the degrees would add up to 9×7=639 \times 7 = 63, an odd number.[9] A complete graph KnK_n, with an edge between every pair of its nn vertices, has n(n−1)/2n(n-1)/2 edges.[9]

The Königsberg bridges

The Königsberg bridge problem asked whether a walk could cross each of the seven bridges of Königsberg exactly once.[18] Leonhard Euler presented a solution to the Academy of Sciences in St. Petersburg in 1735 and wrote it up in a paper the following year.[19] This work is regarded as the beginning of graph theory.[20]

The seven bridges of Königsberg as a graph City a b c d e f g A B C D land → vertex bridge → edge Graph A C B D 5 3 3 3 All four degrees odd, so no walk crosses every bridge once
The seven bridges of Königsberg (left) become a graph (right) with one vertex per land mass and one edge per bridge. The degrees are 5, 3, 3 and 3, which sum to 14=2×714 = 2 \times 7. Because all four degrees are odd, no walk can cross every bridge exactly once.

Turn each land mass into a vertex and each bridge into an edge. One land mass touches 5 bridges and the other three touch 3 each, so all four vertices have odd degree.[18] A walk passes through a vertex by arriving and leaving, which uses its edges in pairs, so odd-degree vertices can only be the start or the end of the walk.[21]

For a connected graph, the general result reads:[21]

  • A graph has an Euler circuit, a walk that uses every edge once and returns to its start, exactly when every vertex has even degree.
  • A graph has an Euler path, a walk that uses every edge once, exactly when at most two vertices have odd degree.

Königsberg has four odd vertices, so no such walk exists.[21] Euler discussed but did not prove that his conditions were enough; Carl Hierholzer published that proof in 1873.[19]

Coloring maps

The four-color problem asks whether the regions of every map on a plane or sphere can be colored with four colors so that regions sharing a border line get different colors.[22] Francis Guthrie posed it in 1852, and Kenneth Appel and Wolfgang Haken answered it in 1976, after which it became the four color theorem.[22]

Their proof relied on a computer to check a very large number of cases. Some mathematicians welcomed it, many felt uneasy, and some rejected it because it could not be checked by hand.[22] A later version of the proof was checked in full by the Coq proof assistant.[23]

Role in computing

Computers use discrete data and processes, and the rise of computing helped make discrete mathematics a field of its own.[3] Its ideas appear in computer hardware, data transmission, security, and the study of what computers can do.

In the curriculum

Discrete mathematics became an important part of the computer science degree starting with the Association for Computing Machinery's Curriculum 1968.[8] The 2013 curriculum from the ACM and the IEEE Computer Society calls it "discrete structures" and makes it one of the two largest parts of the core, at 41 hours of teaching.[8]

The 2013 report lists six topics: sets, relations, and functions; basic logic; proof techniques; basics of counting; graphs and trees; and discrete probability.[8] It notes that graph theory is used in networks, operating systems, and compilers, and set theory in software engineering and databases.[8]

Logic circuits

George Boole's 1854 book An Investigation of the Laws of Thought turned logical reasoning into algebraic equations.[24] Treating Boole's own algebra as modern Boolean algebra is a common misconception. Modern Boolean algebra grew out of a version that William Stanley Jevons introduced in 1864, which Boole rejected.[25]

In his 1937 MIT master's thesis, Claude Shannon showed that Boole's two-valued algebra could be used to design electrical circuits.[26] Each relay or switch is either open or closed, and Shannon matched these two states to the two truth values of logic.[27] A revised version of the thesis was published in 1938.[26]

Error-correcting codes

Computers send data as blocks of 0s and 1s, and extra check bits can reveal errors.[28] Richard Hamming published a way to find and fix errors in the Bell System Technical Journal in April 1950.[28] In his best-known example, 3 check bits added to 4 data bits give 7-bit code words in which any single error can be corrected.[28]

Hamming (7,4) code detecting and correcting a single bit error 1234567 0111100 0111000 checkcheckdatacheckdatadatadata sent received error check 1: positions 1, 3, 5, 7 check 2: positions 2, 3, 6, 7 check 3: positions 4, 5, 6, 7 check 1 fails → 1 check 2 passes → 0 check 3 fails → 1 read check 3, 2, 1: 101 (binary) = 5 → flip bit 5
Hamming's (7,4) code sends 4 data bits with 3 check bits at positions 1, 2 and 4, and each check covers a fixed set of positions. When bit 5 flips in transit, checks 1 and 3 fail and check 2 passes, so reading the checks as 1012=5101_2 = 5 gives the position of the bad bit.

Each check bit makes the number of 1s in a chosen group of positions even:[28]

  • Check 1 covers positions 1, 3, 5, and 7.
  • Check 2 covers positions 2, 3, 6, and 7.
  • Check 3 covers positions 4, 5, 6, and 7.

The receiver writes 1 for each check that fails and 0 for each that passes. Read as a binary number, these digits give the position of a single wrong bit.[28] This scheme is now called the Hamming code, and the wider subject is coding theory (see also error correction code).

Cryptography

In 1977 Ron Rivest, Adi Shamir, and Leonard Adleman developed RSA, a practical form of public-key cryptography, which they published in 1978.[29][10] Anyone can encrypt a message with a public key, but only the holder of a matching private key can decrypt it.[29] Clifford Cocks had developed a similar method earlier at the British agency GCHQ, but it stayed secret until 1997.[29]

RSA is built on modular arithmetic.[10] Its security relies on the fact that no one has found an efficient algorithm for factoring very large integers.[29]

Hard problems

Some discrete problems have answers that are easy to check but seem very hard to find. Choosing 100 of 400 students so that no two listed as incompatible are both picked is one example: a proposed list is quick to check, but no fast method of building one is known.[13]

Whether every problem whose answer is easy to check is also easy to solve is the P versus NP problem. Stephen Cook and Leonid Levin formulated it independently in 1971, and it remains unsolved.[13] It is one of the Clay Mathematics Institute's Millennium Prize Problems, and Clay calls it one of the outstanding problems in computer science.[13]

Overlap with continuous mathematics

Discrete and continuous methods often meet. The Fibonacci formula above uses the irrational number 5\sqrt{5}, even though every Fibonacci number is a whole number.[17]

The book Concrete Mathematics by Ronald Graham, Donald Knuth, and Oren Patashnik describes its subject as "a blend of CONtinuous and disCRETE mathematics."[30] Its topics overlap with discrete mathematics but differ from those of a standard course.[1]

Textbooks for computer scientists also teach tools such as infinite series, approximating sums, and generating functions, which they use for counting and for solving recurrences.[31] A generating function writes the terms of a sequence a0,a1,a2,…a_0, a_1, a_2, \ldots as the coefficients of a power series a0+a1x+a2x2+⋯a_0 + a_1 x + a_2 x^2 + \cdots.[32] In combinatorics the series need not add up to a finite value, so there is no need to worry about convergence.[32]

History

Problems that now belong to discrete mathematics have been studied in many cultures for as long as people have counted. The field was recognized as a distinct area only in the mid-twentieth century.[3] Two forces drove this: the arrival of digital computers, and the need to plan very large projects such as crewed flights to the Moon.[3]

Timeline of discrete mathematics 1735 1854 1950 1971 1977 1852 1937 1968 1976 Euler solvesKönigsbergbridge problem(paper 1736) Boole: Lawsof Thought Hamming:error-correctingcodes Cook and Levinpose P vs NP RSA public-keycryptosystem Guthrie posesfour-colorproblem Shannon:Boolean algebrafor circuits ACM Curriculum68 includesdiscrete math Appel and Hakenprove fourcolor theorem
Nine milestones in discrete mathematics from 1735 to 1977, spaced evenly rather than to scale in time. A break in the line marks the long gap between Boole's 1854 book and Shannon's 1937 work on switching circuits.

Earlier milestones include Euler's work on the Königsberg bridges in 1735 and 1736, the four-color problem of 1852, and Boole's algebra of logic in 1854.[19][22][24] The twentieth century added Shannon's switching circuits, Hamming's codes, the P versus NP question, the computer proof of the four color theorem, and RSA.[26][28][13][22][29]

Research community

Discrete mathematics has its own journals and prizes. The journal Discrete Mathematics has been published since 1971, first by North-Holland in Amsterdam and later by Elsevier.[33] The SIAM Journal on Discrete Mathematics publishes research across pure and applied topics.[34]

The Fulkerson Prize, sponsored jointly by the Mathematical Optimization Society and the American Mathematical Society, has honored outstanding papers in discrete mathematics since 1979. It is awarded every three years.[35] For the prize, "discrete mathematics" includes graph theory, networks, mathematical optimization, and applied combinatorics, and its first winners included Appel and Haken's paper on the four color theorem.[35]

Introductory textbooks include Kenneth Rosen's Discrete Mathematics and Its Applications.[3]

References

  1. Discrete Mathematics, Wolfram MathWorld (Eric W. Weisstein and John Renze).
  2. Mathematical Statements, Oscar Levin, Discrete Mathematics: An Open Introduction.
  3. Discrete mathematics, EBSCO Research Starters (Randa Tantawi), 2023.
  4. What is Discrete Mathematics?, Oscar Levin, Discrete Mathematics: An Open Introduction.
  5. Discrete Mathematics in Computer Science: Sets, Countability, Malte Helmert and Gabriele Röger, University of Basel, 2024.
  6. Discrete Mathematics lecture notes, Andrew Ker, University of Oxford, 2010.
  7. Lecture 29: Infinite Sets, Countability, CS 30: Discrete Math in CS, Dartmouth College, 2020.
  8. Discrete mathematics for computer science, Susanna S. Epp, ICME-13, 2016.
  9. Graph Theory: Definitions, Oscar Levin, Discrete Mathematics: An Open Introduction.
  10. A Method for Obtaining Digital Signatures and Public-Key Cryptosystems, R. L. Rivest, A. Shamir, and L. Adleman, Communications of the ACM, 1978.
  11. Congruence, Wolfram MathWorld (Eric W. Weisstein).
  12. MAT344 Lecture 2, University of Toronto, 2019.
  13. P vs NP, Clay Mathematics Institute.
  14. The Pigeon Hole Principle, Mitchel T. Keller and William T. Trotter, Applied Combinatorics.
  15. Application: The Pigeonhole Principle, course notes based on Susanna S. Epp, Discrete Mathematics with Applications, Section 7.3, Mustafa Jarrar.
  16. Induction, Oscar Levin, Discrete Mathematics: An Open Introduction.
  17. Solving Recurrence Relations, Oscar Levin, Discrete Mathematics: An Open Introduction.
  18. Königsberg bridge problem, Encyclopaedia Britannica.
  19. An Historical Note: Euler's Königsberg Letters, H. Sachs, M. Stiebitz, and R. J. Wilson, Journal of Graph Theory, 1988.
  20. Königsberg Bridge Problem, Wolfram MathWorld.
  21. Euler Paths and Circuits, Oscar Levin, Discrete Mathematics: An Open Introduction.
  22. The Four-Color Theorem 1852 to 1976, Notices of the American Mathematical Society, 2026.
  23. A computer-checked proof of the Four Color Theorem, Inria HAL archive.
  24. An Investigation of the Laws of Thought, George Boole, Project Gutenberg edition of the 1854 book.
  25. George Boole, Stanford Encyclopedia of Philosophy.
  26. Shannon's "Symbolic Analysis of Relay and Switching Circuits", HistoryofInformation.com (Jeremy M. Norman).
  27. A Symbolic Analysis of Relay and Switching Circuits, Claude E. Shannon, Transactions of the AIEE, 1938.
  28. Richard W. Hamming: Error detecting and error correcting codes, A.M. Turing Award site, ACM.
  29. Ronald L. Rivest, A.M. Turing Award site, ACM.
  30. Concrete Mathematics, Wolfram MathWorld.
  31. Mathematics for Computer Science, Eric Lehman, F. Thomson Leighton, and Albert R. Meyer, MIT.
  32. Generating Functions, Kenneth P. Bogart, Combinatorics Through Guided Discovery (OpenMathBooks edition).
  33. Discrete mathematics (NLM Catalog record), US National Library of Medicine.
  34. SIAM Journal on Discrete Mathematics, Society for Industrial and Applied Mathematics.
  35. The Fulkerson Prize, Mathematical Optimization Society.

Figure

Subtopics

Algorithmic Combinatorics on Partial WordsAlgorithms (journal)András SebőArmin B. CremersArs Mathematica ContemporaneaBinary relationBoolean algebraCardinalityCellular automatonChomsky–Schützenberger enumeration theoremCoding theoryCombinatorial optimizationCombinatoricsConcrete MathematicsCrossing Numbers of GraphsCurtis–Hedlund–Lyndon theoremDavid P. Robbins PrizeDIMACSDirection-preserving functionDiscrete AnalysisDiscrete Applied MathematicsDiscrete calculusDiscrete fixed-point theoremDiscrete Mathematics (journal)Discrete Mathematics & Theoretical Computer ScienceDiscrete Mathematics and Its ApplicationsDiscrete optimizationDiscrete probability distributionDonald KnuthFinite differenceFinite fieldFinite mathematicsFinite-state machineFlip distanceFloor and ceiling functionsFormal concept analysisFormal languageFulkerson PrizeFunction (mathematics)Geometric progressionGraph (discrete mathematics)Graph theoryGregory GutinHenry CohnJournal of Difference Equations and ApplicationsKonig PrizeLouxin ZhangMarkov chainMathematical inductionOrder theoryOum Sang-ilPeter WinklerPigeonhole principlePropositional logicQuantifier (logic)Ralph Gordon StantonRandom walkRecurrence relationRecursionReverse-search algorithmRonald GrahamRotation distanceSequenceSergey YablonskySIAM Journal on Discrete MathematicsSummationSusanna S. EppSymposium on Discrete AlgorithmsT-theoryThe Fibonacci AssociationTrinomial triangleWell-ordering principleYoshiharu KohayakawaYuri Zhuravlyov (mathematician)