0
$\begingroup$

I have a system where I number each match in a tournament the following way:

round 1     |   round 2     | ------------|---------------|             · [a vs b] ----------- (match 0)   ·       |             ·       |             ·   [a vs c] ------ [a winner]             ·   (match 2)             ·       |             ·       | [c vs d] ----------- (match 1)   ·             · 

So matches are numbered from top to bottom, and left to right from 0 to N.
When a match is played and a winner is known, I need to know to which match the winner will be placed (Example: in Match 0, winner A will be directed to Match 2)

I've found that:

  next_match_number = (current_match_number + total_number_of_teams)/2 

gives me the next match number that I need. Please note that I need to round down the result.
Example:

  next_match_number = (0+4)/2 = 2 

Now for a different purpose, I need the Match Number where a Team may come from -> The previous match number.
For example, in match 2 I would like to know that its teams come from match 0 and match 1.

Obviously the same formula doesn`t work. I know that rounding down the result is a dirty trick...

  • 0
    That's it @tom, both matches would be what I need. I blame my english level ...2012-03-07

1 Answers 1

2

Given a Match number $m$ and a total number of teams $T$, set

$m_1 := 2(m-\lceil T/2\rceil)$

and then, $m_2 := m_1+1$. Treating the cases where $T$ is even/odd, separately, it follows immediately from your formula that the match following both $m_2$ and $m_1$ is $m$.