๐Ÿ  Home โ€บ ๐Ÿ”บ Pascal's Triangle โ€บ Lesson 2

๐Ÿงฉ The Choose Function โ€” Deriving C(n, k) = n! / (k!(n โˆ’ k)!)

๐Ÿ“– Lesson 2 of 10

๐Ÿ“Œ Key ideas of this section

C(n, k) = the number of ways to pick k things from n things
when order does NOT matter. Read it "n choose k."
C(n, k) = n! / (k!(n โˆ’ k)!)  โ€” and we can DERIVE that formula.
C(n, k) is exactly entry k of row n of the triangle.

Warm-up: the pizza problem, counted two ways

Your pizza place offers 5 toppings. How many 2-topping pizzas are possible? Try it with order first: pick a first topping (5 choices), then a second (4 choices) โ€” that's 5 ร— 4 = 20 ordered picks. But a mushroom-pepperoni pizza is the same pizza as a pepperoni-mushroom pizza! Every unordered pair was counted exactly 2 times (once in each order). So the real count is:

20 รท 2 = 10 different pizzas

That 10 is C(5, 2). Now let's turn the same reasoning into a general formula.

Factorials โ€” the counting engine

Definition: n! (read "n factorial") = n ร— (n โˆ’ 1) ร— ... ร— 2 ร— 1.

3! = 3 ร— 2 ร— 1 = 6
4! = 4 ร— 3 ร— 2 ร— 1 = 24
5! = 120,  6! = 720,  7! = 5040

Why factorials count arrangements: to line up 4 people, you have 4 choices for the first spot, then 3 for the next, then 2, then 1 โ€” and choices multiply: 4 ร— 3 ร— 2 ร— 1 = 4! = 24 lineups. In general, n things can be arranged in n! orders.

One weird convention: 0! = 1. Justification: there is exactly one way to arrange zero things (do nothing!), and the formulas we're about to build only work if 0! = 1. Watch for it below.

Step 1 โ€” count ORDERED picks. How many ways to pick k things from n things where order MATTERS (first pick, second pick, ...)?

n choices for the first, n โˆ’ 1 for the second, ..., down to (n โˆ’ k + 1) for the k-th:
n ร— (n โˆ’ 1) ร— ... ร— (n โˆ’ k + 1)

That product is almost n! โ€” it's n! with the tail (n โˆ’ k) ร— (n โˆ’ k โˆ’ 1) ร— ... ร— 1 missing. The missing tail is exactly (n โˆ’ k)!. So:

ordered k-picks from n = n! / (n โˆ’ k)!

Check with the pizza numbers: ordered pairs from 5 toppings = 5! / 3! = 120 / 6 = 20. โœ… Matches.

Step 2 โ€” erase the order. Every unordered group of k things was counted once for each way to arrange it โ€” that's k! times. So divide:

C(n, k) = (ordered picks) รท (arrangements of each group)
        = [n! / (n โˆ’ k)!] รท k!
        = n! / (k!(n โˆ’ k)!)          โ† THE formula. Memorize its shape:
        upstairs the full n!, downstairs k! and (n โˆ’ k)! โ€” and k + (n โˆ’ k) = n.

Worked example โ€” compute C(8, 3), every step justified:

C(8, 3) = 8! / (3! ยท 5!)                    (the formula with n = 8, k = 3; note 3 + 5 = 8)
      = (8 ร— 7 ร— 6 ร— 5!) / (3! ร— 5!)        (peel the top of 8! off so a 5! is visible)
      = (8 ร— 7 ร— 6) / (3 ร— 2 ร— 1)           (cancel 5! top and bottom โ€” always cancel first!)
      = 336 / 6                             (multiply out the top)
      = 56                                  (divide)
Check on the triangle: row 8, entry 3 is 56. โœ…

Sanity checks at the edges, using 0! = 1:

C(n, 0) = n! / (0! ยท n!) = 1    (one way to choose nothing โ€” and the edge entries are 1 โœ…)
C(n, n) = n! / (n! ยท 0!) = 1    (one way to choose everything โœ…)
C(n, 1) = n! / (1! ยท (nโˆ’1)!) = n    (n ways to choose one thing โ€” entry 1 of row n is n โœ…)

The symmetry identity โ€” with two proofs

Here's a fact we've used informally: C(n, k) = C(n, n โˆ’ k). Now prove it twice.

Algebra proof:
C(n, n โˆ’ k) = n! / ((n โˆ’ k)! ยท (n โˆ’ (n โˆ’ k))!)    (formula with n โˆ’ k in the k slot)
            = n! / ((n โˆ’ k)! ยท k!)                (because n โˆ’ (n โˆ’ k) = k)
            = C(n, k)                             (same denominator, just swapped)  โˆŽ
Story proof: choosing k toppings to PUT ON your pizza is the same act as
choosing the n โˆ’ k toppings to LEAVE OFF. Every "take" choice is secretly a
"leave" choice, so the counts are equal.  โˆŽ

Two proofs of one fact โ€” the algebra is mechanical, the story explains WHY. You'll see this pair again in Lesson 3.

Bonus tool โ€” the ratio trick. Each entry is a predictable multiple of the one before it:

C(n, k + 1) / C(n, k) = (n โˆ’ k) / (k + 1)
Why: C(n, k + 1) = n! / ((k+1)! (nโˆ’kโˆ’1)!). Divide by C(n, k) = n! / (k! (nโˆ’k)!):
the n! cancels, (n โˆ’ k)! = (n โˆ’ k) ยท (n โˆ’ k โˆ’ 1)! supplies an (n โˆ’ k) on top,
and (k + 1)! = (k + 1) ยท k! supplies a (k + 1) on the bottom. โˆŽ
Example: C(10, 5) = C(10, 4) ร— (10 โˆ’ 4)/5 = 210 ร— 6/5 = 252. โœ… (row 10 entry 5!)

The ratio trick explains why entries grow toward the middle: as long as (n โˆ’ k) > (k + 1), the next entry is BIGGER. That stops exactly at the middle of the row.

โœ๏ธ Your Turn!

Compute C(9, 4) with the formula, showing the cancellation. Then find it on the triangle.

๐Ÿ‘€ Show the answers

Answer:

C(9, 4) = 9! / (4! ยท 5!)                    (note 4 + 5 = 9 โœ…)
      = (9 ร— 8 ร— 7 ร— 6) / (4 ร— 3 ร— 2 ร— 1)   (cancel 5!)
      = 3024 / 24
      = 126
Row 9, entry 4: 1 9 36 84 126 ... โ€” there it is. โœ…
V.3.1