It's tournament time!
Given a single-elimination tournament with 2^N competitors, compute the 2^N by 2^N matrix M such that M(i,j)=1 iff competitor i might play competitor j in round R, where 1<=R<=N. (In each round each surviving competitor plays his "next door neighbor" in the bracket.)
For example, if N=1, R=1 then
M =
[ 0 1
1 0]or if N=2, R=2 then
M =
[ 0 0 1 1
0 0 1 1
1 1 0 0
1 1 0 0 ]
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers13
Suggested Problems
-
Number of 1s in the Binary Representation of a Number
486 Solvers
-
Find the largest value in the 3D matrix
1688 Solvers
-
792 Solvers
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
253 Solvers
-
374 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Faulty test suite. The 'for v = 1:10' in problem 5 has a semicolon after it.
Nice problem, but its description could be improved. Adding a link like https://en.wikipedia.org/wiki/Single-elimination_tournament would help. Moreover I would add that at the first round competitor #1 plays against competitor #2, competitor #3 plays against competitor #4, ... and competitor #n-1 plays against competitor #n (no wrap around or modular arithmetic; or else there would be 2 possible starting configurations).