# Alphametic-like fraction equaling 1/2; uniqueness of solutions

This problem is kind of like those alphametics puzzles. The challenge is to assign each whole number from 2 to 9 to the letters in $$\frac{10^3A+10^2B+10C+D}{10^4+10^3E+10^2F+10G+H}$$ such that the fraction equals $\frac{1}{2}$.

(The original challenge was to simply have some ordering of the numbers 1 to 9 in a fraction, such that all the numbers were used exactly once, and the resulting fraction equaled 1/2, but the only possible solution is through this "structure" of $\frac{ABCD}{1EFGH}$.)

Using equal parts logic and bruteforcing, I got a solution of $6792/13584$. Is this a unique solution, and is there some sort of system (besides arbitrary deductions, with trial and error to fill in the gaps) that could give all answers for this sort of problem, or discern if there are none?

The obvious initial deductions: \begin{align*}A &\in \{6,7,8,9\}\\D &\in \{2,3,4,6,7,8,9\}\\E &\in \{2,3,4,5,6,7,8\}\\H &\in \{2,4,6,8\}\end{align*}

Update: I went and wrote up a quick program to bruteforce it, and there are 12 solutions: \begin{align*}\frac{1}{2}&=\frac{6729}{13458}=\frac{6792}{13584}=\frac{6927}{13854}=\frac{7269}{14538}=\frac{7293}{14586}=\frac{7329}{14658}\\\\&=\frac{7692}{15384}=\frac{7923}{15846}=\frac{7932}{15864}=\frac{9267}{18534}=\frac{9273}{18546}=\frac{9327}{18654}\end{align*} This confirms the answer to the first question, but the proof for the second is still open. The initial deductions are reduced to the following, after looking at the answers: \begin{align*}A &\in \{6,7,9\}\\B,C &\in \{2,3,6,7,9\}\\D &\in \{2,3,7,9\}\\E &\in \{3,4,5,8\}\\F,G &\in \{3,4,5,6,8\}\\H &\in \{4,6,8\}\end{align*} The numbers, once set, seem to interchange in interesting ways. There are two distinct groups of possible digits on the top, $\{2,3,7,9\}$ and $\{2,6,7,9\}$. Separating by the first digit, there are five groups. The proof would probably be based on making some of these logical reductions first, especially to $A$, $D$, $E$, and $H$. Maybe it would also incorporate a method of trying out coordinated switches? The way that $6729/13458$ and $6792/13584$ interchange seems to make that unlikely, but proofs tend to make more sense in hindsight anyway.

• How about pure brute force: For every four-digit number $n$, check whether $n$ and $2n$ together has one of each digit among them? 10,000 steps does not seem bad. – Henning Makholm Nov 5 '11 at 1:51
• pastebay.com seems shady. It only shows ads and malware. In Python, all the code you need is ['%d/%d' % (x, 2 * x) for x in range(10000) if set(str(x) + str(2 * x)) == set('123456789')] to get ['6729/13458', '6792/13584', '6927/13854', '7269/14538', '7293/14586', '7329/14658', '7692/15384', '7923/15846', '7932/15864', '9267/18534', '9273/18546', '9327/18654']. – Eric Duminil Oct 16 '17 at 18:40
• @EricDuminil I asked this question six years ago, back when it wasn't shady and when I thought I had to prove I wrote the code. Thanks for noticing, I've removed the link. – algorithmshark Oct 16 '17 at 18:46
• @algorithmshark: I have no idea how I landed here, and didn't notice the question is from 2011. :) It might have been in "Related questions". – Eric Duminil Oct 16 '17 at 18:49
• @EricDuminil If you mean, whether or not there exists an intelligent way of enumerating the solutions to alphametics like this, then no, I haven't the foggiest. – algorithmshark Oct 16 '17 at 18:54

## 2 Answers

According to my alphametic solver http://www.math.ubc.ca/~israel/applet/metic/metic.html the solutions of the alphametic ABCD + ABCD = QEFGH are

8532+8532=17064 7932+7932=15864 8352+8352=16704 9352+9352=18704 8652+8652=17304 6852+6852=13704 5382+5382=10764 5392+5392=10784 7692+7692=15384 6792+6792=13584 8523+8523=17046 7923+7923=15846 9273+9273=18546 7293+7293=14586 6354+6354=12708 5364+5364=10728 8235+8235=16470 9235+9235=18470 6435+6435=12870 8645+8645=17290 6485+6485=12970 5436+5436=10872 8546+8546=17092 5486+5486=10972 9327+9327=18654 6927+6927=13854 9267+9267=18534 5238+5238=10476 7329+7329=14658 6729+6729=13458 5239+5239=10478 7269+7269=14538

Now discard those that have contain 0.

I can answer part of the question: you haven't found the only solution. $${9327\over18654}={1\over2}$$ also works. I don't know if there are more. The only methods I know are educated trial and error, and Henning's method from the comments.