Operator Search is a type of arithmetic puzzle in which you need to find proper mathematical operators in a given equation such that the equation holds true. In the following example, if we consider the 4 mathematical operators , then there are possible combinations:
Are we supposed to list out all 64 possible combinations in order to solve it? Not necessarily! There are certainly ways to reduce the number of cases to check. However, you should keep in mind that there may not necessarily be a unique solution, and some puzzles might even have no solution!
In this wiki, we will only be using the 4 mathematical operators , and BODMAS order of operations is applied unless otherwise stated. By the end, you should be able to identify a couple of tricks that can help you solve these problems with ease.
Operator search puzzles are similar to their sister page, Fill in the Blanks, because the former is to fill in the operators given the numbers whereas the latter is to fill in numbers given the mathematical operators.
1. Each can only be replaced with a mathematical operator.
2. A mathematical operation has to be done for each
In particular, there is no combining of digits. For example, is not allowed.
3. Numbers are fixed in the given order.
Keep in mind that we cannot rearrange the digits, i.e. . This is because each square represents a mathematical operator on the presumption that the positions of the numbers are fixed.
For another explicit example, is not the same as any of the following:
4. Obey the order of operations.
As usual, following the conventions of BODMAS, we should always solve for parenthesis, multiplication, and division first. For example, for the following expression:
if the five squares (left to right) represent then
Here is an easy example as a start:
Determine the value of the expression above, where the 4 squares (left to right) represent the following operators:
By obeying the order of operations, we obtain the answers of for respectively.
How would we solve operator search problems? If we didn't know any better, we would just start off by throwing in random sequences of operators. Albeit not the most effective way, the trial and error approach allows us to obtain all possible results by working through all of the possible cases and determine the solutions that satisfy the given criteria.
Note that because each square is restricted to only four operators, by the rule of product the number of possible cases of squares is . As such, as there are more squares, this process becomes much more tedious.
Determine all pairs of mathematical operators such that the above arithmetic puzzle is true.
Listing out all possible combinations, we have
By listing out all the possible combinations, we can conclude that there is only one solution, namely . Thus the two mathematical operators (left to right) that satisfy the given equation are and
We should keep in mind that even after we have discovered one solution that fits, we would still have to continue searching for other possible solutions. This is because not all problems would have a unique solution.
Determine all pairs of mathematical operators such that the above arithmetic puzzle yields an integer.
Listing out the all possible combinations, we have
By listing out all the possible combinations, we can conclude that there are 9 solutions such that the arithmetic puzzle yields an integer solution.
For this example, is it really necessary to work through all 16 cases? It seems tedious, isn't it? Well yes, there is a nifty little trick to reduce your work.
Notice that is not an integer, so can never be an integer. This is because is not a multiple of the denominator . Similarly, is not an integer, so can never be an integer. This is because is not a multiple of the denominator . In other words, neither of the two squares in can have a division sign for the expression to produce an integer.
With this neat little trick, can you solve the introductory example: ?
In some problems, we are not interested in finding the number of possible solutions, but need to find all possibilities for the resultant number. We would like to know what the maximum and minimum possible values are, which can help us determine if a certain number could be reached. Trial and error could get us all of the results, but if there are a lot of possibilities, then that would take a lot more work.
1. Largest solution
Suppose that we are interested in the maximum possible resultant number for an operator search problem. How are we supposed to find it without listing out all the possible results?
Take the expression above as an example. Well, a thought came to mind that we should consider adding them up: . However, the largest value will form from multiplying all of these numbers: .
In general, it is always better to multiply all of the terms together. There is a slight exception to this rule when the number 1 is involved. In this case, because , slight care has to be taken to consider the possibilities.
What is the maximum possible resultant number for the following operator search puzzles?
i) For the expression to be maximized, all the squares must be the multiplication sign Thus the answer is .
ii) As in you might be tempted to have multiplication signs in all of the squares. But you can make a slight improvement on it. Because anything multiplied by 1 is itself, we can use another operator that increases the resultant number. In this case, it is the addition sign and thus the maximum value is
2. Positive and Negative values
In the previous example of , can we determine, of all the possible values, the number of negative values without listing them out?
Well, yes! Notice that the operations of will not change the sign of the resultant number. Thus, if neither of the two squares is a negative sign, then the resultant number will have to be positive. In other words, for the resultant number to be negative, at least one of the two squares must be a subtraction sign.
Since this is only a necessary condition, we still have to check all of the scenarios just in case some of them yield positive values.
So there are 3 solutions for which yields a negative number. See how much quicker that went? We don't need to go through all 16 cases anymore! Now, apply what you have learnt to the following problem:
If I were to randomly fill the squares with two (not necessarily distinct) mathematical operators out of , is the resultant number more likely to be positive or negative?
You are not allowed to use parenthesis.
Obey the order of operations.
3. Smallest solution
Like the largest solution discussed above, suppose that we are interested in the minimum possible resultant number for an operator search problem. How are we supposed to find it without listing out all the possible results? The smallest solution might be a little bit trickier. Let us think about the same problem as above.
Should we consider all subtraction signs: How about all division signs: It turns out that neither of them works. An even smaller value would be . But how do I know this without working through all combinations? It's simple! We just need to subtract the largest possible number! Since we start with in this example, we only need to subtract the largest possible value from it, i.e. . Simple, right? Like the largest solution, there might be slight exception to this rule, especially when the number 1 is involved.
For example, yields a smaller value when the first two squares are subtraction signs. That is, .
Now, the range of all these not necessarily distinct numbers is simply the difference between the largest and smallest resultant numbers.
There are ways in which we can fill the squares above with . Find the range of all these numbers.
The largest possible value is . The minimum possible value is . Thus, the range is
4. Multiple solutions
If we are interested in determining all possible solutions for which an operator search equation holds true, trial and error is carried out almost every time. Consider the following equation:
Working on the ones inside the parenthesis first, we have
By trial and error, of all of these 16 numbers, only two satisfy the condition, i.e. and .
If we were allowed to use all 4 operators, then we have to use trial and error and check most of our cases. However, if we were to restrict the operators to just addition and subtraction then there are several other tricks that we can apply to solve the problem.
1. Maximum and minimum value
To find the largest value, we just need all the squares to be addition signs Similarly, to find the smallest value, we just need all the squares to be subtraction signs As an explicit example, the maximum and minimum values of are and respectively.
2. Parity Argument
In this section, we will be applying parity to solve these arithmetic puzzles. If you are not familiar with that concept, please read Modular Arithmetic - Parity.
Consider the equation above. With the restriction of only the two operators, how can we determine all the possible solutions?
Let's use an analogy, where we consider all the squares to be light switches!
Imagine turning on a lightbulb as an addition sign
Imagine turning off a lightbulb as a subtraction sign
For the left hand side of the equation, turning on all the lightbulbs, we have a total value of , which we will call the initial state. Observe that if we were to change any sign, then the value of the expression will change by twice of the number. This means that the parity of the result will still be unchanged! We have found an invariant: no matter how many signs we change, the expression must still have the same parity.
Find all the solutions to
Since is even, we know that changing the signs will still leave the number even, and thus there is no way to obtain the odd number 5. Thus there is no solution.
3. Subset sum by parity
Now, this problem is a slight variation of the earlier example problem above. As shown in the following equations, we first add all of the original numbers and then subtract only the number(s) with subtraction sign twice.
In other words, we look for twice the sum of one or more of the values such that the difference between twice the sum and the initial state is really the number on the RHS of the equation, which is in this problem.
To put it short, in this problem we look for a subset of such that the sum of its elements equals
Simple, right? We can solve this puzzle by using an analogy of lightbulbs!
Let's try another scenario. Using the lightbulb analogy above, we can also solve an operator search puzzle which only has powers of 2. Suppose we want to solve the following equation:
By considering the initial state, we have , and we want to find the value of such that . Solving it yields which means we now need to find the sum of powers of that add up to . So we should switch off the corresponding lightbulbs and because That is,
There are ways in which we can fill the squares with . Determine the right combination of these two mathematical operators such that the equation above is fulfilled.
By using the lightbulb analogy, we first get the initial state: which is the sum of a geometric progression. Solving for we have
So we want to find the sum of distinct powers of 2 that yields 104. Subtracting the highest power of 2 from 104 yields . We repeat the process to get and eventually Thus, the following equation holds true:
Therefore, the correct combination of mathematical operators is
The 24 Game is a type of operator search puzzle played with a deck of cards. We encourage you to play this game with a group of friends and see if you can beat them at it.
To play, draw 4 cards from a standard deck of 52 cards. The number cards have values corresponding to the numbers, while the Jack, Queen, King and Ace have values of 11, 12, 13 and 1, respectively. The goal is to be the first person to correctly form the number 24 using basic arithmetic operations which involve all 4 numbers. To win at this game, you will need fast thinking, good mental arithmetic, and lots of practice!
In line with this page, we are restricted to the operations of addition, subtraction, multiplication and division. However, we are allowed to
- rearrange the numbers as we wish since no order has been specified, and
- use parentheses as we wish.
Play the 24 game with the following hand:
There are multiple solutions, so give this a try before looking at the answers!
If you find more, please add them in!
As a challenge, play the 24 game with the following hand:
This is not easy, so spend some time thinking before looking at the solution below.
Given our successes above, is it true that any 4-card hand will always result in 24? Out of the possible four-card hands (review Stars and Bars for further details), it turns out that about 1362 of them have solutions. Given a 4-card hand, the main way to prove that there is no solution would be to run through all of the possible combinations of numbers and operations. If you're interested, you can write a computer program to show that the following hand has no solution: