# Space of possible elections

For a given type of ballot, number of voters and number of candidates, there is a finite and computable number of potential elections that can possibly occur. Due to the combinatorial nature of the problem this number is typically extremely large, even for modest electorate sizes.

Nevertheless, understanding the construction of this space of possible elections may be helpful to others looking for analyzing elections computationally, and may also be instructive for generating alternative parameterizations and analyses of election models.

This article details the space of possible elections for certain ballot types, as well as presents expressions for the total number of possible elections.

# Notation and parameters

• ${\displaystyle n}$: the number of voters
• ${\displaystyle c}$: the number of candidates
• ${\displaystyle r}$: the number of possible scores in a rated ballot
• ${\displaystyle \mathcal{B}}$: the set of possible ballots
• ${\displaystyle \mathcal{E}(\mathcal{B}, n, c)}$: the set of possible elections using ballots from ${\displaystyle \mathcal{B}}$, ${\displaystyle c}$ candidates and ${\displaystyle n}$ voters
• ${\displaystyle |\cdot|}$: the cardinality (or size) of a set, e.g. ${\displaystyle |\mathcal{B}|}$ is the number of possible ballots.
• ${\displaystyle p(k)}$: the set of partitions for the integer ${\displaystyle k}$, with ${\displaystyle |p(k)|}$ the partition number of ${\displaystyle k}$.
• ${\displaystyle C(k)}$: the set of compositions (ordered partitions) for the integer ${\displaystyle k}$, with ${\displaystyle |C(k)|}$ the number of compositions of ${\displaystyle k}$.
• ${\displaystyle \alpha \in p(k)}$: a specific partition of ${\displaystyle p(k)}$
• ${\displaystyle \kappa \in C(k)}$: a specific composition of ${\displaystyle C(k)}$
• ${\displaystyle \binom{N}{k} = \frac{N!}{(N-k)!k!}}$: the binomial coefficient, the number of non-ordered ways to pick ${\displaystyle k}$ elements out of ${\displaystyle N}$, without replacement.

# Number of possible ballots

Since each voter may cast any of a finite set of valid ballots, we must first determine how many valid ballots are available.

## Single-mark ballots

Under single-mark ballots (1), like in plurality voting, the number of ballots is trivially ${\textstyle |\mathcal{B}^1(c)| = c}$.

## Cardinal (rated) systems

Let ${\displaystyle \mathcal{B}^C(c,r)}$ be the set of cardinal (C) ballots with ${\displaystyle r}$ possible evaluations for candidates. In this case, the total number of ballots is

${\displaystyle |\mathcal{B}^C(c,r)| = r^c}$

For approval voting, ${\displaystyle r = 2}$.

 ${\displaystyle c}$ 2 3 4 5 6 7 8 9 10 ${\textstyle |\mathcal{B}^C(c,2)|}$ 2 4 8 16 32 64 128 512 1,024 ${\textstyle |\mathcal{B}^C(c,5)|}$ 25 125 625 3,125 15,625 78,125 390,625 1,953,125 9,765,625 ${\textstyle |\mathcal{B}^C(c,6)|}$ 36 216 1,296 7,776 46,656 279,936 1,679,616 1,0077,696 60,466,176 ${\textstyle |\mathcal{B}^C(c,10)|}$ 100 1,000 10,000 100,000 1,000,000 10,000,000 100,000,000 1,000,000,000 10,000,000,000 ${\textstyle |\mathcal{B}^C(c,11)|}$ 121 1,331 14,641 161,051 1,771,561 19,487,171 214,358,881 2,357,947,691 25,937,424,601

If blanks are allowed, they can be considered an extra degree of rating (so 0-5 scores + blank makes 7 total evaluations).

## Ordinal (ranked) systems

For ranked (>) systems, we must consider the possibility of equal rankings vs. strict rankings. Partial rankings may also be possible, which leads to a more complex computation.

### Full strict rankings

Let ${\displaystyle \mathcal{B}^{>}(c)}$ be the set of ranked ballots with strict, full rankings. In this case, the total number of ballots is simply

${\displaystyle |\mathcal{B}^{>}(c)| = c!}$

These are the factorials or permutation numbers (OEIS sequence A000142).

 ${\displaystyle c}$ 2 3 4 5 6 7 8 9 10 ${\textstyle |\mathcal{B}^{>}(c)|}$ 2 6 24 120 720 5,040 40,320 362,880 3,628,800

### Partial strict rankings

If limited to top ${\displaystyle k}$ candidates, the number is

${\displaystyle |\mathcal{B}^{>\emptyset}_{k}(c)| = \frac{c!}{(c-k)!}}$

But if voters are allowed to cast arbitrary partial rankings, the number becomes

${\displaystyle |\mathcal{B}^{>\emptyset}(c)| = \sum_{k=1}^{c} |\mathcal{B}^{>\emptyset}_{k}(c)| = \sum_{k=1}^{c} \frac{c!}{(c-k)!} = \mathrm{e} \Gamma(c+1,1) - 1}$

Here, ${\displaystyle \Gamma(x, z) = \int_{z}^{\infty} t^{x-1} \mathrm{e}^{-t} \mathrm{d}t}$ is the incomplete gamma function, and ${\displaystyle \mathrm{e}}$ is Euler's number.

These are OEIS sequence A007526.

 ${\displaystyle c}$ 2 3 4 5 6 7 8 9 10 ${\textstyle |\mathcal{B}^{>\emptyset}(c)|}$ 4 15 64 325 1,956 13,699 109,600 986,409 9,864,100

### Full rankings, equality allowed

Let ${\displaystyle \mathcal{B}^{\ge}(c)}$ be the set of ranked ballots with full rankings, possibly with equalities. Every equality creates an equivalence class between candidates, within which the order does not matter. There can be at least 1 equivalence class (all candidates are ranked equal), and at most ${\displaystyle c}$ (all candidates different).

The equivalence classes are determined by the compositions ${\displaystyle \kappa \in C(c)}$. For example, for ${\displaystyle c = 3}$ we may have the compositions (3), (2,1), (1,2) and (1,1,1), giving the ballots of the form (_ = _ = _), (_ = _ > _), (_ > _ = _) and (_ > _ > _). Thus, there are ${\displaystyle \ell = |\kappa|}$ equivalence classes in a given composition, the size of each is given by ${\displaystyle \kappa_i}$.

Each of the "slots" in a ballot may be filled with a candidate, but the order should not matter within an equivalence. Therefore, for the 1st equivalence with ${\displaystyle \kappa_1}$ slots, there are ${\textstyle \binom{c}{\kappa_1}}$ possible choices of candidates. For the second, ${\textstyle \binom{c-\kappa_1}{\kappa_2}}$, for the third ${\textstyle \binom{c-\kappa_1-\kappa_2}{\kappa_3}}$ and so on, exhausting the possibilities at every level.

The total number of ballots is then given by

${\displaystyle |\mathcal{B}^{\ge}(c)| = \sum_{\kappa \in C(c)} \binom{c}{\kappa_1} \binom{c - \kappa_1}{\kappa_2} \cdots \binom{c - \sum_{i=1}^{\ell-1} \kappa_i}{\kappa_\ell}}$

These are known as Fubini numbers or ordered Bell numbers (OEIS sequence A000670).

 ${\displaystyle c}$ 2 3 4 5 6 7 8 9 10 ${\textstyle |\mathcal{B}^{\ge}(c)|}$ 3 13 75 541 4,683 47,293 545,835 7,087,261 102,247,563

## Remarks

In addition to what was outlined above, specific voting systems may induce further structure to the ballots. For example, a cardinal system which normalizes ballots would reduce the number of possible ballots significantly. A cardinal system based entirely on margins would have a different number of effective ballots, despite the ballots themselves being different. Similar things may happen under ranked systems under additional constraints.

One may also want to exclude some ballots for having no effect. For example, the ballot with all equal ratings or rankings will have no effect in most voting systems. However, these ballots are only a vanishingly small number from the total possible ballots.

# The space of possible elections

Each of the ${\displaystyle n}$ voters may cast any one of the ${\displaystyle |\mathcal{B}|}$ ballots, but since voters casting identical ballots are exchangeable the number of elections is smaller than ${\displaystyle |\mathcal{B}|^n}$.

The number of total unique elections depends on the possible partitions of the ${\displaystyle n}$ voters into different groups, each casting identical ballots. For each partition ${\displaystyle \alpha \in p(n)}$ of the ${\displaystyle n}$ voters we have ${\displaystyle |\alpha|}$ groups of voters, each casting a unique ballot. Therefore, we have to pick a different possible ballot for each of these groups. For the first group there are ${\displaystyle |\mathcal{B}|}$ possibilities, for the second ${\displaystyle |\mathcal{B}| - 1}$, for the third ${\displaystyle |\mathcal{B}| - 2}$ and so on. If the number of ballots is smaller than the number of voters, this sum must be truncated. Therefore, the total number of unique elections is then given by

${\displaystyle |\mathcal{E}(\mathcal{B},n,c)| = \sum_{\begin{array}{c} \alpha \in p(n) \\ |\alpha| \le |\mathcal{B}| \end{array}} \frac{|\mathcal{B}|!}{(|\mathcal{B}| - |\alpha|)!}}$

As the partition number may be approximated by ${\textstyle |p(n)| \approx \frac{1}{4n\sqrt{3}} \exp \left( \pi \sqrt{\frac{2n}{3}} \right)}$, we can estimate for cardinal elections

${\displaystyle |\mathcal{E}(\mathcal{B}^C(c,r),n,c)| \approx \frac{1}{n} \mathrm{e}^\sqrt{n} (r^c)!}$

and for full strict ranking elections

${\displaystyle |\mathcal{E}(\mathcal{B}^{>}(c),n,c)| \approx \frac{1}{n} \mathrm{e}^\sqrt{n} (c!)!}$

These numbers are exceptionally large for even modest number of candidates and voters.

# Final remarks

Note that impartial culture models of voters do not sample this space uniformly, as there are many ballot combinations which produce identical elections due to the exchange symmetry between voters casting the same ballot. If there are more ballots than voters, the impartial culture model would on average split the voters into as many groups as there are voters, each voter casting a unique ballot. Due to strong correlations between voters and candidates in real-life elections, most possible ballots are not expected to occur. The structure outlined here can be used to develop alternative sampling models which are agnostic to specific models of utility or voter distributions.