Voting: probability of outcome flip Assume you have a set of $N$ persons who should vote in a poll "for" or "against" an issue. The outcome of the poll is taken with simple majority.
Each person's vote is independent of the rest and has a probability $p$ of voting "for" and $1-p$ of voting against. The value of $p$ is the same for every voter.
Assume now that $n<N$ persons have already voted and $N-n$ are still to vote. You know their $n$ votes, and the partial poll outcome is "for", with a ratio of $r = n_{for}/n > 0.5$. You don't know, however, the true value of $p$.
The question is, which is the probability that the outcome of the poll will change to "against" with the remaining $N-n$ votes?
So far I only have intuitions like:


*

*The probability should be lower the larger is $n$

*The probability should be lower the farther is $r$ from $0.5$

*The probability is zero once $n_{for} > N/2$


But I need an expression for that probability... Any ideas?, I have ran out of them for sure...
 A: I was thinking about this and I think I have an answer for you:
Consider the probability of getting $n_{for}$ votes out of $n$ observations with our base assumption of independence. For a given $p$ the probability of such an observation is:
$P(p)=$$\frac{\Gamma (n+2)}{\Gamma (n_{for}+1) \Gamma (n-n_{for}+1)}$$p^{n_{for}}(1-p)^{n-n_{for}}$
We then proceed to calculate the probability by summing over all possible states. As you guessed there is an edge case where we have $n_{for}>N/2$ or $n-n_{for}>N/2$ where our vote is already decided. If we aren't in such a case we can evaluate the sum/integral:
$\sum_{i=Ceiling(N/2)-n_{for}} ^{N-n} \int_0 ^1 dp (P(p) \binom{N-n}{i} (p)^i (1-p)^{N-n-i})$
Evaluating the integral yields:
$\sum_{i=Ceiling(N/2)-n_{for}} ^{N-n} \frac{\Gamma (n+2) \Gamma (i+n_{for}+1) \Gamma (N-n+1) \Gamma (-i+N-n_{for}+1)}{\Gamma (i+1) \Gamma (N+2) \Gamma (n_{for}+1) \Gamma (n-n_{for}+1) \Gamma (-i+N-n+1)}$
And finally using a computer I was able to get the following expression: 
$\frac{\pi  \Gamma (n+2) \Gamma \left(\left\lceil \frac{N}{2}\right\rceil +1\right) \Gamma (N-n+1) \, _3\tilde{F}_2\left(1,\left\lceil \frac{N}{2}\right\rceil +1,-N+n-n_{for}+\left\lceil \frac{N}{2}\right\rceil ;\left\lceil \frac{N}{2}\right\rceil -N,-n_{for}+\left\lceil \frac{N}{2}\right\rceil +1;1\right)}{\Gamma (N+2) \Gamma (n_{for}+1) \Gamma (n-n_{for}+1) \Gamma \left(N-n+n_{for}-\left\lceil \frac{N}{2}\right\rceil +1\right)}$
where  $\tilde{F}$ is the regularized generalized hypergeometric function.
This would be the probability of not switching so subtract the above from 1 to get the probability of switching.
If we know p ahead of time then this is actually a trivial problem:
$\sum_{i=ceiling{N/2}-n_{for}} ^{N-n} p^i (1-p)^{N-n-i} \binom{N-n}{i} =$
$ p^{\left\lceil \frac{N}{2}\right\rceil - n_{for}} \binom{N-n}{\left\lceil \frac{N}{2}\right\rceil -n_{for}} (1-p)^{-\left\lceil \frac{N}{2}\right\rceil +N-n+n_{for}} \, _2F_1\left(1,-N+n-n_{for}+\left\lceil \frac{N}{2}\right\rceil ;-n_{for}+\left\lceil \frac{N}{2}\right\rceil +1;\frac{p}{p-1}\right)$
A: I don't know what you mean by switching. It could be the against side leading at some point during the count or the against side winning overall. This is for against winning overall. 
Just assume the remaining votes are binomial and the for side has a head start. 
$P(k > \frac{N}{2} - n_{against}|N-n,p)$
Case study: 
Total votes 
1,000,000
Pre-poll 
 200,000 total votes 
 150,000 for 
   50,000 against
Polling day 
  800,000 remaining votes
We need 450,000+ against votes on polling day for the against side to win overall. I'm assuming that $n_{for}$ is known and that the pre-poll numbers don't affect our inference on $p$. 
