# Learn discrete math — the mathematical foundation of computer science

Logic, proofs, combinatorics, and graph theory for every serious programmer

Discrete mathematics is the branch of mathematics that deals with countable, distinct structures — as opposed to calculus, which deals with continuous change. It is the direct mathematical foundation of computer science: logic gates, algorithm analysis, cryptography, databases, and networking all rely on discrete math concepts.

The subject encompasses logic and proof techniques, set theory, combinatorics (counting), graph theory, number theory, and recursion. These topics might seem abstract, but they are the tools you need to reason precisely about algorithms, understand complexity, and follow the proofs in research papers.

Unlike calculus, discrete math doesn't have one central thread — it's a collection of related mathematical areas. Planana's AI tutor organizes them into a coherent learning path with clear connections between topics.

## What you'll learn

### Logic & Proof Techniques

Propositional and predicate logic, truth tables, and proof methods: direct proof, proof by contradiction, and proof by induction.

### Set Theory

Sets, subsets, unions, intersections, power sets, and functions as relations between sets — the language underlying all of mathematics.

### Combinatorics & Counting

Permutations, combinations, the binomial theorem, and inclusion-exclusion — counting the size of finite sets without listing them.

### Graph Theory

Graphs, paths, cycles, trees, and connectivity — the mathematical abstraction for networks, maps, and dependencies.

### Number Theory

Divisibility, prime numbers, modular arithmetic, and the GCD — the mathematics underlying RSA encryption and hash functions.

### Recursion & Recurrences

Recursive definitions and recurrence relations — the mathematical foundation for analyzing recursive algorithms.

### Probability & Counting

Discrete probability spaces, expected value, and the connection between combinatorics and probabilistic analysis of algorithms.

## Why learn Discrete Mathematics?

Discrete math is a required course in virtually every computer science degree because it teaches you to think precisely. Proof writing builds the ability to reason without ambiguity. Graph theory underlies every network algorithm. Combinatorics powers probability and algorithm analysis. Number theory is the basis of cryptography.

If you want to read academic CS papers, understand why cryptographic protocols work, or reason about algorithm correctness, discrete math is the subject that makes that possible.
