Almost all the pairwise products

Algebra Level 5

Let a , b , c , d a, b, c, d be positive integers such that a + b + c + d = 120 , a+b+c+d=120, and define S = a b + b d + d a + b c + c d . S=ab+bd+da+bc+cd. Find the number of ordered quadruples ( a , b , c , d ) (a,b,c,d) for which S S attains its maximum.


The answer is 39.

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.

13 solutions

Michael Tang
Aug 26, 2013

We have S = a b + b d + d a + b c + c d = b ( a + c + d ) + d ( a + c ) = b ( 120 b ) + d ( 120 b d ) = b 2 + d 2 + 120 b + 120 d b d . (1) \begin{aligned} S &= ab+bd+da+bc+cd \\ &= b(a+c+d) + d(a+c) \\ &= b(120-b) + d(120-b-d) \\ &= -b^2 + -d^2 + 120b + 120d - bd. \qquad \textbf{(1)} \end{aligned} We could interpret this expression as a quadratic in b b : S = b 2 + ( 120 d ) b + ( 120 d d 2 ) . S = -b^2 + (120-d)b + (120d-d^2). So, keeping d d constant, S S is maximized when b = ( 120 d ) 2 ( 1 ) = 120 d 2 . (2) \qquad b = \dfrac{-(120-d)}{2(-1)} = \dfrac{120-d}{2}. \qquad \textbf{(2)} We could also interpret the expression as a quadratic in d d : S = d 2 + ( 120 b ) d + ( 120 b b 2 ) . S = -d^2 + (120-b)d + (120b-b^2). Notice that this expression is the same as the previous one, except b b and d d are switched. (This was inevitable, since our formula for S S is symmetric in b , d b, d .) Therefore, S S is maximized when d = 120 b 2 (3) . \qquad d = \dfrac{120-b}{2} \qquad \textbf{(3)}.

We have a system of equations for b b and d d (equations ( 2 ) (2) and ( 3 ) (3) ), which we can solve to get b = d = 40. b=d=40. Then a + c = 120 40 40 = 40 , a+c = 120 - 40- 40 = 40, and since ( 1 ) (1) is not dependent on a a and c , c, any choices of a a and c c will produce the same value of S . S. The possible ordered pairs are ( a , c ) = ( 1 , 39 ) , ( 2 , 38 ) , , ( 39 , 1 ) , (a,c) = (1,39), (2,38), \ldots, (39, 1), so there are 39 \boxed{39} ordered quadruples for which S S is maximized.


Note: the maximum value of S S is S = b 2 d 2 + 120 b + 120 d b d = 4 0 2 4 0 2 + 120 40 + 120 40 4 0 2 = 4800. \begin{aligned} S &= -b^2 -d^2 + 120b + 120d - bd \\ &= -40^2 - 40^2 + 120 \cdot 40 + 120 \cdot 40 - 40^2 = 4800. \end{aligned}

Moderator note:

Great job!

Nicely done!

Alexander Borisov - 7 years, 9 months ago

Nice Solution

Rithvik Pasumarty - 7 years, 9 months ago

This is what I did, yet I stupidly forgot that A and C can not be 0.

Daan Becker - 7 years, 9 months ago

Brilliant!

No solution used derivatives, which amazed me! For S to obtain a maximum it is nessecary (but not sufficient) that all partial derivatives are equal to 0. Substitute 120 a b d 120-a-b-d for c c and take all partial derivatives. That gives us two distinct equations;

2 b + d = 120 2b+d=120

b + 2 d = 120 b+2d=120

These solve to b = d = 40 b=d=40 leaving you with S = 80 a + 80 c + 2000 S=80a+80c+2000 . So as long as a + c a+c is constant you have a maximum.

Did I miss a few bears on the road?

Ton de Moree - 7 years, 9 months ago

So you posted this solution as a 13 year old ! I salute you =)

Even i solved it in the same method ;p

Aditya Kumar - 6 years ago

Lagrangian Multipliers make this problem very very easy.

Surya Prakash - 5 years, 8 months ago
Russell Few
Aug 25, 2013

We note that the maximum is 1 2 \frac{1}{2} of the maximum of 2 S 2S .

2 S = 2 a b + 2 b d + 2 d a + 2 b c + 2 c d = ( a + b + c + d ) 2 ( a 2 + b 2 + c 2 + d 2 ) 2 a c = 14400 ( a 2 + b 2 + c 2 + d 2 + 2 a c 2S=2ab+2bd+2da+2bc+2cd=(a+b+c+d)^2-(a^2+b^2+c^2+d^2)-2ac=14400-(a^2+b^2+c^2+d^2+2ac .

To maximize 2 S 2S , we have to minimize a 2 + b 2 + c 2 + d 2 + 2 a c = ( a + c ) 2 + b 2 + d 2 a^2+b^2+c^2+d^2+2ac=(a+c)^2+b^2+d^2 .

By the QM-AM inequality, we get ( a + c ) 2 + b 2 + d 2 3 ( a + c ) + b + d ) 3 \sqrt{\frac{(a+c)^2+b^2+d^2}{3}} \ge \frac{(a+c)+b+d)}{3} with equality iff a + c = b = d a+c=b=d Hence ( a + c ) 2 + b 2 + d 2 3 120 3 = 40 \sqrt{\frac{(a+c)^2+b^2+d^2}{3}} \ge \frac{120}{3}=40 . Thus ( a + c ) 2 + b 2 + d 2 3 1600 \frac{(a+c)^2+b^2+d^2}{3} \ge 1600 , so ( a + c ) 2 + b 2 + d 2 4800 (a+c)^2+b^2+d^2 \ge 4800 with equality iff a + c = b = d = 120 3 = 40 a+c=b=d=\frac{120}{3}=40 .

Hence we now have to find the number of ordered pairs ( a , c ) (a,c) such that a + c = 40 a+c=40 . Note that the possible ( a , c ) (a,c) are ( 1 , 39 ) , ( 2 , 38 ) , . . . , ( 39 , 1 ) (1,39), (2,38), ..., (39,1) , so there are 39 \boxed{39} ordered quadruples ( a , b , c , d ) (a, b, c, d) for which S S attains its maximum.

Moderator note:

Excellent!

Please scroll to the right to be able to see the entire expression. A minor typo: I forgot to close the parentheses after (14000-(a^2+b^2+c^2+d^2)-2bc.

Russell FEW - 7 years, 9 months ago

Love it :)

Matt McNabb - 7 years, 9 months ago

Log in to reply

Yes, very nice indeed!

Alexander Borisov - 7 years, 9 months ago
C Lim
Aug 25, 2013

Note that:

S = ( a + c ) ( b + d ) + b d = ( 120 b d ) ( b + d ) + b d S = (a+c)(b+d) + bd = (120-b-d)(b+d) + bd

so we only need to focus on the ordered pair ( b , d ) (b, d) . Without loss of generality, suppose b d b\ge d . If b d + 2 b \ge d+2 , then upon replacing ( b , d ) (b,d) by ( b 1 , d + 1 ) (b-1, d+1) , the first term on the right-hand side remains the same while b d bd is replaced by:

( b 1 ) ( d + 1 ) = b d + ( b d ) 1 b d + 1 > b d (b-1)(d+1) = bd + (b-d) - 1\ge bd +1 > bd

so for maximum S S , we must have b d 1 b-d \le 1 . Thus we consider two cases.

Case 1 : b = d b=d . This gives us:

S = 2 b ( 120 2 b ) + b 2 = 240 b 3 b 2 = 3 [ ( b 40 ) 2 1600 ] 4800. \begin{aligned} S &= 2b(120-2b) + b^2 = 240b - 3b^2\\ &= -3[ (b-40)^2 - 1600] \le 4800.\end{aligned}

So the maximum is 4800 in this case, which is attained when b = d = 40 b=d=40 .

Case 2 : b = d + 1 b = d+1 . This gives:

S = ( 2 d + 1 ) ( 119 2 d ) + d ( d + 1 ) = 3 d 2 + 237 d + 119 = 3 ( d 79 2 ) 2 + 19199 4 4799 \begin{aligned} S &= (2d+1)(119-2d) + d(d+1) = -3d^2 + 237d + 119\\ &= -3(d - \frac {79}2)^2 + \frac{19199} 4 \le 4799 \end{aligned}

with equality if and only if d = 39 , 40 d= 39, 40 .

Hence, the first case is where max ( S ) \max(S) is attained, which gives b = d = 40 b=d=40 . The solutions thus correspond to ordered pairs ( a , c ) (a, c) satisfying a + c = 40 a+c = 40 . Hence there are 39 solutions.

In my solution I dismissed case 2 with the following reasoning: suppose we solve Case 1 for b,d real numbers. That gives the maximum for S in real numbers. If it turns out that b,d are integers in this solution then we must have the maximum in integers also.

It does turn out this way so we don't need to fall back on things like considering case 2.

Matt McNabb - 7 years, 9 months ago

Nicely done! As Matt M. noted, one can work in reals, and then specialize to integers. But this works nicely too.

Alexander Borisov - 7 years, 9 months ago

We have S = ( b + d ) ( a + b ) + b d = ( b + d ) ( 120 ( b + d ) ) + b d . S = (b+d)(a+b)+bd = (b+d)(120-(b+d))+bd. AM-GM inequality yields b d ( b + d 2 ) 2 bd \le \Big(\frac{b+d}{2}\Big)^2 with equality if and only if b = d . b=d. Hence S t ( 120 t ) + ( t 2 ) 2 = 3 4 ( t 2 160 t ) . S \le t(120-t)+\Big(\frac{t}{2}\Big)^2 = -\frac{3}{4}(t^2-160t). where t = b + d . t=b+d. Since the last expression is a quadratic with negative leading coefficient, its maximum occurs when t = ( 160 ) / ( 2 ( 1 ) ) = 80. t=-(-160)/(2(1)) = 80. This implies S S attains its maximum when and only when t = b + d = 80 t=b+d=80 and b = d b=d , which is equivalent to saying b = d = 40. b=d=40. Therefore the answer to the question is the number of ordered quadruples ( a , b , c , d ) (a,b,c,d) with c = d = 40 c=d=40 and a , b a,b being positive integers with a + b = 40 a+b=40 . Since we have 1 b = 40 a 1\le b=40-a or a 39 a\le 39 , this is equivalent to count the number of integers a a with 1 a 39 1\le a \le 39 . Obviously, that number is 39 . \boxed{39}.

There are some misprints in my solution: The variables b b and c c should be interchanged with each other starting from "with c = d = 40 c=d=40 and a , b a,b being ..." onwards.

Aram Tangboonduangjit - 7 years, 9 months ago

Nice solution! The unfortunate misprint at the end: b b means c c and c c means b b in the last four lines.

Alexander Borisov - 7 years, 9 months ago
Tim Vermeulen
Aug 27, 2013

S = a b + b d + d a + b c + c d = ( b + d ) ( a + b + c + d ) ( b 2 + d 2 + b d ) = 120 ( b + d ) ( b + d ) 2 + b d . \begin{aligned} S &= ab + bd + da + bc + cd \\ &= (b+d)(a+b+c+d) - (b^2 + d^2 + bd) \\ &= 120(b+d) - (b+d)^2 + bd. \end{aligned}

By AM-GM,

b + d 2 b d b d ( b + d ) 2 4 \frac{b+d}{2} \geq \sqrt{b d} \implies b d \leq \frac{(b+d)^2}{4}

with equality if and only if b = d b=d . So,

S = 120 ( b + d ) ( b + d ) 2 + b d 120 ( b + d ) ( b + d ) 2 + ( b + d ) 2 4 = 3 4 ( ( b + d ) 2 160 ( b + d ) ) = 4800 3 4 ( b + d 80 ) 2 . \begin{aligned} S &= 120(b+d) - (b+d)^2 + bd \\ &\leq 120(b+d) - (b+d)^2 + \frac{(b+d)^2}{4} \\ &= -\frac{3}{4} \left( (b+d)^2 - 160(b+d) \right) \\ &= 4800 - \frac{3}{4} (b+d-80)^2. \end{aligned}

Therefore, S S attains its maximum value of 4800 4800 if and only if

b = d = 80 2 = 40. b = d = \frac{80}{2} = 40.

We know that

a + b + c + d = 120 a + c = 120 ( b + d ) = 120 80 = 40 a + b + c + d = 120 \implies a + c = 120 - (b + d) = 120 - 80 = 40

and thus c = 40 a c = 40 - a . Since a , c a,c are positive integers,

1 a 39 , 1 \leq a \leq 39,

for a total of 39 \boxed{39} ordered quadruples ( a , b , c , d ) (a,b,c,d) for which S S attains its maximum.

Jeffrey Robles
Aug 30, 2013

Let λ \lambda be the Lagrange multiplier. We wish to maximize S ( a , b , c , d ) S(a,b,c,d) under the constraint a + b + c + d = 120 a+b+c+d=120 . Then, applying the concept of Lagrange mulitpliers ( f ( x , y , z ) = λ g ( x , y , z ) \overrightarrow{\bigtriangledown}f(x, y,z)=\lambda \overrightarrow{\bigtriangledown}g(x, y,z) and g ( x , y , z ) = 0 g(x,y,z)=0 ), we get the equations:

b + d = λ a + d + c = λ b + d = λ b + a + c = λ a + b + c + d = 120 b+d=\lambda \\ a+d+c=\lambda \\ b+d=\lambda \\ b+a+c=\lambda \\ a+b+c+d=120

The first and the third equation are similar. Hence, the solution is not unique. Solving such system gives us λ = 80 , b = d = 40 \lambda=80, b=d=40 and a + c = 40 a+c=40 . For the set of positive integers, there are only 40 1 = 39 40-1=39 pairs such that their sum is 40 40 . But because, the values of b b and d d are fixed already, the number of quadruples, all elements of which are positive integers, that maximizes S S is therefore 39 39 .

Note that , a b + b d + d a + b c + c d = ( a + c ) ( b + d ) + b d ab + bd + da + bc + cd = (a+c)(b + d) +bd .To maximise bd , b = d b = d S = ( 120 2 b ) ( 2 b ) + b 2 = 240 b 3 b 2 \Rightarrow S = (120 - 2b)(2b) + b^2 = 240b - 3b^2 Now this is a simple quadratic function which is maximum when b = 40. Hence , b = 40 , d = 40 , a + c = 120 ( b + d ) = 40 b = 40 , d = 40 , a + c = 120 - (b + d) = 40 . Now , since b and d have fixed value (i.e., 40) , we have to select only a and c.Hence, the no. of ordered quadruples = [No. of solutions of a + c = 40 ] = 39 a + c = 40] = \fbox{39}

Ganesh Sundaram
Aug 27, 2013

First note that when S = a b + a d + b c + b d + c d S = ab + ad + bc + bd + cd is maximum, so is 2 S = 2 ( a b + a d + b c + b d + c d ) S 1 2S = 2(ab + ad + bc + bd + cd) \equiv S_1 With abbreviations a a + b + c + d = 120 , and a 2 a 2 + b 2 + c 2 + d 2 , \sum a \equiv a+b+c+d = 120, \quad \text{ and } \quad \sum a^2 \equiv a^2+b^2+c^2+d^2, the following identity holds: S 1 = ( a ) 2 a 2 2 a c = M a 2 2 a c , S_1 = \left(\sum a\right)^2 - \sum a^2 - 2ac = M - \sum a^2 - 2ac, where M = 12 0 2 M = 120^2 .

We need to maximize S 1 S_1 subject to the constraint a 120 = 0 \sum a - 120 = 0 . Introducing the Lagrange multiplier λ \lambda , we must maximize S = M a 2 2 a c + λ ( a 120 = 0 ) . S' = M - \sum a^2 - 2ac +\lambda \left(\sum a - 120 = 0\right). Treating a , b , c , d a,b,c,d as continuous variables, maximizing w.r.t these variables gives a S = 0 2 ( a + c ) + λ = 0 ; \partial_a S' = 0 \ \Rightarrow -2(a+c) + \lambda = 0; c S = 0 2 ( a + c ) + λ = 0 ; \partial_c S' = 0 \ \Rightarrow -2(a+c) + \lambda =0 ; b S = 0 2 b + λ = 0 ; \partial_b S' = 0 \ \Rightarrow -2b + \lambda = 0; d S = 0 2 d + λ = 0 , \partial_d S' = 0 \ \Rightarrow -2d + \lambda = 0, where a / a \partial_a \equiv \partial /\partial a and so on. The last two equations imply b = d = λ / 2 x b = d = \lambda/2 \equiv x Whereas the first two equations imply a + c = λ / 2 = x . a+c = \lambda/2 = x. Thus, a + b + c + d = ( a + c ) + b + d = 3 x = 120 x = 40. a+b+c+d = (a+c)+b+d = 3x = 120 \quad \Rightarrow \quad x = 40. Therefore, b b and d d are fixed, and a a and c c can take a number of possibilities give by b = d = 40 , and a + c = 40. b = d = 40, \ \text{ and } a+c = 40. Thus, possible combinations of a a and c c are 39 given both are positive.

Suppose P=b+d, we have:

S = ( a + c ) ( b + d ) + b d = P ( 120 P ) + b ( P b ) S=(a+c)(b+d)+bd=P(120-P)+b(P-b)

P ( 120 P ) + P 2 4 = 120 P 3 P 2 4 \leq P(120-P)+\frac{P^2}{4}=120P-\frac{3P^2}{4} .

Therefore, S attains its maximum when b = P 2 b=\frac{P}{2} and P = 120 2 3 4 = 80 P=\frac{120}{2*\frac{3}{4}}=80 , or b = d = 40 b=d=40 .

We notice that maxS=4800 when b=d=40, regardless to the value of a,c. a,c can be any integer from 1 to 39 as long as a+c=40.

Therefore, there are 39 quadruples (a,b,c,d) satisfy the given condition.

Pol Mestres
Sep 9, 2015

Let's search for some symmetry in the equation: \S = ab + bd + da +bc +cd\

Ross Dempsey
Aug 30, 2013

The sum of all pairwise products of a a , b b , c c , and d d is ( a + b + c + d ) 2 ( a 2 + b 2 + c 2 + d 2 ) 2 = 12 0 2 ( a 2 + b 2 + c 2 + d 2 ) 2 \frac{(a+b+c+d)^2-(a^2+b^2+c^2+d^2)}{2} \\ = \frac{120^2-(a^2+b^2+c^2+d^2)}{2} The sum S S is henceforth 12 0 2 ( a 2 + b 2 + c 2 + d 2 ) 2 a c \frac{120^2-(a^2+b^2+c^2+d^2)}{2}-ac , which we wish to maximize. This is equivalent to minimizing a 2 + b 2 + c 2 + d 2 2 + a c \frac{a^2+b^2+c^2+d^2}{2}+ac . Multiplying through by 2, this is equivalent in turn to minimizing a 2 + 2 a c + c 2 + b 2 + d 2 = ( a + c ) 2 + b 2 + d 2 a^2+2ac+c^2+b^2+d^2 = (a+c)^2+b^2+d^2 . This expression is clearly minimized by having a + c = b = d = 40 a+c=b=d=40 . This stipulation allows 39 \textbf{39} ordered quadruples, corresponding to a a (or equivalently, c c ) ranging from 1 to 39, inclusive.

Karthik Tadinada
Aug 30, 2013

You can rewrite S S as S = ( a + b + c + d ) 2 ( ( a + c ) 2 + b 2 + d 2 ) 2 S=\frac{(a+b+c+d)^2-((a+c)^2+b^2+d^2)}{2}

We know a + b + c + d = 120 a+b+c+d=120 so all we need to do is minimise ( ( a + c ) 2 + b 2 + d 2 ) ((a+c)^2+b^2+d^2)

Using the quadratic mean-arithmetic mean inequality with terms ( a + c ) , b , d (a+c), b, d we have ( a + c ) 2 + b 2 + d 2 3 ( a + c ) + b + d 3 \sqrt{\frac{(a+c)^2+b^2+d^2}{3}} \geq \frac{(a+c)+b+d}{3}

with equality if and only if a + c = b = d a+c=b=d

As we know that a + b + c + d = 120 a+b+c+d=120 , we must have a + c = b = d = 40 a+c=b=d=40

So we have the condition a + c = 40 a+c=40 and if a a is a positive integer, it can take any of the values 1 to 39 inclusive.

So there are 39 solutions in total

Dan Rubery
Aug 25, 2013

Since S contains all the pairwise products except ac, we can write 2 S = 2 a b + 2 b d + 2 d a + 2 b c + 2 c d = ( a + b + c + d ) 2 a 2 b 2 c 2 d 2 2 a c 2S = 2ab + 2bd + 2da + 2bc + 2cd = (a+b+c+d)^2 - a^2 - b^2 - c^2 - d^2 - 2ac 2 S = 12 0 2 ( a + c ) 2 b 2 d 2 2S = 120^2 - (a+c)^2 - b^2 - d^2

Thus we are minimizing ( a + c ) 2 + b 2 + d 2 (a+c)^2 + b^2 + d^2 subject to ( a + c ) + b + d = 120 (a+c) + b + d = 120 . By repeated use of the AM-GM inequality we can find that the minimum is when ( a + c ) = b = d = 40 (a+c) = b = d = 40

Any quadruple in which a+c add up to 40 will work, and there are 39 of these with a and c positive, giving 39 solutions.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...