The formula this page uses
P(n, r) = n! / (n − r)! C(n, r) = n! / ( r! · (n − r)! ) |A ∪ B| = |A| + |B| − |A ∩ B|
Solve discrete math problems with clear steps, notation, and a final check.
Evaluate the governing formula locally in your browser. Define each known quantity once, then change values to test another case instantly.
Choose an example or enter a formula.
No calculations yet.
P(n, r) = n! / (n − r)! C(n, r) = n! / ( r! · (n − r)! ) |A ∪ B| = |A| + |B| − |A ∩ B|
The setup
Ask whether swapping two chosen items gives a genuinely different outcome. Gold and silver medals: yes, so permutation. Two seats on the same committee: no, so combination. The combination is always the smaller number.
Because there is exactly one way to arrange nothing, and because it keeps the formulas working. C(10, 10) should be 1, and 10!/(10!·0!) only gives 1 if 0! = 1.
If you put more items than boxes, some box holds at least two. With 13 people, two must share a birth month, because there are only 12 months. It proves things exist without ever finding them.
Anywhere the objects come in whole units: hashing and password strength use n^r, network routing uses graphs, and program correctness uses logic and induction. Continuous calculus has almost nothing to say about any of it.