[Math] How to determine if coin comes up heads more often than tails

probability

Not a math student, so forgive me if the question seems trivial or if I pose it "wrong". Here goes…

Say I'm flipping a coin a n times. I am not sure if it's a "fair" coin, meaning I am not sure if it will come up heads and tails each with a propability of exactly 0.5. Now, if after n throws it has come up heads exactly as many times as it has come up tails, then obviously there's nothing to indicate that the coin is not fair. But my intuition tells me that it would be improbable even for a completely fair coin to come up with heads and tails an exact even number of times given a large amount of tosses. My question is this: How "off" should the result be for it to be probable that the coin is not fair? IOW, how many more tosses should come up heads rather than tails in a series of n throws before I should assume the coin is weighted?

Update

Someone mentioned Pearson's chi-square test but then for some reason deleted their answer. Can someone confirm if that is indeed the right place to look for the answer?

Best Answer

Given your prefatory comment, I'm going to avoid talking about the normal curve and the associated variables and use as much straight probability as possible.

Let's do a side problem first. If on a A-D multiple choice test you guess randomly, what's the probability you get 8 out of 10 questions right?

Each problem you have a 25% (.25) chance of getting right and a 75% (.75) chance of getting wrong.

You want to first choose which eight problems you get right. That can be done in 10 choose 8 ways.

You want .25 to happen eight times [$(.25)^8$] and .75 to happen twice [$(.75)^2$]. This needs to be multiplied by the possible number of ways to arrange the eight correct problems, hence your odds of getting 8 out of 10 right is

${10 \choose{8}}(.25)^8(.75)^2$

Ok, so let's say you throw a coin 3000 times. What's the probability that it comes up heads only 300 times? By the same logic as the above problem that would be

${3000 \choose{300}}(.5)^{300}(.5)^{2700}$

or a rather unlikely 6.92379... x 10^-482.

Given throwing the coin n times, the probability it comes up heads x times is

${n \choose{x}}(.5)^n$

or if you want to ask the probability it comes up heads x times or less

$\sum_{i=0}^{x}{{n \choose{i}}(.5)^n}$

so all you have to do is decide now how unlikely are you willing to accept?

(This was a Binomial Probability if you want to read more and all the fancier methods involving an integral under the normal curve and whatnot start with this concept.)