Learn R Programming

TUGLab (version 0.0.1)

codebin2lex: Binary order position to lexicographic order position

Description

Given the binary order position of a coalition, this function returns the corresponding lexicographic order position.

Usage

codebin2lex(n, Nbin)

Value

The corresponding lexicographic order position, as an integer between 1 and \(2^{\code{n}}-1\).

Arguments

n

Number of players, as an integer.

Nbin

A binary order position, as an integer between 1 and \(2^{\code{n}}-1\).

Details

The binary order position of a coalition \(S\in 2^N\) is given by \(\sum_{i\in S} 2^{i-1}\). Lexicographic order arranges coalitions in ascending order according to size, and applies lexicographic order to break ties among coalitions of the same size.

See Also

bin2lex, codelex2bin, lex2bin

Examples

Run this code
codebin2lex(5, 4)

Run the code above in your browser using DataLab