I was working on some programming projects then I suddenly got stuck at a particular problem that took me a whole day still unable to solve. When simplified, it looks like this:
Background
Consider a tournament where we want to find out the ranking of N contestants. In each competition, M contestants compete with each other at the same time to generate a ranking order. How many such competitions S are required in the tournament to fully rank all contestants given
(which would become regular binary sort) and
.
There are a few things that are obvious:
1. Inherently at atomic level, the act of ranking involves comparing 2 contestants, which is a binary case.
2. We do not need every contestant to have had competed with every other contestant. Between 2 contestants, the winner wins every other person that the loser wins and vice versa.
3. We must have information of combination(N, 2) rankings between any 2 contestants.
To be continued…
, we can never quite know whether it was
or
; even if some of the operands were known, there are still quite many possible equations that gives the answer
it will always equal