Pulsars
0 %
Log inSign up

Counting without enumerating

Arrangements and combinations

Two questions are enough to pick the right formula: does order matter? and can items repeat?

Arrangements: ordered, without repetition

Choosing k objects among n, taking order into account and without repetition, is written A(n,k):

A(n,k) = n × (n-1) × ... × (n-k+1)  =  ---------
                                        (n - k)!
                 k factors
A podium (gold, silver, bronze) among 10 athletes:

A(10,3) = 10 × 9 × 8 = 720 possible podiums

Order is essential here: "Alice gold, Bob silver" and "Bob gold, Alice silver" are two different podiums.

Combinations: unordered, without repetition

Choosing k objects among n without regard to order is written C(n,k):

              A(n,k)             n!
   C(n,k) = ---------  =  ---------------
                k!          k! (n - k)!

We divide A(n,k) by k! because the k! ways of ordering the same selection count only once.

A committee of 3 people among 10 (no assigned roles):

              720
   C(10,3) = ------ = 120 committees
                6

Six times fewer than podiums: 3! = 6 possible orders for each group of three.

The table of four cases

                      ORDER MATTERS            ORDER DOES NOT MATTER
                 ---------------------      ----------------------
with repetition       n^k                     (rarer case)
                  (codes, draws                combinations with
                   with replacement)            repetition

no repetition     A(n,k) = n!/(n-k)!          C(n,k) = n!/(k!(n-k)!)
                  (podium, ranking)           (committee, card hand)

In practice the three cases on the left and bottom cover the overwhelming majority of problems.

The question to ask

"If I swap two chosen objects, do I get the SAME situation?"

   YES ->  order does not matter  ->  COMBINATION
   NO  ->  order matters          ->  ARRANGEMENT
5-card hand        : swapping two cards in the hand -> same hand  -> C
4-digit code       : 1234 and 1243 -> different codes             -> ordered
Exact-order trifecta : order imposed                              -> A
Committee of 3     : same committee                               -> C

Two numerical examples

5-card hands from a 52-card deck:

   C(52,5) = 2,598,960

Lottery tickets (5 numbers among 49):

   C(49,5) = 1,906,884       ->  P(winning) ≈ 1 / 1,900,000

That last figure gives a concrete sense of scale: playing one ticket a week for 36,000 years would on average produce a single winning draw.

Summary

  • Arrangement A(n,k) = n!/(n-k)!: ordered, no repetition.
  • Combination C(n,k) = n!/(k!(n-k)!): unordered, no repetition.
  • You go from one to the other by dividing by k!.
  • Draw with replacement and order: n^k.
  • The decisive test: does swapping two objects change the situation?
  • C(52,5) = 2,598,960 card hands; C(49,5) = 1,906,884 lottery tickets.