Double Elimination Tournament Algorithm for Bytes% 4

I'm trying to encode a Double Elimination tournament where the brackets are based on version 4. The first round should handle all the bikes, so after round 2 there will be no more bytes. It’s hard for me to find real math that determines the number of bytes I need. If someone can help me with the math behind this, we will be very grateful.

There are 4 possible answers for any mod 4 (0,1,2,3) I need to handle bytes at 1,2,3.

An example of what I mean 13 players (13% 4 = 1) so the bracket of the 1st round should look like this: 1vs2 2vs3 3vs4 4vs5 5vs6

and round 2 Winner 7vs Winner 8vs Winner 9vs winner vs winner and then you have a bracket of losers

Basically, if you are familiar with the Challenge website, I want to generate brackets similar to them, but I cannot understand the math behind their definition of bytes.

If someone did something like this, I would be very grateful for his help.

+3
source share
3 answers

Where Nis the number of competitors, the number of rounds will be:

nRounds = Math.Ceiling( Math.Log( N, 2 ) );

The number of slots in the first round will be:

firstRoundSlots = Math.Pow( 2, nRounds );

The best competitors are a thing of the past, so in your example there are 13 participants in round 16, so the best 3 participants will enjoy. In other words, the number of bytes firstRoundSlots - N.

. , , . , . . , .

, (.. 1 ), :

http://blogs.popart.com/2012/02/things-only-mathematicians-can-get-excited-about/

+2

, . , 2 2.

2: (matches in round 1)/2 + byes)
P - .

2^n = (P-byes)/2 + byes
2^(n+1) = P-byes + 2*byes
2^(u) = P + byes

, u s.t. 2^u >= P, 2^u-P byes.

: 7 → 2 ^ u = 8 → (8-7) → 1 bye
1 bye, 3 → 4 2

4, 9 13: 9 → 2 ^ u = 16 → (16-9) → 7 13 → 2 ^ u = 16 → (16-13) → 3 byes

, , , .

0

, :

  • ( , - ).
  • , ,
  • , , ,
  • Whenever one person loses a total of two games (or two loss equivalents if the draw prevails), that person leaves the tournament
  • Repeat this until one player remains in the tournament.
0
source

All Articles