Docsity

Counting Subsets: Binomial Coefficients and Pascal's Triangle, Study notes of Discrete Structures and Graph Theory

Partial preview of the text

Download Counting Subsets: Binomial Coefficients and Pascal's Triangle and more Study notes Discrete Structures and Graph Theory in PDF only on Docsity!

Counting subsets

How many ways are there to play the Illinois Lottery?

  • Pick 4: Choose 4 numbers between 0 and 9.
  • Lotto: Choose 6 different numbers between 1 and 52.

( Binomial coefficients n k

is the number k-element subsets of a set of size n. ( n k

is pronounced “ n choose k ”

Alternate notations: C(n, k) or Cn,k or (^) nCk or Cnk or nCk None of these are used by professional mathematicians.

For any integers 0 ≤ k ≤ n:

n k

︷ k^ terms︸︸ ︷ n(n − 1)(n − 2) · · · (n − k + 1) k!

= n! k!(n − k)!

k∏− 1

i=

n − i k − i

Examples:

  • There are

· 5 · 4 · 3 · 2 · 1 = 2,^598 ,^960 different poker hands.

  • There are

6 · 5 · 4 · 3 · 2 · 1 = 20,^358 ,^520 dif- ferent ways to play Illinois Lotto.

  • There are

= 635, 013 , 559 , 600 different bridge hands.

Pascal’s Identity

( n k

n − 1 k − 1

n − 1 k

A k-element subset of { 1 , 2 , 3 ,... , n} either includes n or it doesn’t.

If it does, there are exactly

(n− 1 k− 1

ways to choose the other k − 1 elements from { 1 , 2 , 3 ,... , n − 1 }

If it doesn’t, there are exactly

(n− 1 k

ways to choose the k elements from { 1 , 2 , 3 ,... , n − 1 }.

Boundary cases: ( n 0

k k

If k < 0 , then

n k

= If k > n, then

n k

Induction!

( n k

∑^ k

i=

n − 1 i

Yang Hui’s Triangle, as drawn by Zhu Shijie in Si Yuan Yu Jian [Jade Mirror of the Four Unknowns] (1303)

Pascal’s Triangle

1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 2 4

8 16 32

64 128 256

∑^ n

k=

n k

= 2n

Theorem:

∑^ n

k=

n k

= 2n^ for all non-negative integers n.

Proof (combinatorial): Let n be an arbitrary non-negative integer.

Let X be an arbitrary set of size n.

X has exactly 2 n^ subsets.

Each subset of X has size between 0 and n.

By definition, X has exactly

n k

subsets of size k, for any integer k. 

This is just a special case of the Binomial Theorem :

(1 + x)n^ =

∑^ n

k=

n k

xk

(1 + x)^0 = 1 (1 + x)^1 = 1 + x (1 + x)^2 = 1 + 2x + x^2 (1 + x)^3 = 1 + 3x + 3x^2 + x^3 (1 + x)^4 = 1 + 4x + 6x^2 + 4x^3 + x^4 (1 + x)^5 = 1 + 5x + 10x^2 + 10x^3 + 5x^4 + 1

This is straightforward (but tedious) to prove by induction.

Combinatorial proof: There are n factors in the product (1 + x)(1 + x) · · · (1 + x). Each subset of k factors adds 1 to the xk^ coefficient.

Pascal’s Triangle

1 1 2 3 5 8

13 21 34

1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

∑^ n

k=

n − k k

= Fn

Fn is the nth Fibonacci number:

Fn =

0 if n = 0 1 if n = 1 Fn− 1 + Fn− 2 if n ≥ 2

Counting!

  • Product rule: |A × B| = |A| · |B|
  • Sum rule: If A ∩ B = ∅, then |A ∪ B| = |A| + |B|
  • Inclusion-exclusion: |A ∪ B| + |A ∩ B| = |A| + |B|
  • Functions: There are exactly |B||A|^ functions from A to B.
  • Permutations: There are exactly |A|! bijections from A to itself.
  • Equivalence class rule: If a set of size n is partitioned into equivalence classes, each with k elements, the number of equivalence classes is n/k.
  • Subsequence rule: There are exactly n!/(n − k)! different ways to choose a sequence of k distinct elements from a set of size n.
  • Subset rule: There are exactly

(n k

= n!/k!(n − k)! different ways to pull a subset of k distinct elements from a set of size n.

Why do we care?

  • Counting helps in analyzing algorithms.

A complete undirected graph with n vertices has

(n 2

edges.

  • Counting arguments help in thinking about algorithms.

How do you choose 5 random cards from a deck of size 52?

  • Counting arguments are good practice for induction proofs, and think- ing recursively is very useful.
  • Counting arguments are good practice for combinatorial proofs, and thinking combiantorially is very useful.
  • Pascal’s triangle is the coolest thing since non-decaffeinated coffee.