INFO

In general, if I want to put n indistinguishable objects in k different baskets, I could instead count the number of ways of ordering bars and stars Or equivalently ones and zeros

Which 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:
  1. Put 0 under the 5 knights and 1 between the castles
  2. Now we have a binary string that can be arranged
  3. Now we need to choose 2 1 to 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 = 10
  • k = 4
  • result =

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?

  1. No restrictions
  2. Each variable is positive:
  3. 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
  4. 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