Monte Carlo Methods for Calculating Shapley-Shubik Power Index in Weighted Majority Games

This paper addresses Monte Carlo algorithms for calculating the Shapley-Shubik power index in weighted majority games. First, we analyze a naive Monte Carlo algorithm and discuss the required number of samples. We then propose an efficient Monte Carlo algorithm and show that our algorithm reduces the required number of samples as compared to the naive algorithm.


Introduction
The analysis of power is a central issue in political science.In general, it is difficult to define the idea of power even in restricted classes of the voting rules commonly considered by political scientists.The use of game theory to study the distribution of power in voting systems can be traced back to the invention of "simple games" by von Neumann and Oskar Morgenstern [30].A simple game is an abstraction of the constitutional political machinery for voting.
In 1954, Shapley and Shubik [27] proposed the specialization of the Shapley value [26] to assess the a priori measure of power of each player in a simple game.Since then, the Shapley-Shubik power index (S-S index) has become widely known as a mathematical tools for measuring the relative power of the players in a simple game.
In this paper, we consider a special class of simple games, called weighted majority games, which constitute a familiar example of voting systems.Let N be a set of players.Each player i ∈ N has a positive integer voting weight w i as the number of votes or weight of the player.The quota needed for a coalition to win is a positive integer q.A coalition N ⊆ N is a winning coalition, if i∈N w i ≥ q holds; otherwise, it is a losing coalition.
The difficulty involved in calculating the S-S index in weighted majority games is described in [13] without proof (see p. 280, problem [MS8]).Deng and Papadimitriou [9] showed the problem of computing the S-S index in weighted majority games to be #P-complete.Prasad and Kelly [24] proved the NP-completeness of the problem of verifying the positivity of a given player's S-S index in weighted majority games.The problem of verifying the asymmetricity of a given pair of players was also shown to be NP-complete [21].It is known that even approximating the S-S index within a constant factor is intractable unless P = NP [10].
This paper addresses Monte Carlo algorithms for calculating the S-S index in weighted majority games.In the following section, we describe the notations and definitions used in this paper.In Section 3, we analyze a naive Monte Carlo algorithm (Algorithm A1) and extend some results obtained in the study reported in [1].In Section 4, we propose an efficient Monte Carlo algorithm (Algorithm A2) and show that our algorithm reduces the required number of samples as compared to the naive algorithm.Table 1 summarizes the results of this study, where (ϕ 1 , ϕ 2 , . . ., ϕ n ) denotes the S-S index and (ϕ A 1 , ϕ A 2 , . . ., ϕ A n ) denotes the estimator obtained by Algorithm A1 or A2.
An integer n denotes the size of a maximal player subset with mutually different weights.

Notations and Definitions
In this paper, we consider a special class of cooperative games called weighted majority games.Let N = {1, 2, . . ., n} be a set of players.A subset of players is called a coalition.A weighted majority game G is defined by a sequence of positive integers G = [q; w 1 , w 2 , . . ., w n ], where we may think of w i as the number of votes or the weight of player i and q as the quota needed for a coalition to win.In this paper, we assume that 0 A coalition S ⊆ N is called a winning coalition when the inequality q ≤ i∈S w i holds.The inequality q ≤ w 1 + w 2 + • • • + w n implies that N is a winning coalition.A coalition S is called a losing coalition if S is not winning.We define that an empty set is a losing coalition.

Naive Algorithm and its Analysis
In this section, we describe a naive Monte Carlo algorithm and analyze its theoretical performance.
Put (the random variable) Step 2: If m = M , then output ϕ i /M (∀i ∈ N ) and stop.Else, update m := m + 1 and go to Step 1.
For each permutation π ∈ Π N , we can find the pivot piv(π) ∈ N in O(n) time.Thus, the time complexity of Algorithm A1 is bounded by O(M (τ (n) + n)) where τ (n) denotes the computational effort required for random generation of a permutation.
The following theorem provides the number of samples required in Algorithm A1.
Theorem 2. For any ε > 0 and 0 < δ < 1, we have the following. ( ( The distance measure It is obvious that for each player i ∈ N , {X i , X i , . . ., X Hoeffding's inequality [14] implies that each player i ∈ N satisfies (2) If we set M ≥ ln(2n/δ) 2ε 2 , then we have that (3) Obviously, the vector of random variables Then, the Bretagnolle-Huber-Carol inequality [29] (Theorem 8 in Appendix) implies that Pr 1 2 and thus, we have the desired result.

Our Algorithm
In this section, we propose a new algorithm based on the hierarchical structure of the partition {Π 1 , Π 2 , . . ., Π n }.First, we introduce a map denotes a permutation obtained by swapping the positions of players i and i − 1 in the permutation (π(1), π(2), . . ., π(n)).Because w i−1 ≥ w i (Assumption 1), it is easy to show that the pivot of f i (π) becomes the player i − 1.The definition of f i directly implies that ∀{π, π } ⊆ Π i , if π = π , then f i (π) = f i (π ).Thus, we have the following.Lemma 3.For any i ∈ N \ {1}, the map f i : Π i → Π i−1 is injective.When an ordered pair of permutations (π, π ) satisfies the conditions that π ∈ Π i , π ∈ Π j , i ≤ j, and π we say that π is an ancestor of π.Here, we note that π is always an ancestor of π itself.Lemma 3 implies that every permutation π ∈ Π N has a unique ancestor, called the originator, π ∈ Π j satisfying that either j = n or its inverse image f −1 j+1 (π ) = ∅.For each permutation π ∈ Π N , org(π) ∈ N denotes the pivot of the originator of π; i.e., Π org(π) includes the originator of π.Now, we describe our algorithm.
Update Step 2: If m = M , then output ϕ i /M (∀i ∈ N ) and stop.Else, update m := m + 1 and go to Step 1.
For each permutation π ∈ Π N , we can find the originator org(π) ∈ N in O(n) time.Thus, the time complexity of Algorithm A2 is also bounded by O(M (τ (n) + n)) where τ (n) denotes the computational effort required for random generation of a permutation.
(2) For each pair of players {i, j} ⊆ N , if The following theorem provides the number of samples required in Algorithm A2.
(1) For each player i ∈ N = {1, 2, . . ., n}, if we set M ≥ ln 2 + ln(1/δ) ( . ( where It is obvious that for each player i ∈ N , {X i , X i , . . ., X (M ) i } is a collection of independent and identically distributed random variables satisfying Hoeffding's inequality [14] implies that each player ( (2) If we set M ≥ ln(2/δ) 2ε 2 , then we have that Step 2 of Algorithm A2 defined by Because n =1 Y (m) = 1 (∀m), the above definition directly implies that For each player i ∈ N and i ≤ ∀ ≤ n, we define The above definitions imply that For each player ∈ N * , we have the equalities |Π | = n!ϕ = n!ϕ +1 = |Π +1 |, which yields that f +1 : Π +1 → Π is a bijection and thus Π does not include any originator.From the above, it is obvious that, if ∈ N * , then For each ∈ {1, 2, . . ., n}, {Y (1) , Y = 0 for any m ∈ {1, 2, . . ., M }.To summarize the above, we have shown that Now, we have an upper bound of the total variation distance Obviously, the vector of random variables ∈N * is multinomially distributed and satisfies that the total sum is equal to M .Then, the Bretagnolle-Huber-Carol inequality [29] (Theorem 8 in Appendix) implies that Pr 1 2 and thus, we have the desired result.
The following corollary provides an approximate version of Theorem 5 (2).Surprisingly, it says that the required number of samples is irrelevant to n (number of players).Corollary 6.For any ε > 0 and 0 < δ < 1, we have the following.If we set M ≥ ln 2 + ln(1/δ ) + ln 1.129 2ε 2 , then Proof.If we put δ = δ /1.129, then Theorem 2 (2) implies that Here, we note that ln 2 0.69314 and ln 1.129 0.12133.In a practical setting, it is difficult to estimate the size of N * defined in Theorem 5 (3), since the problem of verifying the asymmetricity of a given pair of players is NP-complete [21].The following corollary is useful in some practical situations.

Computational Experiments
This section reports the results of our preliminary numerical experiments.
All the experiments were conducted on a windows machine, i7-7700 CPU@3.6GHzMemory (RAM) 16GB.Algorithms A1 and A2 are implemented by Python 3.6.5.We tested the EU Council instance and the United States instance described in the previous section.In each instance, we set M in Algorithm A1 and A2 (the number of generated permutations) to M ∈ {1 × 10 5 , 2 × 10 5 , . . ., 24 × 10 5 }.For each value M , we executed Algorithms A1 and A2, 100 times.Figures 2 and 3 show results of some players.For each value M , we calculated the mean number of |ϕ i − ϕ A i |, denoted by ε i , in an average of 100 trials.The horizontal axes of Figures 2 and 3 show the value 1/ ε i 2 .Under the assumption that M = α/ ε i 2 , we estimated α by the least squares method.Table 2 shows the results and ratios of α of two algorithms.For each (generated) permutation, the computational effort of both Al- gorithms A1 and A2 are bounded by O(n).Here, we discuss the constant factors of O(n) computations.We tested the cases that weights w i are generated uniformly at random from the intervals [1,10] or [1,20], and quota is equal to (1/2) i∈N w i .For each n ∈ {10, 20, . . ., 100}, we executed Algorithms A1 and A2 by setting M = 10, 000.Under the assumption that computational time is equal to an + b, we estimated a and b by the least squares method.Figure 4 shows that for each permutation, the computational effort of Algorithm A2 increases about 5-fold comparing to Algorithm A1.

Conclusion
In this paper, we analyzed a naive Monte Carlo algorithm (Algorithm A1) for calculating the S-S index denoted by (ϕ 1 , ϕ 2 , . . ., ϕ n ) in weighted majority games.By employing the Bretagnolle-Huber-Carol inequality [29] (Theorem 8 in Appendix), we estimated the required number of samples that gives an upper bound of the total variation distance.We also proposed an efficient Monte Carlo algorithm (Algorithm A2).
|N * | is equal to the size of the maximal player subset, the S-S indices of which are mutually different.Proof.Let us introduce random variables X (m) i (∀m ∈ {1, 2, . . ., M }, ∀i ∈ N ) in Step 2 of Algorithm A2 defined by

Table 1 :
Required Number of Samples.
n is equal to the size of a maximal player subset with mutually different weights.Proof.Since ϕ i > ϕ i+1 implies w i > w i+1 , it is obvious that |N * | ≤ n and we have the desired result.