# Riddle similar to the 100 prisoners riddle, but different

The riddle goes like this:

$$\qquad$$ There are $$100$$ prisoners standing in line, each with a number on their back. The numbers are all different, and range from $$1$$ to $$101$$ (i.e. one number is missing). The person in the back of the line can see all 99 prisoners ahead of him's numbers. The prisoner in the front of the line sees no numbers. Starting with the prisoner in the back, each prisoner must shout the number on their own back, but each number can be said aloud only once.

$$\qquad$$The first prisoner clearly only has a $$50$$% chance of guessing his number correctly. However, once he has guessed his number correctly, the remaining 99 prisoners have a $$100$$% chance of correctly guessing the number on their backs.

What is their strategy to achieve this?

Update:

I have been given a hint that the solution "does not just involve modulo sums." There is more to the solution than just a modular trick.

• To be clear, I don't know the solution. I was given the riddle and am seeing if anyone else knows it. – BrianW Apr 26 '16 at 1:58
• So each prisoner can shout multiple numbers? What do you mean by "once he has guessed his number correctly"? Or should it be "If he guess his number correctly"? – Ove Ahlman Apr 26 '16 at 6:00
• So you are saying if the first one guesses his numbers correctly, other ones will be able to guess their and be 100% sure about it? So you are assuming they heard his correct guess, and now person $99$ knows all numbers in front of him, including the number that the person $100$ behind him guessed correctly? This leaves two numbers unknown for person $99$, his own and the missing one. Doesn't this leave him in the same situation as the person $100$? And what do you mean "once he guessed his number..." How many guesses then they have? I think you need to be more clear about certain things here. – Vepir Apr 26 '16 at 7:59
• @Matta, not necessarily -- the first prisoner can base which of her 2 options she picks based on which numbers she sees in front of her. This way, she can communicate information to the other prisoners. (In fact, with 2 players and 3 numbers, the game is quite easy: the first prisoner shouts the number she sees in front of her, minus 1 modulo 3, and the prisoner in front of her can invert that.) – Mees de Vries Apr 26 '16 at 8:01
• @Ove yes, he only gets one guess to shout his number so it should be corrected to if. – BrianW Apr 26 '16 at 12:29

The back prisoner imagines another behind with the missing number. He then guesses the number that will make the list an even permutation of the numbers $1$ to $101$. The person in front of him (assuming the first guess is correct) knows all the numbers but two and can select the one that makes the permutation even. Each prisoner in turn has just two choices (assuming the previous shouts are correct) and one of those will make the permutation even.
• @BrianW: : "A prisoner isn't allowed to say a number that he can see in front of him. " was not part of the problem. I was trying a solution where the back person would say a number known to be wrong in some cases. He would always shout $1$, even if somebody else had that number. It failed, but I didn't think it outside the rule. – Ross Millikan Apr 29 '16 at 4:04