Solution to 2):
Call the switches A and B (where the prisoners agree a way of distinguishing the switches unambiguously). One particular prisoner is designated to operate as follows: Every time he finds the A switch in the 'down' position he switches it 'up' and counts these occurrences. If he finds it in the 'up' position, he switches the B switch (regardless of its position). All others operate on the switches as follows: If they find switch A in the 'up' position, they switch it to 'down'. However, if they have already operated on switch A twice before in this manner, or if they find it 'down', they switch the other switch, B once (regardless of its position). When the one designated prisoner operating only on switch A has counted 47 occurrences of switch A being in the down position he knows that all have been in the room at least once.