Maybe I'm dense, but the strategy offered by the site tsuwm posted seems without logic. I'll read it carefully again but in the meantime I'd like to post a strategy that is in a large part based on delimiting comments made by contributors to this thread. As given below...

After much hand wringing and gnashing of teeth the prisoners finally realized that their fate was left to the less than exacting craft of Probability Math. And since fractioning a .9999999 likelihood will never reach a certainty of 1, they sighed and voted on what percentage of chance that they would collectively accept against the unpleasant act of being eaten alive and torn limb from limb by prison alligators.

But prison itself wasn't much of lark either so they found a point of convergence that would spring them from jail at the earliest time, while at the same time giving them a 98 per cent chance of not being thrown to the gators. The trigger is the number of trips to the switch room by the most frequent prisoner, the math works out something like this...

The odds of all prisoners being selected at random on the first round of 23 are against selection at about a trillion or so to one.

But surprisingly only 92 random trips to the switch room gives a 94 percent likelihood that everyone has visited the switch room at least once.

As well, after 92 random visits to switch room the chance of one prisoner haven visited the switch room four times was 88 percent likely. But our understandably nervous prisoners weren't much at close gambling, so here is the plan they devised...

The first prisoner to visit the switch room was to leave the switch room with switch (A) in the DOWN position by either pulling it down or leaving it and pulling switch (B). All prisoners were afterwards to pull switch (B) only. Except for the first prisoner to visit the switch room for the fifth time. (This maths out to a 98 percent likelihood that all prisoners have visited the switch room.) Then he is to say to the warden
"EVERYONE HAS VISITED THE SWITCH ROOM" and then throw switch (A) to the UP position.

Why does the prisoner throw the switch to UP after just haven been saved from death by alligators? Well that's a prisoners way of saying...

"UP YOURS WARDEN!".