Possible Opponents Matrix for single-elimination tournament - MATLAB Cody - MATLAB Central

Problem 2254. Possible Opponents Matrix for single-elimination tournament

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

88.24% Correct | 11.76% Incorrect
Last Solution submitted on Feb 01, 2023

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers11

Suggested Problems

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!
Go to top of page