# Voting power (7): Quarreling voters

In all the previous discussions of voting power, we have assumed that all
winning coalitions are equally likely. But in practice that is not necessarily
the case. Two or more voters may be opposed on so many issues that they would
never vote the same way on any issues: such a pair of voters may be said to be
*quarrelling*.

To see how this may make a difference, consider the voting game \[ [51; 49,48,3] \] The winning coalitions for which a party is critical are \[ [49,48],\; [49,3],\; [48,3] \] and since each party is critical to the same number of winning coalitions, the Banzhaf indices are equal.

But suppose that the two largest parties are quarrelling, and so the only winning
coalitions are then
\[
[49,3],\; [48,3].
\]
This means that the smaller party has *twice* the power of each of the larger
ones!

We can set this up in Sage, using polynomial rings, with an ideal that represents the quarrel. In this case:

```
1sage: q = 51
2sage: w = [49,48,3]
3sage: R.<x,y,z> = PolynomialRing(QQ)
4sage: qu = R.ideal(x*y)
5sage: p = ((1+x^49)*(1+y^48)*(1+z^3)).reduce(qu)
6sage: p
```

\[ x^{49}z^3+y^{48}z^3+x^{49}+y^{48}+z^3+1 \] From this polynomial, we choose the monomials whose degree sums are not less than the quota:

```
1sage: wcs = [m.degrees() for m in p.monomials() if sum(m.degrees()) >= q]
2sage: wcs
```

\[ [(49,0,3),(0,48,3)] \] To determine the initial (not normalized) Banzhaf values, we traverse this list of tuples, checking in each tuple if the value is critical to its coalition:

```
1sage: beta = [0,0,0]
2sage: for c in wcs:
3 sc = sum(c)
4 for i in range(3):
5 if sc-c[i] < q:
6 beta[i] += 1
7 beta
```

\[ [1,1,2] \] or \[ [0.24, 0.25, 0.5] \] for normalized values.

## Generalizing

Of course the above can be generalized to any number of voters, and any number of quarrelling pairs. For example, consider the Australian Senate, of which the current party representation is:

Although the current government consists of two separate parties, they act in effect as one party with a weight of 36. (This is known formally as the "Liberal-National Coalition".) With no quarrels then, we have \[ [39;36,26,9,2,1,1,1] \] of which the Banzhaf values have been found to be 52, 12, 12, 10, 4, 4, 4 and the Banzhaf power indices \[ 0.5306, 0.1224, 0.1224, 0.102, 0.0408, 0.0408, 0.0408. \] Suppose that the Government and Opposition are quarrelling, as are also the Greens and One Nation. (This is a reasonable assumption, given current politics and the platforms of the respective parties.)

```
1sage: q = 39
2sage: w = [36,26,9,2,1,1,1]
3sage: n = len(w)
4sage: R = PolynomialRing(QQ,'x',n)
5sage: xs = R.gens()
6sage: qu = R.ideal([xs[0]*xs[1],xs[2]*xs[3]])
7sage: pr = prod(1+xs[j]^w[j] for j in range(n)).reduce(qu)
```

As before, we extract the degrees of those monomials whose sum is at least \(q\), and determine which party in each is critical:

```
1sage: wcs = [m.degrees() for m in pr.monomials() if sum(m.degrees()) >= q]
2sage: beta = [0]*n
3sage: for c in wcs:
4 sc = sum(c)
5 for i in range(n):
6 if sc-c[i] < q:
7 beta[i] += 1
8sage: beta
```

\([16,0,7,6,2,2,2]\)

which can be normalized to

\([0.4571, 0.0, 0.2, 0.1714, 0.0571, 0.0571, 0.0571]\).

The remarkable result is that Labor - the Opposition party, with the second
largest number of seats in the Senate - loses all its power! This means that
Labor *cannot* afford to be in perpetual quarrel with the government parties.

## A simple program

And of course, all of the above can be written into a simple Sage program:

```
1def qbanzhaf(q,w,r):
2 n = len(w)
3 R = PolynomialRing(QQ,'x',n)
4 xs = R.gens()
5 qu = R.ideal([xs[y[0]]*xs[y[1]] for y in r])
6 pr = prod(1+xs[j]^w[j] for j in range(n)).reduce(qu)
7 wcs = [m.degrees() for m in pr.monomials() if sum(m.degrees()) >= q]
8 beta = [0]*n
9 for c in wcs:
10 sc = sum(c)
11 for i in range(n):
12 if sc-c[i] < q:
13 beta[i] += 1
14 return(beta)
```

All the quarrelling pairs are given as a list, so that the Australian Senate computation could be entered as

```
1sage: qbanzahf(q,w,[[0,1],[2,3]])
```