# Simulate results of a round robin tournament

I wasn't sure whether this Question will be appropriate here or on SO, I'm still going ahead and posting it here. Please let me know if this doesn't belong here.

Consider a round robin tournament with $k$ players ($k*(k-1)/2$ matches). Result of each match is either win ($+1$ to the winner) or loss ($0$ to the loser). The questions I have are -

1. How many different arrangements are possible regarding the total points won by each of the $k$ players at the end of the tournament?
2. I also want to write up a code simulating all possible results in R or MATLAB.

Thanks.

As you say, there are $k(k-1)/2$ matches, so there are $2^{k(k-1)/2}$ sets of results. To check them all, assign each match to a bit position, count from $0$ to $2^{k(k-1)/2}-1$ and take each bit as the result of the match. As $k$ grows, this becomes a lot of computation.
• I was hoping for a better solution than this (not sure whether it's possible). The reason being we are concerned with final tally of no. of wins by a player, doesn't matter the order of wins and losses (i.e. $1's$ and $0's$) for the $k$'th player.. – steadyfish Jun 25 '13 at 1:14
• I didn't understand that from your question. I believe you can get any assortment of results that has the proper total and not too many too high or too low. Describing that constraint is difficult. You can't have more than one team with $0$ or $k-1$ points. If you do have, you can't have more than one with $1$ or $k-2$. If there is no team with $0$, you can have three with $1$ and so on. – Ross Millikan Jun 25 '13 at 3:21