Learn R Programming

TUGLab (version 0.0.1)

dualgame: Dual game

Description

Given the characteristic function of a game, this function returns the characteristic function of the dual game.

Usage

dualgame(v)

Value

The characteristic function of the dual game. It is to be interpreted according to the order that v is introduced in.

Arguments

v

A characteristic function, as a vector.

Details

The dual game of \(v\in G^N\) is defined by \(v^D(S)=v(N)-v(N\backslash S)\) for all \(S \in 2^N\).

Examples

Run this code
v <- c(rep(0,4),rep(5,6),rep(20,4),40)
dualgame(v)
v <- seq(1:31)
dualgame(v)
dualgame(dualgame(v)) == v

Run the code above in your browser using DataLab