<p>
  The king sits in his central room and the n prisoners are all locked in their sound proof cells. In the king&#8217;s central chamber is a table with a single chalice sitting atop it. Now, the king opens up a door to one of the prisoners&#8217; rooms and lets him into the room, but always only one prisoner at a time! So he lets in just one of the prisoners, any one he chooses, and then asks him a question, &#8220;Since I first locked you and the other prisoners into your rooms, have all of you been in this room yet?&#8221; The prisoner only has two possible answers. &#8220;Yes,&#8221; or, &#8220;I&#8217;m not sure.&#8221; If any prisoner answers &#8220;yes&#8221; but is wrong, they all will be beheaded. If a prisoner answers &#8220;yes,&#8221; however, and is correct, all prisoners are granted full pardons and freed. After being asked that question and answering, the prisoner is then given an opportunity to turn the chalice upside down or right side up. If when he enters the room it is right side up, he can choose to leave it right side up or to turn it upside down, it&#8217;s his choice. The same thing goes for if it is upside down when he enters the room. He can either choose to turn it upright or to leave it upside down. After the prisoner manipulates the chalice (or not, by his choice), he is sent back to his own cell and securely locked in.
</p>

<p>
  The king will call the prisoners in any order he pleases, and he can call and recall each prisoner as many times as he wants, as many times in a row as he wants. The only rule the king has to obey is that eventually he has to call every prisoner in an arbitrary number of times. So maybe he will call the first prisoner in a million times before ever calling in the second prisoner twice, we just don&#8217;t know. But eventually we may be certain that each prisoner will be called in ten times, or twenty times, or any number you choose.
</p>

<p>
  Here&#8217;s one last monkey wrench to toss in the gears, though. The king is allowed to manipulate the cup himself, k times, out of the view of any of the prisoners. That means the king may turn an upright cup upside down or vice versa up to k times, as he chooses, without the prisoners knowing about it. This does not mean the king must manipulate the cup any number of times at all, only that he may.
</p>
<p>
</p>