The rules are almost same, so I won't waste time by rewriting them all here. (They're still valid, though.) The only major difference is the structure of the prison. It is not necessarily circular.
The prison has $n$ cells, each having atleast one switch and atleast one light. Every light is completely controlled by exactly one switch. A light and its switch cannot exist in the same room. As in the earlier version, lights emit a single flash at noon, after which the prisoners are re-scattered, one prisoner per room.
There is no dead end (or start) in the graph of the lights and switches. Meaning to say, if I select any switch in any room, find the room of its light, then see any one of the switches in that room and find the room of that light, and keep on doing so, I will eventually end up in the room I started with. This effectively makes the structure a set of cycles that are interlinked.
Added rule: One cannot find two independent non-empty subsets of this graph. Meaning to say, if the cells are divided into two sets, there will always exist a switch in set 1 that controls a light in set 2, and a switch in set 2 that controls a light in set 1.
As earlier, you can devise a plan for the other prisoners and follow a different strategy yourself. And the task is same, find the value of $n$ from any one prisoner's point of view.
If this gets solved, try
- a method that enables a prisoner to figure out the entire structure, rather than just $n$
- a method that does not involve randomness
Please clearly specify if you are solving a variant and not the actual puzzle.