From f2e7d6f36da0fada8158cfadc103e66c7576026d Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 19 Jan 2025 22:00:39 -0800 Subject: [PATCH] auto-update(nvim): 2025-01-19 22:00:39 --- .../pstat-120a/course-notes/main.typ | 105 +++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/documents/by-course/pstat-120a/course-notes/main.typ b/documents/by-course/pstat-120a/course-notes/main.typ index c07b837..8ca363f 100644 --- a/documents/by-course/pstat-120a/course-notes/main.typ +++ b/documents/by-course/pstat-120a/course-notes/main.typ @@ -580,7 +580,7 @@ Now we can use the multiplication principle to count permutations. $ (n)_k = n dot (n - 1) ... (n - k + 1) = n! / (n-k)! $ In particular, with $k=n$, each $n$-tuple is an ordering or _permutation_ of $A$. So the total number of permutations of a set of $n$ elements is $n!$. -] +] #proof[ We construct the $k$-tuples sequentially. For the first element, we choose @@ -592,3 +592,106 @@ Now we can use the multiplication principle to count permutations. @tuplemultiplication the number of $k$-tuples being $n dot (n - 1) dot ... dot (n - k + 1) = (n)_k$. ] + +#example[ + Consider a round table with 8 seats. + + + In how many ways can we seat 8 guests around the table? + + In how many ways can we do this if we do not differentiate between seating arrangements that are rotations of each other? + + For (1), we easily see that we're simply asking for permutations of an + 8-tuple, so $8!$ is the answer. + + For (2), we number each person and each seat from 1-8, then always place person 1 in seat 1, and count the permutations of the other 7 people in the other 7 seats. Then the answer is $7!$. + + Alternatively, notice that each arrangement has 8 equivalent arrangements under rotation. So the answer is $8!/8 = 7!$. +] + +== Counting from sets + +We turn our attention to sets, which unlike tuples are unordered collections. + +#fact[ + Let $n,k in NN$ with $0 <= k <= n$. The numbers of distinct subsets of size $k$ that a set of size $n$ has is given by the *binomial coefficient* + $ vec(n,k) = n! / (k! (n-k)!) $ +] + +#proof[ + Let $A$ be a set of size $n$. By @permutation, $n!/(n-k)!$ unique ordered + $k$-tuples can be constructed from elements of $A$. Each subset of $A$ of + size $k$ has exactly $k!$ different orderings, and hence appears exactly $k!$ + times among the ordered $k$-tuples. Thus the number of subsets of size $k$ is + $n! / (k! (n-k)!)$. +] + +#example[ + In a class there are 12 boys and 14 girls. How many different teams of 7 pupils + with 3 boys and 4 girls can be create? + + First let us compute how many subsets of size 3 we can choose from the 12 boys and how many subsets of size 4 we can choose from the 14 girls. + + $ + "boys" &= vec(12,3) \ + "girls" &= vec(14,4) + $ + + Then let us consider the entire team as a 2-tuple of (boys, girls). Then + there are $vec(12,3)$ alternatives for the choice of boys, and $vec(14,4)$ alternatives for + the choice of girls, so by the multiplication principle, we have the total being + + $ vec(12,3) vec(14,4) $ +] + +#example[ + Color the numbers 1, 2 red, the numbers 3, 4 green, and the numbers 5, 6 + yellow. How many different two-element subsets of $A$ are there that have two + different colors? + + First choose 2 colors, $vec(3,2) = 3$. Then from each color, choose one. Altogether it's + $ vec(3,2) vec(2,1) vec(2,1) = 3 dot 2 dot 2 = 12 $ +] + +One way to view $vec(n,k)$ is as the number of ways of painting $n$ elements +with two colors, red and yellow, with $k$ red and $n - k$ yellow elements. Let +us generalize to more than two colors. + +#fact[ + Let $n$ and $r$ be positive integers and $k_1, ..., k_r$ nonnegative integers + such that $k_1 + dots.c + k_r = n$. The number of ways of assigning labels + $1,2, ..., r$ to $n$ items so that for each $i = 1, 2, ..., r$, exactly $k_i$ + items receive label $i$, is the *multinomial coefficient* + + $ vec(n, (k_1, k_2, ..., k_r)) = vec(n!, k_1 ! k_2 ! dots.c k_r !) $ +] + +#proof[ + Order the $n$ integers in some manner, and assign labels like this: for the + first $k_1$ integers, assign the label 1, then for the next $k_2$ integers, + assign the label 2, and so on. The $i$th label will be assigned to all the + integers between positions $k_1 + dots.c + k_(i-1) + 1$ and $k_1 + dots.c + + k_i$. + + Then notice that all possible orderings (permutations) of the integers gives + every possible way to label the integers. However, we overcount by some + amount. How much? The order of the integers with a given label don't matter, + so we need to deduplicate those. + + Each set of labels is duplicated once for each way we can order all of the + elements with the same label. For label $i$, there are $k_i$ elements with + that label, so $k_i !$ ways to order those. By @tuplemultiplication, we know + that we can express the combined amount of ways each group of $k_1, ..., k_i$ + numbers are labeled as $k_1 ! k_2 ! k_3 ! dots.c k_r !$. + + So by @ktoone, we can account for the duplicates and the answer is + $ n! / (k_1 ! k_2 ! k_3 ! dots.c k_r !) $ +] + +#remark[ + @multinomial-coefficient gives us a way to count how many ways there are to + fit $n$ distinguishable objects into $r$ distinguishable containers of + varying capacity. + + To find the amount of ways to fit $n$ distinguishable objects into $k$ + indistinguishable containers of equal capacity, use the "ball-and-urn" + technique. +]