What Is Discrete Mathematics?
What You’ll Learn
Section titled “What You’ll Learn”In this lesson you’ll learn what makes something “discrete,” how discrete math differs from the continuous math you’ve seen in algebra and calculus, and what the major branches of the subject are. Think of this as the map before the road trip.
The Concept
Section titled “The Concept”Discrete means separated, distinct, countable. Continuous means unbroken, flowing, with no gaps.
The number of chairs in a room is discrete. You can have 4 chairs or 5 chairs, never 4.5. The temperature of the room is continuous. Between 68 and 69 degrees there are infinitely many values, and the temperature passes through all of them.
Here’s the test that matters: between any two values, is there always another one?
- Integers: between 4 and 5 there is no integer. Discrete.
- Real numbers: between 4 and 5 there is 4.5, and between 4 and 4.5 there is 4.25, forever. Continuous.
Calculus lives on the continuous side. Derivatives and integrals both depend on being able to shrink a gap toward zero, and that only makes sense if there’s always something in the gap.
Discrete math lives on the other side, and it asks different kinds of questions:
- How many? Counting arrangements, selections, and possibilities.
- Is this true? Logic, validity, and proof.
- Is there a path? Networks, connections, and structure.
- What’s left over? Divisibility and remainders.
The five main areas
Section titled “The five main areas”- Logic - the study of statements that are true or false, and how to combine them. It’s the foundation for everything else, because every proof is an argument in logic.
- Set theory - the study of collections. A set is just a collection of distinct objects, and it turns out that almost every mathematical object can be described as a set.
- Combinatorics - counting, done carefully. “How many 5-card hands are there?” is a combinatorics question, and the answer is 2,598,960.
- Graph theory - the study of things connected to other things. A graph here is not a plot of a function. It’s a set of dots (vertices) with lines between some of them (edges).
- Number theory - in this section, the arithmetic of integers: divisibility, primes, and remainders.
Why computers care
Section titled “Why computers care”A computer is a discrete machine. It stores bits, which are 0 or 1 with nothing in between. It executes a whole number of instructions. Its memory has finitely many addresses.
So when you ask “how much math do programmers use?” the honest answer is: a lot, but mostly this kind. A calculus-heavy field like graphics or machine learning is the exception, not the rule.
Worked Examples
Section titled “Worked Examples”Example 1: Classify each quantity as discrete or continuous.
- The number of students enrolled in a class.
- The exact weight of a bag of flour.
- The number of possible passwords of length 8.
- The time it takes you to run a mile.
Solution.
- Discrete. You can have 23 students or 24, never 23.5.
- Continuous. A bag could weigh 2.0001 pounds or 2.00011 pounds.
- Discrete. It’s a count, and a huge one, but still a whole number.
- Continuous. Your stopwatch rounds it, but the actual duration can be any real value.
Notice that #3 being enormous doesn’t make it continuous. Discrete does not mean small.
Example 2: A counting question you can already answer.
A café offers 3 sizes of coffee and 4 syrup flavors. How many different size-plus-syrup combinations are there?
Solution. For each of the 3 sizes you have 4 syrup choices:
There are 12 combinations. This is the multiplication principle, and it’s the single most useful idea in all of counting. You’ll meet it formally in a later lesson, but you already have the instinct for it.
Example 3: A logic question you can already answer.
Someone tells you: “If it’s Tuesday, the trash gets collected.” You observe that the trash got collected. Can you conclude it’s Tuesday?
Solution. No. The statement only tells you what happens on Tuesdays. It says nothing about whether the trash might also get collected on other days. Maybe it’s collected on Tuesdays and Fridays.
This particular mistake is common enough to have a name, the converse error, and you’ll see exactly why it fails when we build truth tables.
Example 4: A graph question you can already answer.
Five friends are in a group chat. Every person is connected to every other person. How many distinct pairs of friends are there?
Solution. Line them up: A, B, C, D, E.
- A pairs with B, C, D, E: 4 pairs
- B pairs with C, D, E: 3 new pairs
- C pairs with D, E: 2 new
- D pairs with E: 1 new
There are 10 pairs. In graph theory language, the complete graph on 5 vertices has 10 edges.
Real-World Applications
Section titled “Real-World Applications”Discrete math is the reason a lot of everyday technology works at all.
When your phone finds a driving route, it’s running a shortest-path algorithm over a graph where intersections are vertices and roads are edges. When a website tells you your password is weak, it’s estimating the size of a set of possibilities. When a scheduling app fits 30 meetings into a week without double-booking anyone, it’s solving a graph coloring problem.
Outside of tech, the logic half of this subject is just good thinking. Contracts, legal arguments, medical diagnoses, and debugging your own code all come down to reasoning carefully about what actually follows from what.
Retrying will remove your ✅ checkmark until you pass again.