Permutations vs combinations: does order matter?
Both count the ways to pick r things from n. The difference is whether rearranging the picks counts as new. Choosing gold, silver and bronze from 8 runners is a permutation — Ana-Ben-Cy is a different podium from Ben-Ana-Cy — so there are 8P3 = 8 × 7 × 6 = 336 outcomes. Choosing 3 runners to advance to a final is a combination — the same three people in any order are one selection — so there are 8C3 = 336 ÷ 3! = 56.
The formulas: nPr = n! ÷ (n − r)! and nCr = n! ÷ (r! × (n − r)!). The combination is always the permutation divided by r!, the number of ways to order the r chosen items. That is why 10P3 = 720 but 10C3 = 120, and why a 5-card poker hand from 52 cards has 52C5 = 2,598,960 possibilities while dealing them in order gives 311,875,200.
With repetition. If items can be reused — digits in a PIN, scoops of ice cream from the same tub — the counts change. Ordered choices with repetition are simply nʳ: a 4-digit PIN from 10 digits has 10⁴ = 10,000 possibilities. Unordered choices with repetition (a "multiset") use the stars-and-bars result (n + r − 1)Cr: choosing 3 scoops from 6 flavours with repeats allowed gives 8C3 = 56 combinations.
Large numbers. Factorials explode: 20! is already over 2 × 10¹⁸. The calculator computes exactly with integer arithmetic up to 15 significant digits and switches to scientific notation beyond that, so 100C50 (≈ 1.009 × 10²⁹) still returns a correct value rather than overflowing.