Monday, 31 March 2014

logical deduction - Council of Magic, 5 years later - more spellcasters, more deception


Council of Magic - 5 Years Later:
Five years ago, you managed to gain the support of the Council of Magic. However, now the King of Puzzlington needs their aid once again. As it worked last time, he sends you once again. However, 5 years have passed and things have changed. The old members of the council have retired and new ones have been elected.


There are now 5 types of spellcasters in Puzzlington: Wizards, Witches, Priests, Warlocks and Sorcerers. The first four work exactly the same as last time, but I'll repeat them here.


Wizards:
Wizards follow one of two paths: the path of Fire or the path of Water.
Wizards on the Path of Fire always tell the truth when asked a question.
Wizards on the Path of Water always lie when asked a question.


Witches:
Witches come in two styles: Light Witches or Dark Witches.

Light Witches tell the truth during the day and lie at night.
Dark Witches lie during the day and tell the truth at night.


Priests:
Priests worship one of two Gods: Yes, god of life or No, god of death.
When asked a question, instead of answering, priests just say their God's name.
That is, a Priest of Yes will always answer "Yes" to any question.


Warlocks:
Warlocks are unpredictable tricksters.
When asked a question, Warlocks will tell the truth or lie, as they wish.
However, Warlocks have now learned to withhold answers and remain silent.



Sorcerers:
Sorcerers draw their power from one of two star signs: Taurus or Gemini.
Taurus Sorcerers tell the truth if the question has an odd number of words.
Gemini Sorcerers tell the truth if the question has an even number of words.
Sorcerers will never lie; if the word count is wrong, they remain silent.


The Council:
The Council of Magic now consists of 6 powerful spellcasters. The spellcaster's names are Aries, Bandana, Cathy, Darrin, Eve and Francis. The Council has one Wizard, one Witch, one Priest, one Warlock and one Sorcerer; you do not know which Council member is which type of spellcaster.


In addition, the Council now has a High Mage. The High Mage can be any spellcaster type; however, you know the High Mage is not a Warlock. You do not know who the High Mage is or what spellcaster type they are.


You do not know the Path of the Wizard, Style of the Witch, God of the Cleric or Sign of the Sorcerer. You do, however, know the High Mage does not have the same sub-type as the other council member of the same type.


The members of the Council have full knowledge of each other. That is, they know which member is which type of spellcaster and which sub-type each is; they also know which member of the Council is the High Mage. The sub-type of a spellcaster is their Path, Style, God or Sign, as appropriate.



You arrive at the palace at noon. You can, once every 12 hours, ask any one member of the Council any one question that can be answered Yes or No (that is, after each question, it switches from night to day or day to night). If a spellcaster is asked a question they can't answer (because they don't know the answer), they remain silent. Priests are an exception to this rule; to them, their god is always the answer, no matter what the question.


The new Warlock hates you as much as the old one; when asked a question, they will choose to tell the truth or lie, whichever they think will hurt you the most.


Your task is the same as before. Learn the type and sub-type of all Council members as fast as you can; you will also need to learn the identity of the High Mage.




To list the changes carefully: There is a new spellcaster type that either tells the truth or says nothing, there is a duplicate spellcaster on the council and warlocks can choose silence.


I'm not yet sure how many questions it will take this time. More is all I can say with certainty.



Answer



I can do it in:



11 questions at most




background:



First, note that the theoretical minimum for the worst-case number of questions is 10. No strategy can ever require less than 10 questions in the worst case. Proof: Each question has 3 possible answers - yes, no or silence. A perfectly constructed question will evenly split all the remaining possible configurations at the time into 3 groups, corresponding with each answer, thus dividing the possibility space by 3. A perfect strategy will do this for each question. The number of possible configurations at the start = 6! * 2*2*2*2*4 = 46080. log(base3, 46080) = 9.77, therefore 10 questions is the theoretical minimum, whether it can be achieved is a different question ( I think it could be by improving my stage 1 questions, but I leave that to someone else).




Let's recap two important facts from the previous incarnation of this question. First, anyone who is known to either reliably lie or reliably tell the truth, can be forced to tell the truth with a nested question, e.g: "what would you say if I asked you "does 1+1=2?"". This can be used to extract truth from any of (wizard of any type, witch of any type, sorcerer of known type), which we'll call the target-group. Secondly , Etoplay's answer to the previous council of magic question (link at the top) contains a general strategy which I will use, which is optimal after you know the identity of someone in the target group. It's a 2-stage strategy: first use normal questions to establish a target-group member, then use what Etoplay calls the 'last few questions' to narrow down to the one true solution. Anyone who wants to understand this is advised to read Etoplay's answer as it's complex and I won't repeat it here.



strategy:




As mentioned, stage 2 of my strategy is the same as Etoplay's 'last few questions' section. The only thing remaining is to detail the first stage, along with logarithmic calculations for the number of questions required in each variation. Stage 1 proceeds as follows. Let the council members be numbered 1-6, let P = the number of possible configurations remaining. Calculating P is tricky combinatorics which I won't detail, but all values have been verified with a script.




first question, to person 1:
"If I asked the warlock whether two plus two equals four, what would he say?".
If silent: 1 is either witch, wizard or sorcerer of even-truth. All of these are in the target-group, so proceed to stage 2. P = 24000, ceiling(log(base3, P)) = 10, so 10 more questions required in this case, 11 total.
If not silent: 1 is either warlock or priest, with subtype depending on what the answer was. Now ask second question.
second question is the same, but to person 2:
If silent: 2 is in target group, move to stage 2. P = 7680 given everything we know, 9 more questions required, total 11.
If not silent: 2 is either warlock or priest, with subtypes depending on both answers. Now ask third question.

third question is the same, but to person 3:
If silent: 3 is in target group, move to stage 2. P = 1680 in the worst case (ie. first 2 answers were different). 7 questions required, 10 total.
If not silent: 3 is either warlock or priest, with person 1-3 subtypes highly narrowed down based on answers 1-3. Now ask question 4.
fourth question, to person 4:
"are you alive?"
if silent: 4 is a sorc of even-truth. move to stage 2. P = 32 given everything we know by now. 4 more questions required, 8 total.
If not silent: 4 is witch or wizard. move to stage 2. P = 64 based on everything we know. 4 more questions required, 8 total.



No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...