lex2bin {TUGLab}R Documentation

Lexicographic order to binary order

Description

Given a characteristic function in lexicographic order, this function returns the characteristic function in binary order.

Usage

lex2bin(v)

Arguments

v

A characteristic function, as a vector in lexicographic order.

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}.

Value

The characteristic function, as a vector in binary order.

See Also

bin2lex, codebin2lex, codelex2bin

Examples

v <- seq(1:31)
lex2bin(v)
bin2lex(lex2bin(v))==v

[Package TUGLab version 0.0.1 Index]