# What is the minimum number of matchsticks that you can use to build expressions having the following results?

## Instructions

You have a bag containing infinite number of matchsticks all having the same cuboidal shape and size. Digits can be made using these matchsticks:

• $0$ takes 6 matchsticks
• $1$ takes 2 matchsticks
• $2$ takes 5 matchsticks
• $3$ takes 5 matchsticks
• $4$ takes 4 matchsticks
• $5$ takes 5 matchsticks
• $6$ takes 6 matchsticks
• $7$ takes 3 matchsticks
• $8$ takes 7 matchsticks
• $9$ takes 6 matchsticks

And the operators which you can use are

• '$+$' takes 2 matchsticks
• '$-$' takes a matchsticks
• '$\times$' takes 2 matchsticks

## Requirement

You are required to create expressions by creating numbers and operators together using the matchsticks provided to you. The expressions that you create must have at least one operator and must have the result which will be provided to you.

## Example

Question: Create an expression having result 1000 using matchsticks

$10 \times 10 \times 10$ takes 28 matchsticks

## Question

Create an expression using the minimum number of matchsticks having results

1. 10
2. 45
3. 50
4. 99
5. 125

I will accept the answer which uses the least number of matches in all the five expressions combined.
The current accepted answer by @Jabe uses a total of 55 matchsticks.
Have fun trying to beat the highscore!

• How long do you think it will be before someone writes a program to optimize it? – mdc32 Jan 27 '15 at 13:29
• @mdc32 , Making a program to answer this question is tiresome. You have to manually implement number of matches for each digit and then test the possibilites for all combinations! I don't think anyone will make a program for this question... – Spikatrix Jan 28 '15 at 13:36
• If you're used to programming, and your language of choice has an eval(string) function, then it should take ~5 minutes to write a program to solve this. – Lopsy Jan 28 '15 at 17:32
• @CoolGuy: I actually think "write a program to solve this" might be an interesting problem over at PPCG. Would you have any objections to it being posted there? – ais523 Mar 27 '17 at 20:51
• @ais523 No. Not at all. You may do whatever you want with this. I don't mind even if you don't provide any attribution. You can do whatever you like. – Spikatrix Mar 28 '17 at 14:55

1. (10) 7 matchsticks: $11-1$
2. (45) 12 matchsticks: $44 + 1$
3. (50) 10 matchsticks: $51-1$
4. (99) 12 matchsticks: $11\times9$
5. (125) 14 matchsticks: $114+11$

Total: 55 matchsticks

• I can do one better for 45. Namely, "+45" uses 11 matchsticks. Hey, it has at least one operator! – Lopsy Jan 28 '15 at 16:13
• (10), (45), (50) are optimal though not necessarily exclusively so. Still checking the others. – Nij Jun 30 '16 at 1:44
• As are (99) and (125). Well done. It can't get better, though alternatives can... match that score ;) yeeaaah! – Nij Jun 30 '16 at 1:52
1. $11 - 1$ takes 7 sticks.
2. $9 \times 5$ takes 13 sticks.
3. $51 - 1$ takes 10 sticks.
4. $11 \times 9$ takes 12 sticks.
5. $5^3$ would take 10, but if not, then $121 + 4$ takes 15, I think.

Still working on a program to optimize it, but that could take a bit.

• How about $71+71-17$. It isn't optimal, but it is interesting. It takes 18 sticks I think. – Trenin Jan 27 '15 at 14:23
• And $71+54$ takes 16 as well. – Trenin Jan 27 '15 at 14:25
• @Trenin $71\times2-17$ as well. – Jabe Jan 27 '15 at 14:46
• You can only use the operators which are mentioned in the question. So the ^ operator is not allowed. – Spikatrix Jan 28 '15 at 13:53

First off, in your example, you used $10\times10\times10$ which seems to me that we can make numbers with multiple digits.

Usually, the definition of an expression doesn't require the use of an operator, so I would make the following trivial initial guesses:

1. 10: 8 matchsticks - "$10$"
2. 45: 9 matchsticks - "$45$"
3. 50: 11 matchsticks - "$50$"
4. 99: 12 matchsticks - "$99$"
5. 125: 12 matchsticks - "$125$"

But none of these answers is very interesting. In fact, some of them aren't even optimal! So I will assume that we need to include operators.

1. 10: 7 matchsticks - "$11-1$"
2. 45: 13 matchsticks - "$5 \times 9$"
3. 50: 10 matchsticks - "$51 - 1$"
4. 99: 12 matchsticks - "$11 \times 9$"
5. 125: 16 matchsticks - "$11 \times 11 + 4$"
• Correct, except 16 isn't optimal for the last. See my answer, you can get down to at least 15. – mdc32 Jan 27 '15 at 13:28
• @mdc32 Good one! – Trenin Jan 27 '15 at 13:31
• Yes. You have to use at least one operator in each expression. – Spikatrix Jan 28 '15 at 13:54
• @mbomb007 If you look at the edit history of the question, that requirement was added after I posted my answer. I even noted in this answer that doing so without an operator results in trivial answers, which is why I included answers for them also with operators. – Trenin Mar 29 '17 at 16:37
• The requirements changing isn't really an excuse to not change your answer to fit them. Just get rid of the ones that don't fit, I'd say. – mbomb007 Mar 29 '17 at 17:38

54.

11-1

5×9

51-1

11×9

112+4

The sum's 54. He didn't say exponentiation assumed with using ^ operator. QED

• The question says, “the operators which you can use are +, −, and ×”.  Since it doesn’t mention exponentiation, that means that exponentiation is not allowed. QED – Peregrine Rook Aug 23 '17 at 17:57