Discrete mathematics
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]
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 when their difference is divisible by ; on a 12-hour clock, for example, .[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 and , with T for true and F for false.[2]
| and | or | if then | not | ||
|---|---|---|---|---|---|
| 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 " or " is true when both parts are true.[2] An "if then " statement is false in only one case, when is true and 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 objects from different objects, ignoring order, is the binomial coefficient:[12]
Here and are integers with , and (" factorial") is the product , with .[12] For example, if 10 people each shake hands once with every other person, there are 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 pigeons go into 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]
Mathematical induction
Mathematical induction proves that a statement is true for every whole number from some starting point on.[16] A proof has two parts and a conclusion:[16]
- Base case: show that is true.
- Inductive step: show that for every , if is true, then is true. The assumption that is true is called the inductive hypothesis.
- Conclude that is true for all .
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]
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]
The values and 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 th term directly, without computing all earlier terms.[17]
For a recurrence of the form , the characteristic root technique finds the roots of the characteristic equation .[17] If the equation has two distinct roots and , then , where the constants and come from the initial conditions.[17] For the Fibonacci sequence the equation is , and its roots involve the golden ratio :[17]
Here and are the two roots, and the factor comes from fitting and .
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]
Here is the set of vertices, is the degree of vertex , and is the number of edges. This fact is the handshaking lemma.
The lemma settles some problems at once. Nine people cannot each shake hands with exactly 7 others, because the degrees would add up to , an odd number.[9] A complete graph , with an edge between every pair of its vertices, has 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]
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]
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 , 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 as the coefficients of a power series .[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]
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
- Discrete Mathematics, Wolfram MathWorld (Eric W. Weisstein and John Renze).
- Mathematical Statements, Oscar Levin, Discrete Mathematics: An Open Introduction.
- Discrete mathematics, EBSCO Research Starters (Randa Tantawi), 2023.
- What is Discrete Mathematics?, Oscar Levin, Discrete Mathematics: An Open Introduction.
- Discrete Mathematics in Computer Science: Sets, Countability, Malte Helmert and Gabriele Röger, University of Basel, 2024.
- Discrete Mathematics lecture notes, Andrew Ker, University of Oxford, 2010.
- Lecture 29: Infinite Sets, Countability, CS 30: Discrete Math in CS, Dartmouth College, 2020.
- Discrete mathematics for computer science, Susanna S. Epp, ICME-13, 2016.
- Graph Theory: Definitions, Oscar Levin, Discrete Mathematics: An Open Introduction.
- A Method for Obtaining Digital Signatures and Public-Key Cryptosystems, R. L. Rivest, A. Shamir, and L. Adleman, Communications of the ACM, 1978.
- Congruence, Wolfram MathWorld (Eric W. Weisstein).
- MAT344 Lecture 2, University of Toronto, 2019.
- P vs NP, Clay Mathematics Institute.
- The Pigeon Hole Principle, Mitchel T. Keller and William T. Trotter, Applied Combinatorics.
- Application: The Pigeonhole Principle, course notes based on Susanna S. Epp, Discrete Mathematics with Applications, Section 7.3, Mustafa Jarrar.
- Induction, Oscar Levin, Discrete Mathematics: An Open Introduction.
- Solving Recurrence Relations, Oscar Levin, Discrete Mathematics: An Open Introduction.
- Königsberg bridge problem, Encyclopaedia Britannica.
- An Historical Note: Euler's Königsberg Letters, H. Sachs, M. Stiebitz, and R. J. Wilson, Journal of Graph Theory, 1988.
- Königsberg Bridge Problem, Wolfram MathWorld.
- Euler Paths and Circuits, Oscar Levin, Discrete Mathematics: An Open Introduction.
- The Four-Color Theorem 1852 to 1976, Notices of the American Mathematical Society, 2026.
- A computer-checked proof of the Four Color Theorem, Inria HAL archive.
- An Investigation of the Laws of Thought, George Boole, Project Gutenberg edition of the 1854 book.
- George Boole, Stanford Encyclopedia of Philosophy.
- Shannon's "Symbolic Analysis of Relay and Switching Circuits", HistoryofInformation.com (Jeremy M. Norman).
- A Symbolic Analysis of Relay and Switching Circuits, Claude E. Shannon, Transactions of the AIEE, 1938.
- Richard W. Hamming: Error detecting and error correcting codes, A.M. Turing Award site, ACM.
- Ronald L. Rivest, A.M. Turing Award site, ACM.
- Concrete Mathematics, Wolfram MathWorld.
- Mathematics for Computer Science, Eric Lehman, F. Thomson Leighton, and Albert R. Meyer, MIT.
- Generating Functions, Kenneth P. Bogart, Combinatorics Through Guided Discovery (OpenMathBooks edition).
- Discrete mathematics (NLM Catalog record), US National Library of Medicine.
- SIAM Journal on Discrete Mathematics, Society for Industrial and Applied Mathematics.
- The Fulkerson Prize, Mathematical Optimization Society.
