Learn R Programming

CoopGame (version 0.2.2)

isConstantSumGame: Check if game is constant-sum

Description

Checks if a TU game with n players is constant-sum. In a constant-sum game for any coalition S the sums of the values of the coalition S and its complement equal the value of the grand coalition N.

Usage

isConstantSumGame(v)

Arguments

v

Numeric vector of length 2^n - 1 representing the values of the coalitions of a TU game with n players

Value

TRUE if the game is constant-sum, else FALSE.

References

Peleg B. and Sudhoelter P. (2007) Theory of cooperative games, 2nd Edition, Springer, p. 11

Examples

Run this code
# NOT RUN {
library(CoopGame)
v=c(0,0,0,2,2,2,2) 
isConstantSumGame(v)

# }
# NOT RUN {
#Example of a game that is not constant-sum 
library(CoopGame)
v=c(0,0,0,40,30,130,100) 
isConstantSumGame(v)

#Another example of a constant-sum game
library(CoopGame)
v=c(1,1,1,2, 2,2,2,2,2,2, 2,3,3,3, 4)
isConstantSumGame(v)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab