A Voting Problem

by Alicia Morelli

Suppose Peter won an election over Paul. If Peter received P votes, and Paul received Q votes, what is the probability that Peter, the winner, was always ahead throughout the counting of the votes?

To see one simulated election enter 1 in the Simulation input area.
Multiple elections can be simulated by entering a number larger than 1 in the Simulation input area.

The progression of the line shows the number of votes by which Peter is ahead. If the line dips below the x axis then Peter is no longer leading the election.




ElectionSimulator.java
ElectionSimulatorApplet.java
Graph.java