cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A224711 Number of ballot results from n voters that prompt a run-off election when three candidates vie for two spots on a board.

Original entry on oeis.org

1, 0, 6, 6, 18, 90, 150, 420, 1890, 3570, 10206, 42966, 87318, 252252, 1019304, 2172456, 6319170, 24810786, 54712086, 159906318, 614406078, 1390381278, 4077926034, 15403838346, 35579546262, 104633453340, 389788932240, 915500037120, 2698033909680, 9934966920960
Offset: 0

Views

Author

Dennis P. Walsh, Apr 29 2013

Keywords

Comments

We assume each of n voters cast two votes, one each for two of three candidates. A run-off election is necessitated if all 3 candidates receive the same number of votes or if there is a tie for the second to most votes. The total number of ballot results is 3^n since each voter must choose two of three candidates. The number of ballot results that necessitate a run-off election is derived in the note "The probability of a run-off election.." cited in the link section below.
The sequence A103221 is used in the derivation. Note that we assign the value 1 to a(0) because if no voters cast ballots on election day another election is needed.

Examples

			For n=3, a(3)=6 since a three voter election has 6 possible ballot results that necessitate a run-off. Let A, B, and C denote the three candidates, and, for example, let [AB|AC|BC] denote a ballot result in which voter 1 votes for candidates A and B, voter 2 votes for candidates A and C, and voter 3 votes for candidates B and C. The 6 ballot results that necessitate a run-off election are then given by [AB|AC|BC], [AB|BC|AC], [AC|AB|BC], [AC|BC|AB], [BC|AB|AC], and [BC|AC|AB].
		

Programs

  • Maple
    ind:= n-> piecewise(n mod 3=0, 1, 0):
    u:= n-> floor(n/2+1)-floor(n/3+2/3)-1:
    a:= n-> 3*add(binomial(n, 2*ceil((n-1)/2)-2*k)*
            binomial(2*ceil((n-1)/2)-2*k, ceil((n-1)/2)-k), k=0..u(n))
            -ind(n)*2*binomial(n, 2*n/3)*binomial(2*n/3, n/3):
    seq(a(n), n=0..30);

Formula

a(n) = 3*sum(C(n,2*b(k)) *C(2*b(k),b(k)), k=0..u(n)) -2*C(n,2n/3) * C(2n/3,n/3) I[3|n] where b(k) = ceiling((n-1)/2)-k, u(n) = floor((n+2)/2) - floor((n+2)/3)-1 = A103221(n)-1, and I[statement] equals 1 if the statement is true and equals 0 otherwise.