# coalitionalgame: Coalitional game associated with a claims problem In ClaimsProblems: Analysis of Conflicting Claims

## Description

This function returns the pessimistic and optimistic coalitional games associated with a claims problem.

## Usage

 `1` ```coalitionalgame(E, d, opt = FALSE, lex = FALSE) ```

## Arguments

 `E` The endowment. `d` The vector of claims. `opt` Logical parameter. If opt = TRUE, both the pessimist and optimistic associated coalitional games are given. By default, opt = FALSE, and only the associated pessimistic coalitional game is computed. `lex` Logical parameter. If lex = TRUE, coalitions of claimants are ordered lexicographically. By default, lex = FALSE, and coalitions are ordered using their binary representations.

## Details

Let E≥ 0 be the endowment to be divided and d the vector of claims with d≥ 0 and such that the sum of claims exceeds the endowment.

For each subset S of the set of claimants N, let d(S) be the sum of claims of the members of S and let N-S be the complementary coalition of S.

Given a claims problem (E,d), its associated pessimistic coalitional game is the game vp assigning to each coalition S the real number:

vp(S)=max {0,E-d(N-S)}.

Given a claims problem (E,d), its associated optimistic coalitional game is the game vo assigning to each coalition S the real number:

vo(S)=min {E,d(S)}.

The optimistic and the pessimistic coalitional games are dual games, that is, for all S:

vo(S)=E-vp(N-S).

An efficient way to represent a nonempty coalition S is by identifying it with the binary sequence a(n)a(n-1) … a(1) where a(i)=1 if i belongs to S and a(i)=0 otherwise. Therefore, each coalition S is represented by the number associated with its binary representation: ∑ a(i)2^(i-1). Then coalitions can be ordered by their associated numbers.

Alternatively, coalitions can be ordered lexicographically.

Given a claims problem (E,d), its associated coalitional game v can be represented by the vector whose coordinates are the values assigned by v to all the nonempty coalitions. For instance. if n=3, the associated coalitional game can be represented by the vector of the values of all the 7 nonempty coalitions, ordered using the binary representation:

v = [v({1}), v({2}), v({1,2}), v({3}), v({1,3}), v({2,3}), v({1,2,3})]

Alternatively, the coordinates can be ordered lexicographically:

v = [v({1}), v({2}), v({3}), v({1,2}), v({1,3}), v({2,3}), v({1,2,3})]

When n=4, the associated coalitional game can be represented by the vector of the values of all the 15 nonempty coalitions, ordered using the binary representation:

v = [v({1}), v({2}), v({1,2}), v({3}), v({1,3}), v({2,3}), v({1,2,3}), v({4}), v({1,4}), v({2,4}), v({1,2,4}), v({3,4}), v({1,3,4}), v({2,3,4}), v({1,2,3,4})]

Alternatively, the coordinates can be ordered lexicographically:

v=[v({1}), v({2}), v({3}), v({4}), v({1,2}), v({1,3}), v({1,4}), v({2,3}), v({2,4}), v({3,4}), v({1,2,3}), v({1,2,4}), v({1,3,4}), v({2,3,4}), v({1,2,3,4})]

## Value

The pessimistic (and optimistic) associated coalitional game(s).

 ```1 2 3 4 5 6 7``` ```E=10 d=c(2,4,7,8) v=coalitionalgame(E,d,opt=TRUE,lex=TRUE) #The pessimistic and optimistic coalitional games are dual games v_pes=v\$v_pessimistic_lex v_opt=v\$v_optimistic_lex v_opt[1:14]==10-v_pes[14:1] ```