MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Ten chess-players...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104807] Re: [mg104219] Ten chess-players...
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Tue, 10 Nov 2009 06:02:14 -0500 (EST)
  • References: <200910240638.CAA07417@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

Here's a simple way to compute a round robin tournament:

Clear[roundRobin]
roundRobin[n_?EvenQ][k_Integer] /; 1 <= k < n :=
  Transpose@Partition[Flatten@{1, RotateRight[Range[2, n], k - 1]}, n/2]
roundRobin[n_?Positive][k_Integer] := roundRobin[n + 1][k]

Ten players:

Array[roundRobin[10], 9]

{{{1, 6}, {2, 7}, {3, 8}, {4, 9}, {5, 10}}, {{1, 5}, {10, 6}, {2,
    7}, {3, 8}, {4, 9}}, {{1, 4}, {9, 5}, {10, 6}, {2, 7}, {3,
    8}}, {{1, 3}, {8, 4}, {9, 5}, {10, 6}, {2, 7}}, {{1, 2}, {7,
    3}, {8, 4}, {9, 5}, {10, 6}}, {{1, 10}, {6, 2}, {7, 3}, {8, 4}, {9,
     5}}, {{1, 9}, {5, 10}, {6, 2}, {7, 3}, {8, 4}}, {{1, 8}, {4,
    9}, {5, 10}, {6, 2}, {7, 3}}, {{1, 7}, {3, 8}, {4, 9}, {5, 10}, {6,
     2}}}

9 players:

Array[roundRobin[9], 8]

{{{1, 6}, {2, 7}, {3, 8}, {4, 9}, {5, 10}}, {{1, 5}, {10, 6}, {2,
    7}, {3, 8}, {4, 9}}, {{1, 4}, {9, 5}, {10, 6}, {2, 7}, {3,
    8}}, {{1, 3}, {8, 4}, {9, 5}, {10, 6}, {2, 7}}, {{1, 2}, {7,
    3}, {8, 4}, {9, 5}, {10, 6}}, {{1, 10}, {6, 2}, {7, 3}, {8, 4}, {9,
     5}}, {{1, 9}, {5, 10}, {6, 2}, {7, 3}, {8, 4}}, {{1, 8}, {4,
    9}, {5, 10}, {6, 2}, {7, 3}}}

Bobby

On Sat, 24 Oct 2009 01:38:47 -0500, <cmpbrn at gmail.com> wrote:

> Given 10 (1 to 10) chess-players, in one day they play 5 games (1-2,
> 6-10, 5-7, 4-8, 3-9).
> Then they need 8 more days to complete the championship (one gamer
> must play one time against any other player):
> 1-3, 2-10, 6-7, 5-8, 4-9
> 1-4, 2-3, 7-10, 6-8, 5-9
> 1-5, 2-4, 3-10, 7-8, 6-9
> 1-6, 2-5, 3-4, 7-9, 8-10
> 1-7, 2-6, 3-5, 4-10, 8-9
> 1-8, 2-7, 3-6, 4-5, 9-10
> 1-9, 2-8, 3-7, 4-6, 5-10
> 1-10, 2-9, 3-8, 4-7, 5-6
>
> How can I get the 10*(10-1)/2 = 45 pairs distributed in the 9x5
> matrix?
> What's about any other even number of players?
>
> Bruno
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: Give arrow a certain color
  • Next by Date: Re: Re: Mathematica skill level snippet(s)
  • Previous by thread: Re: Ten chess-players...
  • Next by thread: Re: Ten chess-players...