logic problem's bugging my mind...

Discussion in 'Community' started by shadowfax, Aug 28, 2003.

  1. shadowfax macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #1
    OK, i have been looking at this problem off and on today, and it's still puzzling me. i can't see any way out. anybody got any tips, insights, etc?

    i here it's pretty famous or something, but i haven't seen it anywhere.

    "You are stranded on a desert island and have discovered a computer left on the island by a departed AI guru. The computer's batteries are about to run out of power. There are three programs installed on the computer. The names of the programs are HelpMe, Ayudame, and AideMoi. (There is no significance in these names. They could just has well have been A, B, and C, or Dog, Cat, and Mouse, or any other names. Names are specified only to provide some uniform terminology for solutions to this homework problem.) All three programs attempt to perform the same functions. If you run any one of the programs and supply it with a question that has a yes-or-no answer, the program responds with a yes-or-no answer. If you run the program and supply the input "Help", the program sends an email message to a rescue team, explaining your situation and the providing location of the desert island. The computer has just enough power to answer one question and send one help message. You can select which program to run and supply whatever input you like (but only one input -- you have to run it again if you want to supply another input). You can do this twice, once to ask a question and once to send a message. After that, you're stuck on the island. No more battery power.

    "One of the programs (you don't know which one) is defect free. It always answers yes-or-no questions correctly, and, upon request, it always transmits your correct location to the rescue group. Another of the programs (again, you don't know which one) is almost defect free. Upon request, it always transmits your correct location to the rescue group, but because the AI guru accidentally swapped entries in the answer table, the answer "Yes" means "No", and and the answer "No" means "Yes". In other words, this program always gives the wrong answer to yes-or-no questions. The third program has a lot of bugs. It answers some questions correctly and some incorrectly, with no indication as to which is which. Besides that, it always sends the wrong location in help messages.

    "Figure out a question to ask one of the programs so that, when you get the answer, you will be able to select a program that will send your correct location to the rescue team."
     
  2. shadowfax thread starter macrumors 603

    shadowfax

    Joined:
    Sep 6, 2002
    Location:
    Houston, TX
    #2
    well, after hours of agonizing (where were you, Doctor Q? i thought you would be all over this!), i got it from a friend of mine who's like a Junior at Rice... here's my summary of how it all ends up working...

    The Question, which in this form must be posed to program “HelpMe:”

    Is “Ayudame” bug-free or does “Aidemoi” have the inverted yes-no answer bug?

    Explanation:

    HelpMe must tender a yes or no answer to this question. If it responds with Yes, then the following three scenarios are possible:

    1. HelpMe has the random response and bad information bug. In this case, both Ayudame and Aidemoi will transmit the proper rescue email.
    2. HelpMe is bug-free. In this case, the statement that “Ayudame is bug-free” must be false, so the statement that “Aidemoi has the inverted yes-no bug” must be true, so Aidemoi will transmit the proper rescue email.
    3. HelpMe has the inverted yes-no bug. In this case, both statements are false: Ayudame is not bug-free, and obviously HelpMe is not, since it has the inverted yes-no bug, so Aidemoi must be bug-free, and will transmit the proper rescue email.

    In each scenario, Aidemoi will always transmit the proper email, and should be given the “help” message following this.

    If HelpMe responds with No, then the following three scenarios are possible.

    1. HelpMe has the random response and bad information bug. In this case, both Ayudame and Aidemoi will transmit the proper rescue email.
    2. HelpMe is bug-free. In this case, both statements are false, so Aidemoi must not have the yes-no inversion bug. Since clearly in this case, Helpme is not either, Ayudame must have the yes-no inversion bug, and will transmit the proper rescue email.
    3. HelpMe has the inverted yes-no bug. In this case, the statement that “Ayudame is bug-free” must be true, so Ayudame will transmit the proper rescue email.

    In each of these scenarios, Ayudame will transmit the proper email, and it should be given the “help” message following this.
    *******
    thanks to everyone who actually looked at this, all 24 of you, myself included.
     

Share This Page