I have two numbers: 1536 and 2048, I would like to reduce these numbers to as close as 600 as possible while retaining their ratio. How can I achieve this in mathematics?
- 115
-
What exactly do you mean with reduce? – Git Gud Apr 21 '13 at 17:18
-
Keep the current ratio of 1536:2048 but turn the numbers into say 548:600 – S-K' Apr 21 '13 at 17:19
-
3Do you want the ratio to be exactly the same, or do only need it close to the original ratio? – ShreevatsaR Apr 21 '13 at 17:34
-
Anyway for this particular example, as the ratio is $3 : 4$ and both $3$ and $4$ divide $600$, you can make either the earlier or latter number exactly $600$: the ratio $1536 : 2048$ is equal to $450 : 600$ and to $600 : 800$. See my answer for a general method. – ShreevatsaR Apr 21 '13 at 17:54
3 Answers
$\dfrac{1536}{2048}=k$
$\dfrac{x}{600}=k$ or $\dfrac{600}{x}=k$
$\dfrac{1536}{2048}=\dfrac{x}{600}$ or $\dfrac{600}{x}=\dfrac{1536}{2048}$.
Solve for $x$, you will still have ratios constant.
- 7,881
You can continually divide both numbers by a common factor.
$2048:1536 = 1024:768 = 512:384 = 256:192 = 128:96 = 64:48 = 32:24 = 16:12 = 8:6 = 4:3$
Notice how I simply continued to divide both numbers by a common factor of $2$. The closest to 600 with these integers was $512:384$.
If you want exactly $600$ for the first term, you could divide both numbers in the original ratio by $\frac{2048}{600}$, and that would give $600:450$.
If it's the other number that you want to be $600$, then you would divide both sides by $\frac{1536}{600}$ instead, which would give you $800:600$.
- 4,675
- 7
- 33
- 58
-
Well, another question for the OP is, which number should be close to 600? Does he want 600 to be the bigger number or the smaller number? – Fixed Point Apr 21 '13 at 17:37
-
-
2+1 ;-) the 4:3 ratio at the end was a dead giveaway. The numbers are most likely a resolution and the ratio is of course the standard television aspect ratio. – Fixed Point Apr 21 '13 at 17:45
-
1
-
Here is a systematic recipe (algorithm) for doing what you want, assuming you want the ratio to remain exactly the same. (Otherwise, there are solutions involving continued fractions!)
First, reduce the given ratio to lowest terms, and call the ratio $p/q$. This involves dividing both the numerator and denominator by their gcd. In other words, if you have a fraction $\frac{a}{b}$, in lowest terms it is $\frac{p}{q} = \frac{a\,/\gcd(a,b)}{b\,/\gcd(a,b)}$.
If $q > 600$, stop. You're already as close as you can get.
Else, consider the multiples of $q$ closest to $600$. Specifically, you need to consider the two numbers (possibly equal) $l = \lfloor \frac{600}{q} \rfloor$ and $h = \lceil \frac{600}{q} \rfloor$.
For each of these two, consider the corresponding ratios. That is, consider the ratios $\frac{lp}{lq}$ and $\frac{hp}{hq}$. Pick whichever is "better" according to you.
The gcd can be found with the Euclidean algorithm. For example, Python code:
def gcd(a, b):
return abs(a) if b == 0 else gcd(b, a%b)
For the given example $1536/2048$: you have $\gcd(1536, 2048) = 512$, so the fraction in lowest terms is $\frac{1536/512}{2048/512} = \frac{3}{4}$. So $q = 4$, and you want $600 / q$, which is $150$. Multiplying both numerator and denominator by $150$ gives the ratio $\frac{150 \times 3}{150 \times 4} = \frac{450}{600}$, so $450 : 600$ is the ratio with denominator closest to $600$.
(Note: if it's the numerator that you want closest to 600, then do the procedure (finding $l$ and $h$) with $p$ in place of $q$. In this case, that gives $600/3 = 200$, so the ratio with numerator closest to $600$ is $600 : 800$, as $\frac{200 \times 3}{200 \times 4} = \frac{600}{800}$. Also, of course, the whole thing works with any number in place of $600$.)
- 41,374