From Steven Pratt, a real-life electoral problem:

In Steven’s hometown, 11 fine folks are running in a primary for three at-large seats on the City Commission. Each voter may vote for up to three candidates. This election will reduce the field of candidates from 11 to six.

  1. How many different (legal) ways may a voter cast his or her ballot?
  2. How many different outcomes (excluding ties) are there for who advances to November’s general election?

In [1]:
from scipy.special import binom

In [8]:
binom(11,3) + binom(11,2) + binom(11,1) + binom(11,0)


Out[8]:
232.0

1

232 different possible ballots


In [5]:
binom(11,6)


Out[5]:
462.0

2

462 possible outcomes