How many triples of positive integers ( r , s , t ) such that r < s < t which satisfy the equation below?
r + s + t = 5 2
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.
r 1 1 1 ⋅ 1 s 2 3 4 ⋅ 2 5 t 4 9 4 8 4 7 ⋅ 2 6 r 2 2 2 ⋅ 2 s 3 4 5 ⋅ 2 4 t 4 7 4 6 4 5 ⋅ 2 6 r 3 3 3 ⋅ 3 s 4 5 6 ⋅ 2 4 t 4 5 4 4 4 3 ⋅ 2 5 ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ r 1 4 1 5 1 5 1 5 1 6 s 1 8 1 6 1 7 1 8 1 7 t 2 0 2 1 2 0 1 9 1 9
From the table of ( r , s , t ) triples above, we note that for a value of r (say 1), we can have many values of s (2 to 25), But for a pair of ( r , s ) , there is only one value of t which is equal to 5 2 − r − s . Therefore, the total number of ( r , s , t ) triples N is equal to the total number of ( r , s ) pairs or the sum of possible s for all r or N = ∑ r = 1 r m a x n r , where n r is the number of s for a particular r and r m a x is the maximum value of r . We can find the value of r m a x by considering r m a x + s r m a x + 1 + t r m a x + 2 ≤ 5 2 ⟹ r m a x = ⌊ 3 4 9 ⌋ = 1 6 as shown in the table above.
We see that n r = s r , m a x − r (for example: r = 1 , n 1 = 2 5 − 1 = 2 4 ). Similar to finding r m a x , s r , m a x + s r , m a x + 1 t ≤ 5 2 − r ⟹ s r , m a x = ⌊ 2 5 1 − r ⌋ . Then we have:
N = r = 1 ∑ 1 6 n r = r = 1 ∑ 1 6 ( s r , m a x − r ) = r = 1 ∑ 1 6 ⌊ 2 5 1 − r ⌋ − r = 1 ∑ 1 6 r = k = 1 ∑ 8 ( o d d ⌊ 2 5 1 − ( 2 k − 1 ) ⌋ + e v e n ⌊ 2 5 1 − 2 k ⌋ ) − 2 1 6 ( 1 7 ) = k = 1 ∑ 8 ( 5 1 − 2 k ) − 1 3 6 = 8 ( 5 1 ) − 8 ( 9 ) − 1 3 6 = 2 0 0 Consider odd and even r separately.
Consider first all the positive integer solutions to the given equation: r + s + t ( r ′ + 1 ) + ( s ′ + 1 ) + ( t ′ + 1 ) r ′ + s ′ + t ′ = 2 0 = 5 2 = 4 9
Note that the variables are expressed as x ′ + 1 so that x ′ can be zero. Using Stars and Bars, there are ( 2 5 1 ) = 1 2 7 5 .
This set of solutions consists of three subsets: none are equal , two are equal , all three are equal . Since 52 is not divisible by 3, then the last subset is empty. The required total is the number of elements belonging to the first subset (none are equal), only that we have to restrict the order (such that r < s < t ) by dividing by 3 ! . We can first find the number of cases when two are equal, subtract this from the overall total, and finally divide by 3 ! .
Case: Two are equal W.L.O.G., assume r = s (the subtotal is then multiplied by ( 2 3 ) ): 2 r + t = 5 2 t = 5 2 − 2 r
Since, t > 0 , then r ∈ [ 1 , 2 5 ] .
Therefore, the number of positive integer triples ( r , s , t ) where r < s < t is 3 ! 1 2 7 5 − ( 2 3 ) ( 2 5 ) = 2 0 0
Brute force solution in Ruby, which prints 200:
I did this in command line in Windows 10. The image is because the solutions editor editor here does not seem to understand single spaced lines.
Consider the number of ways pairs s and t, you can have with known r. We know the largest r can be is 16.
As 3 5 2 =17 3 1 r < s < t and positive integers. r =17 3 1 - 1 3 1 =16, s =17 3 1 - 1 3 1 =17, t =17 3 1 - 1 3 2 =19
Lowest r can be is 1, 0 not considered positive nor negative. And the lowest s can be is r +1, means the largest t can be is 52 -(2r +1)
We can can add 1 to s =r +1 and minus 1 from t, and conditions are still satisfied as, until s = t. Part of the question can be seen as how many times can you increase s by 1 and decrease t by 1, for 1 ≤ r ≤ 16. With given constraints.
In this range we have 16 distinct value for r. the difference between the lowest s and largest t is D = t - s = 52 -(3r +2), this is our limit to how much we can make s and t apart. As we +1 to s and -1 to t we lower the difference my 2. There are two case to consider; when the difference is even or when it is odd.
even:
we have current position, example r =2, s = 3, t = 47, D = difference = 44, we can add up to 21 to s and subtract 21 from t such that s < t still, but at s+22 and t-22 the s=t and that is not allowed for this question. so the total time we can increase s by 1 is 21. The total number of s and t with r =2, for given constraints is 22 = 2 D
odd:
we have current position, example r =1, s =2, t =49, D =47. As D is odd and we subtract 2 every time to find new s and t, D will reach 1 so there exist t such that t = s+1,and so the number of ways to increase s is 23 . the number of pairs of s and t for r =1, for given constraints is 24 = 2 D − 1 +1
However this can be written differently 24 = ⌈ 2 D ⌉ , this works for the even case as well, try it yourself.
We can then find the total number of triplet = ∑ r = 1 1 6 ⌈ 2 D ⌉ = ∑ r = 1 1 6 ⌈ 2 5 2 − ( 3 r + 2 ) ⌉ = 2 0 0
which can be further generalise for instead of 52 we have n then the number of triplets we have is = ∑ r = 1 k ⌈ 2 n − ( 3 r + 2 ) ⌉ . Where k is the largest r can be.
<?php
$n = 0;
for($i=1;$i<=52;$i++){
for($j=$i+1;$j<=52;$j++){
for($k=$j+1;$k<=52;$k++){
if($i+$j+$k==52){
$n++;
}
}
}
}
echo $n; //prints 200
?>
Problem Loading...
Note Loading...
Set Loading...
Let s = r + a and t = s + b = r + a + b for positive integers a , b , and write the given equation as 3 r + 2 a + b = 5 2 or 3 r + 2 a ≤ 5 1 . Now r may be any integer between 1 and 16, and, for a given r , there are ⌊ 2 5 1 − 3 r ⌋ choices for a . The answer is ∑ r = 1 1 6 ⌊ 2 5 1 − 3 r ⌋ = 2 0 0 .