Daniel's quadruple differences

For a positive integer k k , let N ( k ) N(k) denote the number of ordered quadruples of integers ( a , b , c , d ) (a,b,c,d) such that 0 < d < c < b < a < 11 0<d<c<b<a<11 and the sum of the six pairwise positive differences between a , b , c , d a,b,c,d is k k .

Find the sum of all values of k , k, such that N ( k ) N(k) is the largest possible.

This problem is posed by Daniel C .


The answer is 22.

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.

3 solutions

Gornic Adams
Nov 4, 2013

Wrapping our head around this one is a trick, but with careful reading, the meaning can be determined.

For each ordered quadruple, ( a , b , c , d ) (a, b, c, d) ,

k = ( a b ) + ( a c ) + ( a d ) + ( b c ) + ( b d ) + ( c d ) k = (a-b)+(a-c)+(a-d)+(b-c)+(b-d)+(c-d) = 3 a + b c 3 d = 3 ( a d ) + ( b c ) = 3a+b-c-3d = 3(a-d) + (b-c)

Since the difference between the highest and lowest values, ( a d ) (a-d) , must be at least 3 but not more than 9 and the difference between the middle two terms, ( b c ) (b-c) , must be at least 1 but not more than 7, we can now consider the short list of values that k can be.

  • When a d = 3 a-d = 3 => b c = 1 b-c = 1 => k = 10 k = 10 . This can happen in 7 ways... (4, 3, 2, 1) through (10, 9, 8, 7)

  • a d = 4 a-d = 4 => b c = 1 , 2 b-c = 1, 2 => k = 13 , 14 k = 13, 14 . This can happen in 12 and 6 ways respectively.

  • a d = 5 a-d = 5 => b c = 1 , 2 , 3 b-c = 1, 2, 3 => k = 16 , 17 , 18 k = 16, 17, 18 . This can happen in 15, 10 and 5 ways respectively.

  • a d = 6 a-d = 6 => b c = 1 , 2 , 3 , 4 b-c = 1, 2, 3, 4 => k = 19 , 20 , 21 , 22 k = 19, 20, 21, 22 . This can happen in 16, 12, 8 and 4 ways respectively.

  • a d = 7 a-d = 7 => b c = 1 , 2 , 3 , 4 , 5 b-c = 1, 2, 3, 4, 5 => k = 22 , 23 , 24 , 25 , 26 k = 22, 23, 24, 25, 26 . This can happen in 15, 12, 9, 6 and 3 ways respectively.

  • a d = 8 a-d = 8 => b c = 1 , 2 , 3 , 4 , 5 , 6 b-c = 1, 2, 3, 4, 5, 6 => k = 25 , 26 , 27 , 28 , 29 , 30 k = 25, 26, 27, 28, 29, 30 . This can happen in 12, 10, 8, 6, 4 and 2 ways respectively.

  • a d = 9 a-d = 9 => b c = 1 , 2 , 3 , 4 , 5 , 6 , 7 b-c = 1, 2, 3, 4, 5, 6, 7 => k = 28 , 29 , 30 , 31 , 32 , 33 , 34 k = 28, 29, 30, 31, 32, 33, 34 . This can happen in 7, 6, 5, 4, 3, 2 and 1 ways respectively.

Thus N ( 10 ) = 7 , N ( 13 ) = 12 , N ( 14 ) = 6 , . . . , N ( 34 ) = 1 N(10)=7, N(13)=12, N(14)=6,..., N(34)=1 . However, the highest value of N ( k ) N(k) occurs when k = 22 k=22 . N ( 22 ) = 19 N(22)=19 so the solution is 22 .

The 4 ordered quadruples where a d = 6 a-d=6 and b c = 4 b-c=4 thus k = 22 k=22 are

(7, 6, 2, 1), (8, 7, 3, 2), (9, 8, 4, 3), (10, 9, 5, 4)

and the 15 ordered quadruples where a d = 7 a-d = 7 and b c = 1 b-c = 1 thus k = 22 k=22

(8, 3, 2, 1), (8, 4, 3, 1), (8, 5, 4, 1), (8, 6, 5, 1), (8, 7, 6, 1), (9, 4, 3, 2), (9, 5, 4, 2), (9, 6, 5, 2), (9, 7, 8, 2), (9, 8, 7, 2), (10, 5, 4, 3), (10, 6, 5, 3), (10, 7, 6, 3), (10, 8, 7, 3), (10, 9, 8, 3)

Here is my solution:

First, let us make condition 2 into an equation. Using condition 1, we get that 3 a + b c 3 d = 3 ( a d ) + ( b c ) = k 3a+b-c-3d=3(a-d)+(b-c)=k Let a d = x a-d=x and b c = y b-c=y .

Let f ( x , y ) f(x,y) be the number of ways to have a quadruple of integers ( a , b , c , d ) (a,b,c,d) such that condition 1 is satisfied, a d = x a-d=x , and b c = y b-c=y .

We will try to find an explicit formula for f ( x , y ) f(x,y) . First, let us find the number of possibilities for a a and d d in terms of x x . d d can start at 1, and keep increasing until a = 10 a=10 . Since a d = x a-d=x , there are 10 x 10-x ways to find a a and d d . Similarly, there are x y 1 x-y-1 possibilities for b b and c c . Therefore, f ( x , y ) = ( 10 x ) ( x y 1 ) f(x,y)=(10-x)(x-y-1)

Now, if we have one pair ( x , y ) (x,y) such that 3 x + y = k 3x+y=k , then the pair ( x 1 , y + 3 ) (x-1,y+3) also satisfies condition 2. However, we must make sure that x y + 2 x\ge y+2 , that x < 10 x<10 , and that y > 0 y>0 . Also, note that for a fixed k k , there can be no more than 2 pairs ( x , y ) (x,y) such that 3 x + y = k 3x+y=k .

We will attempt to maximize N ( k ) N(k) by finding pairs ( x , y ) (x,y) , rather than testing each possible k k . To make this quick, we notice that f ( x , y + 1 ) = ( 10 x ) ( x y 2 ) < f ( x , y ) f(x,y+1)=(10-x)(x-y-2)<f(x,y) Now, we lay out possibilities: f ( 9 , 1 ) + f ( 8 , 4 ) = 7 + 6 = 13 f(9,1)+f(8,4)=7+6=13 f ( 8 , 1 ) + f ( 7 , 4 ) = 12 + 6 = 18 f(8,1)+f(7,4)=12+6=18 f ( 7 , 1 ) + f ( 6 , 4 ) = 15 + 4 = 19 f(7,1)+f(6,4)=15+4=19 f ( 6 , 1 ) = 16 f(6,1)=16 f ( 5 , 1 ) = 15 f(5,1)=15 f ( 4 , 1 ) = 12 f(4,1)=12 f ( 3 , 1 ) = 7 f(3,1)=7 Now, we see that 3 ( 7 ) + 1 = 3 ( 6 ) + 4 = 22 3(7)+1=3(6)+4=\boxed{22} maximizes N ( k ) N(k) .

Daniel Chiu - 7 years, 7 months ago

Log in to reply

Rather nice! Thanks.

Mirza Baig - 7 years, 7 months ago

Just wondering why you phrased the question as find the sum of all possible values of k ... when in fact there was only one value of k. I found this quite misleading and it led to me checking and re-checking my solution for an hour because I only found k = 22. Of course when I finally decided to submit it turned out that I had the correct answer. I think this should be reworded to "find the value of k that maximises N(k)". Apart from that it is a nice question.

John Taylor - 7 years, 7 months ago

Log in to reply

Actually answer should remain same irrespective of the wording. The idea must have been to make us think about concrete proof instead of intelligent guesses.

Mirza Baig - 7 years, 7 months ago

Log in to reply

@Mirza Baig Yeah, I notice that Brilliant does that a lot, asking for all the solutions when there is only 1, or asking for the last three digits of a 2/3 digit number.

Daniel Chiu - 7 years, 7 months ago

Actually, I did ask for the single value, but Brilliant changed that part of the question. Sorry for any trouble.

Daniel Chiu - 7 years, 7 months ago

Log in to reply

@Daniel Chiu Thanks for your reply. I think it is a strange thing for Brilliant to do but I get what Mirza is saying.

John Taylor - 7 years, 7 months ago

If it asked for the single value that would be giving you additional information that there is a single value.

Matt McNabb - 7 years, 7 months ago
Snehal Shekatkar
Nov 5, 2013

Since d < c < b < a d<c<b<a , six pairwise positive differences are a b , a c , a d , b c , b d , c d a-b,a-c,a-d,b-c,b-d,c-d . Their sum is 3 ( a d ) + ( b c ) 3(a-d)+(b-c) . Hence the for the given k k we should have

3 ( a d ) + ( b c ) = k 3(a-d)+(b-c)=k

Now, since a < 11 a<11 , maximum possible value of a a is 10 10 . Using similar logic about lower bound and differences we can see that maximum possible value of d d is 7 7 , minimum possible value of d d is 1 1 , maximum possible value of b b is 9 9 and so on. (Its quite easy to get all of these).

This gives us possible values for x = a d x=a-d and y = b c y=b-c as follows:

x = ( 3 , 4 , 5 , 6 , 7 , 8 , 9 ) x=(3,4,5,6,7,8,9) and y = ( 1 , 2 , 3 , 4 , 5 , 6 , 7 ) y=(1,2,3,4,5,6,7) .

Also observe that, we must have ( a d ) > b c + 1 (a-d)>b-c+1 . This gives:

y < ( x 1 ) y<(x-1) .

Thus, for a given value of x x , only certain values of y y are allowed. These allowed ( x , y ) (x,y) pairs and corresponding k k values are listed below ( k = 3 x + y k=3x+y ):

x = 3 y = 1 k = 10 x=3 \Rightarrow y=1 \Rightarrow k=10

x = 4 y = 1 , 2 k = 13 , 14 x=4 \Rightarrow y=1,2 \Rightarrow k=13,14

x = 5 y = 1 , 2 , 3 k = 16 , 17 , 18 x=5 \Rightarrow y=1,2,3 \Rightarrow k=16,17,18

x = 6 y = 1 , 2 , 3 , 4 k = 19 , 20 , 21 , 22 x=6 \Rightarrow y=1,2,3,4 \Rightarrow k=19,20,21,22

x = 7 y = 1 , 2 , 3 , 4 , 5 k = 22 , 23 , 24 , 25 , 26 x=7 \Rightarrow y=1,2,3,4,5 \Rightarrow k=22,23,24,25,26

x = 8 y = 1 , 2 , 3 , 4 , 5 , 6 k = 25 , 26 , 27 , 28 , 29 , 30 x=8 \Rightarrow y=1,2,3,4,5,6 \Rightarrow k=25,26,27,28,29,30

x = 9 y = 1 , 2 , 3 , 4 , 5 , 6 , 7 k = 28 , 29 , 30 , 31 , 32 , 33 , 34 x=9 \Rightarrow y=1,2,3,4,5,6,7 \Rightarrow k=28,29,30,31,32,33,34

Now we want to find out number of ordered quadruples for each pair ( x , y ) (x,y) . To do this, observe that for given x x , a can take values from x + 1 x+1 to 10 10 . Hence there are ( 10 x ) (10-x) choices for a a . Then for a given a a , we have d = a x d=a-x . Also then b b can take values from ( a 1 ) (a-1) till c c becomes d + 1 = a x + 1 d+1 = a-x+1 .

Hence, c c varies from a x + 1 a-x+1 to a 1 y a-1-y . Combining these, we get a 1 y ( a x + 1 ) + 1 = x y 1 a-1-y-(a-x+1)+1=x-y-1 choices for c c and then for a given c c , d d is determined.

Thus, in total for a pair ( x , y ) (x,y) , there are ( 10 x ) ( x y 1 ) (10-x)*(x-y-1) quadruples. We can see that this value is greatest when y = 1 y=1 . But from above list, we see that, some k k values are repeated. Using this formula for those k k values for which either y = 1 y=1 or k k is repeated or both, we see that for k = 22 k=22 , we get N ( k ) = 19 N(k)=19 and there is no other k k which gives N ( k ) N(k) equal to or greater than 19 19 . Hence the required answer is 22 \boxed{22} .

There is some bug in latex here I think. That d + 1 = a x + 1 d+1=a-x+1 is not appearing correctly in the solution. Also I think that this question should have been put in combinatorics section instead of algebra.

Snehal Shekatkar - 7 years, 7 months ago

Log in to reply

The "bug" was the right "bracket" in this formula, it had two symbols switched. \ ( d + 1 = a x + 1 ) \ \backslash (d+1 = a-x+1)\backslash It is fixed now.

This problem is indeed about as much Combinatorics, as it is Algebra. Can be called Number Theory as well :)

Alexander Borisov - 7 years, 7 months ago

After calculating different values ok 'k' I didn't got anytthing sir its really very confusing for me :(

Yash Kumar Gupta - 7 years, 7 months ago

Log in to reply

What is confusing exactly? Can you elaborate?

Snehal Shekatkar - 7 years, 6 months ago
Abhishek Rawat
Nov 7, 2013

k=(a-b)+(a-c)+(a-d)+(b-c)+(b-d)+(c-d)=3(a-d)+(b-c)........(1)

from the condition given above

a E [4,10],b E [3,9], c E [2,8] ,d E [1,7] ................(2)

thus from (2) min(a-d)=3,min(b-c)=1 and max(a-d)=9,max(b-c)=7....................(3)

thus from (1) and (3) k E[10,34]

also from (3) min((a-d)-(b-c))=2 and max((a-d)-(b-c))=8.................................(4)

now from 1,k=3p+q where p=a-d and q=b-c

hence from(3) and (4) p E [3,9],q E [1,7] and p-q E [2,8]

Case 1: q=1 i.e k=3p+1

it will cover the numbers 10,13,16,19,22,25,28 as p E [3,9]

N(10)=7 1,N(13)=6 2,N(16)=5 3,N(19)=4 4.......

note that N(K)=m*(8-m) where m is integer greater than 1

N(K)=7,12,15,16,15,12,7 respectively for above k

proceeding in the above way we'll find the value of N(K) for 3p+2,3p+3,3p+4,3p+5,3p+6,3p+7

to save the time rather than proceeding the above way,we'll find the value of k such that we'll get

the value of N(K) from multiple types i.e 3p+1,3p+4,3p+7 for different p maybe the same

such numbers are 22,25,26.28.29 and 30 if we keep in mind (2),(3) and (4)

i.e 22=3(7)+(1)=3(6)+4,25=3(8)+1=3(7)+4,26=3(8)+2=3(7)+5,28=3(9)+1=3(8)+4

note that above numbers are written in the form 3p+q

N(22)=3 5+4 1=19,N(25)=3 4+2 3=18,N(26)=2 5+3 1=13,

so the answer is 22.....

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...