codelex2bin: Lexicographic order position to binary order position
Description
Given the lexicographic order position of a coalition, this function returns the corresponding binary order position.
Usage
codelex2bin(n, Nlex)
Value
The corresponding binary order position, as an integer between 1 and \(2^{\code{n}}-1\).
Arguments
n
Number of players.
Nlex
A lexicographic order position, as an integer between 1 and \(2^{\code{n}}-1\).
Details
Lexicographic order arranges coalitions in ascending order according to size, and applies lexicographic order to break ties among coalitions of the same size. The binary order position of a coalition \(S\in 2^N\) is given by \(\sum_{i\in S} 2^{i-1}\).