3

Find the number of non-negative integral solutions of $x+y+z≤ 20$.

Conventional method :

$ x+y+z=20$, then no. of ways= $^{22}C_2$ (using beggar's method)

$x+y+z=19$, then no. of ways= $^{21}C_2$

$x+y+z=18$, then no. of ways= $^{20}C_2$ ...

...

...

...

$x+y+z=0$, then no. of ways= $^{2}C_2$

Therefore total number of ways= $^{22}C_2$ + $^{21}C_2$ +... $^{3}C_2$+ $^{2}C_2 = ^{23}C_2$

I was wondering if there is any other way to solve this question.

Jay
  • 295
Arishta
  • 959

5 Answers5

3

Let $w=20-x-y-z$. Then $w+x+y+z=20$ and $x,y,z,w$ are non-negative integers.

CY Aries
  • 23,788
3

If $x+y+z \leq 20$ Then the number of solutions will be the same as solving for the number of solutions to $w + x + y + z = 20$.

One approach to compute this is to look at the coefficient of $x^{20}$ in the generating function $f(x) = (1 + x + x^2 + ... + x^{20})^{4}$.

Use the identity $\displaystyle \sum_{n=0}^{k}x^n = \frac{1-x^{k+1}}{1-x}$:

$$[x^{n}]f(x) = [x^{n}](1 + x + x^2 + ... + x^{20})^{4}$$

$$[x^{n}]f(x) = [x^{n}]\left(\dfrac{1-x^{21}}{1-x}\right)^{4}$$

$$[x^{n}]f(x) = [x^{n}]\dfrac{x^{84} - 4 x^{63} + 6 x^{42} - 4 x^{21} + 1}{(1-x)^4}$$

Use the identity $\displaystyle \frac{1}{(1-x)^{m+1}} = \sum_{n=0}^{\infty}\binom{n+m}{m}x^n$:

$$[x^{n}]f(x) = [x^{n}](x^{84} - 4 x^{63} + 6 x^{42} - 4 x^{21} + 1)\sum_{n=0}^{\infty}\binom{n+3}{3}x^n$$

$$[x^{n}]f(x) = [x^{n}]\sum_{n=0}^{\infty}\binom{n+3}{3}x^{n+84} - 4 \sum_{n=0}^{\infty}\binom{n+3}{3}x^{n+63} + 6 \sum_{n=0}^{\infty}\binom{n+3}{3}x^{n+42} \\- 4 \sum_{n=0}^{\infty}\binom{n+3}{3}x^{n+21} + \sum_{n=0}^{\infty}\binom{n+3}{3}x^n$$

Shift indices:

$$[x^{n}]f(x) = [x^{n}]\sum_{n=84}^{\infty}\binom{n-81}{3}x^{n} - 4 \sum_{n=63}^{\infty}\binom{n-60}{3}x^{n} + 6 \sum_{n=42}^{\infty}\binom{n-39}{3}x^{n} \\- 4 \sum_{n=21}^{\infty}\binom{n-18}{3}x^{n} + \sum_{n=0}^{\infty}\binom{n+3}{3}x^n$$

Now we take the coefficient of $x^{20}$:

$$[x^{20}]f(x) = \binom{20+3}{3} = \binom{23}{3}$$

Note that most of the binomial sums dropped out because their starting indices were greater than $20$ (and therefore there were no $x^{20}$ terms present in any of them), but you could easily recompute the number of ways for any given boundary (not just $20$) and take the relevant binomial coefficients.

For example the number of ways for $w+x+y+z = 50$ where $0 \leq w, x, y, z \leq 20$ would be $[x^{50}]f(x) = 6\binom{50-39}{3}- 4 \binom{50-18}{3} + \binom{50+3}{3} = 4576$

  • The solution to x+y+z+w=20 is similar to finding the number of ways to distribute 20 coins to 4 beggars. Using beggar's method, the number of ways can be directly given as (20+3)C3=23C3. I like your approach of introducing a dummy variable and then finding the number of solutions. The remaining part of your solution is the formal proof of the result that I have used directly. – Arishta May 07 '17 at 18:31
1

$x+y+z\leq 20$ means $w+x+y+z=20$ for some $w\geq 0$.

Now imagine we have to distribute 20 balls to 4 people so using partition method

o o o o o / o o o o / o o o o / o o o o o o o

so the total objects including the partitions is 23

so it's $23!$

but then the balls are similar to each other and the partitions are similar to each other

so $23!/(20!3!)$

it's $^{23}C_3$

0

You can take a multinomial as $(a+a+a+1)^{20} $

The general term is coefficient × $a^{x+y+z} ×1^k$, where x+y+z+k=20

So note that it includes every case of x+y+z less than or equal to 20(non negative integral).

So the number of terms of the multinomial $^{23}C_3$ will give you the answer.

0

Before proceeding to the main proof, some lemmas :

Lemma 1 : The number of strictly increasing sequences of m elements of $[\![1, n]\!]$ is $ \binom{n}{m} $ with n,m two integers such that $ m \leq n $ (otherwise the answer would be 0) :

Proof of lemma 1 : To choose a strictly increasing sequence it suffices to choose a subset of m distinct elements of $[\![1, n]\!]$, and then order them so that the sequence is strictly increasing ( $ x_1 = Min(A)$, $ x_2 = Min(A-\{x_1\}) $, ...etc), and inversely, any sequence of m strictly increasing elements of $[\![1, n]\!]$ can be associated with a subset of m elements. We have thus established a bijection, and so the number of strictly increasing sequences of m elements is the same as that of subsets of m elements, which is $ \binom{n}{m}$

Lemma 2 : The number of strictly increasing sequences of m elements of $[\![1, n]\!]$ is $ \binom{n+m - 1}{m} $ with n,m two integers such that $ m \leq n $ (otherwise the answer would be 0) :

Proof of lemma 2 : This follows from the first lemma, in short, to each increasing sequence of m elements of $[\![1, n]\!]$ $ (x_1, ..., x_m) $ we associate a strictly increasing sequence of elements : $ (y_1, ..., y_m) $ defined by : $ y_1 = x_1 $, $ y_k = x_k + (k-1) $ for all other k, this is clearly a strictly increasing sequence of m elements of $[\![1, n + m - 1]\!]$, in the same manner, any such strictly increasing sequence of elements of $[\![1, n + m - 1]\!]$ can be associated to an increasing sequence of $[\![1, n]\!]$

Because we'll be dealing with integers that can be null (i.e. elements of $[\![0, n]\!]$ ), we offset the result of lemma 2 (there is a clear bijection between $[\![0, n]\!]$ and $[\![1, n + 1]\!]$ ), So for elements of $[\![0, n]\!]$ , the count is : $ \binom{n+m}{m} $

We can count the number of solutions in a more general setting. Consider m integers $ 0 \leq x_1, \dots, x_m \leq n $ and $ n \in N^{*} $ such that : $$ x_1 + \dots + x_m \leq n $$ and let $ 0 \leq y_1, \dots, y_m \leq n $ such that : $ \forall k \in [\![1, m]\!] : y_k = x_1 + \dots + x_k $. It is evident that $(y_k)_{ 1 \leq k \leq m }$ is an increasing sequence of integers of [0,n]. Inversely , given an increasing sequence of integers : $(y_k)_{ 1 \leq k \leq m }$, we consider $(x_k)_{ 1 \leq k \leq m }$ such that $x_1 = y_1$ and $ x_k = y_{k} - y_{k-1} $ for all other k. It is easy to check that $ x_1 + \dots + x_m \leq n $. We have thus established a bijection between two sets, the solution set of the equation and the set of increasing sequences of m elements of $[\![0, n]\!]$. Of which there are : $ \binom{n+m}{m} $, Thus the number of solutions is also : $ \binom{n+m}{m}$ by taking n = 20 and m = 3, we get the same answer that you've gotten.

DProBoy
  • 11