2
$\begingroup$

This is an easy one, just came out of my mind yesterday, while discussing calculator's architecture with a friend, even if it is not related to architecture itself.

A man walks into his office. He finds the calculator opened on his laptop with 0.33333333333 written on it. Just for fun, he wants to make 1 with just one operation (he's having such a good time). So he tries to divide by 0.33333333333. The calculator output is not 1.

What's the result he got? Why? What's the correct operation to get 1?

EDIT: Just to clarify, let's assume this is google calculator, that one you can use from google search page. Se everyone can "work" on the same calculator. It makes no difference, but this removes the "maybe this doesn't work on my '77 calculator" wild card.

$\endgroup$
  • 2
    $\begingroup$ Are we to assume that the 3s repeat infinitely, or just for 8 digits? $\endgroup$ – Brandon_J Sep 7 at 14:42
  • $\begingroup$ Is it because of precision error? If yes, then note that there are many architectures being used which means: different calculators, different results. In particular case, different answers may arise for this puzzle. $\endgroup$ – athin Sep 7 at 14:56
  • $\begingroup$ No, it's not precision error :D @Brandon_J, you have all the information to assume correctly if is repeated or not. $\endgroup$ – Miles Davis Sep 7 at 14:56
  • $\begingroup$ @athin Nope, it is not precision error ;) $\endgroup$ – Miles Davis Sep 7 at 15:01
  • 7
    $\begingroup$ To problems like this, my default response is xkcd.com/169/ $\endgroup$ – Don Thousand Sep 7 at 15:42
11
$\begingroup$

Value to power of 0 = 1 exactly

$\endgroup$
  • 1
    $\begingroup$ Wow this is a beautiful answer $\endgroup$ – Always Confused Sep 8 at 6:15
  • $\begingroup$ This is an excellent partial answer as a correct (guaranteed) way to get 1. $\endgroup$ – Rand al'Thor Sep 8 at 7:46
9
$\begingroup$

If you type 0.333333333333 (12 3s) into google calculator and press enter, the display shows 0.33333333333 (11 3s). This is what happened before the man found the calculator.

If you then divide that by 0.33333333333 (11 3s), you get 1.00000000001 because internally it still remembers the number at a higher precision than what it displays.

$\endgroup$
  • 3
    $\begingroup$ Didn't the OP say in the comments it wasn't to do with precision error? $\endgroup$ – hexomino Sep 7 at 20:03
  • $\begingroup$ Whoops forgot to spoiler it. Sorry about that. And I answered like this because I don't think this is a precision error. I think it's a display error :) $\endgroup$ – hdsdv Sep 8 at 1:20
  • 1
    $\begingroup$ If it is not that, then it is a "guess what I think" problem. $\endgroup$ – Florian F Sep 8 at 20:50
4
$\begingroup$

Scenarios that could have lead to this:

1. Someone divided $1$ by $3$ or did an equivalent operation, hit equal and left it there.
2. Someone entered $0.$ and at least $12$ $3$'s after that, hit equal and left it there.

Division by $0.33333333333$ gives:

$1.00000000001$

This happened because:

The memory of the calculator stores more than what it displays: in this case the calculator stores exactly $12$ digits while it shows just $11$ digits.

Possible ways to get $1$:

1. Adding $0.666666666667$
2. Multiplying by $3$
3. Dividing by $0.333333333333$
4. Raising to the power $0$

I don't know exactly how common this is, but all the calculators I tried has the same behaviour too:

Storing one digit more than it displays

$\endgroup$
  • 1
    $\begingroup$ Nice answer with more holistic / big picture approach $\endgroup$ – Always Confused Sep 8 at 6:16
4
$\begingroup$

I guess

It is a problem with recurring decimal where someone divided 1 by 3.


Probably the calculator holds more decimal places than it shows. ( though i cant remember if i saw so at past) so dividing with displayed number does not work.


Therefore:

Multiplying with 3 may result closer to 1.

$\endgroup$
3
$\begingroup$

It could be that somebody entered $1/3=$ followed by

$+($

If you now type $/.33333333333333$ then

the division operator is ignored because it makes no sense after an open-parenthesis. The answer you get is $0.6666666666666$.

To get a result of $1$ you could type:

$0.6666666666666=$

$\endgroup$
1
$\begingroup$

This answer doesn't seem to work on the google calculator

since it shows full calculation and history, but on an old fashion standard calculator the display could show 0.33333333, if the number had been input by hand without equals having been pressed.

The computer could have been found after

3*0.33333333 had been input, such that adding /0.3333333 = would return 3.

The operation

raise to the power of zero might be able to give one assuming the calculator has such a function, but this might fail (when operator precidence is respect) had the input had been 1 + 0.3333333.

The most reliable way (if it can be considered an answer) is

Cancel button followed by a 1.

$\endgroup$
1
$\begingroup$

The Google calculator has a little history line that could reveal how the result was derived, but the user could have obfuscated this by typing Ans = which would make the history line show Ans =.

Because of internal digits stored by the calculator, it is impossible to say whether the user typed a decimal followed by eleven 3's and pressed = Ans = or performed 1 / 3 = Ans =. In the first case, multiplying by 3 will result in 0.999999999 and the second case will give 1. And dividing by a decimal followed by eleven 3's will give 1 in the first case and 1.00000000001 in the other.

Without knowing how the number was derived, neither approach will work.

To guarantee getting 1:

Divide the display by itself using / Ans =

or on an RPN calculator:

Enter /

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.