Combinations and the formula for nCr · Mathematics Class 11–12 | StemPy Lab
Course 4.3·Lesson 1 of 3
Combinations and the formula for nCr
A combination is a selection in which order does not matter. Each selection of r things can be arranged in r! orders, so nPr=nCr×r!
about 25 min1 simulation1 practice question1 Python program5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
Order or no order
Coach Selvi has four runners: Asha, Bilal, Chen and Dev. She needs two of them.
For a relay, one runs first and one runs second. Asha then Bilal is different from Bilal then Asha.
For a team photo, she just picks two. Asha and Bilal is the same pair as Bilal and Asha.
The relay needs an arrangement, a permutation. The photo needs a selection, a combination. In a combination, order does not matter.
Listing them
Write the runners as A, B, C and D. The selections of two are
{A,B}, {A,C} and {A,D}, the pairs with A;
{B,C}, {B,D} and {C,D}, the pairs without A.
That is 6 selections. The arrangements of two number 4P2=4×3=12. Each selection appears twice among them, once in each order.
On the left, six blue boxes list the selections of two letters from A, B, C and D: {A, B}, {A, C}, {A, D}, {B, C}, {B, D} and {C, D}. An arrow runs from each to two orange boxes on the right, its two arrangements, such as A then B and B then A. The caption says each selection gives 2! = 2 arrangements, so 12 = 6 × 2.
From arrangements to selections
The number of selections of r things from n different things is written nCr, read "n choose r". Books also write C(n,r) or (rn).
To arrange r things from n, you can work in two steps.
Step 1. Choose which r things: nCr ways.
Step 2. Arrange the chosen r in a row: r! ways.
By the multiplication principle,
nPr=nCr×r!.
Since nPr=(n−r)!n!, dividing by r! gives the formula:
nCr=r!(n−r)!n!,0≤r≤n.
Working it out quickly
You rarely need the full factorials. Cancel (n−r)! first:
nCr=r!n(n−1)(n−2)⋯(n−r+1).
There are r factors on top, counting down from n. For example,
7C3=3×2×17×6×5=35,11C3=611×10×9=165.
The answer is always a whole number, even though it looks like a fraction.
Small values
nC0=1. There is one way to choose nothing. This is why 0!=1.
nCn=1. There is one way to choose everything.
nC1=n. Choose any single one.
nC2=2n(n−1). This counts the pairs, or the handshakes in a group of n.
In the simulation, each bar of row n is one value of nCk. Move r and compare the selections with the arrangements.
Set r=1. Then r!=1 and the selections equal the arrangements. Set r=0: there is exactly one selection, the empty one.
A worked example
Meghna's exam paper has 12 questions. She must answer any 8. In how many ways can she choose them?
Step 1. Order? She answers the same questions whatever order she picks them in. So this is a selection.
Step 2. The formula.12C8=8!4!12!.
Step 3. Cancel. Keep the smaller factorial below: 4×3×2×112×11×10×9=495.
Answer:495 ways. Choosing 8 to answer is the same as choosing 4 to leave out, so 12C8=12C4.
Practise with new numbers
Try it in Python
The itertools module lists the selections and the arrangements. The math module has comb(n, r) for nCr.
Common mistakes
Using nPr for a selection. A committee, a team or a hand of cards has no order. Divide by r!.
Using nCr for an arrangement. Prizes of different value, posts such as captain and vice captain, or a code, all have order.
Working out huge factorials. Cancel (n−r)! first, and multiply only r factors on top.
Forgetting nC0=1. Choosing nothing is one choice, not zero.
Remember these
A combination is a selection; order does not matter.
nCr=r!(n−r)!n!, and nPr=nCr×r!.
nCr=r!n(n−1)⋯(n−r+1), with r factors on top.
nC0=nCn=1, nC1=n and nC2=2n(n−1).
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Is choosing 5 students to clean the lab a permutation or a combination?
Work out 9C2 and 9C7.
Ten guests at a party each shake hands with every other guest once. How many handshakes are there?
nP3=990 and nC3=165. Check that these fit nPr=nCr×r!.
Why is nC0=1 and not 0?
Enroll free in Combinations
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.