# Thread: how to get a number without a remainder

1. ## how to get a number without a remainder

Let A and B be some number, integer or decimal.

I want to figure out the lowest possible integer X that will yield another integer Y in the following formula.

(A * X) / B = Y

Using some concrete numbers, say A = 55 and B = 2.25.

Then, applying the above formula, you get

(55 * X) / 2.25 = Y

By trial and error, I was able to figure out that X has to be 9 in order to yield a value for Y that is another integer.

This is feels like a common denominator type of a problem, but I can't figure out how to get X without doing a trial and error.

2. Originally Posted by doolindalton
Let A and B be some number, integer or decimal.

I want to figure out the lowest possible integer X that will yield another integer Y in the following formula.

(A * X) / B = Y

Using some concrete numbers, say A = 55 and B = 2.25.

Then, applying the above formula, you get

(55 * X) / 2.25 = Y

By trial and error, I was able to figure out that X has to be 9 in order to yield a value for Y that is another integer.

This is feels like a common denominator type of a problem, but I can't figure out how to get X without doing a trial and error.
you want y to integer so you want to delete the denominator so

$\displaystyle \frac{55(x)}{2.25} = \frac{5500(x)}{225}$

$\displaystyle \frac{5(1100)x}{5(45)} = \frac{1100(x)}{45} = \frac{5(220)x}{5(9)}$

$\displaystyle \frac{220(x)}{9}$ you want to relax from 9 how ?? let x be 9 that's it and when you relax from denominator y will be a integer

3. Hello doolindalton
Originally Posted by doolindalton
Let A and B be some number, integer or decimal.

I want to figure out the lowest possible integer X that will yield another integer Y in the following formula.

(A * X) / B = Y

Using some concrete numbers, say A = 55 and B = 2.25.

Then, applying the above formula, you get

(55 * X) / 2.25 = Y

By trial and error, I was able to figure out that X has to be 9 in order to yield a value for Y that is another integer.

This is feels like a common denominator type of a problem, but I can't figure out how to get X without doing a trial and error.
First of all, note that this is not always possible. For example, if $\displaystyle a = \sqrt2$ and $\displaystyle b = 1$, then there are no integers $\displaystyle x, y$ for which $\displaystyle \frac{ax}{b}=y$.

Why? Substituting $\displaystyle a = \sqrt2, b = 1$ and re-writing the equation, we get

$\displaystyle \frac{\sqrt2}{1}=\frac{y}{x}$,

and it is well-known that $\displaystyle \sqrt2$ is irrational; in other words, it can't be written in the form $\displaystyle \frac{y}{x}$, where $\displaystyle x, y$ are integers.

So, when can we solve the problem? If we re-write the equation yet again, we get

$\displaystyle x = \frac{b}{a}\cdot y$

So the answer is that $\displaystyle \frac{b}{a}$ has to be rational. It doesn't mean that individually $\displaystyle a$ and $\displaystyle b$ must be rational - for example, $\displaystyle a = \sqrt2$ and $\displaystyle b = \sqrt8$ - but when we divide $\displaystyle b$ by $\displaystyle a$, the answer must be rational. So that means that we must be able to write

$\displaystyle \frac{b}{a}=\frac{p}{q}$, for some integers $\displaystyle p, q$

So, assuming that we can do that, we then express $\displaystyle \frac{p}{q}$ in its lowest terms, by 'cancelling' if necessary. Then, with $\displaystyle y = q$ being the smallest possible integer for which $\displaystyle \frac{py}{q}$ is an integer, the resulting value of $\displaystyle p$ gives the smallest possible value of $\displaystyle x$.

Let's see how this works with the example you gave: $\displaystyle a = 55, b = 2.25$:

$\displaystyle \frac{b}{a}=\frac{2.25}{55}=\frac{225}{5500}=\frac {9}{220}$

So there are our values of $\displaystyle p$ and $\displaystyle q: p = 9, q = 220$. And there's your answer: $\displaystyle x = 9$.