Possible Combinations Calculator

Possible Combinations Calculator

Count unordered selections with and without repetition, then enumerate the selected combination type when the result has no more than 300 rows.

Objects n 6 Sample r 3 Generated 20 Mode Without repetition

Workbook ready for the demonstration values.

Set of objects

Required whole number from 1 to 200.

Required whole number from 0 to n.

The list is generated only when the selected count is 300 or fewer.

Number of selections

Combinations 20

Unordered selections without repeated objects: C(n, r).

Combinations with repetitions 56

Unordered selections where an object may appear more than once.

For n = 6 and r = 3, there are 20 combinations without repetition and 56 with repetition.

Combination generator

20 rows · Without repetition

# Combination

The generator labels the distinct objects 1 through n. It lists unordered selections once each.

How to use this possible combinations calculator

What this calculator does

This calculator counts how many unordered selections of size r can be formed from n distinct object types. It reports both the ordinary combination count, where an object cannot be selected twice, and the combinations-with-repetition count, where the same object type may appear multiple times. It also generates the actual selections for the mode you choose when that list contains at most 300 rows. It does not count permutations: if different orders such as 1,2,3 and 3,2,1 must be treated as different outcomes, you need a permutation model instead. MIT OpenCourseWare's combinations lesson explains why order is ignored when counting subsets.

When to use it

Use the calculator when choosing a committee from a larger group, selecting menu items or features where order is irrelevant, counting lottery-style subsets, or choosing quantities from several object types when repeats are allowed. The generator is especially useful for small teaching examples because it lets you verify the count by inspecting every distinct selection.

How to calculate

  1. The calculator opens with the demonstration values n = 6 and r = 3, so the results and an example XLSX workbook are available immediately.
  2. Replace Total number of objects n and Sample size r with your own whole numbers. Results update live as soon as both fields are valid.
  3. Choose What do you want to generate? to list selections without repetition or with repetition. If the chosen count exceeds 300, the exact count remains available but the row-by-row generator is intentionally suppressed.
  4. Read the two count cards and, for small cases, inspect the generator table. Use Download Excel to export the current inputs, exact counts, selected mode, and generated rows. Reset clears the demonstration data; Excel export is then disabled until a complete valid state is entered again.

Input guide

Total number of objects n is required and accepts an unformatted whole number from 1 through 200; for example, 6. It represents the number of distinct objects or object types available. Raising n usually increases both counts because there are more choices. Do not type commas, decimal values, signs, currency symbols, or scientific notation: values such as 1,000 and 1e3 are rejected rather than silently reinterpreted.

Sample size r is required and accepts an unformatted whole number from 0 through n; for example, 3. It is the number of positions in each unordered selection. With no repetition, r cannot exceed n because each object can appear at most once. A value of 0 is valid and represents the single empty selection. A common mistake is to use r for the number of ordered positions when order actually matters; that is a permutation question, not a combination question.

What do you want to generate? is required and has two choices. Without repetition lists subsets containing distinct labels. With repetition lists nondecreasing label sequences so repeated labels can appear. This control changes the generator table and its row count, but it does not hide either result card.

Output guide

Combinations is the exact identity C(n,r), shown as a whole number with digit grouping. It is driven by n and r and measures the number of unordered selections without repetition. It equals 1 when r = 0 or r = n. Combinations with repetitions is the exact count C(n+r – 1,r), also shown as a grouped whole number. It is always at least as large as the no-repetition count for the same valid n and r. The header pills Objects n, Sample r, Generated, and Mode summarize the live state. Generated is the number of rows actually listed: it is the exact selected count when that count is at most 300, and 0 when enumeration is suppressed or the inputs are invalid.

The Combination generator table has two columns. # is the one-based row index. Combination shows the selected object labels, using 1 through n. These rows are exact enumerations of the chosen mode, not probability estimates or sampled examples.

Worked example

With the startup values n = 6 and r = 3, the ordinary count is C(6,3) = 6! / (3! × 3!) = 20. Allowing repetition changes the count to C(8,3) = 8! / (3! × 5!) = 56. Because the generator starts in Without repetition mode and 20 is below the 300-row limit, the table displays all 20 selections, beginning with 1, 2, 3 and ending with 4, 5, 6. The initial Excel workbook contains the same inputs, both counts, the selected mode, and those 20 rows.

How the formulas work

For combinations without repetition, order is ignored and every chosen object is distinct. The count is:

C(n, r) = n! / (r! × (n – r)!)

The factorials compensate for all the different orders that would otherwise describe the same subset. For example, choosing objects 1, 2, and 3 is the same combination whether they were encountered as 3, 1, 2 or 2, 3, 1. Mathematics LibreTexts gives a detailed derivation and interpretation of ordinary combinations.

When repetition is allowed, a selection can contain the same object type more than once. The standard stars-and-bars result is:

C with repetition = C(n + r – 1, r)

This converts the repeated-choice problem into an ordinary combination problem over n + r – 1 positions. LibreTexts' unlimited-repetition theorem develops this formula with the stars-and-bars argument.

Interpretation and common mistakes

The two result cards answer different questions, so they should not be added together or treated as parts of one total. The ordinary count assumes every selected object is distinct; the repetition count assumes objects are types that may be chosen again. That difference is why a chart would be misleading here: the outputs are alternative models, not mutually exclusive categories or a time series.

Another common error is confusing repetition with order. Allowing repetition does not make a combination ordered. In with-repetition mode, 1,1,3 is a valid selection, but 1,3,1 is not a second combination; it represents the same unordered multiset. Finally, remember that enumeration grows quickly. The calculator always reports the exact counts, but it limits the visible generator to 300 rows so the page and exported workbook stay practical.