[Math] Find the number of possible solutions in $x+y+z=30$ under conditions.

combinationscombinatoricspermutations

Three variables $x,y,z$ have a sum of $30$. All three are Non-Negative integers.
If any $2$ variables don't have the same value and exactly one variable has
value less than or equal to $3$, find the number of possible solutions ?

$a.)\ 98 \\
b.)\ 285 \\
c.)\ 68 \\
\color{green}{d.)\ 294\\}
$

I did

$x=0,y+z=30\implies 31\ \text{ways}$

$x=1,y+z=29\implies 30\ \text{ways}$

$x=2,y+z=28\implies 29\ \text{ways}$

$x=3,y+z=27\implies 28\ \text{ways}$

Total ways=$118$

But the book is giving answer as $294$ .

I look for a short and simple way.

I have studied maths upto $12$th grade.

Best Answer

Your method is OK, just a few slips - however unless I'm missing something, none of the suggested answers is correct.

  • $x=0$, $y+z=30$: only $23$ ways with $y,z\ge4$, but one of these is $y=z=15$ which is not allowed, so only $22$ ways.
  • Similar adjustments give $22+22+20+20=84$.
  • But any of the three variables could be ${}\le3$, it doesn't have to be $x$. So multiply by $3$ to give (answer) $252$ possibilities.