Logic!

Mike Schilling

Mike has been a software engineer far longer than he would like to admit. He has strong opinions on baseball, software, science fiction, comedy, contract bridge, and European history, any of which he's willing to share with almost no prompting whatsoever.

Related Post Roulette

28 Responses

  1. KatherineMW says:

    Eh, this comic remains my favourite solution to this logic problem: http://www.giantitp.com/comics/oots0327.htmlReport

  2. Brandon Berg says:

    Must both questions be decided up front, or can you choose the second question based on the answer to the first?Report

  3. Kazzy says:

    Dude, where were you when David Bowie was torturing the children of the 80s?Report

  4. BlaiseP says:

    Quoted from an old comment of mine:

    There is an old logic parable called the Pilgrim to Jerusalem. At a fork in the road stand two brothers: one will always lie and the other will always tell the truth. The Pilgrim may only ask one question of one brother to find his way to Jerusalem. What is the question the Pilgrim must ask?

    “Which fork in the road will your brother tell me to take?” is the question. When the questioned brother says “A”, the Pilgrim must take the “B” fork.Report

  5. Brandon Berg says:

    Actually, no need. Here’s the easy answer:

    1. Ner lbh gur fbeg jub jbhyq fnl gung gurer ner na bqq ahzore bs gehgu gryyref?

    2. Ner lbh gur fbeg jub jbhyq fnl gung gur ahzore bs gehgu-gryyref vf srjre guna gjb?

    V fhfcrpg gung gurer’f na nafjre gung vaibyirf punvavat erfcbafrf. Jbhyq lbh fnl gung Puhpx jbhyq fnl gung Rq jbhyq fnl….Be fbzrguvat yvxr gung.Report

  6. dragonfrog says:

    Obligatory xkcd reference – there are three guards, one who lies, one who tells the truth, and one who stabs people who ask tricky questions.

    Also, in Kingdom of Loathing – there are four guards, one who lies, one who tells the truth, one who can’t be counted on to do either, and one who craves the taste of human flesh.Report

  7. Alan Scott says:

    The simplest questions I can think of. I think the second one still counts as a meta-question, though.

    1) Vf bayl bar bs lbhe sevraqf n yvne?
    2) Jbhyq obgu bs lbhe sevraqf fnl lbh’er n yvne?

    Vs obgu dhrfgvbaf ner nafjrerq jvgu n ab, gura gurer ner ab yvnef. Vs gur svefg vf nafjrerq lrf naq gur frpbaq ab, gurer’f bar yvne. Vs gur svefg nafjre vf ab naq gur frpbaq vf lrf, gurer ner gjb yvnef, naq vs obgu nafjref ner lrf, gurer ner guerr yvnef.Report

  8. dilbert dogbert says:

    The real puzzle is whether the questioner is a liar or truth teller.
    The most interesting answer that I have read was when the questioner does not ask questions but add untruthful information: Hey! They are serving free beer in the village!Report

  9. DavidTC says:

    Whenever I hear one of those questions, I have to immediately ask:

    How do I know _you’re_ telling the truth?

    Seriously, this story is about some people who lie, and some tell the truth. All the time.

    This seems rather implausibly. Seriously, how would the liars buy food? Or do anything else. And how the hell do you handle Opposite Day?

    So, by Occam’s razor, I am forced to assume that it it _you_ who are lying. (Probably not all the time, just this once.) There are no people who tell the truth all the time, there are no people who lie all the time. In fact, there _might not even be any island at all_.Report

    • DavidTC in reply to DavidTC says:

      More seriously, I always thought it would be funny to do a puzzle of this form:

      You come across a fork in the road with a sign saying ‘One person here lies, and the other tells the truth. You may ask exactly one of them one question, and that is all.’

      And, sure enough, two people stand there. How do you figure out which way to go?

      The traditional answer is to ask one of them which direction the other would say, and then pick the opposite.

      However, in _my_ puzzle, both of the people tell the truth, and the _sign_ is lying about that fact. (It might even by lying about only one question, who knows?) So everyone who tries to logic it ends up going the wrong way.

      Also, there’s something else wrong with the puzzle as I stated it.Report

      • Ken in reply to DavidTC says:

        Yes, you have to include the information that Monty knows which door has the prize and which doors have the goat.

        (Sorry, that’s a different puzzle that’s often mis-stated.)Report

    • Alan Scott in reply to DavidTC says:

      Relevant

      On topic bit starts at 5:20Report

  10. BSEconomist says:

    Great puzzle!

    Gur fbyhgvba vf cerggl fvzcyr. V tbg gur svefg dhrfgvba vafgnagyl. Gur frpbaq dhrfgvba jnf uneqre, fvapr lbh arrq n dhrfgvba “begubtbany” gb gur svefg. D1. Qb Rney naq Serq orybat gb gur fnzr gevor? Juvpu vf rdhvinyrag gb nfxvat jurgure gurer ner na bqq be rira ahzore bs gehgu gryyref. Lrf sbe bqq naq ab sbe rira. D2. Qb lbh orybat gb gur fnzr gevor nf rvgure Rney be Serq? Juvpu vf rdhvinyrag gb nfxvat vs gurer ner gjb be zber gehgu gryyref. Lrf sbe 2 be 3 gehgu gryyref, ab sbe 0 be 1.Report

    • Mike Schilling in reply to BSEconomist says:

      Very nice, and a great explanation of why it works.

      By the way, the custom here is to ROT13 answers, so people still working won’t see them by accident. I’ve taken the liberty of doing that to yours.Report

  11. Mike Schilling says:

    To wrap this up, there have been two correct sets of simple questions that meet the requirements. First was Alan Scott, with:

    A1) Is exactly one of your friends a liar?
    A2) Is either friend of the same type as you?

    Next came BSEconomist with:

    B1) Are your friends of the same type?
    A2) Is either friend of the same type as you?

    To see that these work, let’s consider all the possibilities:

    All three are truth-tellers: A1 no, A2 yes, B1 yes

    Dick is a truth-teller, as is one of the others: A1 yes, A2 yes, B1 no
    Dick is a liar, and the others truth-tellers: A1 yes, A2 yes, B1 no

    Dick is a truth-teller, the other two are liars: A1 no, A2 no, B1 yes
    Dick is a liar, as is one of the others: A1 no, A2 no, B1 yes

    All three are liars: A1 yes, A2 no, B1 no

    Brandon had two questions that are correct, but more complicated:

    1. Are you the sort who would say that there are an odd number of truth tellers?
    2. Are you the sort who would say that the number of truth-tellers is fewer than two?

    Asking “Are you the sort who would say X” results in the correct answer to X, so these questions lead directly to the number of truth-tellers.Report

  12. roger says:

    Mike,

    This reminds me of the stuff the philosopher/logician Raymond Smullyan wrote. “The Tao is Silent” was a favorite of my youth.Report

    • Mike Schilling in reply to roger says:

      His “The Lady or the Tiger?” is one of my favorites. It has a lot of similar puzzles, but not this kind specifically. For instance, it has a place with four kinds of inhabitants:

      * Sane humans, who have correct beliefs and tell the truth about them
      * Insane humans, who have incorrect beliefs and tell the truth about them
      * Sane vampires, who have correct beliefs and lie about them
      * Insane vampires, who have incorrect beliefs and lie about them

      So, if you ask someone “Are you a vampire?”, both kinds of insane ones say yes.Report