> Given a single elimination tennis tournament (you loose a match and you're > out) > with N players. How many matches are required to determine a winner? Here > is > an example, four players A, B, C, and D. In the first round, A play B and C > plays > D. A and D win. So far 2 matches and 2 players go to next round.
rounds = ceil(ln(N)/ln(2)); games = N-1; -John C. _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php