Turn off a calculator: Difference between revisions

From Math Puzzle Wiki
Jump to navigation Jump to search
Oscarlevin (talk | contribs)
Created page with 'As you are finishing up you math homework, the power goes out. You realize that it might not come on for a while, so you should probably just call it quits. You reach for the c…'
 
No edit summary
Line 1: Line 1:
As you are finishing up you math homework, the power goes out.  You realize that it might not come on for a while, so you should probably just call it quits.  You reach for the calculator to turn it off, but then realize that you are not sure whether it was on or off to start with.  You know that the "on" button will turn the calculator on if it is off, but does nothing if the calculator is on.  To turn the calculator off, you must first press the "2nd" key, and then the "on" key.  However, if the calculator is off, the "2nd" key has no action.  Given that the calculator could be off, on, or on with the "2nd" key already pressed, is there a sequence of button presses that will guarantee the calculator is off once finished?   
As you are finishing up your math homework, the power goes out.  You realize that it might not come on for a while, so you should probably just call it quits.  You reach for the calculator to turn it off, but then realize that you are not sure whether it was on or off to begin with.  You know that the "on" button will turn the calculator on if it is off, but does nothing if the calculator is already on.  To turn the calculator off, you must first press the "2nd" key, and then the "on" key.  However, if the calculator is off, the "2nd" key has no action.  Given that the calculator could be off, on, or on with the "2nd" key already pressed, is there a sequence of button presses that will guarantee the calculator is off once finished?   
 
{{Solution| The desired sequence is On->On->2nd->On. In the case that the calculator is already off this sequence turns it on, does nothing, and then turns it off. If the calculator is on then this sequence does nothing, turns it on and then turns it off again. Finally, if the calculator is on with the "2nd" key pressed this sequence turns it off, turns it on, and then turns it off. }}


[[Category: Computer science]]
[[Category: Computer science]]

Revision as of 18:36, 6 November 2010

As you are finishing up your math homework, the power goes out. You realize that it might not come on for a while, so you should probably just call it quits. You reach for the calculator to turn it off, but then realize that you are not sure whether it was on or off to begin with. You know that the "on" button will turn the calculator on if it is off, but does nothing if the calculator is already on. To turn the calculator off, you must first press the "2nd" key, and then the "on" key. However, if the calculator is off, the "2nd" key has no action. Given that the calculator could be off, on, or on with the "2nd" key already pressed, is there a sequence of button presses that will guarantee the calculator is off once finished?

Solution
The desired sequence is On->On->2nd->On. In the case that the calculator is already off this sequence turns it on, does nothing, and then turns it off. If the calculator is on then this sequence does nothing, turns it on and then turns it off again. Finally, if the calculator is on with the "2nd" key pressed this sequence turns it off, turns it on, and then turns it off.