the numbers of solution

Find the number of quadruplets of non-negative integers ( a , b , c , d ) (a,b,c,d) satisfying a + b + c + 4 d = 20 a+b+c+4d=20


The answer is 536.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Chris Lewis
Jun 24, 2020

Let's build up to the full problem. Below, a 1 , a 2 , a 3 , a 4 a_1,a_2,a_3,a_4 will always be non-negative integers (the summands); n n will be a non-negative integer target. Let f k ( n ) f_k(n) be the number of solutions to the equation a 1 + + a k = n a_1 + \cdots + a_k = n .

Clearly, f 1 ( n ) = 1 f_1(n)=1 .

How many solutions are there to a 1 + a 2 = n a_1+a_2=n ? We can pick any value from 0 0 to n n inclusive for a 1 a_1 , and then a 2 = n a 1 a_2=n-a_1 will work; so f 2 ( n ) = n + 1 f_2(n)=n+1 .

By extending this logic we find, in general, f k ( n ) = r = 0 n f k 1 ( n r ) = r = 0 n f k 1 ( r ) f_k(n)=\sum_{r=0}^n f_{k-1}(n-r) = \sum_{r=0}^n f_{k-1}(r)

So f 3 ( n ) = 1 2 ( n + 1 ) ( n + 2 ) f_3(n)=\frac12 (n+1)(n+2) .

For example, there are 231 231 solutions to a 1 + a 2 + a 3 = 20 a_1+a_2+a_3=20 .

How does this help with a + b + c + 4 d = 20 a+b+c+4d=20 ? Well, note that 0 d 5 0\le d \le 5 ; we can just rewrite the equation as a + b + c = 20 4 d a+b+c=20-4d and use the above result to find the number of solutions is f 3 ( 20 ) + f 3 ( 16 ) + f 3 ( 12 ) + + f 3 ( 0 ) = 231 + 153 + 91 + 45 + 15 + 1 = 536 f_3(20)+f_3(16)+f_3(12)+\cdots + f_3(0) = 231+153+91+45+15+1=\boxed{536} .


In general, the number of solutions to a + b + c + 4 d = 4 m a+b+c+4d=4m is given by d = 0 m f 3 ( 4 d ) = 1 3 ( 1 + m ) ( 3 + 13 m + 8 m 2 ) \sum_{d=0}^m f_3 (4d) = \frac13 (1 + m) (3 + 13 m + 8 m^2)

Some bonus questions:

  • what if the target n n is not a multiple of 4 4 ?

  • can you find a closed formula for the number of solutions to a + b + c + 4 d = n a+b+c+4d=n for all non-negative n n ?

  • are these formulas always polynomials?

  • if so, what degree are these polynomials, and why?

1
2
3
4
5
6
7
8
j=0
for a in range(0,21):
    for b in range(0,21):
        for c in range(0,21):
            for d in range(0,21):
                if ((a+b+c+4*d)==20):
                    j+=1
print (j)

1
536

I wish to know the proper way to solve, because I couldn't find any.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...