Turn off a calculator: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
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? | 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| | {{Solution| Such a sequence is given by 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 again. If the calculator is on then this sequence does nothing, does nothing and then turns it off. 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]] |
Current revision as of 18:39, 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
Such a sequence is given by 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 again. If the calculator is on then this sequence does nothing, does nothing and then turns it off. Finally, if the calculator is on with the "2nd" key pressed this sequence turns it off, turns it on, and then turns it off.