This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.

I was thinking about this over the weekend, since we have a tri-nations one-day Cricket competition running between Australia, India and Zimbabwe. Aust and India played on Friday, but then I had to wait till Sunday for Australia and Zimbabwe to play in the next game! Q: How many teams (greater than 2 ) do you need in a competition so that a single game can be played every day, every team plays every other team, and no team plays consecutive games (ie on consecutive days)? Q2: How is this arranged? (Proof required, since I don't have the slution stashed somewhere)

Five. If there are 3 teams, then two must play the first day. On the second day, the remaining team is the only one eligible to play, because the other two teams played just one day ago. So 3 teams is impossible. If there are 4 teams, then let the teams who play on day 1 be known as A and B. On day 2, the remaining teams must play - call them C and D. On day 3, only A and B are eligible to play, and they've already played each other, so no solution is possible for 4 teams. If there are 5 teams, they can play a schedule as follows: 1: A-B 2: C-D 3: E-A 4: B-C 5: D-E 6: A-C 7: B-D 8: C-E 9: D-A 10: E-B That covers all 10 possible combinations of 5 elements taken 2 at a time (C(5, 2) = 5!/(2!(5-2)!) = 10), with no teams playing on consecutive days. [ January 11, 2004: Message edited by: Jim Yingst ]