Voting Project Needs Python People

Alan Dechert adechert at earthlink.net
Sun Jul 27 14:15:15 EDT 2003


"Ian Smith" <iandjmsmith at aol.com> wrote in message
news:2dc49b63.0307240824.4e1b2136 at posting.google.com...


> There's a lot of assumed knowledge in this discussion. I know nothing
> about electronic voting systems, I know almost nothing about Python as
> a programming language but I do know how to calculate values
> associated with the cumulative binomial distribution. A Javascript
> (sorry!) calculator for the binomial distribution amongst others can
> be found at http://members.aol.com/iandjmsmith/EXAMPLES.HTM.
> Javascript can be converted to Java, C etc quite easily. I would
> imagine with my lack of knowledge of Python you'll probably be better
> off doing the conversion yourself.
>
> The code is quick and accurate and can handle large sample sizes and
> very small probabilities which you probably need. There's even a
> calculator for the Hypergeometric distribution should you wish to do
> sampling without replacement calculations.
>
>
> Ian Smith
>
> P.S. the calculation of 70 is fine. If you don't want to calculate
> anything much more difficult then you probably don't need a calculator
> anyway.
>
Thanks, Ian.  I could not quite figure out if your binomial distribution
calculator would be applicable.

Here's what Bill Buck ( billbuck at cox.net ) sent me.  It turns out there is a
BINOMDIST function in Excel.  I think it might be what I want.

http://home.earthlink.net/~adechert/LOTAcceptanceCalculator.xls

Let me try to clarify what I'm after.  The paper record should always match
the electronic record.  So the allowable defects is zero.  If there is a
mismatch found in the sample, we don't publish the electronic tally: we take
all the paper ballots and check them.

We are talking about an election conducted with computer-generated paper
ballots.  The paper ballots represent the actual vote since these ballots
are what voters actually saw, verified, and cast.  We will have an
electronic record obtained from the computers which should match each paper
ballot generated.  We want to use the electronic record since it will give
us an instant result -- but we have to check it against the paper ballots to
be sure the election result is correct.  So, in this scenario, the
electronic count is a prediction (or preliminary tally).

So, if by the preliminary electronic tally a candidate won a race by 1
percent, I want to know how many ballots we have to check (random sample) to
be certain that the result predicted is true.

When I put one million into this Confidence Level Calculator, and Acceptable
Quality Level of .01, a sample of 10,000 shows a confidence level of "1."  A
sample of 2000 give C.L of 0.999999998  Presumably, "1" is really
.9999999999+ more 9s.  Can we get more decimal places?

So I guess the Lot Fraction Defective is analgous to the predicted victory
margin.  Is that right?

I would still like a standalone calculator that doesn't require Excel.

Alan Dechert






More information about the Python-list mailing list