Learn R Programming

TUGLab (version 0.0.1)

constantsumgame: Constant sum game

Description

This function computes the characteristic function of the specified constant sum game.

Usage

constantsumgame(halfv, vN)

Value

The characteristic function of the constant sum game. It is to be interpreted according to the order that halfv is introduced in.

Arguments

halfv

The first half (according to lexicographic or binary order) of the characteristic function (excluding the grand coalition), as a vector.

vN

The utility of the grand coalition.

Details

A game \(v\in G^N\) is a constant sum game if, for each \(S \in 2^{N}\), \(v(S) + v(N \setminus S) = v(N)\). Thus, if \(v\) is a constant sum game and \(F\) is a family of \(2^{n-1}-1\) coalitions such that \(S \cup T \neq N\) for any \(S,T \in F\), the full characteristic function of \(v\) is strictly determined by the utilities of the coalitions in \(F\) and the utility of the grand coalition.

Examples

Run this code
constantsumgame(c(0,0,0), 1) # the dollar game
# Building a random constant sum game:
players <- sample(3:6,1) # random number of players between three and six
halfv <- runif(2^(players-1)-1, 0, 10) # random halfv
vN <- runif(1,30,50) # random vN
constantsumgame(halfv, vN)

Run the code above in your browser using DataLab