Two interesting math puzzles (not homework)

How? Even if he’s buffering all the deputies and all m non-counters that the master counter is scheduled to count, I don’t see any way for anyone other than the master counter to verify that the master counter has visited the room.

Postscript: never mind, it is possible, for example if the deducer buffers all but one of the deputy counters and the m master counter’s non-counters, then observes the coin in a single phase 2 both after the deputy counter flips and again after the master counter unflips during that phase.

A note, which everybody seems to realise anyway but just to be clear. I should have specified that only full DCs do anything in phase 2 and the MC also needs to be full to declare.

The problem with #22 is that if a prisoner enters the chamber and sees heads for the second time, he doesn’t know whether (A) He is the counter, or (B) a prior prisoner has established himself as the counter. Consider the order ABCD ECFB: On the 6th day, it’s C’s second visit, so he flips it to tails and becomes the counter. F comes in on day 7 and switches it back to heads. When B comes in on day 8 for his second visit, he does not know that C has established himself as the counter.

My though is that the person on the 3rd night is the counter. The person on the 1st day will never flip the coin. The person on the 2nd night (if not the first person) will flip the coin to tails. The person on the 3rd night will know whether or not the chamber has been visited by one or two people, and sets the coin to heads.

Nobody switches it back to heads for any reason before day 20.

During Phase 2, when deputies signal ‘count complete’ to master by flipping heads to tails, master acknowledges each signal, by flipping tails to heads, to allow the phase 2 signalling to continue. Anyone who visits in phase 2 and sees (or leaves) tails and later visits again and sees heads during the same segment of phase 2 can be sure master visited — noone else is allowed to change tails to heads in phase 2.

There are other ways a non-master can deduce all 20 prisoners have visited. Assuming the {Three deputy counters, each waiting for four signals} case, if a player flips heads to tails on Day 1; and then visits and sees heads on each of Days 3, 7, 11, 15, …, 55, 59; and visits and sees tails on each of Days 5, 9, 13, 17, … 57, 61, he knows he’s seen all 16 non-counters signal, and seen all four counters respond (since each counter will make no more than four phase-1 responses) and can claim Freedom-for-all at Day 61.

Perhaps I should fix my simulator to detect these cases, but I’ll guess the probabilities are quite small.