Learn R Programming

TUGLab (version 0.0.1)

subgame: Subgame of a coalition

Description

Given a game and a coalition, this function returns the characteristic function of the subgame of the given coalition.

Usage

subgame(v, S, binary = FALSE)

Value

The characteristic function of the subgame of the given coalition, as a vector in binary order if binary=TRUE and in lexicographic order otherwise.

Arguments

v

A characteristic function, as a vector.

S

The position of a coalition, as an integer.

binary

A logical value. By default, binary=FALSE. Should be set to TRUE if v and S are introduced according to binary order instead of lexicographic order.

Details

Given \(v\in G^N\), the subgame of coalition \(S \in 2^{N}\) is defined by \(v_S(T)=v(T)\) for all \(T\in 2^S\).

Examples

Run this code
v <- c(0, 0, 0, 0, 2, 3, 4, 5, 6, 9, 1, 15, 20, 30, 100)
S <- 13
subgame(v, S)
n <- 4
for (i in 1 : (2^n-1)) {
  cat("[", i, "]", paste(subgame(v,i)), "\n")
}
subgame(v,15)==v

Run the code above in your browser using DataLab