1

I'm playing an iOS escape game where a problem is this :

a b c d e
- f g h i
---------
3 3 3 3 3

Where :

  • d = 6
  • each letter is a unique digit > 0 (a & b can't be 2 for example)

I block after these hypotheses :

  • abc6ef = 33333 + ghij
  • ghij can be at the highest 9875 and the lowest 1234, so a = 3 or a = 4
  • Digit available : 1, 2, (3 or 4), 5, 7, 8, 9
  • all available values for {e;i} are {1;8},{2;9},{8;5},{7;4},{5;2},{4;1}

Maybe a logical solution exists, but my mind is too weak for find a path ^^ And if this problem is in a game, I don't think the solution is brute force mode...

BaptX
  • 121
  • 2
    Please edit to include your efforts. Don't reference ChatGPT "solutions". That system isn't trying to do the math, it just tries to sound like it is doing the math. – lulu Mar 09 '23 at 14:58
  • Dit it. hypotheses are from my mind, not ChatGPT. And ChatGPT talk about brute force. I'm sure a mathematic reasoning exists – BaptX Mar 09 '23 at 15:02
  • 1
    Off topic, but this reminds me of my childhood and the book series Sideways Stories from Wayside School. Those books were full of problems like these. – JMoravitz Mar 09 '23 at 15:03
  • So, I'd start by separating the cases $e>i$ and $e<i$. You get a lot of information if you know which of those you have. For instance, if $e>i$ then $h=3$ which means that $a=4$. And so on. – lulu Mar 09 '23 at 15:04
  • There are surely smart ways to do this, but if you feel stuck on these types of problems, you should try "brute force"; not as in, plug in numbers till you get a solution, but find all possible cases, and for each case deduce as much as possible. Example: We see that either $e=i+3$ or $e=i-7$. If $e=i+3$, there is no carry to the second digit, so $d=h+3$ or $d=h-7$. If $e=i-7$, then either $d=h+4$ or $d=i-6$. But we know $d=6$, so the latter isn't possible in any scenario. Then you can further deduce for the remaining digits, and then start checking if there are any examples fitting the bill. – SomeCallMeTim Mar 09 '23 at 15:09
  • 1
    For what its worth, I wrote a quick and dirty script to brute force this, and there are a total of $65$ different solutions if we ignore the condition that $d=6$, ranging from $34608-1275$ to $43160-9827$. – JMoravitz Mar 09 '23 at 15:10
  • At some point, you will also want to use that all the digits are different. This should lead you to a solution pretty straight-forwardly. – SomeCallMeTim Mar 09 '23 at 15:10
  • @JMoravitz How many of those have $d=6$? – lulu Mar 09 '23 at 15:11
  • @JMoravitz 0 is forbidden. I will edit my post – BaptX Mar 09 '23 at 15:12
  • Thanks, I missed that $d=6$. That drops the total down to 7. The values of $x$ being $34860, 38460, 39061, 39160, 41268, 43061,$ and $43160$ – JMoravitz Mar 09 '23 at 15:13
  • 1
    If zero is forbidden, that drops it down to just the one solution. $41268-7935$. This is admittedly brute force which you wanted to avoid, but it will at least help others check their work. – JMoravitz Mar 09 '23 at 15:14
  • The difference of the sum of digits, $a+b+c+d+e-(f+g+h+i),$ must be $\equiv6\pmod 9.$ – Thomas Andrews Mar 09 '23 at 15:16
  • Likewise $$(a-b+c-d+e)+(f-g+h-i)\equiv 3\pmod {11}.$$ – Thomas Andrews Mar 09 '23 at 15:19
  • If $k$ is the digit missing, the $k+2(f+g+h+i)\equiv 3\pmod 9.$ – Thomas Andrews Mar 09 '23 at 15:25
  • Do you know for sure that there is a solution? – Thomas Andrews Mar 09 '23 at 17:36

2 Answers2

1

You can quickly exclude half the pairs you found for $e$ and $i$. If there’s no carry in that digit, then $h$ must be $3$, so $a$ must be $4$; that exclude the two pairs with a $4$. If there’s a carry, then $h$ must be $2$, so that excludes another pair.

That leaves you with three cases; in each case you already know $d$, $e$, $h$ and $i$, and in two cases you also know $a$, so the rest should be manageable.

joriki
  • 238,052
0

This approach will use some knowledge to reduce the brute force. But it is still brute force.

First, if $u$ is one of the digits on the lower term, then the digit above must be either $(u+3)\bmod{10}$ or $(u+4)\bmod {10}.$ In particular, $a\in\{3,4\}$ and $h\in\{2,3\}.$

Summing digits we have:

$$(a+b+c+6+e)-(f+g+h+i)\equiv 33333\equiv 6\pmod 9.$$

But we know that $$45=(a+b+c+6+e)+(f+g+h+i)$$ So $$a+b+c+e\equiv 6\pmod {9},f+g+h+i\equiv6\pmod 9.$$

So you want to find the subsets $\{f,g,h,i\}$ of $\{1,2,3,4,5,7,8,9\}$ with a sum $\equiv 6\pmod 9$ and which don't contain both $3$ and $4,$ but must contain at least one of $2,3.$

The maximum value of $f+g+h+i$ is $29,$ the minimum is $11,$ so this means $f+g+h+i\in\{15,24\}.$

The values equal to $24$ are:

$$9+8+5+2\\9+7+5+3$$

The subsets with sum $15$ are:

$$9+3+2+1\\8+4+2+1\\7+5+2+1$$


Case: $9852.$ The digit above the $5$ has to be $8$ or $9.$ No solutions.


Case: $9753.$ The Ramaining digits are $8421.$ $9$ has to be under $2,$ $7$ under $1,$ $5$ under $8$ and $3$ under $6.$ We also deduce the $2-9$ pair must be directly to the right of $1-7,$ so that we "borrow" and that $1-7$ must be to the right of the $4.$

So we get $41268-7935=33333.$


Case: $9321.$ But the digit above $9$ must be $2$ or $3.$ No solutions.


Case: $8421.$ The digit above $8$ must be $1$ or $2.$ No solutions.


Case $7521.$ The $7$ has to go under $1.$ No solutions.


So there is only one solution, $41268-7935=33333.$

Thomas Andrews
  • 177,126