Learn Discrete Math
The math of logic, counting and graphs that computer science runs on.
Free to start. Built from a single prompt. No credit card.
Discrete mathematics studies structures made of separate, countable pieces rather than continuous quantities: logical statements, sets, integers, sequences and graphs. It is the core math of computer science, used to reason about algorithms, data structures, networks, databases and cryptography. A course typically covers propositional and predicate logic, proof techniques including induction, sets, functions and relations, counting with permutations and combinations, recurrence relations, graph theory and modular arithmetic. Learnr builds a personalized discrete math course and teaches it through short interactive lessons, with lots of small problems so proof and counting skills grow together.
How to learn Discrete Math, step by step
- Start with logic and truth tables. Learn and, or, not, implication and biconditional, and verify equivalences like the contrapositive with truth tables. Then practice negating quantified statements, such as turning "every x has a y" into "some x has no y".
- Learn to write proofs early. Write direct proofs about even and odd integers, then proofs by contradiction and contrapositive. Read each proof aloud and check that every line follows from definitions or earlier lines.
- Practice induction until it is routine. Prove sum formulas like 1 + 2 + ... + n = n(n + 1)/2, then inequalities and divisibility claims. Clearly state the base case, the inductive hypothesis and where you use it.
- Drill counting problems. Decide whether order matters and whether repetition is allowed, then choose permutations, combinations or the multiplication principle. Add the pigeonhole principle, inclusion-exclusion and binomial coefficients, checking small cases by listing them.
- Study recurrences and modular arithmetic. Solve linear recurrences like the Fibonacci relation, and connect them to the running time of recursive algorithms. Learn congruences, the Euclidean algorithm and modular inverses, which reappear in cryptography.
- Finish with graph theory. Learn degrees, paths, cycles, connectivity, trees, bipartite graphs, and Euler and Hamiltonian paths. A handful of mixed problems each day in Learnr keeps logic, counting and graphs all in active memory.
What you'll learn
- Use propositional and predicate logic, truth tables and quantifiers correctly
- Write direct, contradiction and induction proofs
- Count with permutations, combinations, the pigeonhole principle and inclusion-exclusion
- Solve recurrence relations and analyze simple algorithms
- Reason about graphs, trees, paths and connectivity
What's inside your Discrete Math course
A sample path Learnr builds for Discrete Math. Your real course adapts to your goal and level.
- 1. Logic and quantifiers
- 2. Proof techniques and mathematical induction
- 3. Sets, functions and relations
- 4. Combinatorics and counting
- 5. Recurrences and modular arithmetic
- 6. Graph theory and trees
How long does it take to learn Discrete Math?
A standard one-semester discrete math course takes about 3 to 4 months at 5 to 8 hours a week. Learners new to proofs usually spend the most time on the logic and induction units, which then make everything else faster.
What you need before you start
High school algebra and comfort with functions and exponents. No calculus is required. Some programming experience helps you see the applications but is not needed.
Common mistakes to avoid
- Confusing an implication with its converse, assuming "if P then Q" also means "if Q then P".
- In induction proofs, writing the base case and then proving the next step without actually using the inductive hypothesis.
- Double counting in combinatorics by treating arrangements as ordered when order does not matter. Check your formula against a small, listable case.
How Learnr builds your course
Type your topic
Tell Learnr you want to learn Discrete Math, or get as specific as you like.
Get a personalized course
Learnr instantly builds a full Discrete Math course tailored to your goal and skill level.
Learn and level up
Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.
Discrete Math questions, answered
Why do computer science students take discrete math?
It provides the reasoning tools for the field: logic for program correctness, induction for recursive algorithms, counting and probability for analyzing running time, graphs for networks, and modular arithmetic for cryptography and hashing.
Is discrete math harder than calculus?
It is different. Discrete math involves fewer computations and more proofs and careful reasoning, which feels hard at first for people used to computation-focused math. Others find it more intuitive than calculus.
Explore more courses
- Learn Mathematical Proofs
- Learn Logic
- Learn Computer Science
- Learn Data Structures and Algorithms
- See all courses
More math courses
- Learn Probability
- Learn Number Theory
- Learn Differential Equations
- Learn Multivariable Calculus
- Learn Mental Math
- Learn Pre-Algebra
- Learn Fractions
- Learn Game Theory
Ready to learn Discrete Math?
Start your free, personalized Discrete Math course in seconds. .