3
$\begingroup$

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.

  • 0
    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.2011-11-05
  • 0
    `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']`.2017-10-16
  • 1
    @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.2017-10-16
  • 0
    @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".2017-10-16
  • 0
    BTW, did you find any answer to the second question?2017-10-16
  • 1
    @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.2017-10-16

2 Answers 2