How many distinct solutions does the following equation have?
a+b+c+d = 100
where a ∈ {1,2,3,...}, b ∈ { 2,3,4,...}, c ∈ {0,1,2,3,...} , d ∈ {0,1,2,3,...}
Try to solve this problem yourself before moving on to the solution below
.
.
.
.
Solution
This is the famous coin and stick problem with a given constraint. Consider there are 100 identical coins and 3 identical sticks. Given a random permutation, we count the number of coins till the first stick & give it to a, count the number of data points between first and second stick & give them to b and so on. Take some time to convince yourself that these two problems are equivalent.
This time we have placed restrictions on the domains of the variables. Due to the restrictions placed on a and b, we have already assigned a minimum of (1 + 2 = 3) coins before the first stick and between the first and second stick. We have 97 coins left to assign along with 3 dividers. Therefore, the total number of items to assign amounts to 97 + 3 = 100.
Therefore the total number of unique permutations are n choose m ( i.e 100 choose 3 ) = 161700
😃 Over to you: Were you able to solve this?
👉 If you liked this post, don’t forget to leave a like ❤️. It helps more people discover this newsletter on Substack and tells us that you appreciate solving these weekly questions. The button is located towards the bottom of this email.
👉 If you love reading this newsletter, feel free to share it with friends!
My approach to this problem was like:
1. If there were no restrictions:
We can assume there are 103 things. Out of these 100 are coins and 3 are partitions (or sticks as mentioned). Now we see the number of ways to select the 3 things to appoint them as 'Partion'(or stick) which has 103C3 ways.
2. As per the restrictions given:
I assumed the partion number 1 is attached with 1 coin to its left and the partion number 2 is attached to two coin to its left. So, now considering these as one 'thing'. We now have 100 things to choose 3 things to appoint them as partion. Which has 100C3 ways.