# Math Puzzle for Quarantining Humans: 3333

My next few posts will be a series of simple math puzzles that will require a little bit of cleverness to solve. Here’s the list if you want to jump to a particular problem:

Hopefully, some bored human in quarantine might find joy in solving these problems. Let’s start with `3333`:

# 3333: PROBLEM

You have one number minus another number, and the result is 3333. The question is: what are the 2 numbers that give this result? But here’s the catch: the digits of the two numbers must be chosen from 1–9, and each digit must be used at exactly once.

For instance, `5678 — 2345` does not work because it does not use the digit `1` and it uses the digit `5` twice. `12345 — 6789` is invalid because the result is not `3333` .

Now, I already gave you a hint in the picture above that the first number must have 5 digits and the second number 4 digits. That’s the only way this would work. Now, you have to find the two numbers. GO!

Scroll down to see a hint if you get stuck, and scroll further down to see the solution. Photo by Markus Winkler on Unsplash

# 3333: HINT

There’s a high possibility that you figured this out already, but here it goes. Since the operation’s result (one number minus another) is 3333, a positive number, the top number must be larger than the bottom number, and since we need to use all 9 digits, the first digit of the top number must be a small one (because if it’s too large then the result will be too large). In fact, like mentioned above, it’s 5 digits and the bottom is 4 digits. Thus, the first digit must be a 1. It can’t be 2 because 20,000–9,999 = 10,001 (the smallest difference between a 5 digit number starting with 2 and a 4 digit number). Photo by Markus Winkler on Unsplash

# 3333: SOLUTION

It turns out that there are many solutions to this problem, and here they are:

`12678 - 9345 = 333312687 - 9354 = 333312768 - 9435 = 333312786 - 9453 = 333312867 - 9534 = 333312876 - 9543 = 3333`

If you look closely, the solutions resemble each other a lot, and they reveal something about how you find the solution.

First, we know we’re doing something of the form `1xxxx — xxxx = 33333` . Because we know that 1 is the first digit (as explained in the hint), we know that we must carry in order for that 1 to disappear. Let’s keep that information aside for now.

We need to list all the possible ways we get get `3` from subtracting two digits. We get it with `4-1` , `5-2` , `6-3` , `7-4` , `8-5` , `9-6` . We can’t use `4-1` because the digit `1` is already used. At the same times, we can use at most 3 of these because after 3 selections of pairs of digits, other digits start repeating (this is because any group of more than 3 pairs will repeat a digit).

It seems like we’re out of luck. However, remember that we have to carry over to get rid of the `1` . Which means, there are other possibilities at play. If we carry, we can get `10` plus whatever digit was there before. All the ways we can get `3` from `10` plus a digit minus another digit are: `10+1-8` and `10+2-9` . Those give us `1-8` and `2-9` pairs. However, `1` again cannot be used, so we’re left with only one pair: `2–9`. However, that’s just enough to get one of the solutions. We can use the following pairs: `2-9` , `8–5` , `7-4` , `6-3` . With that, we get `12876 — 9543 = 3333`.

Now, you can see that the order of the last 3 pairs that I gave has nothing inherently special. That is, the last 3 pairs could be permuted. The permutation formula is the following:

What this formula essentially describes is the following. Let’s say we have `n` objects, and let’s say we could order these objects into `r` possible placements. Then the total number of orderings is given by `P(n,r)` . Here’s a video that probably explains it better. With that said, `P(3,3) = 3!/(3-3)! = 3!/0! = 6` . If you look above, we have exactly 6 solutions! So, that checks out with the solutions we gave above :D.

If you were able to solve this, why don’t you try 4444? It’s the same problem, except the result is 4444. It’s much harder than this one, so get ready!

--

-- ## Robert M. Vunabandi

I’m a human, living on earth, and doing Software Engineering. I enjoy reading thoughtful posts, and I like to write! So, here we are.