Weird arithmetic and fractions. When the wrong method gives right results.

88 Views Asked by At

In Ian Stewart's book "Cabinet of mathematical curiosities" he mentions a (fictional) student that performs the following operation:

$\frac{1}{4} \times \frac{8}{5} = \frac{18}{45} $

Stewart asks when this method works (given non-zero digits in the first two fractions). We're then trying to solve:

$\frac{a}{b} \times \frac{c}{d} = \frac{10a+c}{10b+d} $

which simplifies to

$\ ac(10b+d) = bd(10a+c)$

How do you use this expression to find all the possible solutions? Any clever tricks or systematic approaches?

1

There are 1 best solutions below

0
On

There are a total of $95$ solutions that satisfies $10ab(c-d)=(b-a)cd$.

One obvious case is when $c=d$ and $b=a$.

Also, note that $a=b \iff c=d$.

Suppose $c \ne d$ or $b \ne a$, then we have a total of $14$ solutions.

Also notice that if $(a,b)$ and $(c,d)$ is a valid pair, then $(b,a)$ and $(d,c)$ is another valid pair.

Hence, we can assume that $a > b$, which would imply that $c< d$ in that case, there are $7$ solutions.

$$10ab(c-d)=(b-a)cd$$

Consider a few cases:

  • $b-a=-5$, then $-2ab(c-d)=cd$. Notice that the parity of $a$ and $b$ must be distinct. LHS is a multiple of $4$. If none of $c$ and $d$ are multiple of $4$, then both of them are even, and the LHS is indeed a multiple of $8$ which is a contradiction. Hence either $c$ or $d$ is a multiple of $4$.

    • If $c=4$, $-2ab(4-d)=4d$, that is $ab(d-4)=d$ which is equivalent to $(b+5)b(d-4)=d$ where we use $a=b+5$. That is $1 \le b \le 4$. Also if $b \ge 2$, then the LHS is more than $10$, hence $b=1$, and $d$ must be a multiple of $6$. Hence $(a,b,c,d)=(6,1,4,6)$.

    • If $c=8$, then $d=9$. $2ab=72$, $ab=36$, $(b+5)(b)=36$ which implies that $b=4$. Hence $(a,b,c,d)=(9,4,8,9)$.

    • If $d=4$, then $-2ab(c-4)=4c$, $ab(4-c)=2c$. If $c=1$, LHS is a multiple of $3$, it's a contradiction. If $c=2$, $2ab=4$, $ab=2$, there is no solution. If $c=3$, $ab=6$. Hence $(a,b,c,d)=(6,1,3,4)$.

    • If $d=8$, then $-2ab(c-8)=8c$, $b(b+5)(8-c)=4c$. We just have to substitute $b=1,2,3$ to chek that they are not valid.

  • If $c=5$, you can check for $d=6.7,8,9$.

  • If $d=5$, you can check for $c=1,2,3,4$.

I will just run my Python program.

ans = set()
for a in range(1, 10):
    for b in range(1, 10):
        for c in range(1,10):
            for d in range(1,10):
                if 10*a*b*(c-d) == (b-a)*c*d:
                    ans.add((a,b,c,d))
print(len(ans))
#for i in ans:
#    print(i)
    
ans2 = [i for i in ans if i[0] != i[1] or i[2] != i[3]]
print(len(ans2))
#print(ans2)
#for i in ans2:
#    print(i)

ans3 = [i for i in ans2 if i[0] > i[1]]
for i in ans3:
    print(i)

which gives me the following output:

95
14
(9, 1, 5, 9)
(2, 1, 4, 5)
(9, 4, 8, 9)
(6, 2, 5, 6)
(4, 1, 5, 8)
(6, 1, 3, 4)
(6, 1, 4, 6)