Solution To The Three Demons Puzzle

A little while ago I posted a brainteaser: the three demons puzzle. For those who didn’t get it, who nearly got it, or who just wanted to compare answers, or who just couldn’t be bothered to try, here’s the solution.

Solution – Short Version

  1. “Amos, is it true that either (a) ‘da’ means ‘yes’ and Baeti lies more frequently than Corpi or (b) ‘ja’ means ‘yes’ and Corpi lies more frequently than Baeti?”
  2. If:
    • Answer is “ja”: “Corpi, is exactly one of the following two statements true: (a) ‘da’ means ‘yes’; (b) this is my second question?”
    • Answer is “da”: “Baeti, is exactly one of the following two statements true: (a) ‘da’ means ‘yes’; (b) this is my second question?”
  3. To the same demon again: “Is it true that either (a) ‘da’ means ‘yes’ and Amos answers randomly, or (b) ‘da’ means ‘no’ and Amos does not answer randomly?”
  • If the answer to both question 2 and question 3 is “ja”, then Amos is the liar, the demon spoken to in questions 2 and 3 is the honest one, and the remaining demon is the random one.
  • If the answer to question 2 is “ja” and the answer to question 3 is “da”, then Amos is the random demon, the demon spoken to in questions 2 and 3 is the honest one, and the remaining demon is the liar.
  • If the answer to question 2 is “da” and the answer to question 3 is “ja”, then Amos is the random demon, the demon spoken to in questions 2 and 3 is the liar, and the remaining demon tells the truth.
  • If the answer to both question 2 and question 3 is “da”, then Amos tells the truth, the demon spoken to in questions 2 and 3 is the liar, and the remaining demon answers randomly.

Solution – Long Version

If your brain wasn’t fully pickled by the short version and you’re brave enough to take on the long version, here it is:

First Question

Our first goal is to find one of the demons who is not the demon who always answers randomly, because such a demon would just be bad news. My initial attempt at solving the puzzle started with about seven questions which got cut down to four when I realised the importance of this first step, and then later to three.

There are, essentially, 12 different states of play that we have to consider and find a way of differentiating between:

Demon state
(T = truthful, L = liar, R = random)
State Amos Baeti Corpi meaning of “da”
1 T L R yes
2 T R L yes
3 L T R yes
4 R T L yes
5 L R T yes
6 R L T yes
7 T L R no
8 T R L no
9 L T R no
10 R T L no
11 L R T no
12 R L T no

For no particular reason, we ask our first question to Amos: at this point, all possibilities are equal. We ask “Amos, is it true that either (a) ‘da’ means ‘yes’ and Baeti lies more frequently than Corpi or (b) ‘ja’ means ‘yes’ and Corpi lies more frequently than Baeti?” This cleverly-worded question helps us to separate the possibilities in the following ways:

The “lies more frequently” clause is a quick way to obtain information quickly about the relationship between the other two demons (assuming that Amos is not answering randomly), rather than asking a more simple question which, in turn, could only have a true or false answer. Liars (L) will lie more frequently than random demons (R), because random demons will sometimes tell the truth, and random demons will lie more frequently than truthful demons (T), because truthful demons always tell the truth. On my paper diagrams, I drew arrows between the columns of Baeti and Corpi, one for each row, indicating who lied most frequently of the two in each state.

The combination of the “test for meaning of da/ja” and “demon X lies more frequently than demon Y” gives us a wonderful split in the results, laterally, through the da-meanings. This occurs because the pattern of possibilities is now identical for each meaning of “da”, as shown:

State Amos meaning of “da” Answer Amos says…
1 T yes yes da
2 T yes no ja
3 L yes no da
4 R yes no da/ja
5 L yes yes ja
6 R yes yes da/ja
7 T no no da
8 T no yes ja
9 L no yes da
10 R no yes da/ja
11 L no no ja
12 R no no da/ja

As you can see, the lateral split ensures that we get the same answer from Amos regardless of the meaning of “da” (notice how the pattern of “Amos says…” repeats itself in the second half of the table).

In states 4, 6, 10 and 12, Amos may say “da” or “ja”, because Amos is the random demon. This is not a problem, because the entire point of this question is to determine which of the other two demons is not a random demon (no matter what the configuration, this must be the case for at least one of them): whichever way he happens to answer is irrelevant, because whomever of Baeti and Corpi we choose as our “definitely not random” demon, we’ll be right.

In states 1, 3, 7, and 9, and, potentially, in the four ambiguous states – the states in which Amos will answer this first question with “da” – we can see from the original table that Baeti can only ever be truthful or a liar; never random. In states 2, 5, 8 and 11 (and, again, potentially, the random responses Amos would give in states 4, 6, 7 and 9) the response “ja” shows us (check the original table again) that Corpi is never random.

Therefore, this single question tells us that one of Baeti at Corpi is not random, and which one. This is valuable information, because we can trust the information given by non-random demons in order to trick them into revealing whether or not they are random.

Second Question

From here on, we’ll be dealing with whichever demon we decided, through question one, is definitely not a random demon: either Baeti or Corpi. The one we have chosen shall be known as x1, and the other shall be known as x2.

Next, we can use a slightly more complicated version of the question one must ask gaolers (when one lies and one tells the truth – you know the puzzle I mean) in order to determine if the demon we’re dealing with, x1, is truthful or a liar (we have already ensured through question one that Amos or x2 are random, so x1 cannot be). We ask, “[x1], is exactly one of the following statements true: is exactly one of the following two statements true: (a) ‘da’ means ‘yes’; (b) this is my second question?”

Again, this is a lateral split technique: by demanding that exactly one of the criteria must be met in order for the response to be true (and knowing that the liar demon will say that respond negatively if it is and that the honest demon will respond positively), we ensure that half of the possible states are treated differently, like so:

x1 state meaning of “da” actual answer demon’s answer demon says…
T yes no no ja
L yes no yes da
T no yes yes ja
L no yes no da

See what we did there? By setting up a question involving both the meaning of the word “da” and an indisputable fact (that this is our second question – although we could equally use any other indisputable fact and these demons, knowing everything, would understand) we set up the answers in the heads of the “da = yes” theoretical demons than in the heads of the “ja = yes” ones. Because we know that lying demons will invert the answer we can identify them. Now, we know whether or not x1 is an honest demon or a liar.

Unfortunately, we still don’t actually know the meaning of the word “da” (or “ja”) so we can’t just ask our new-found honest demon (or easily-manipulated known liar) about his friends, and to ask about the meaning of the words would use up our last question and still leave us in the dark about the nature of the other two demons.

Third Question

We need one more fact – the identity of one of the remaining two demons – but we don’t understand the language well enough to just ask, so we’ll have to do our language-inversion trick again to “flip” the results of the second half of the table and thereby be able to understand the results (even if we don’t know the language).
We ask “Is it true that either (a) ‘da’ means ‘yes’ and Amos answers randomly, or (b) ‘da’ means ‘no’ and Amos does not answer randomly?” Spot the inversion again – “da means yes”/”da means no”!

We already know whether or not x1 is honest, so we can dramatically simplify our tables:

If x1 is known to be honest:

Amos state meaning of “da” actual answer demon’s answer demon says…
L yes no no ja
R yes yes yes da
L no yes yes ja
R no no no da
Amos state meaning of “da” actual answer demon’s answer demon says…
T yes no no da
R yes yes yes ja
T no yes yes da
R no no no ja

It’s probably possible to rewrite the question to get more beautiful truth tables, but I honestly couldn’t be bothered. If x1 is honest and says “ja” then we know that Amos is a liar, and if he says “da” then we know that Amos is random. If x1 is a known liar than “da” means that Amos is the honest one and “ja” means that Amos is the random one.

We’ve now ascertained the identities of two of the demons, and the third is therefore obvious.

Now wasn’t that a mind-blowingly cool puzzle?

The Three Demons Puzzle

Spent my entire lunch break solving this brainteaser that some sadist e-mailed to me, so I thought I’d share it with you. I’ll post a solution soon.

The Three Demons Puzzle

You have been granted an audience with the three demons of time and space, who know everything about the past, present, and future, and can even read minds: Amos, Baeti, and Corpi. You are allowed to ask them only three questions, but you can direct these three questions at the demons in any configuration: so you could, for example, ask all three questions of one demon, if you wished. Obviously this gives you a great deal of power, and you could use it to learn any secret you desired, but, as always, there is a catch:

  • The demons will only answer questions that can meaningfully be answered with “yes” or “no”.

Still; that’s not so bad. But it gets worse:

  • One of the demons always tells the truth.
  • One of the demons always lies.
  • One of the demons randomly answers “yes” or “no”, regardless of the question asked.
  • You do not know which demon is which.

Starting to get a bit more problematic? There’s more:

  • The demons will only answer in their native tongue, saying “da” and “ja” rather than “yes” and “no”. You do not know which demon syllable (“da” and “ja”) means which answer.

The aim of the puzzle is to determine which demon tells the truth, which one lies, and which one is random.

Special Rules And Tips

Some thoughts to help you get started and to ensure you don’t accidentality cheat:

  • You may only ask “yes or no” type questions. For example, you could ask Amos “Did Baeti say ‘yes’ to the last question I asked of him?” but you could not ask “What answer did Baeti give to the last question I asked of him?” Despite the fact that the latter would be expected to produce the same result as the former, the context is different: all questions must be phrased as “yes or no” type questions.
  • There is no point in repeatedly asking a demon the same question in order to try to determine whether or not he is the one that answers randomly.
  • If you can’t find a solution, try first removing the “you may only ask three questions” restriction. My first solution required that four questions be asked, for example, and I later refined the first two questions into a better single question, once I knew what I needed to determine before asking the next one.

Your Questions

In answer to some of the questions I’ve been asked:

  • Each question is asked to exactly one demon: you can’t ask a question to multiple demons at the same time.
  • The answers given by the random demon are random insofar as it is not possible for any human to determine what an answer would be in advance. However, as the demons themselves are able to see the future, each demon would theoretically know what the next answer that the random demon was going to give. However, I can’t think of a way that could possibly be useful.

Good luck! I’m not sure whether or not this is harder than the blue eyes/green eyes puzzle I posted to my blog last year. You decide.

I’ve published the solution in a separate post.

Out Of Town

Claire and I are out of town for about 31 hours, off to Norfolk but back on Sunday evening to make plans for Fresher’s Fair. My apologies to everybody I’ve been trying to get things done for this last week: it’s been somewhat insane over here.

For those of you travelling this way this weekend (Lawrence, Kit, etc.): JTA is here and can let you into the The Cottage, and there’s a “welcome” leaflet on the living room door. Unless there’s some kind of disaster we’ll be back in town before Kit is, but you never can tell. That’s the thing about disasters.

I’ve got a lot of things I mean to write about: my latest (very successful) homebrew, happenings in Aber, progress with camping for the upcoming Real Ale Ramble, and more. Just… don’t ask until like Monday, and that way I won’t have to kill you.

The Abnib Real Ale Ramble 2006

Following the success of last year’s Abnib Real Ale Ramble, we’re going to do it all again! All the walking! All the freezing temperatures! All the fried breakfasts! All the broken feet! And all the tasty tasty ale. And all on the weekend of 25th/26th November 2006.
I’m sure you want to come along, and you’re probably more than welcome. I’m currently working on sorting out self-catering accomodation, which should be at least partially arranged by the end of the week, but what I’m sure you’re all actually wondering is… where is the wiki?

Well, rest assured, there is one. And a mailing list too, no less. I’ve already added to the mailing list the names of pretty much everybody who’s ever expressed an interest in the Real Ale Ramble, so it’s pretty heavy right now, but I’m sure some folks will wimp out and unsubscribe soon. If you’re on the list, you’ve probably already received an e-mail from me. Good for you.

Either way, go read the wiki now: http://ramble.abnib.co.uk/

The End of The Job Interview

Seth Godin thinks that job interviews are pointless, and he makes a convincing argument. Give his blog a read.

Most of you who read this spend far more of your time on the receiving end of job interviews, and so his thoughts perhaps aren’t so much use to you, unless you feel bold enough to tell a potential employer what they’re doing wrong at the interview (“you know, this isn’t a very good way to hire people…”) – that said, I might just try that next time I’m in any kind of interview situation – but if you find yourself on the other side of the desk come recruitment time, give it a read.

You Can Get Anything On The Internet

I frequently find myself impressed with some of the more unusual things it’s possible to obtain on the internet. I was browsing the binaries newsgroups when I came across this gem of a self-help film:

Meeting Women Online PAR Files

A few interesting things about this film:

  • It’s called Meeting Women Online. I suppose that’s a valid topic for a self-help film, although I find myself wondering if there’s enough material in this topic to warrant an entire film, rather than – say – How To Meet Women or Making Friends… And More… Online.
  • It’s posted in the alt.binaries.seduction newsgroup.
  • And here’s the killer: this film comes on four DVDs. That’s right – count ’em – four. A little research online suggests that the main program (not the special features) is in itself over five hours long!

Just plain scary.

A little more research and I found the web site of David DeAngelo, who made the film: there’s a page to sign up for his online course in meeting women online… the page starts by promising the usual crap that you can get from any spam-ridden inbox: “how you can manipulate your online profile to inspire interest,” “how to be confident when it comes to talking on the phone,” and so on, but the thing that got my attention was the following line. It’s as much bullshit as these programmes always are, but it makes a promise I’ve not yet seen in my 12 years of net-surfing:

Inside you’ll learn… a “secret” email subject line that drives a woman crazy
with curiosity and gets her to open YOUR email
first.

What do you know: women’s heads are hard-wired so that a few key words in a subject line will get them to open it, no matter who it’s from or what the context in which they receive it. Dating be damned: if this were true then I would subscribe to the program. Why?

  • If I were a spammer, I would want to know the secret keywords I could use to have 50% of the population open my e-mails without even thinking twice.
  • And if I were not, I would want to know how to configure spam filters to protect those poor vulnerable women from the big bad spammers with the secret codewords that tripped the “common sense” switches in their brains.

Tie Rack: Your New Illuminati Card

Here’s a conspiracy theory for you: Tie Rack are a decentralised, corporate-funded, international network of smugglers and drug runners. It stands to reason:

  • Do you really think there’s a market for a shop that sells only ties? Okay, I know that they also sell umbrellas and scarves: but really… most of their shops are at transportation hubs like airports and train stations – I wonder how many people ever say, “Well, I’m off to [important event] and I can’t find a suitable tie… but it’s okay, because I can get one on the way! Thank heavens for Tie Rack™!” I don’t buy it: they’ve got to be a front to something bigger.
  • And it stands to reason that they’re in the perfect place to be into smuggling: drugs, illegal documents, whatever… they have a store (which is open 24-hours a day) at every major international airport in the Western hemisphere. But where is the shop? It’s on the other side of customs and excise and passport control – by the time you get to Tie Rack, they’ve already taken your bottle of water and your nail clippers off you… plus: when have you ever seen security do a random stop-and-search on a man wearing a tie.
  • Do you really think that the lorry loads of ties that get transported into airports every day are searched for drugs and weapons? Of course not: they’re not getting on a ‘plane – or are they? Tie Rack’s expert network of traffickers turn up at the airport (and can be searched all that security wish: they’re clean) and then, while in the departure lounge waiting for their flight to be cancelled they decide to buy a tie (or perhaps an umbrella or a handbag). And that’s where they pick up what they’re transporting…
  • …few airports bother to do a drugs scan when you get off the ‘plane: why bother – the airport at the other end did it already, and most of the security guards, especially these days, are preoccupied with ensuring that no suspicious-looking Muslims get anywhere near an aircraft without a full body cavity search. The mules have already arrived with their package. For the price of an EasyJet flight across Europe you can bring cannabis and ecstasy from Holland or opiates from Turkey and nobody knows any better.
  • How’d they get started? Well, they’re the new arm of the Italian mafia! Even their web site proudly states that they’re “genuinely Italian”. Wikipedia reports that the company acts as a major retailer for the Frangi retail group… guess where Frangi are from: Sicily.

If I go missing in the near future, it’s because I’ve revealed Tie Rack’s dirty secret. You know what to do.

A Postcard From Heather

We’ve just received a postcard from Heather

Cheddar Cave


…which immediately got us out of The Game. For those that aren’t sure how that could have happened from an innocuous postcard, the blame goes to Jimmy, who took great pains to get us to associate the word cheese with The Game. Heather writes:

Hello Troma Geeks!

Thought you’d all appreciate this lovely cheesy postcard. Weather here remarkably like Aber, but seaside not so good. Difficult to have BBQ on sinking sand. Is also very good alcohol country – every pub is a CAMRA member & has a cask marque. All kinds of bizarre wines. Tell Jimmy I’ve found his ideal part of the world!

Heather

Thought I’d share that with you all this morning. Right: off to work…

Chinese Funerals And Sudo

Scott Adams has written a fabulous blog entry about strippers at Chinese funerals, but it’s not quite as funny as the latest xkcd comic. For those who aren’t sufficiently geeky (if you’re a geek: read the comic first then come back here), sudo is a command found on some computer systems that allows you to act as if you had greater (typically) priviledges than you wouild normally have. In the comic, the speaker attempts to do something, fails (because he’s not permitted to perform that operation), and tries again, this time using sudo.

Well; I thought it was funny.

If you’re still not laughing, watch How Lord Of The Rings Should Have Ended.

Strange Happenings In LiveJournalLand

Strange. First Faye’s comment on Andy‘s controversial blog post diappears. Now her entire LiveJournal is empty of posts (not just friends-only but gone, as far as I can see), but the account still exists.

Faye? What’s going on? Has the internet eaten you whole?

EDIT: The plot thickens. I’ve just remembered that I noticed this weekend that Faye changed her RockMonkey page recently: it’s now a lot tamer than it used to be, doesn’t link to ARSEnalScumDepreciationSociety, and one of Andy’s infamous spelling mistakes has been fixed. Perhaps the internet really is eating Faye up…

Arrow Tag

Here’s a fab little Flash game I just discovered: Arrow Tag. I’ve just won with a time of 14 minutes and 35 seconds. Think you can beat me?

Orgasms And Biochemistry

Just read a great article on brain activity during sexual stimulation and specifically upon orgasm: scanning people’s brains while they’re engaged in sexual activity with their partners has lead to some fascinating results. From the article:

In men, greater activity was seen in the insula, which deals with emotion, and particularly in the secondary somatosensory cortex, which rates the significance of physical sensations. This suggests that the sensory input coming from the genitals is being judged highly important and pleasurable by the brain.

Women, however, show very little increased brain activity, and only in the primary somatosensory cortex – which registers purely that a sensation in the genitals is there.”In women the primary feeling is there, but not the marker that this is seen as a big deal,” Dr Holstege said.”For males, touch itself is all-important. For females, it is not so important.”

I fascination turned to amusement when I read about some of the difficulties the participants had under experimental conditions, though:

The experiments also revealed a rather surprising effect: both men and women found it easier to have an orgasm when they kept their socks on. Draughts in the scanning room left couples complaining of “literally cold feet”, and providing a pair of socks allowed 80 per cent rather than 50 per cent to reach a climax while their brains were scanned.

A Town Called Eureka – People Enjoy This?

We’ve been watching a little of A Town Called Eureka of late, following the discovery that Matt watches it and so does my mum. We watched the first episode earlier this week, which I found to be well-performed and a great idea… but terribly realised. Nonetheless, I thought to myself, it was a pilot episode and they are often shaky, so last night we watched the second episode.

What follows is my annotated synopsis of the episode. If you plan to watch it, you might want to skip it, but I’d recommend reading my comments and then simply skipping it:

Start Of Spoilers
The episode starts where the last one left off, with Jack Carter having just taken up his position of sheriff in the town of Eureka, Walter Perkins has been killed by a tacyon-related accident, and his wife Susan has been killed in a fake suicide.

During the course of the episode, a partially visible glowing humanoid shape is seen around town, and sightings are accompanied by electromagnetic disturbances which shut down computers and damage lights, but only when it’s convenient to the plot for it to do so. Meanwhile, Susan reappears in town, and it becomes apparent that there are two of them which an atomic-level analysis shows are identical, which, of course, would not be the case even for identical twins or clones because of chemical changes due to diet, lifestyle, etc. A DNA test, which would have actually proven that one was a twin or clone, is not done, because it would be “too primitive” (even though it could conceivably achieve the correct result, albeit with less flashy lights and cool scientific equipment). Curiously, despite never having met and the clone having been made seven years ago, the two women dress identically at all times. It is later determined that one of the women must be a fully-grown clone made by Walter, and a scientist makes a throwaway remark that this would explain why the computer had said that the dead Susan was made of “younger” materials, but for some reason he didn’t bring this up earlier, instead claiming that the two were identical.

Normally rational scientists turn to supernatural beliefs in order to explain the electromagnetic disturbances and the humanoid figure, repeatedly talking about “ghosts”. It later appears that Walter, killed last episode, is not dead but is merely “existing in an alternate timestream” (which by itself is fine – this is a work of fiction, but I don’t appreciate the way that the scientists feel the need to use oversimplistic analyses and excessive buzzwords when talking to each other). In any case, they put him into a device resembling a magic eight ball (which they presumabley had lying around for just this kind of occurance) which will make him all fine again. His former wife, the original Susan, has since pieced together the full story: after they divorced seven years ago, he came to Eureka, made a clone of her, built the house that they had designed together and had a son. In the end, despite the fact that doing so will probably cause irreparable damage to the boy, the original Susan agrees to stay (after all, they only divorced once, then he made a clone of her which, when it died, caused great distress to her family, and now – despite being an intelligent woman, she’s decided that a woman who looks identical to his mother but knows nothing about him is a better adoptive parent for a young boy than, say, anybody else on Earth).

Oh yeah, and Jack Carter moves into a house with a personality and a will of it’s own but no overrides. Well, I suppose comic effect is allowed.
Spoilers end.
The problem with the show, I suppose, is that it doesn’t know what it wants to be. The idea behind it lines it up perfectly to be a great sitcom, but it’s hard to see the humour because it’s trying so hard to be a gritty drama. Meanwhile, unforgivably awful pseudo-science means that you want to hurt yourself, or, failing that, the screenwriter. The action seems distant from the characters: always as if everything will work itself out in the end and the actors just came along for the ride. Rather than actually having anything to do with the plot they just sit in the foreground and make jokes about the scientific buzzwords that they’re saying, and each other’s inability to comprehend them.

The show pisses me off.