evan's notes
cal 3discreteodeenv systems
中文

On this page

  • Permutations: order matters
  • Example: assigning three offices
  • Combinations: order does not matter
  • Example: forming a committee
  • Example: poker hands and flushes
  • Example: bit strings with four zeros
  • Stars and bars
  • Two binomial identities
  • Symmetry
  • Pascal's identity
  • Pascal's triangle

Discrete Structures

§3 Permutations and Combinations

Evan Luo · Sep 10, 2026

Discrete Structures

§3 Permutations and Combinations

Evan LuoSep 10, 2026

5 min read

Counting depends on whether order matters and whether repetition is allowed. Those two questions decide whether a problem uses permutations, combinations, or a different model such as stars and bars.

Permutations: order matters

A kkk-permutation of an nnn-element set is an ordered arrangement of kkk distinct elements. Here nnn and kkk are nonnegative integers with k≤nk\le nk≤n. There are

P(n,k)=n!(n−k)!\boxed{P(n,k)=\frac{n!}{(n-k)!}} P(n,k)=(n−k)!n!​​

such arrangements. The factorial notation means

n!=n(n−1)(n−2)⋯2⋅1,0!=1.n!=n(n-1)(n-2)\cdots2\cdot1, \qquad 0!=1. n!=n(n−1)(n−2)⋯2⋅1,0!=1.

The first position has nnn choices, the second has n−1n-1n−1, and the kkkth has n−k+1n-k+1n−k+1. Their product is n!/(n−k)!n!/(n-k)!n!/(n−k)!.

Example: assigning three offices

From a class of 202020 students, choose a president, a vice-president, and a secretary. The offices are different, so order matters:

20⏟president⋅19⏟vice-president⋅18⏟secretary=6840.\underbrace{20}_{\text{president}} \cdot \underbrace{19}_{\text{vice-president}} \cdot \underbrace{18}_{\text{secretary}} =6840. president20​​⋅vice-president19​​⋅secretary18​​=6840.

This is also

P(20,3)=20!17!=20⋅19⋅18.P(20,3)=\frac{20!}{17!}=20\cdot19\cdot18. P(20,3)=17!20!​=20⋅19⋅18.

When k=nk=nk=n, every element is used. This is a full permutation, and

P(n,n)=n!0!=n!.P(n,n)=\frac{n!}{0!}=n!. P(n,n)=0!n!​=n!.

For example, the set {1,2,3,4,5}\{1,2,3,4,5\}{1,2,3,4,5} has

5!=1205!=120 5!=120

permutations.

Combinations: order does not matter

A kkk-combination of an nnn-element set is a subset with exactly kkk elements, where n,k∈Z≥0n,k\in\mathbb Z_{\ge0}n,k∈Z≥0​ and k≤nk\le nk≤n. Its order does not matter. The notation

(nk)\binom nk (kn​)

is read “nnn choose kkk” and is called a binomial coefficient.

Every group of kkk selected elements has k!k!k! possible orders. Dividing the permutation count by k!k!k! removes those repeated arrangements:

(nk)=C(n,k)=P(n,k)k!=n!k!(n−k)!.\boxed{ \binom{n}{k} =C(n,k) =\frac{P(n,k)}{k!} =\frac{n!}{k!(n-k)!} }. (kn​)=C(n,k)=k!P(n,k)​=k!(n−k)!n!​​.

Example: forming a committee

A three-student committee from a class of 202020 has no assigned offices. The same three students were counted 3!=63!=63!=6 times by the ordered calculation, so

(203)=20⋅19⋅183⋅2⋅1=1140.\binom{20}{3} =\frac{20\cdot19\cdot18}{3\cdot2\cdot1} =\boxed{1140}. (320​)=3⋅2⋅120⋅19⋅18​=1140​.

Example: poker hands and flushes

A five-card hand is a set of five cards chosen from a deck of 525252, so the number of hands is

(525).\binom{52}{5}. (552​).

To count five-card hands in which every card has the same suit:

  1. choose one of the four suits;
  2. choose five of the thirteen cards in that suit.

The product principle gives

4(135).4\binom{13}{5}. 4(513​).

Example: bit strings with four zeros

A length-101010 bit string containing exactly four zeros is determined by the four positions occupied by those zeros. Therefore,

(104)=210.\boxed{\binom{10}{4}=210}. (410​)=210​.

The remaining six positions automatically contain ones.

Stars and bars

Use stars and bars when identical objects are distributed among distinct categories and a category may receive more than one object.

Suppose a store has seven chocolate flavors, and we choose four bars. Purchase order does not matter, and repeated flavors are allowed. Represent each bar by a star and use six dividers to split the stars among seven flavors.

For example,

**|*||*|||

represents two bars of the first flavor, one of the second, none of the third, one of the fourth, and none of the last three.

Every purchase corresponds to a string with four stars and six dividers. The string has ten positions, and choosing the four star positions gives

(104)=210.\boxed{\binom{10}{4}=210}. (410​)=210​.

More generally, if r≥0r\ge0r≥0 and n≥1n\ge1n≥1 are integers, distributing rrr identical objects among nnn categories gives

(r+n−1r)\binom{r+n-1}{r} (rr+n−1​)

possibilities when zero objects in a category are allowed.

There are rrr stars and n−1n-1n−1 dividers, hence r+n−1r+n-1r+n−1 positions in total. Choosing the rrr star positions produces the formula.

Two binomial identities

A combinatorial proof shows that two expressions are equal by showing that they count the same collection in two different ways.

Symmetry

The first identity is

(nk)=(nn−k).\boxed{\binom{n}{k}=\binom{n}{n-k}}. (kn​)=(n−kn​)​.

A length-nnn bit string with kkk zeros has n−kn-kn−k ones. We can count the same strings by choosing either:

  • the kkk positions occupied by zeros, giving (nk)\binom nk(kn​); or
  • the n−kn-kn−k positions occupied by ones, giving (nn−k)\binom n{n-k}(n−kn​).

Both expressions count exactly the same strings, so they are equal.

The factorial formula gives the same identity algebraically:

(nk)=n!k!(n−k)!=n!(n−k)!k!=(nn−k).\binom nk =\frac{n!}{k!(n-k)!} =\frac{n!}{(n-k)!k!} =\binom n{n-k}. (kn​)=k!(n−k)!n!​=(n−k)!k!n!​=(n−kn​).

Pascal's identity

For integers n≥1n\ge1n≥1 and 1≤k≤n1\le k\le n1≤k≤n, Pascal's identity is

(n+1k)=(nk−1)+(nk).\boxed{ \binom{n+1}{k} = \binom{n}{k-1} + \binom{n}{k} }. (kn+1​)=(k−1n​)+(kn​)​.

Consider a class of n+1n+1n+1 students, including one particular student called student 000. Count the kkk-student committees by splitting them into two disjoint cases:

  1. Student 000 is on the committee. Choose the other k−1k-1k−1 members from the remaining nnn students, giving (nk−1)\binom n{k-1}(k−1n​) committees.
  2. Student 000 is not on the committee. Choose all kkk members from the remaining nnn students, giving (nk)\binom nk(kn​) committees.

The cases do not overlap and include every committee. The sum principle gives Pascal's identity.

At the boundary, use (n0)=(nn)=1\binom n0=\binom nn=1(0n​)=(nn​)=1. If Pascal's identity is to include the endpoints, adopt the convention (nr)=0\binom nr=0(rn​)=0 when r<0r<0r<0 or r>nr>nr>n.

Pascal's triangle

Pascal's identity calculates each interior binomial coefficient by adding the two entries above it. The boundary values are

(n0)=(nn)=1.\binom n0=\binom nn=1. (0n​)=(nn​)=1.

The first five rows are

111121133114641.\begin{array}{ccccccccc} &&&&1&&&&\\ &&&1&&1&&&\\ &&1&&2&&1&&\\ &1&&3&&3&&1&\\ 1&&4&&6&&4&&1. \end{array} 1​1​14​13​126​13​14​1​1.​

For example,

(42)=(31)+(32)=3+3=6.\binom42=\binom31+\binom32=3+3=6. (24​)=(13​)+(23​)=3+3=6.

This gives a recursive way to calculate binomial coefficients using addition instead of factorials.

Source: https://notes.ohevan.com/notes/discrete-structures/03-permutations-and-combinations

© 2026 Evan Luo. All rights reserved.

Back to Discrete Structures

0 reads

·Last edited Oct 19, 2026
  • newsletter

  • about me

  • sponsor

© 2026 Evan Luo. All rights reserved.