Fog Creek Software
Discussion Board

Three computers

There are 3 computers on sale in a hardware store - made in Japan, China and Russia. They all look exactly the same, with the only difference: the Japanese computers replies to any "yes/no" question with a true answer, the Chinese one - with a false answer, and the Russian one - either with a true or false answer randomly.

No one in a store (except for computers themselves, possessing the unlimited knowledge, of course) knows which computer is which.

You want to avoid the unpredictable Russian computer, and buy a "consistent" computer, no matter if it is Japanese or Chinese.

You are allowed to ask only one question to only one computer of your choise before deciding which one to buy.

Can you buy what you want, and if yes, how?

Dmitri Papichev
Saturday, August 2, 2003

This one is along the lines of the riddle with the two tribes, Truthtellers and Liars (Greecians and Phoenicians (?)). You come to a road crossing with a Liar and a Truthteller, but don't know which is which (I HATE it when that happens) and have to find out which way to go with only one question. Answer is: "If you were the other guy, which way would you tell me to go?" and then go opposite to the answer. The Truthteller would truthfully reproduce what the liar would say and the Liar would lie about the right answer...

That doesn't work on this problem though, because the Russian computer is random, so you can use it to cancel out any input. Assuming that the computers have a perfect AI interface, my question would be: "If you were the Russian computer, what would you answer?" The two consistant computers would print "DOES NOT COMPUTE!" in big flashing letters, and the Russian computer would answer randomly...

Of course, a computer that randomly switches ones and zeros can't really be expected to have a perfectly working AI interface ... :)

Monday, August 4, 2003

Theres no way of buying the consistent computer by asking  one question to only ONE computer. There are several questions that you can come up with but as long as you have to pose it to only one computer and the answer being a YES or NO, it would not be possible without an element of probability being involved.

It would however be possible if you asked the same one question to all the computers and based on the result made your selection. You can ask the computers one of several truth based or fallacy based questions. For example ask them: Is today's date mm/dd/yyyy
the two possible scenarios will be as given below
          Japanese                      Chinese                    Russian
A.)          True                              False                          False
B.)          True                              False                          True

In scenario A you can then pick the computer giving the 'true' answer knowing that it is japanese  (since it has to agree on today's date) and will always give you the true answers
In scenario B you can pick the computer giving the 'False' answer and knowing that it is the Chinese (since it disagreed on today's date) and also knowing that it will always give the opposite of what is true but atleast being consistent.

Dmitri, do let me know if it is atleast possible to select the computer the way you've framed the question as then atleast I shall spend more time thinking about it.

Hadi Mohammed
Monday, August 11, 2003

It's impossible, no matter how many questions you ask.  The Russian computer could, just for kicks, mimic the responses from one of the other computers.  You could ask 894 questions and the Russian and Japanese computers could have identical responses to all of them.

Tuesday, August 12, 2003

I think it is possible as long as you can ask a really complicated question ;-)

There are 6 combinations:

Now let's say we will question the first computer and make a choice based on the answer.
R J C    (pick 2 or 3)
R C J    (pick 2 or 3)
J R C    (pick 1 or 3)
J C R    (pick 1 or 2)
C J R    (pick 1 or 2)
C R J    (pick 1 or 3)

We can not pick the questioned computer, because of the case when we are asking the Russian one.
Thus, for example answer Yes means 'choose the 3rd, No means 'choose the 2nd'.

let's now start to "design" the question:

R J C - not interesting, we eliminated it.
J R C - we need to hear Yes - real result of the question Yes
J C R - we need to hear No  - real result of the question No
C J R - we need to hear No  - real result of the question Yes
C R J - we need to hear Yes - real result of the question No

question for the 1st computer is (I let the reader to translate that into a human langugage):
    J R C || C J R

if the answer is Yes -> select the 3rd computer
if the answer is No  -> select the 2nd computer

Thursday, August 28, 2003


Thursday, September 4, 2003

i am dumb enough to ask one of you to translate JRC || CJR.

is it like asking  japanese "Is russian comp second one ?"

if ans is yes, take third one, else take second one...

lets see.

if it is russian comp. same q'n, its answer can be y or N. either way, you get a consistant comp

if it is japanese comp, the answer is Y or N based on the arrengement. if yes, take 3rd, if no take 2nd.

if it is chinese comp, the answer is Y or N based on the arrengement (which  is false). if yes, take 3rd, if no take 2nd.

so, in any case one can get a consistant comp...


Friday, September 12, 2003

To correct the previous posting, the question to the first computer should read something like this:

"What would you answer to the question "Is the second computer Russian?"?"

Take the third computer if the answer is "yes", and the second one if "no".

The first part of that question ("what would you answer to the question...") is actually a famous "lie killer" in the logical puzzles like this. Using it in front of your actual question allows you to get a true answer regardless of who you speak to - a truth-teller or a liar.

Interesting thing about that puzzle is that first it seems to be impossible to solve, because the Russian computer can say anything and ruin the value of any answer.

However, as we do not need to tell apart the other two computers here, the solution (and a nice one!) exists, as we see.

Indeed, having a "lie killer" as a tool, we have no logical reasons to distinguish between the consistent computers.

Dmitri Papichev
Sunday, October 26, 2003

*  Recent Topics

*  Fog Creek Home