For a positive integer k , let N ( k ) denote the number of ordered quadruples of integers ( a , b , c , d ) such that 0 < d < c < b < a < 1 1 and the sum of the six pairwise positive differences between a , b , c , d is k .
Find the sum of all values of k , such that N ( k ) is the largest possible.
This problem is posed by Daniel C .
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.
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 Let a − d = x and b − c = y .
Let f ( x , y ) be the number of ways to have a quadruple of integers ( a , b , c , d ) such that condition 1 is satisfied, a − d = x , and b − c = y .
We will try to find an explicit formula for f ( x , y ) . First, let us find the number of possibilities for a and d in terms of x . d can start at 1, and keep increasing until a = 1 0 . Since a − d = x , there are 1 0 − x ways to find a and d . Similarly, there are x − y − 1 possibilities for b and c . Therefore, f ( x , y ) = ( 1 0 − x ) ( x − y − 1 )
Now, if we have one pair ( x , y ) such that 3 x + y = k , then the pair ( x − 1 , y + 3 ) also satisfies condition 2. However, we must make sure that x ≥ y + 2 , that x < 1 0 , and that y > 0 . Also, note that for a fixed k , there can be no more than 2 pairs ( x , y ) such that 3 x + y = k .
We will attempt to maximize N ( k ) by finding pairs ( x , y ) , rather than testing each possible k . To make this quick, we notice that f ( x , y + 1 ) = ( 1 0 − x ) ( x − y − 2 ) < f ( x , y ) Now, we lay out possibilities: f ( 9 , 1 ) + f ( 8 , 4 ) = 7 + 6 = 1 3 f ( 8 , 1 ) + f ( 7 , 4 ) = 1 2 + 6 = 1 8 f ( 7 , 1 ) + f ( 6 , 4 ) = 1 5 + 4 = 1 9 f ( 6 , 1 ) = 1 6 f ( 5 , 1 ) = 1 5 f ( 4 , 1 ) = 1 2 f ( 3 , 1 ) = 7 Now, we see that 3 ( 7 ) + 1 = 3 ( 6 ) + 4 = 2 2 maximizes N ( k ) .
Log in to reply
Rather nice! Thanks.
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.
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.
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.
Actually, I did ask for the single value, but Brilliant changed that part of the question. Sorry for any trouble.
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.
If it asked for the single value that would be giving you additional information that there is a single value.
Since d < c < b < a , six pairwise positive differences are a − b , a − c , a − d , b − c , b − d , c − d . Their sum is 3 ( a − d ) + ( b − c ) . Hence the for the given k we should have
3 ( a − d ) + ( b − c ) = k
Now, since a < 1 1 , maximum possible value of a is 1 0 . Using similar logic about lower bound and differences we can see that maximum possible value of d is 7 , minimum possible value of d is 1 , maximum possible value of b is 9 and so on. (Its quite easy to get all of these).
This gives us possible values for x = a − d and y = b − c as follows:
x = ( 3 , 4 , 5 , 6 , 7 , 8 , 9 ) and y = ( 1 , 2 , 3 , 4 , 5 , 6 , 7 ) .
Also observe that, we must have ( a − d ) > b − c + 1 . This gives:
y < ( x − 1 ) .
Thus, for a given value of x , only certain values of y are allowed. These allowed ( x , y ) pairs and corresponding k values are listed below ( k = 3 x + y ):
x = 3 ⇒ y = 1 ⇒ k = 1 0
x = 4 ⇒ y = 1 , 2 ⇒ k = 1 3 , 1 4
x = 5 ⇒ y = 1 , 2 , 3 ⇒ k = 1 6 , 1 7 , 1 8
x = 6 ⇒ y = 1 , 2 , 3 , 4 ⇒ k = 1 9 , 2 0 , 2 1 , 2 2
x = 7 ⇒ y = 1 , 2 , 3 , 4 , 5 ⇒ k = 2 2 , 2 3 , 2 4 , 2 5 , 2 6
x = 8 ⇒ y = 1 , 2 , 3 , 4 , 5 , 6 ⇒ k = 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0
x = 9 ⇒ y = 1 , 2 , 3 , 4 , 5 , 6 , 7 ⇒ k = 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4
Now we want to find out number of ordered quadruples for each pair ( x , y ) . To do this, observe that for given x , a can take values from x + 1 to 1 0 . Hence there are ( 1 0 − x ) choices for a . Then for a given a , we have d = a − x . Also then b can take values from ( a − 1 ) till c becomes d + 1 = a − x + 1 .
Hence, c varies from a − x + 1 to a − 1 − y . Combining these, we get a − 1 − y − ( a − x + 1 ) + 1 = x − y − 1 choices for c and then for a given c , d is determined.
Thus, in total for a pair ( x , y ) , there are ( 1 0 − x ) ∗ ( x − y − 1 ) quadruples. We can see that this value is greatest when y = 1 . But from above list, we see that, some k values are repeated. Using this formula for those k values for which either y = 1 or k is repeated or both, we see that for k = 2 2 , we get N ( k ) = 1 9 and there is no other k which gives N ( k ) equal to or greater than 1 9 . Hence the required answer is 2 2 .
There is some bug in latex here I think. That 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.
Log in to reply
The "bug" was the right "bracket" in this formula, it had two symbols switched. \ ( d + 1 = a − x + 1 ) \ It is fixed now.
This problem is indeed about as much Combinatorics, as it is Algebra. Can be called Number Theory as well :)
After calculating different values ok 'k' I didn't got anytthing sir its really very confusing for me :(
Log in to reply
What is confusing exactly? Can you elaborate?
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.....
Problem Loading...
Note Loading...
Set Loading...
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 ) ,
k = ( a − b ) + ( a − c ) + ( a − d ) + ( b − c ) + ( b − d ) + ( c − d ) = 3 a + b − c − 3 d = 3 ( a − d ) + ( b − c )
Since the difference between the highest and lowest values, ( a − d ) , must be at least 3 but not more than 9 and the difference between the middle two terms, ( 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 => b − c = 1 => k = 1 0 . This can happen in 7 ways... (4, 3, 2, 1) through (10, 9, 8, 7)
a − d = 4 => b − c = 1 , 2 => k = 1 3 , 1 4 . This can happen in 12 and 6 ways respectively.
a − d = 5 => b − c = 1 , 2 , 3 => k = 1 6 , 1 7 , 1 8 . This can happen in 15, 10 and 5 ways respectively.
a − d = 6 => b − c = 1 , 2 , 3 , 4 => k = 1 9 , 2 0 , 2 1 , 2 2 . This can happen in 16, 12, 8 and 4 ways respectively.
a − d = 7 => b − c = 1 , 2 , 3 , 4 , 5 => k = 2 2 , 2 3 , 2 4 , 2 5 , 2 6 . This can happen in 15, 12, 9, 6 and 3 ways respectively.
a − d = 8 => b − c = 1 , 2 , 3 , 4 , 5 , 6 => k = 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 . This can happen in 12, 10, 8, 6, 4 and 2 ways respectively.
a − d = 9 => b − c = 1 , 2 , 3 , 4 , 5 , 6 , 7 => k = 2 8 , 2 9 , 3 0 , 3 1 , 3 2 , 3 3 , 3 4 . This can happen in 7, 6, 5, 4, 3, 2 and 1 ways respectively.
Thus N ( 1 0 ) = 7 , N ( 1 3 ) = 1 2 , N ( 1 4 ) = 6 , . . . , N ( 3 4 ) = 1 . However, the highest value of N ( k ) occurs when k = 2 2 . N ( 2 2 ) = 1 9 so the solution is 22 .
The 4 ordered quadruples where a − d = 6 and b − c = 4 thus k = 2 2 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 and b − c = 1 thus k = 2 2
(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)