Enrichment · STEM Explorations · Math

How many ways?
Count them, then
see them all.

Type how many things there are and how many you pick, and say whether order matters and whether repeats are allowed. The calculator counts exactly, shows the factorial working, and lists every result when there are few enough to read.

The counting calculator

The worked example: how many different three-topping pizzas six toppings make. Nothing you type leaves this browser.

Loading the calculator. If nothing appears, turn on JavaScript.

What you get

Enrichment · STEM ExplorationsFree

What you finish with
The exact count for the kind of selection you choose, the other three counts beside it, the formula and working, and a list of every result for small cases. It prints as a summary and downloads as a spreadsheet.
Who it is for
Middle and high school math students, statistics and probability classes, math teachers and tutors, and math club students.
Format
Browser calculator for a phone, tablet or computer, by touch or keyboard. n and r up to 500. Prints a summary; downloads a spreadsheet (.csv); export and import a file.
Access
Free. No account, no sign-in and nothing to install. Everything you type stays in this browser; nothing is sent to Caveat.
Where it lives
The STEM Explorations space in Caveat Enrichment.
Support
Questions, a correction or a request: team@caveatacademic.com.

How to use it

  1. Type the question so the printout makes sense later.
  2. Choose whether order matters and whether repeats are allowed.
  3. Type n and r.
  4. Name the things to see every result listed.
  5. Print the summary or download the spreadsheet.

Count the ways

How the counts work

Two questions decide the formula.

The worked example: why 6C3 is 20Line up 3 of 61206 × 5 × 4 choicesSame 3, any order÷ 63 × 2 × 1 ordersDistinct pizzas20120 ÷ 6The worked example: why 6C3 is 20Line up 3 of 61206 × 5 × 4 choicesSame 3, any order÷ 63 × 2 × 1 ordersDistinct pizzas20120 ÷ 6
Picking toppings one at a time gives 6 × 5 × 4 = 120 ordered picks, but each pizza is counted once for every order its three toppings could have come in, 3 × 2 × 1 = 6 times; 120 ÷ 6 = 20.

Order and repeats

If order matters and nothing repeats, there are n choices for the first pick, n − 1 for the second, and so on for r picks: nPr. If order does not matter, every group has been counted once for each of its r × (r − 1) × … × 1 orders (r factorial), so divide: nCr. If any pick may repeat and order matters, each of r picks has n choices: n^r. Groups with repeats allowed are counted by C(n + r − 1, r), the “stars and bars” count.

Exact numbers

Factorials grow fast: 20 factorial, 20 × 19 × … × 1, already has 19 digits, more than a calculator’s display holds. This page does whole-number arithmetic, so 52C5, the number of five-card poker hands, comes out as exactly 2,598,960 and very large counts are shown in full in the table.

Sources

  1. OpenStax. Contemporary Mathematics (2023), chapter 7, Probability: the multiplication rule, permutations and combinations (openstax.org).
  2. Common Core State Standards for Mathematics, High School Statistics and Probability, S-CP.B.9: use permutations and combinations to compute probabilities.
  3. NIST Digital Library of Mathematical Functions, section 26.3, Lattice Paths: Binomial Coefficients (dlmf.nist.gov).
  4. Feller, W. (1968). An Introduction to Probability Theory and Its Applications, Vol. 1 (3rd ed.). Wiley, chapter II: combinatorial analysis, including selections with repetition.

The worked example is for practice. Your entries stay in this browser. Support: team@caveatacademic.com.