$a+b+c+d+e+f=14$ , where $a,b,c,d,e$ and $f$ are whole numbers $\le 4$

I need to find the number of solutions to $$a+b+c+d+e+f=14$$ where $$a,b,c,d,e$$ and $$f$$ are whole numbers $$\le 4$$.

Manually I am getting the result which is $$1506$$, but is there any other method that solves the problem easily?

EDIT: Actually this is the question of cricket I converted it into the following problem:

In Indo-Pak one day International cricket match at Sharjah, India needs $$14$$ runs to win just before the start of the final over. Find the number of ways in which India just manages to win the match (i.e. scores exactly $$14$$ runs), assuming that all the runs are made off the bat & the batsman can not score more than $$4$$ runs off any ball.

• Do "whole numbers" include zero? – user7530 Aug 17 '18 at 17:51
• If I remember correctly, whole numbers include 0, and natural do not. If they don't, I can change my answer appropriately. – Don Thousand Aug 17 '18 at 17:53
• Yes the alphabets can be identical but sum needs to be 14 – Samar Imam Zaidi Aug 17 '18 at 17:54
• In Indo-Pak one day International cricket match at Sharjah , India needs 14 runs to win just before the start of the final over. Find the number of ways in which India just manages to win the match (i.e. scores exactly 14 runs) , assuming that all the runs are made off the bat & the batsman can not score more than 4 runs off any ball. – Samar Imam Zaidi Aug 17 '18 at 17:54
• Actually this is the question of cricket I converted it into the following problem – Samar Imam Zaidi Aug 17 '18 at 17:55

This problem is a perfect demonstration of stars and bars. We can think about distributing the units of 14 into 6 baskets, each representing one of the variables.

So, we divide our pile of 14 units (*) into 6 pieces (|). This leaves us with

**************|||||


So, we choose where to place the 5 bars in the 19 possible positions, so the answer is $19\choose{5}$ which is $11628$.

Now, I've ignored the condition that none of the numbers can be greater than 4. In order to account for that, I'll count the number of ways that one number will be greater than 4. First, I have 6 choices as to where to put 5 of our 14 units, and then, the remaining combinations are

*********|||||


So, we have $6\cdot{14\choose5}$. However, we've now undercounted, since if two of the numbers are above 4, then we double subtracted them from the total.

Hence, assume that we choose two numbers $6\choose2$ to have value 5 or above. So, we distribute these values and spread the remaining 4 across the bars

****|||||


This gives us $15{9\choose4}$.

So, our answer is ${19\choose 5} - 6{14\choose5} + {6\choose2}{9\choose4} = 1506$.

• Gregory is right – Samar Imam Zaidi Aug 17 '18 at 17:57
• Maximum number is 4 – Samar Imam Zaidi Aug 17 '18 at 17:58
• @Rushabh Mehta it is correct See the actual problem, I converted it for solving purpose as it involves knowledge of cricket – Samar Imam Zaidi Aug 17 '18 at 18:04
• @RushabhMehta - I agree that the answer is fixed now, so I've deleted the original comment. – Gregory J. Puleo Aug 17 '18 at 18:23

Another method is using generating functions (e.g. here and here) leading to $$(1+x+x^2+x^3+x^4)^6$$ with the coefficient of $\color{red}{x^{14}}$ being the answer, which is 1506.