Tuesday, October 8, 2019

mathematics - Calculator Bomb


So, I need your help.


I got home after a long day and found a calculator roughly taped to my door. However, there was something much more disturbing attached to that calculator. It was some kind of black device with a blinking red 12 on it. There was also a note which I read.



Hello... In order to live, you must defuse the bomb by making the calculator show the number 212. However, you only have 12 key presses to do it, including the = key at the end. Don't try to enter your house through a window or opening a door, or any other way, or the bomb will go off. Don't call the police or anyone to help, either. This message contains no hints, so it's a waste of time looking for them. In addition, this calculator is modified so that you can't press a number when there's a number and no operation in (for example, you can't press the 6 key if the calculator shows 89 with no equation.)



Easy. I was about to hit 212 Enter when I noticed, the 2 and 1 keys were broken. So were so many keys, that, it's easier to list the keys that weren't broken.



Keys remaining: $0, 4, 7,+, -, x^2, 10^x, =$


Note: The $x^2$ and $10^x$ keys give their result immediately, without requiring another key press.


The calculator currently displays the number $5$.


One last thing: You must hit the = sign at the end.


Good luck. I definitely hope you have it, because I need some right now.


Also, the tag says no computers, but feel free to pull out an actual calculator and give it a go. Just no computer programs.


If you have any questions on how certain buttons work, feel free to ask me in comments.


CLARIFICATION: The calculator has no memory function, so you can't do equations 'on the side' like squaring a number separately, then adding that number to the main total.


Extra Credit: Can you do it without the + key?



Answer




[OP has clarified the somewhat unorthodox behaviour of the calculator; my earlier answer, preserved below, no longer applies but we can do something else instead.]


Do this:



+ 4 + 7 sq - 4 4 =



That will



add 4+7 to our initial 5, getting 16; square it, getting 256; subtract 44, getting 212.



We have used




9 keypresses in total.



If we need to use the full 12 keypresses, we can



follow up with + 0 = which of course changes nothing.





Old answer, applicable to real calculators


I think I can do it in 11 key presses:




sq - 4 - 7 = sq + 4 sq =



So



after squaring the calculator shows 25; we subtract 4 and 7 to get 14; we square to get 196; we add 4^2=16 to get 212.



If we need to use exactly 12 key presses we can



press = after subtracting 4.




No comments:

Post a Comment

classical mechanics - Moment of a force about a given axis (Torque) - Scalar or vectorial?

I am studying Statics and saw that: The moment of a force about a given axis (or Torque) is defined by the equation: $M_X = (\vec r \times \...