DSCI 220, 2025 W1
November 18, 2025
You have 5 cookies ๐ช and 3 friends ๐ฉโ๐ฆฑ๐งโ๐ฆฐ๐งโ๐ฆฑ. Each friend can get any number of cookies.
Question: How many different ways can you share the cookies?
Each way of sharing is one arrangement of 5 stars and 2 bars.
Or equivalently:
\[ \text{# ways} = \binom{5 + 3 - 1}{3 - 1} = \binom{7}{2} = 21 \]
You need to buy 5 boxes of GG ๐ช, and there are 3 flavours.
Question: How many different ways can you buy the boxes of cookies?
| Scenario | Interpretation | Whatโs being partitioned? |
|---|---|---|
| ๐ช Cookie Counter | Distributing identical items among labeled friends | Items โ People |
| ๐ Girl Guide Boxes | Counting totals of each labelled flavour | boxes โ Flavours |
Each arrangement of stars and bars corresponds to a unique configuration:
\[ \text{# ways} = \binom{j + k - 1}{k - 1} \]
After King Arthurโs death, Guenevere always sits in the same seat. The 100 knights are arranged clockwise in increasing order of honor using 5 ranks. Knights of the same rank are indistinguishable, and each rank sits together (one contiguous block).
Question:
How many different seating configurations are possible?
Discussion:
Suppose you have 10 cookies and 3 friends, and each friend must receive at least one cookie.
Suppose a set of \(n\) items is to be partitioned among \(k\) categories, \(C_1, \ldots, C_k\).
Also, suppose category \(C_i\) requires \(x_i\) items.
Then the number of partitions is:
\[ \binom{n - \sum_{i=1}^{k} x_i + k - 1}{k - 1} \]
Reasoning:
Among 10 students, each will choose either AI or Data Science for a class project.
| Student | Choice |
|---|---|
| 1 | ๐ค๐ |
| 2 | ๐ค๐ |
| โฎ | โฎ |
| 10 | ๐ค๐ |
\[ \Rightarrow 2^{10} \text{ unique groups } \]
But notice that each of those choices has some number, \(k\), of DSci. How many ways are there to choose \(k\) students for DSci, from among the 10?
This is true for any \(k\), so we must have:
\[ \binom{10}{0} + \binom{10}{1} + \cdots + \binom{10}{10} = 2^{10}. \]
This is the sum of binomial coefficients identity โ each term counts the groupings with exactly \(k\) DSci projects, and the sum counts all possible configurations.
Our 10 students can now choose a project in AI, Data Science, or Statistics.
Question:
How many different ways can the classโs choices be distributed?
| Category | Symbol | Count |
|---|---|---|
| AI | ๐ค | \(x_1\) |
| DSci | ๐ | \(x_2\) |
| Stat | ๐ | \(x_3\) |
Each student picks exactly one category, so:
\[ x_1 + x_2 + x_3 = 10 \]
Count as a sequence of combination steps:
For each of the \(\binom{10}{x_1}\) choices of AI, there are \(\binom{10 - x_1}{x_2}\) choices of DSCI, and the rest are Stat.
\[ \text{Total} = \binom{10}{x_1} \binom{10 - x_1}{x_2} = \frac{10!}{x_1!x_2!(10 - x_1 - x_2)!} \]
Generalizing to \(k\) categories:
If \(n\) students choose among \(k\) labeled categories with counts \(x_1,\dots,x_k\):
\[ \binom{n}{x_1,x_2,\ldots,x_k} = \frac{n!}{x_1!x_2!\cdots x_k!} \]
Weโve seen how two categories led to:
\[ \sum_{k=0}^{n} \binom{n}{k} = 2^n \]
Now each student chooses one of three project types: ๐ค AI, ๐ Data Science, or ๐ Statistics
For each possible triple \((x_1, x_2, x_3)\) with \(x_1 + x_2 + x_3 = n\), the number of ways to assign projects is:
\[ \binom{n}{x_1, x_2, x_3} = \frac{n!}{x_1!x_2!x_3!} \]
If we add them all up โ over every valid triple:
\[ \sum_{x_1+x_2+x_3=n} \binom{n}{x_1, x_2, x_3} = 3^n \]
What is the result if there are \(k\) choices?
\[ \sum_{x_1+x_2+\ldots x_k=n} \binom{n}{x_1, x_2, \ldots x_k} = k^n \]