INFO
In general, if I want to put
nindistinguishable objects inkdifferent baskets, I could instead count the number of ways of ordering bars and stars Or equivalently ones and zerosWhich we know how to count
Suppose we are playing a game where we can place 5 different knights into 3 different castles. How many ways can I use the knights to guard the castles?
Suppose now the 5 knights are now indistinguishable into 3 different castles
Configuration ⇆ fixed density binary strings
n knights ⇆ n zeros
k castles ⇆ k-1 ones
Proof:
- Put
0under the 5 knights and1between the castles - Now we have a binary string that can be arranged
- Now we need to choose 2
1to place in this 7 length string Hence the
Examples
If I had 5 different castles and 11 indistinguishable knights, which binary strings would this configuration map to?
How many different configurations are there with 5 different castles and 11 indistinguishable knights if each castle gets at least 1 knight?
Explanation:
- Start by assigning 5 knights each to one castle (have them go inside and make themselves comfortable). Then the remaining 6 can be arranged as if the castles are empty
- In other words, treat each knight castle pairing as 1 castle (k)
Integer Equations
INFO
In general, consider the equation
where and ‘s are non-negative integers
- number of stars = RHS constant =
- number of bars = (number of variables) - 1 =
There are solutions
Example 1
Consider the equation
where are non-negative integers. How many solutions does this equation have?
One can approach this problem by considering each as a basket / castle and use the Stars and Bars method
n= 10k= 4result=
Example 2
Consider the equation
where and ‘s are positive integers
This is the same as placing soldiers into castles such that each castle must have at least one soldier. We can think of the number 0 already being every variable
Practice Problems
How many non-negative integer solutions are there to the equation?
- No restrictions
- Each variable is positive:
- is greater than 5: , (for all ) Explanation: Since is some value greater than or equal to 6, then that means that n has been reduced by 6 as it is already guaranteed to be included within But since is not guaranteed to be 6, is still within the consideration of the 4 variables
- is less than or equal to 5: , (for all ) Explanation: Notice that this problem is a bijection with the previous problem. Therefore, we can take all possible outcomes of the problem - the previous answer to get the same result