Can you complete the expression $2 \underline{ }\, \underline{ }\, \underline{ } \,\underline{ } 5 = 2015$?

Can you complete the expression

$2 \underline{ } \, \underline{ }\, \underline{ } \, \underline{ } 5 = 2015$

and make it correct by replacing two underscores with a selection of the operational symbols $+, - , /, \times$ and the other two underscores with digits $0,1,\ldots,9$?

I have been working on this problem for quite a while now where my main strategy has simply been trial and error. However, I still can't seem to find a combination of operational symbols and digits where the result gives me 2015. If this is in fact not possible I would greatly appreciate an explanation and if it is possible, I would greatly appreciate an explanation of how you were able to solve it.

Thank you.


Exactly two underscores must be occupied by operators. Furthermore, no two operators can be placed adjacently, as this would be syntactically meaningless. Hence, there are only three possible arrangements of digit and operator positions:

  • $2$ # @ # @ $5$
  • $2$ @ # @ # $5$
  • $2$ @ # # @ $5$

For each case, we choose the digits and operators that give the largest possible output, to see if it actually possible to reach the required neighborhood of values.

By inspection, I think it is fairly obvious that for each of the three cases above, filling the blanks with 9's and multiplication in the indicated positions (# for number, @ for operator) yields the largest possible output for each case:

  • $2 9 \times 9 \times 5 = 1305$
  • $2 \times 9 \times 9 5 = 1710$
  • $2 \times 9 9 \times 5 = 990$

Any other digits or operators decrease the output, hence it is not possible to reach the neighborhood of $2015$, and therefore (I'm quite sure) the task is not possible.


No where in the puzzle forces us to interpret the digits as decimal numbers.
In base $8$, we have: $$21 \times +75 = 2015$$


This is not possible, the largest number we can make using two operations and two digits is given by $$ 2 \cdot 9\cdot 95=1710<2015$$ so this problem has no solution stated as such. Of course if you relax the condition 2 operations-2 digits then, as proposed by 5xum (who proposed 2010+5), it is much easier.


The puzzle does not restrict the operations to binary, so using + as a unary operator opens up even more possibilities and allows to reach higher numbers. It seemed promising at first, but sadly none of the possibilities is 2015. Here's a table:

$$ 2\mathrm{X} \times +\mathrm{Y}5$$


Brute force solution

I originally wrote the solution for 5 slots, with only 4 slots this approach proves that only two solution candidates appear: 2010+5 and 2020-5. Obviously these don't match the criterium so it is proved that no solution exists. For illustration I will hereby show how I found the solution for when there are 5 slots.

Approach

It can easily be seen that there there are just a limited number of possibilities here. A simple upper bound can be found by considering that each slot can be occupied by 14 different characters, and there are 5 slots. As such we can simply try roughly half a million possibilities (14^5 to be exact) and evaluate the solution.

Matlab code

v = ['0':'9' '+' '-' '*' '/'];

results = [];
for a=v
    for b=v
        for c=v
            for d=v
                for e=v
                    x = false;
                    s = ['x = 2' a b c d e '5 == 2015;'];
                    try 
                        eval(s);
                    catch
                    end
                    if x
                        results = [results; s];
                    end
                end
            end
        end
    end
end

Results

x = 2000+15 == 2015;
x = 2010+05 == 2015;
x = 2010++5 == 2015;
x = 2010--5 == 2015;
x = 2020+-5 == 2015;
x = 2020-05 == 2015;
x = 2020-+5 == 2015;
x = 2030-15 == 2015;
x = 2040-25 == 2015;
x = 2050-35 == 2015;
x = 2060-45 == 2015;
x = 2070-55 == 2015;
x = 2080-65 == 2015;
x = 2090-75 == 2015;
x = 20+1995 == 2015;
x = 2100-85 == 2015;
x = 2110-95 == 2015;

Conclusion

Most combinations do not meet the restriction of having exactly 2 operators, but some do. My personal favorite which I would personally consider to be the answer:

2010--5 == 2015