LECTURE 03

Counting Things

The primitive of multiplicity. How many?

COLLECTION

The Hook

Question 1: You have 5 different reagent bottles. How many ways can you arrange them on a shelf?

Question 2: A protein has 100 amino acid positions. Each position can be one of 20 amino acids. How many possible sequences exist?

Question 3: Benzene has 6 equivalent positions. You want to substitute 2 of them with chlorine. How many dichlorobenzene isomers are there?

These questions share a structure: counting configurations.

The numbers involved grow rapidly. Question 2 has more possible sequences than atoms in the observable universe.

We need systematic methods.

Recognition

THE PRIMITIVE

COLLECTION: "There are many."

Before we can do anything with objects — arrange them, select them, distribute them — we must count them.

Counting is the foundation. The tools are:

The Multiplication Principle

The most fundamental counting rule.

If task A can be done in m ways, and for each way of doing A, task B can be done in n ways, then A followed by B can be done in m × n ways.

Interactive: Decision Tree

Watch how choices multiply at each step.

[ MULTIPLICATION PRINCIPLE TREE ]
3
2
3 × 3 = 9 outcomes

Examples

License plates: 3 letters followed by 3 digits

DNA sequences of length k:

Each position has 4 choices (A, T, G, C). For k positions: 4k sequences.

General formula: n choices at each of k positions → nk sequences.

The Factorial

How many ways to arrange n distinct objects in a row?

DEFINITION

The factorial of a non-negative integer n is:

$$n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1$$

with the convention that 0! = 1.

Why 0! = 1?

  1. Combinatorial: There is exactly one way to arrange zero objects: do nothing.
  2. Recursive: We have n! = n × (n−1)!. Setting n = 1: 1! = 1 × 0!, so 0! = 1.
  3. Gamma function: Γ(1) = 1, and Γ(n+1) = n! for positive integers.

Interactive: Factorial Calculator

[ FACTORIAL VALUES ]
5
5! = 5 × 4 × 3 × 2 × 1
= 120

Factorial Growth

Factorials grow faster than exponentials. 70! > 10100 (a googol).

[ FACTORIAL GROWTH — LOG SCALE ]
10
n!    2n    10n

Stirling's Approximation

For large n:

$$n! \approx \sqrt{2\pi n} \left(\frac{n}{e}\right)^n$$

Or more simply: $$\ln(n!) \approx n\ln(n) - n$$

nn!
01
5120
103,628,800
202.43 × 1018
1009.33 × 10157

Permutations

A permutation is an arrangement of objects where order matters.

PERMUTATIONS OF n TAKEN k

From n distinct objects, the number of ways to select and arrange k of them:

$$P(n, k) = \frac{n!}{(n-k)!} = n \times (n-1) \times \cdots \times (n-k+1)$$

Interactive: Permutation Calculator

[ PERMUTATIONS P(n, k) ]
10
3
P(10, 3) = 10 × 9 × 8
= 720

Example: From 10 runners, how many ways to award gold, silver, bronze?

P(10, 3) = 10 × 9 × 8 = 720

Permutations with Repetition

How many arrangements of the letters in MISSISSIPPI?

The formula:

$$\frac{n!}{n_1! \times n_2! \times \cdots \times n_k!}$$

MISSISSIPPI: $\frac{11!}{1! \times 4! \times 4! \times 2!} = \frac{39,916,800}{1,152} = 34,650$

Combinations

A combination is a selection of objects where order does not matter.

COMBINATIONS OF n TAKEN k

From n distinct objects, the number of ways to choose k of them:

$$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$

Read as "n choose k"

Key insight: Each unordered selection of k objects can be arranged in k! ways. So:

$$\binom{n}{k} = \frac{P(n,k)}{k!}$$

Interactive: Combination Calculator

[ COMBINATIONS C(n, k) ]
10
3
C(10, 3) = 10! / (3! × 7!)
= 120
Symmetry: C(10, 3) = C(10, 7) = 120

Properties of Binomial Coefficients

Symmetry: $\binom{n}{k} = \binom{n}{n-k}$

Choosing k objects to include is equivalent to choosing n−k objects to exclude.

Pascal's Identity: $\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}$

Each entry is the sum of two entries above it.

Sum of row n: $\displaystyle\sum_{k=0}^{n} \binom{n}{k} = 2^n$

Pascal's Triangle

[ PASCAL'S TRIANGLE ]
8
Click any entry to see its identity

The Binomial Theorem

$$(x + y)^n = \sum_{k=0}^{n} \binom{n}{k} x^{n-k} y^k$$

Example: $(x + y)^4 = x^4 + 4x^3y + 6x^2y^2 + 4xy^3 + y^4$

Coefficients: 1, 4, 6, 4, 1 — row 4 of Pascal's triangle.

Counting Principles Summary

Situation Formula When to use
n choices at each of k positions nk Independent choices with replacement
Arrange n distinct objects n! All objects, order matters
Arrange k of n distinct objects n!/(n−k)! Subset, order matters
Arrange n with repetitions n!/(n₁!n₂!···) Identical objects present
Choose k of n objects n!/[k!(n−k)!] Subset, order doesn't matter

Chemistry Connections

Counting Isomers

How many structural isomers of C₅H₁₂ (pentane)?

Not a simple formula — requires enumerating distinct carbon skeletons:

  1. n-pentane: C-C-C-C-C (linear)
  2. isopentane: C-C-C(-C)-C (one branch)
  3. neopentane: C-C(-C)(-C)-C (two branches on same carbon)

Answer: 3 isomers.

For larger alkanes, the count grows rapidly:

Benzene Substitution Patterns

Benzene has 6 equivalent positions. Choose 2 for Cl.

Naive count: $\binom{6}{2} = 15$

But benzene has symmetry. Positions related by rotation/reflection give the same isomer.

[ BENZENE SUBSTITUTION ]
2
Naive count: C(6, 2) = 15
Distinct isomers: 3

Actual distinct dichlorobenzene isomers:

  1. ortho (1,2-): adjacent positions
  2. meta (1,3-): one position apart
  3. para (1,4-): opposite positions

Answer: 3 isomers. Symmetry reduces the count from 15 to 3.

Electron Configurations

How many ways to put electrons in orbitals?

[ ELECTRON MICROSTATES ]
2
Microstates = C(6, 2)
= 15

For p² (2 electrons in p subshell): C(6, 2) = 15 microstates

These 15 microstates span three term symbols: ³P (9), ¹D (5), ¹S (1).

Protein Sequences

How many possible sequences for a 100-residue protein?

20 amino acid choices at each of 100 positions:

$20^{100} = 10^{130}$

For comparison:

The sequence space of even modest proteins is astronomically vast. This is why evolution explores only a tiny fraction of possible sequences.

Statistical Mechanics: Microstates

The Boltzmann entropy:

$$S = k_B \ln W$$

where W is the number of microstates.

If n₁ particles have energy E₁, n₂ have E₂, etc., the number of arrangements is:

$$W = \frac{N!}{n_1! n_2! n_3! \cdots}$$

This multinomial coefficient counts how many ways to partition N distinguishable particles into groups.

Exercises

Exercise 1: Basic Counting

(a) How many 5-letter "words" can be formed from the 26-letter alphabet (letters can repeat)?

(b) How many if no letter can repeat?

(c) How many 5-letter words have exactly one vowel (A, E, I, O, U)?

Exercise 2: Factorials

(a) Compute 8!/5! without computing each factorial separately.

(b) Simplify: n!/(n−2)!

(c) Use Stirling's approximation to estimate ln(50!).

Exercise 3: Permutations

(a) How many ways can 8 people stand in a line?

(b) How many ways can 8 people sit at a round table? (Rotations are considered the same.)

(c) How many distinct arrangements of the letters in CHEMISTRY?

Exercise 4: Combinations

(a) From a standard 52-card deck, how many 5-card hands are possible?

(b) How many of these hands contain exactly 2 aces?

(c) How many contain at least one ace?

Exercise 5: Chemistry Applications

(a) How many tripeptides can be formed from the 20 standard amino acids?

(b) Methane (CH₄) has 4 equivalent H atoms. How many distinct mono-chlorinated products exist when one H is replaced by Cl?

(c) For the complex [Co(NH₃)₄Cl₂]⁺, how many geometric isomers exist? (Hint: octahedral geometry)