Let b a be the smallest of the fractions that are greater than 1 5 1 3 where a , b < 5 0 0 are positive integers.
What is the value of a + b ?
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.
Nice work, Daniel! There is one tricky point here. We need to minimize b a − 1 5 1 3 = 1 5 b 1 5 a − 1 3 b . This is not quite the same as minimizing 1 5 a − 1 3 b . So how do you know that 1 5 a − 1 3 b = 1 gives the smallest answer? What if 1 5 a − 1 3 b = 2 is better, because it allows for higher b ?
Log in to reply
Well, if 1 5 a − 1 3 b ≥ 2 ,
b a − 1 5 1 3 = 1 5 b 1 5 a − 1 3 b ≥ 1 5 b 2 ≥ 1 5 × 5 0 0 2 > 1 5 × 4 8 8 1 = 4 8 8 4 2 3 − 1 5 1 3
Log in to reply
Yes, this is the missing part of the argument. Great job!
Am I wrong?
if difference between 15a and 13b is minimum it implies that the difference between a/b and 13/15 is minimum so we take 15a-13b=1
Log in to reply
This is not quite true: the size of the denominator also matters. For example, 3 1 2 7 is closer than 8 7 to 1 5 1 3 .
May I know how did you arrive at
a = 1 3 n + 7 and b = 1 5 n + 8
? Thanks!
Log in to reply
There’s a theorem for Diophantine equations like this one that goes like this:
Theorem. The equation s a + t b = c has a solution in integers if and only if d ∣ c where d = ( s , t ) . If ( a 0 , b 0 ) is any particular solution of the equation, then all solutions are given by
a = a 0 − ( t / d ) n and b = b 0 + ( s / d ) n
where n is an arbitrary integer.
For 1 5 a − 1 3 b = 1 , d = 1 and ( 7 , 8 ) is a solution. So,
a = 7 + 1 3 n and b = 8 + 1 5 n
Log in to reply
Can you please explain the notation, in layman's terms? I have no idea what | in d|c is supposed to mean.
Log in to reply
@Carl Araya – The notation d ∣ c means that d divides c , or, in other words, c is a multiple of d .
d=(s,t) and d divides c can't understand this statement. Will it be d=gcd(s,t) ?
d=(s,t) and d divides c
can't understand this statement.
Will it be d=gcd(s,t) ?
Log in to reply
@Md Saiful Islam – You are right , ( a , b ) means the gcd of a and b and also [ a , b ] means the lcm of a and b .
yeah. same question. this is the most important part.
See here .
How did you get a=13n+7 and b=15n+8 ? I know it simplifies to 1=1, but how did you derive it?
Log in to reply
Look at Sadman Sakib's post somewhere at the top of the replies.
Really nice solution!!
Very good!!
Let A = { b a ∣ a , b < 5 0 0 and 1 5 1 3 < b a } , we then have to find m i n ( A ) . Suppose b a is an arbitrary fraction in A , then : 1 5 1 3 < b a ⇒ 1 5 1 3 b < a . Obviously for a fixed b , a must be as small as possible (a fraction gets smaller as the numerator decreases) and the last inequality must hold at the same time. This is possible if we take a to be the smallest integer bigger than 1 5 1 3 b or in other words : a = ⌊ 1 5 1 3 b ⌋ + 1 , where ⌊ x ⌋ is the floor of x .
*Assertion 1 : * If ’b’ is a positive integer then 1 5 1 3 < b ⌊ 1 5 1 3 b ⌋ + 1 ≤ b a for any ’a’ for which 1 5 1 3 < b a
We'll prove this by contradiction : Suppose there is a and b such that : 1 5 1 3 < b a , but b ⌊ 1 5 1 3 b ⌋ + 1 > b a .Then : 1 5 1 3 b < a < ⌊ 1 5 1 3 b ⌋ + 1 , ⌊ 1 5 1 3 b ⌋ ≤ 1 5 1 3 b ⇒ ⌊ 1 5 1 3 b ⌋ < a < ⌊ 1 5 1 3 b ⌋ + 1 ⇒ contradiction , there can't be an integer between two consecutive integers .
Now the problem is finding the minimum of : b ⌊ 1 5 1 3 b ⌋ + 1 where b ∈ { 1 , 2 , . . . , 4 9 9 } .This sequence behaves rather strangely , locally it's neither increasing nor decreasing but globally it decreases to 1 5 1 3 .
Let's turn our attention to the Divison Theorem for now , which says that for all integers n , m we can find only one pair of numbers q ∈ Z , r ∈ { 0 , 1 , . . . , m − 1 } such that : n = q ∗ m + r .Intuitively q is the amount of times m goes into n , or better said q is the biggest number for which m q ≤ n ⇒ q ≤ m n ⇒ q = ⌊ m n ⌋ .And we'll denote the remainder when n is divided by m by r ( n , m ) ⇒ n = m ∗ ⌊ m n ⌋ + r ( n , m ) ⇒ ⌊ m n ⌋ = m n − r ( n , m ) , for all integers n , m .
Then ⌊ 1 5 1 3 b ⌋ = 1 5 1 3 b − r ( 1 3 b , 1 5 ) , and the whole expression we have to minimize becomes : b ⌊ 1 5 1 3 b ⌋ + 1 = b 1 5 1 3 b − r ( 1 3 b , 1 5 ) + 1 = b 1 5 1 3 b − r ( 1 3 b , 1 5 ) + 1 5 = 1 5 b 1 3 b + 1 5 − r ( 1 3 b , 1 5 ) = 1 5 1 3 + 1 5 1 b 1 5 − r ( 1 3 b , 1 5 ) . The only part we have to minimize is b 1 5 − r ( 1 3 b , 1 5 ) , the rest of it doesn't depend on b .From the Division Theorem we have b = 1 5 q + r ⇒ b 1 5 − r ( 1 3 b , 1 5 ) = 1 5 q + r 1 5 − r ( 1 3 ∗ 1 5 q + 1 3 r , 1 5 ) = 1 5 q + r 1 5 − r ( 1 3 r , 1 5 ) . Keeping q fixed ,let's try to find for which remainder that fraction is the smallest , we have two cases :
1) 0 ≤ r ≤ 7
If r = 0 then 1 5 q + r 1 5 − r ( 1 3 r , 1 5 ) = q 1 , otherwise r ( 1 3 r , 1 5 ) = r ( 1 5 + 1 3 r , 1 5 ) = r ( 1 5 + 1 3 r + 2 r − 2 r , 1 5 ) = r ( 1 5 + 1 5 r − 2 r , 1 5 ) = r ( 1 5 − 2 r , 1 5 ) = 1 5 − 2 r ⇒ 1 5 q + r 1 5 − ( 1 5 − 2 r ) = 1 5 q + r 2 r .As r grows so does 1 5 q + r 2 r , so its smallest value is when r = 1 : 1 5 q + 1 2 .This is less than q 1 .
2) 8 ≤ r ≤ 1 4
r ( 1 5 − 2 r , 1 5 ) = r ( 3 0 − 2 r , 1 5 ) = 3 0 − 2 r ⇒ 1 5 q + r 1 5 − r ( 1 3 r , 1 5 ) = 1 5 q + r 2 r − 1 5 , again this grows with r .The smallest possible value is when r = 8 : 1 5 q + 8 1 .Between 1 5 q + 1 2 and 1 5 q + 8 1 , the later is the smallest ⇒ For a fixed q , 1 5 q + r 1 5 − r ( 1 3 r , 1 5 ) is the smallest when r = 8 .And obviously for a fixed r , 1 5 q + r 1 5 − r ( 1 3 r , 1 5 ) gets smaller as q grows . Let's denote 1 5 q + r 1 5 − r ( 1 3 r , 1 5 ) by E ( b ) , q and r are simply the quotient and the remainder when b is divided by 15.The last number between 1 and 499 to have a remainder of 8 is 488 , so E ( 4 8 8 ) ≤ E ( n ) , 0 < n < 4 9 4 .Now E ( 4 9 6 ) < E ( 4 9 7 ) < . . . < E ( 4 9 9 ) and E ( 4 9 6 ) > E ( 4 9 5 ) since 496 has a remainder of 1 .We only need to know whether E ( 4 8 8 ) < E ( 4 9 6 ) or not .
Looking at the more general statement : E ( 1 5 q + 8 ) < E ( 1 5 ( q + 1 ) + 1 ) ⇔ 1 5 q + 8 1 < 1 5 q + 1 2 , so E ( 1 5 q + 8 ) < E ( 1 5 ( q + 1 ) + 1 )
The fractions is the smallest when b = 4 8 8 , and a = ⌊ 1 5 1 3 b ⌋ + 1 = 4 2 3 .
a + b = 9 1 1
JAVA CODE ::
import java.io.*;
import java.math.*;
public class SmallSmallerSmallest
{
public static void main(String args[])throws IOException
{
double i=0.0,j=0.0,k=13.0/15.0,l=0,m=10000.0,x=0.0,y=0.0;
for(i=1.0;i<500.0;i+=1.0)
{
for(j=1.0;j<500.0;j+=1.0)
{
l=i/j;
if(l>k)
{
if(m>l)
{
m=l;
x=i;
y=j;
}
}
}
}
System.out.println((x+y));
}
}
OUTPUT :: 911.0
It is the Best of Number Theory who reshared this not the Best of Computer Science.
Log in to reply
Indeed.
But really, there's no reason not to tackle this via programming.
It follows from the property of Farey sequence that if a real number x is between b a and d c then the farey median c + d a + b is a new estimate to x and we iterate to get the best two fractional estimate and the answer is of course the larger ones.
Simple question with clear algorithmic solution. We start from 1 0 and 1 1 , the next one is 2 1 ... and we get our answers eventually.
but is is only brute force with a bit of ingenuity,it will take time to solve this question by your process,but hey new solutions are always welcome
For simplicity, let N : = 5 0 0 ..
The integers a , b are a solution to a Diophantine Equation ! We can be sure a solution exists, because 1 3 , 1 5 are coprime. Use Euclid's Algorithm to find the general solution: \[\begin{align} \begin{array}{r|r|r|r} n&p_n&a_n&x_n\\ \hline -2&15&\%&\red{8}\\ -1&-13&\%&\green{7}\\ 0&2&-1&1\\ 1&1&-7&0\\ 2&0&2&1 \end{array}&&\Rightarrow&&
\begin{pmatrix} a\\b \end{pmatrix}&=\begin{pmatrix} \green{7}&13\\ \red{8}&15 \end{pmatrix}\begin{pmatrix} l\\\Psi \end{pmatrix},&&&l&\in\mathbb{N},&\Psi\in\mathbb{Z} \end{align}\]
The restriction 0 < a , b < N together with l > 0 leads to a restriction for t : = Ψ / l : 0 < a , b < N ⇒ l Ψ = t ∈ ( − 1 5 8 ; min { 1 5 l N − 1 5 8 , 1 3 l N − 1 3 7 } ) = : I ( l ) ( ∗ )
Insert the solution of the Diophantine Equation into a , b : b a = 8 l + 1 5 Ψ 7 l + 1 3 Ψ = 8 + 1 5 t 7 + 1 3 t = 1 5 1 3 + 1 5 1 ⋅ 1 5 t + 8 1 = : f ( t ) , t = l Ψ
Notice that f is strictly decreasing for t ∈ I ( l ) - if we want to minimize b a = f ( t ) , we need to maximize the upper bound of I ( l ) in ( ∗ ) ! As that decreases with l > 0 , we need to use l = 1 :
Ψ = 1 Ψ < min { 1 5 N − 8 , 1 3 N − 7 } N = 5 0 0 = 3 2 5 3 ⇒ Ψ = 3 2 , ( a b ) = ( 7 8 1 3 1 5 ) ( 1 3 2 ) = ( 4 2 3 4 8 8 )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
You might want to specify that a and b are positive integers. Otherwise you could get arbitrarily close to 13/15th, by choosing, for example, a = -13,000,000,001 and b = -15,000,000,000 (both less than 500, but a/b just barely > 13/15)
Problem Loading...
Note Loading...
Set Loading...
Note that we want 1 5 1 3 < b a , or 1 5 a − 1 3 b > 0 ; we want to minimize 1 5 a − 1 3 b . Since a , b are integers, the smallest difference possible between 1 5 a − 1 3 b is 1 ; therefore we let 1 5 a − 1 3 b = 1 . Parameterizing for a and b , we get that a = 1 3 n + 7 and b = 1 5 n + 8 . Now note that the higher n gets, the closer b a gets to 1 5 1 3 . Therefore, we want the highest n possible. Obviously, 1 3 n + 7 < 1 5 n + 8 . We let 1 5 n + 8 < 5 0 0 , and solving for the maximum n gets gives us n = 3 2 . Plugging this back into a and b , we get that a = 4 2 3 and b = 4 8 8 . Our answer is therefore 4 2 3 + 4 8 8 = 9 1 1 .