Professional Documents
Culture Documents
Stars and Bars Introduction To Competition Math
Stars and Bars Introduction To Competition Math
Stars and Bars Introduction To Competition Math
Akshay A.∗
May 2020
Preface
1
Akshay A. CONTENTS
Contents
2 Problems 20
2.1 Problems . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2 Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . 24
3 Ending Remarks 36
3.1 Acknowledgements . . . . . . . . . . . . . . . . . . . 36
3.2 Contact Information . . . . . . . . . . . . . . . . . . 36
2
Akshay A. 1 DEFINING STARS AND BARS
3
Akshay A. 1 DEFINING STARS AND BARS
Remark 1.0.1 Some people call stars and bars “stones and
sticks” as well as “ball and urn”. Just note these so that you
don’t get confused.
4
Akshay A. 1 DEFINING STARS AND BARS
5
Akshay A. 1 DEFINING STARS AND BARS
Now, let us mark all the gaps in which we can insert the lines
as we did above. Note that any person can have 0 candies, which
is why we have to count the gap to the left of the leftmost ball and
the gap to the right of the rightmost ball.
6
Akshay A. 1 DEFINING STARS AND BARS
However, adding in the extra gaps is not very easy. Every gap
between the balls could have up to 5 (all of the lines) lines inside
of it. As we initially had seven slots, we would now have 7 · 5 = 35
slots. We now face an annoying, yet true conundrum. If we have
five gaps but only put one line, it’s identical if the line is on the 1st
gap, the 2nd gap, the 3rd gap, the 4th gap, or the 5th gap.
The diagram below shows an example of this being true.
Assume the gaps are in between two balls.
Putting just one line in the first slot like that is equivalent to
putting just one line on another gap, as shown below.
7
Akshay A. 1 DEFINING STARS AND BARS
circles.
8
Akshay A. 1 DEFINING STARS AND BARS
Example 1.2.1 How many ways are there for Jones to give
eight coins to his four friends such that each of his friends gets
at least one coin?
In this question, we will try to use our stars and bars strategy.
However, we will need to be a little careful because everyone gets
at least one coin.
Let’s mark all the gaps which we can use, yet we have to be
careful not to mark extra gaps, as no person can get 0 coins.
9
Akshay A. 1 DEFINING STARS AND BARS
10
Akshay A. 1 DEFINING STARS AND BARS
This is essentially what stars and bars is. In the next section,
we’ll look at the concept of partitions, which sometimes overlaps
with stars and bars problems.
First, what exactly are partitions, and how are they different
from stars and bars? As usual, we will resort to a problem.
When we first read this, it feels like a standard stars and bars
question. However, recall stars and bars also require a different
order of the addends, as previously shown. That means that this
question cannot be solved with stars and bars. Additionally,
through this problem, we’ll be able to prove the first out of three
partition formulas!
Just like other problems, we’ll look at it like a picture!
We’ll start by drawing our example in the problem 3 + 3 + 4
into a diagram.
11
Akshay A. 1 DEFINING STARS AND BARS
Remark 1.3.1 The first row of the diagram has 4, the second
row of the diagram has 3, and the last row of the diagram has
3, matching 4 + 3 + 3. This is called the Young Diagram.
12
Akshay A. 1 DEFINING STARS AND BARS
13
Akshay A. 1 DEFINING STARS AND BARS
14
Akshay A. 1 DEFINING STARS AND BARS
15
Akshay A. 1 DEFINING STARS AND BARS
16
Akshay A. 1 DEFINING STARS AND BARS
is because in any of the two remaining rows, there can be one ball.
Then, when we add a third group of one ball, we’ll have two
groups of one ball, which means that they aren’t distinct.
Therefore, we have to think of something else to do.
You’ll notice both theorem 1.3.1 and theorem 1.3.2 are rather
17
Akshay A. 1 DEFINING STARS AND BARS
Example 1.3.3 How many ways are there for two or more
positive integers to sum to 10, such that the order matters?
(for example, 6 + 3 + 1 is different from 1 + 3 + 6).
18
Akshay A. 1 DEFINING STARS AND BARS
+ ∗
19
Akshay A. 2 PROBLEMS
2 Problems
2.1 Problems
Problem 1: How many ways are there for James to give his 17
identical dimes to his 3 friends, such that each of his friends gets at
least 3 dimes? Hints: 3
20
Akshay A. 2 PROBLEMS
21
Akshay A. 2 PROBLEMS
2.2 Hints
22
Akshay A. 2 PROBLEMS
23
Akshay A. 2 PROBLEMS
2.3 Solutions
Here are the solutions for all 12 exercise problems. Please only
look at the solutions after you’ve attempted all the problems and
looked at the hints, because you then get more out of each
problem. I will additionally add some problem solving tips if we
used a strategy that is used in several counting problems.
Problem 1: How many ways are there for James to give his
17 identical dimes to his 3 friends, such that each of his friends
gets at least 3 dimes?
24
Akshay A. 2 PROBLEMS
25
Akshay A. 2 PROBLEMS
26
Akshay A. 2 PROBLEMS
27
Akshay A. 2 PROBLEMS
appears in math contests all the time, including this year’s 10A
problem 21. Now, applying this identity, we get
21 + 22 + 23 + · · · + 22019 − 2019 = 22020 − 2 − 2019 = 22020 − 2021.
We now have it in the correct form! We see a = 2020 and
b = 2021, therefore, the answer is 20200 + 2021 = 22221 . In this
problem, we also learned a new theorem!
28
Akshay A. 2 PROBLEMS
29
Akshay A. 2 PROBLEMS
30
Akshay A. 2 PROBLEMS
31
Akshay A. 2 PROBLEMS
32
Akshay A. 2 PROBLEMS
the main restriction which makes the problem hard? In this case,
the restriction is that xi has to be odd. So now, how do we get rid
of that restriction? We know we have to find the solutions of
x1 + x2 + x3 + x4 = 98, where xi is a positive odd number. We can
represent xi as 2ki + 1, for some constant k. Then, we get
2k1 + 2k2 + 2k3 + 2k4 + 4 = 98, where ki ≥ 0. Simplifying gives us
k1 + k2 + k3 + k4 = 47. As each solution of ki yields a unique
solution to xi , we just need to find the number of solutions to this
equation.
By
stars and bars, we get the number of solutions are
47+4−1 50
4−1
= 3 = 19600 = n. Therefore, the answer is
19600
100
= 196 .
33
Akshay A. 2 PROBLEMS
subsequences. Now, we just have to add two H’s and five T ’s, as
the other H’s and T ’s to make T T and HH are already in
T HT HT HT H. Since the H’s are not distinguishable, we know
there are 4 different spaces to put the H’s. Since we have to put 2
H’s, we’ve made this a stars and bars problem. We can represent
this
ash1 + h + h3 + h4 = 2, where hi ≥ 0. There are
2
4+2−1 5
4−1
= 3 = 10 ways to have two HH. Similarly, we have 4
gaps to put 5 T ’s in. We can represent
this
as t1 + t2 + t3 + t4 = 5,
where ti ≥ 0. Therefore, there are 4−1 = 83 = 56 ways to have
5+4−1
34
Akshay A. 2 PROBLEMS
factors we can put the 6 − k factors of 2 in. This is just a stars and
bars problem!
With
n = 6 − k and k = k, the number of ways =
6−k+k−1 5
k−1
= k−1 . Multiplying this by the number of ways we can
5
add the factor of 3, yields us k k−1
. Now, we just have to sum
P6 5
this up for all values of k from 1 to 6. k=1 k k−1
. This is equal
to 1 + 10 + 30 + 40 + 25 + 6 = 112 .
35
Akshay A. 3 ENDING REMARKS
3 Ending Remarks
3.1 Acknowledgements
If you still need help with problems on this topic please email
me at mathgeek145@gmail.com. Also, please go to this link to
tell me what handout you want to see next! If you would be
interested in collaborating with me, please email me.
36