A single elimination tournament - number of possible combinations

ⅰ亾dé卋堺 提交于 2019-12-12 16:40:56

问题


What are the number of combinations in which 8 persons taking part in a single elimination tornament play? Total no of matches played would be 7 but I also need the number of combinations that can for this set


回答1:


If it doesn't matter where in the tree a player starts, but only which opponents he/she fights, and how long he/she gets, we can say that the left player always wins and then just calculate the number of ways to create the bottom most row, which is 8! 40320.

The first possibility:

       a
   a       e
 a   c   e   g
a b c d e f g h

The second possibility:

       a
   a       e
 a   c   e   h
a b c d e f h g



回答2:


There are (8 * 7) / 2 combinations = 28 [ in other words, 8!/(2! * (8-2)!) ]

With Set::Partition in Perl I can write:

my $s = Set::Partition->new(
    list      => ['a'..'h'],
    partition => [2, 6],
);

while (my $p = $s->next) {
    print join( ' ', map { "[@$_]" } @$p ), $/;
}

which gives

[a b] [c d e f g h]
[a c] [b d e f g h]
[a d] [b c e f g h]
[a e] [b c d f g h]
[a f] [b c d e g h]
[a g] [b c d e f h]
[a h] [b c d e f g]
[b c] [a d e f g h]
[b d] [a c e f g h]
[b e] [a c d f g h]
[b f] [a c d e g h]
[b g] [a c d e f h]
[b h] [a c d e f g]
[c d] [a b e f g h]
[c e] [a b d f g h]
[c f] [a b d e g h]
[c g] [a b d e f h]
[c h] [a b d e f g]
[d e] [a b c f g h]
[d f] [a b c e g h]
[d g] [a b c e f h]
[d h] [a b c e f g]
[e f] [a b c d g h]
[e g] [a b c d f h]
[e h] [a b c d f g]
[f g] [a b c d e h]
[f h] [a b c d e g]
[g h] [a b c d e f]

which you can interpret two players playing, and the six others standing around cheering and drinking beer.




回答3:


If you mean, how many possible 2 player matches are there in a pool of 8 players then the answer is 28 (8x7/2). If you mean something else, then clarify your question a bit.



来源:https://stackoverflow.com/questions/2244009/a-single-elimination-tournament-number-of-possible-combinations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!