From c0890e35fadb91d5a6bd412bc963e1bbfdd724f9 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 19 Jan 2025 23:14:43 -0800 Subject: [PATCH] auto-update(nvim): 2025-01-19 23:14:43 --- .../pstat-120a/course-notes/main.typ | 78 ++++++++++++++++++- 1 file changed, 77 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 8ca363f..929292d 100644 --- a/documents/by-course/pstat-120a/course-notes/main.typ +++ b/documents/by-course/pstat-120a/course-notes/main.typ @@ -692,6 +692,82 @@ us generalize to more than two colors. 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" + indistinguishable containers of _any_ capacity, use the "ball-and-urn" technique. ] + +#example[ + How many different ways can six people be divided into three pairs? + + First we use the multimonial coefficient to count the amount of ways to assign specific labels to pairs of elements: + $ vec(6, (2,2,2)) $ + But notice that the actual labels themselves are irrelevant. Our multimonial + coefficient counts how many ways there are to assign 3 distinguishable + labels, say Pair 1, Pair 2, Pair 3, to our 6 elements. + + To make this more explicit, say we had a 3-tuple where the position encoded + the label, where position 1 corresponds to Pair 1, and so on. Then the values + are the actual pairs of people (numbered 1-6). For instance + $ ((1,2), (3,4), (5,6)) $ + corresponds to assigning the label Pair 1 to (1,2), Pair 2 to (3,4) and Pair + 3 to (5,6). What our multimonial coefficient is doing is it's counting this, + as well as any other orderings of this tuple. For instance + $ ((3,4), (1,2), (5,6)) $ + is also counted. However since in our case the actual labels are irrelevant, + the two examples shown above should really be counted only once. + + How many extra times is each case counted? It turns out that we can think of + our multimonial coefficient as permuting the labels across our pairs. So in + this case it's permuting all the ways we can order 3 labels, which is $3! = + 6$. That means by @ktoone our answer is + + $ vec(6, (2,2,2)) / 3! = 15 $ +] + +#example("Poker")[ + How many poker hands are in the category _one pair_? + + A one pair is a hand with two cards of the same rank and three cards with ranks + different from each other and the pair. + + We can count in two ways: we count all the ordered hands, then divide by $5!$ + to remove overcounting, or we can build the unordered hands directly. + + When finding the ordered hands, the key is to figure out how we can encode + our information in a tuple of the form described in @tuplemultiplication, and + then use @tuplemultiplication to compute the solution. + + In this case, the first element encodes the two slots in the hand of 5 our + pair occupies, the second element encodes the first card of the pair, the + third element encodes the second card of the pair, and the fourth, fifth, and + sixth elements represent the 3 cards that are not of the same rank. + + Now it is clear that the number of alternatives in each position of the + 6-tuple does not depend on any of the others, so @tuplemultiplication + applies. Then we can determine the amount of alternatives for each position + in the 6-tuple and multiply them to determine the total amount of ways the + 6-tuple can be constructed, giving us the total amount of ways to construct + ordered poker hands with one pairs. + + First we choose 2 slots out of 5 positions (in the hand) so there are + $vec(5,2)$ alternatives. Then we choose any of the 52 cards for our first + pair card, so there are 52 alternatives. Then we choose any card with the + same rank for the second card in the pair, where there are 3 possible + alternatives. Then we choose the third card which must not be the same rank + as the first two, where there are 48 alternatives. The fourth card must not + be the same rank as the others, so there are 44 alternatives. Likewise, the + final card has 40 alternatives. + + So the final answer is, remembering to divide by $5!$ because we don't care + about order, + $ (vec(5,2) dot 52 dot 3 dot 48 dot 44 dot 40) / 5! $ + + Alternatively, we can find way to build an unordered hand with the + requirements. First we choose the rank of the pair, then we choose two suits + for that rank, then we choose the remaining 3 different ranks, and finally a + suit for each of the ranks. Then, noting that we will now omit constructing + the tuple and explicitly listing alternatives for brevity, we have + $ 13 dot vec(5,2) dot vec(12, 3) dot 4^3 $ + + Both approaches given the same answer. +]