This puzzle has been on the XKCD puzzles wiki for several years. They have some very fun puzzles there. It's a huge timewaster, so only click if you have nothing pressing to do.
http://wiki.xkcd.com/irc/puzzles#Prisoners
If you need help on any of the puzzles, hints and answers are on the talk page. For this specific puzzle, the talk page links to a paper by William Wu that answers this exact question with asymptotic analysis.
http://www.ocf.berkeley.edu/~wwu/papers/100prisonersLightBul...