As an example, consider a two candidate election between
Coke and
Pepsi, as illustrated in the preceding diagram. The order of the letters beside the candidates' names could be A and then B, or B and then A. We will call this ordering P_1, and let P_1=0 for the former ordering and P_1=1 for the latter. Therefore, P_1: order of symbols beside candidate list, :P_1\in\{0,1\}=\{\mbox{AB},\mbox{BA}\}\,. Likewise we can generalize for other parts of a ballot: P_2: order of symbols through the holes, :P_2\in\{0,1\}=\{\mbox{AB},\mbox{BA}\}\,. P_3: which hole is marked, :P_3\in\{0,1\}=\{\mbox{1st},\mbox{2nd}\}\,. R: result of the ballot, :R\in\{0,1\}=\{\mbox{Coke},\mbox{Pepsi}\}\,. Note that the order of the candidates' names are fixed across all ballots. The result of a ballot can be calculated directly as, :R = P_1 + P_2 + P_3\bmod 2\, (
Equation 1) However, when one layer of the ballot is shredded, either P_1 or P_2 is destroyed. Therefore, there is insufficient information to calculate R from the receipt (which is scanned). In order to calculate the election results, an electronic
database is used. Before the election, the database is created with a series of columns as such. Each row in the database represents a ballot, and the order that the ballots are stored in the database is
shuffled (using a
cryptographic key that each candidate can
contribute to). The first column, D_1, has the shuffled order of the serial numbers. D_2 contains a pseudorandom
bitstream generated from the key, and it will act as a
stream cipher. D_3 will store an intermediate result. D_4 contains a bit such that: :D_2 + D_4 = P_1 + P_2 \bmod 2\, The result of each ballot will be stored in a separate column, R, where the order of the ballots will be reshuffled again. Thus D_5 contains the row number in the R column where the result will be placed. After the election is run and the P_3 values have been scanned in, D_3 is calculated as: :D_3 = P_3 + D_2 \bmod 2\, And the result is calculated as, :R = D_3 + D_4 \bmod 2\, This is equivalent to equation 1, :\begin{align} R &= (D_3) + D_4 \bmod 2\\ &= (P_3 + D_2) + D_4 \bmod 2\\ &= P_3 + (D_2 + D_4) \bmod 2\\ &= P_3 + (P_1 + P_2) \bmod 2 \end{align} The result column is published and given the ballots have been shuffled (twice), the order of the results column does not indicate which result is from which ballot number. Thus the election authority cannot trace votes to serial numbers.
Generalized form For an election with n candidates, the above procedure is followed using
modulo-n equations. == Basic auditing procedures ==