Separate fraction in two with the denominator

57 Views Asked by At

I have this problem:

$\frac{a}{5} + \frac{b}{8} = \frac{31}{40}$

I now the answer is $a=2$ and $b=3$.

I tried doing a table with simple formula:

$(a*8) + (b*5)= 31$

So, I do the table:

\begin{array}{c|cccc} a\backslash b& 1& 2& 3& 4& 5& 6& 7 \\ \hline 1& 13& 18& 23& 28& 33& 38& 43 \\ 2& 21& 26& \color{green}{\mathbf{31}}& 36& 41& 46& 51 \\ 3& 29& 34& 39& 44& 49& 54& 59 \\ 4& 37& 42& 47& 52& 57& 62& 67 \\ \end{array}

But I think maybe have another method without brute force.

How I can solve this problem with the best way?

2

There are 2 best solutions below

5
On

If you assume that $a,b$ are positive integers (as it seems you do), then you can write $$5b=31-8a.$$

That means $31-8a$ has to be $\geq 0$, or $a\leq 3$. So you are just left to try $a=1,2,3$. Only $a=2$ gives an integer value of $b$.

0
On

Your problem of finding integer solutions to $8a + 5b = 31$ is an example of a linear diophantine equation. There are several well known approaches, here's one.

First, note that $\gcd(5,8) = 1$. So, begin by solving $8a + 5b = 1$. A systematic way to do so is with the extended Euclidean algorithm. In particular, we find that $$ 8 = (2)5 - 2, \qquad 5 = (2)2 + 1 \implies\\ 1 = 5 - (2)2 = 5-(2)[(2)5 - 8] = (2)8 + (-3)5 $$ so, $a = 2$ and $b = -3$ solves $8a + 5b = 1$.

So, if we now take $a = 2 \cdot 31$ and $b = -3 \cdot 31$, we have a solution to $8a + 5b = 31$. That is, $a = 62,b = -93$ is one solution to the equation we started with.

From there, we can deduce that the general solution will be $$ a = 62 - 5n, \quad b = -93 + 8n, \quad n \in \Bbb Z $$ Setting $n = 12$, we get the solution with the lowest positive value of $a$, namely $$ a = 2, \quad b = 3 $$