Math Atlas

순열과 조합Permutations & Combinations

Algebra 2Algebra 2 · 9. 세기와 확률9. Counting & Probability

학습 목표
  • 합의 법칙과 곱의 법칙으로 세기를 조립한다.
  • 순열 nPr_n\mathrm P_r을 곱의 법칙에서, 조합 nCr_n\mathrm C_r을 "순서 지우기" 나눗셈에서 유도한다.
  • 묶음·여사건·같은 것이 있는 순열 등 표준 기법을 익힌다.

두 법칙: 세기의 문법

세기의 조립 부품은 둘뿐이다.

  • 합의 법칙: 두 경우가 겹치지 않으면, 전체는 각각의 합 — "A 또는 B".
  • 곱의 법칙: 일이 단계로 나뉘고 각 단계의 가짓수가 앞 선택과 무관하면, 전체는 곱 — "A 그리고 B".
예제

셔츠 44벌, 바지 33벌로 만드는 옷차림: 셔츠 선택(4) 그리고 바지 선택(3) — 4×3=124 \times 3 = 12가지.

nn명을 한 줄로 세우는 것은 곱의 법칙의 연쇄다: 첫 자리 nn, 둘째 자리 n1n-1, … —

n!=n×(n1)××2×1n! = n \times (n-1) \times \cdots \times 2 \times 1

(nn 팩토리얼). 5!=1205! = 120, 10!=3,628,80010! = 3{,}628{,}800 — 팩토리얼은 폭발적으로 자란다.

순열: 뽑아서 줄 세우기

nn개 중 rr개를 뽑아 순서 있게 배열하는 가짓수가 순열 nPr_n\mathrm P_r이다. 곱의 법칙으로: 첫 자리 nn, 둘째 n1n-1, …, rr번째 자리 nr+1n - r + 1

nPr=n(n1)(nr+1)=n!(nr)!_n\mathrm P_r = n(n-1)\cdots(n-r+1) = \frac{n!}{(n-r)!}

(뒤 표기는 n!n!에서 쓰지 않은 꼬리 (nr)!(n-r)!을 나눠 지운 것). 5P2=5×4=20_5\mathrm P_2 = 5 \times 4 = 20.

조합: 순서를 지우는 나눗셈

순서 없이 rr개를 뽑기만 하는 가짓수가 조합 nCr_n\mathrm C_r이다. 유도는 이중 세기다 — 순열을 두 단계로 다시 세면: 먼저 rr개를 뽑고(nCr_n\mathrm C_r가지), 뽑힌 것들을 줄 세운다(r!r!가지):

nPr=nCr×r!    nCr=nPrr!=n!r!(nr)!_n\mathrm P_r = {}_n\mathrm C_r \times r! \;\Longrightarrow\; \boxed{{}_n\mathrm C_r = \frac{_n\mathrm P_r}{r!} = \frac{n!}{r!\,(n-r)!}}

— 순열에서 순서의 중복 r!r!을 나눠 지운 것이 조합이다.

6 = 3 × 2! AB BA ÷2! {A, B} AC CA ÷2! {A, C} BC CB ÷2! {B, C}
순서쌍 여섯이 짝을 지우면 셋으로 — 나눗셈 2!의 정체.

대칭도 공짜로 나온다:

nCr=nCnr_n\mathrm C_r = {}_n\mathrm C_{n-r}

rr개를 뽑는 것과 nrn - r개를 남기는 것은 같은 행동이기 때문이다(10C8=10C2=45_{10}\mathrm C_8 = {}_{10}\mathrm C_2 = 45처럼 계산도 짧아진다).

표준 기법 세 가지

묶음: "두 사람이 이웃하도록"은 둘을 한 덩어리로 묶어 배열하고((n1)! (n-1)!꼴), 덩어리 안을 다시 배열한다(2!2!).

여사건: "적어도 하나"는 정면으로 세면 갈래가 많다 — 전체에서 '하나도 없는' 경우를 뺀다.

같은 것이 있는 순열: 같은 글자끼리의 자리바꿈은 구별되지 않으므로 팩토리얼로 나눈다 — LEVEL의 배열은 5!2!2!=30\dfrac{5!}{2!\,2!} = 30 (L 둘, E 둘).

주의

순열이냐 조합이냐의 판별 질문은 하나다 — 뽑힌 것들의 역할이 다른가? 회장·부회장(다름)은 순열, 대표 둘(같음)은 조합. 그리고 0!=10! = 1은 약속이되 자의적이지 않다: nCn=n!n!0!=1_n\mathrm C_n = \frac{n!}{n!\,0!} = 1("전부 뽑기"는 한 가지)이 성립하려면 그래야 한다. 곱의 법칙은 각 단계의 가짓수가 앞 선택과 무관할 때만 쓴다.

Goals
  • Assemble counts with the addition and multiplication principles.
  • Derive permutations nPr_n\mathrm P_r from the multiplication principle, and combinations nCr_n\mathrm C_r by the "erase the order" division.
  • Master the standard techniques: gluing, complements, repeated-letter arrangements.

Two principles: the grammar of counting

Counting assembles from just two parts.

  • Addition principle: if two cases never overlap, the total is the sum — "A or B."
  • Multiplication principle: if a task splits into stages whose option-counts don't depend on earlier choices, the total is the product — "A and B."
Example

Outfits from 44 shirts and 33 pants: choose a shirt (4) and pants (3) — 4×3=124 \times 3 = 12.

Lining up nn people chains the multiplication principle: nn for the first spot, n1n-1 for the second, … —

n!=n×(n1)××2×1n! = n \times (n-1) \times \cdots \times 2 \times 1

(nn factorial). 5!=1205! = 120, 10!=3,628,80010! = 3{,}628{,}800 — factorials grow explosively.

Permutations: choose, then line up

The number of ways to pick rr of nn objects in order is the permutation nPr_n\mathrm P_r. By the multiplication principle: nn choices, then n1n-1, …, down to nr+1n - r + 1 for the rrth spot —

nPr=n(n1)(nr+1)=n!(nr)!_n\mathrm P_r = n(n-1)\cdots(n-r+1) = \frac{n!}{(n-r)!}

(the right form divides away the unused tail (nr)!(n-r)! of n!n!). 5P2=5×4=20_5\mathrm P_2 = 5 \times 4 = 20.

Combinations: the division that erases order

The number of ways to merely select rr objects, order ignored, is the combination nCr_n\mathrm C_r. The derivation is a double count — recount permutations in two stages: first select rr objects (nCr_n\mathrm C_r ways), then line them up (r!r! ways):

nPr=nCr×r!    nCr=nPrr!=n!r!(nr)!_n\mathrm P_r = {}_n\mathrm C_r \times r! \;\Longrightarrow\; \boxed{{}_n\mathrm C_r = \frac{_n\mathrm P_r}{r!} = \frac{n!}{r!\,(n-r)!}}

— a combination is a permutation with the r!r!-fold order-redundancy divided out.

6 = 3 × 2! AB BA ÷2! {A, B} AC CA ÷2! {A, C} BC CB ÷2! {B, C}
Six ordered pairs collapse to three when order is erased — the division by 2! in the flesh.

Symmetry falls out free:

nCr=nCnr_n\mathrm C_r = {}_n\mathrm C_{n-r}

choosing rr and leaving nrn - r are the same act (and computations shorten: 10C8=10C2=45_{10}\mathrm C_8 = {}_{10}\mathrm C_2 = 45).

Three standard techniques

Gluing: "two people adjacent" — glue them into one block, arrange the blocks ((n1)!(n-1)!-style), then arrange within the glue (2!2!).

Complements: "at least one" splinters when counted head-on — count everything, subtract the 'none' cases.

Repeated letters: swaps among identical letters are indistinguishable, so divide by their factorials — LEVEL arranges in 5!2!2!=30\dfrac{5!}{2!\,2!} = 30 ways (two L's, two E's).

Watch out

The one diagnostic question for permutation versus combination: do the chosen objects get different roles? President and vice-president (different) — permutation; two delegates (same) — combination. And 0!=10! = 1 is a convention but not arbitrary: nCn=n!n!0!=1_n\mathrm C_n = \frac{n!}{n!\,0!} = 1 ("choose all" is one way) demands it. Use the multiplication principle only when each stage's count of options is independent of earlier choices.