Hi,
the solution presented below works, but requires some manual
work to get the details right.
It is still difficult.
require(prob)
games = urnsamples(1:11, x =
c('A','B','C','D','E','F','G','H','I','J','K'), size=2,
replace=F,
ordered=FALSE)
games
(round1 = sample(55,5))
(round2 = sample(55,5))
(round3 = sample(55,5))
(round4 = sample(55,5))
(round5 = sample(55,5))
(round6 = sample(55,5))
(round7 = sample(55,5))
(round8 = sample(55,5))
(round9 = sample(55,5))
(round10 = sample(55,5))
(round11 = sample(55,5))
(round = rbind(
round1,
round2,
round3,
round4,
round5,
round6,
round7,
round8,
round9,
round10,
round11
))
--------------------------------------
Silvano Cesar da Costa
Departamento de EstatÃstica
Universidade Estadual de Londrina
Fone: 3371-4346
--------------------------------------
----- Original Message -----
From: "peter dalgaard" <pda...@gmail.com>
To: "Michael Bedward" <michael.bedw...@gmail.com>
Cc: "Silvano" <silv...@uel.br>; <r-help@r-project.org>
Sent: Friday, August 13, 2010 10:29 AM
Subject: Re: [R] Games
On Aug 13, 2010, at 3:10 PM, Michael Bedward wrote:
Nice question Silvano !
teams <- LETTERS[1:11]
matches <- combn(teams, 2)
draw <- data.frame(team1=matches[1,], team2=matches[2,],
round=sequence(10:1) + rep(0:9, times=10:1))
Is there a prize :-)
Maybe you want to sponsor one, because your solution
certainly doesn't work!
I see 10 games in the 10th round, all involving team K.....
That's not how to arrange a tournament!
--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd....@cbs.dk Priv: pda...@gmail.com
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.