Weighted coin question and probability

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

FixMyIgnorance
Posts: 6
Joined: Thu Aug 18, 2011 5:02 pm UTC

Weighted coin question and probability

Postby FixMyIgnorance » Thu Aug 18, 2011 5:05 pm UTC

Disclaimer: I have already graduated from college -- this isn't a homework question.

I have always been curious about this:

Say I have a coin. I flip it, and it turns up heads. I flip it again -- heads. And again, heads. My question is how would we assess the "probability that this coin is weighted?"

If it were not weighted we could basically compare it against how confident we are in its convergence to 50% heads/tails, whereas for a weighted coin we'd compare it to 100% heads or something. But what is the statistical logic behind making this kind of claim?

For instance, say my question was "I flip a coin 6 times and get 6 heads. What is the probability it's a weighted coin?" How would I construct such a certainty threshold/probability?

User avatar
Qaanol
The Cheshirest Catamount
Posts: 3069
Joined: Sat May 09, 2009 11:55 pm UTC

Re: Weighted coin question and probability

Postby Qaanol » Fri Aug 19, 2011 4:08 am UTC

wee free kings

User avatar
ConMan
Shepherd's Pie?
Posts: 1690
Joined: Tue Jan 01, 2008 11:56 am UTC
Location: Beacon Alpha

Re: Weighted coin question and probability

Postby ConMan » Fri Aug 19, 2011 4:20 am UTC

If you don't want to go into Bayesian probabilities, you can still use a hypothesis test to compare against the null hypothesis that the coin is fairly weighted - which is, in a way, what you're talking about when you say "compare it against how confident we are in its convergence to 50% heads/tails". The rough set-up of the hypothesis test is to say "If this coin were fair, how likely is it that a result as unusual as three of the same in a row occurs?" and if the likelihood of that is fairly small, then we reject the null hypothesis - i.e., we conclude that it's unlikely the coin is fair.

You can also look at the level of weighting as being a parameter of the coin, and construct a maximum likelihood estimate of that parameter, to get a feel for where you might suspect that the coin's probability of showing heads lies.
pollywog wrote:
Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.
I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.

FixMyIgnorance
Posts: 6
Joined: Thu Aug 18, 2011 5:02 pm UTC

Re: Weighted coin question and probability

Postby FixMyIgnorance » Fri Aug 19, 2011 4:40 am UTC

Yes I know it would involve some sort of Bayesian probability or a null hypothesis test of sorts, but I never knew how to actually compute it

TheWaterBear
Posts: 118
Joined: Tue Jun 24, 2008 2:57 am UTC
Location: Atlanta, GA
Contact:

Re: Weighted coin question and probability

Postby TheWaterBear » Fri Aug 19, 2011 6:17 am UTC

FixMyIgnorance wrote:Yes I know it would involve some sort of Bayesian probability or a null hypothesis test of sorts, but I never knew how to actually compute it


Right, but that would imply that you test how weighted you believe the coin is weighted to begin with, as Conman pointed out.

GreedyAlgorithm
Posts: 286
Joined: Tue Aug 22, 2006 10:35 pm UTC
Contact:

Re: Weighted coin question and probability

Postby GreedyAlgorithm » Sat Aug 20, 2011 5:10 pm UTC

Edit: I didn't answer your 6-heads question, modified to "I flip a coin 3 times and get 3 heads. What is the probability it's a weighted coin?" instead.

Bayesian: start with your current belief, which for a random coin found in your change normally looks something like "the coin flips like a normal coin, landing heads with p=0.5 +- 0.001, with probability ~0.99995, and like a trick coin, landing heads say P(p)=1/sqrt(p(1-p)) the remaining 0.00005". Now we want int(P(trick,p=p*|HHH),p*=0..1), which is int(P(HHH|trick,p=p*)P(trick,p=p*)/P(HHH),p*=0..1)
P(HHH|trick,p=p*)=p*^3
P(trick,p=p*)=(0.00005)/sqrt(p*(1-p*))
int(x^3*0.00005/sqrt(x*(1-x)),x=0..1)= 0.0000490874

Divide by P(HHH) which is 0.99995*(1/2)^3+0.00005*int(x^3/sqrt(x*(1-x)),x=0..1)=0.125043 (and will be dominated by (1/2)^X for X heads in a row until about a dozen heads).

So after three heads, rather than a normal coin with probability 0.99995 you should think it's a normal coin with probability 0.9996.

After 10 heads? 1 - 0.000027677 / (0.000027677+0.0009765625) = 97.2%

After 15 heads? 1 - 0.0000226924 / (0.0000226924+0.000030517578125) = 57.4%

After 20 heads? 1 - 0.0000196932 / (0.0000196932+0.00000095367431640625) = 4.6%

For things this extreme, the quick and dirty solution is probably better: your prior says a 1 in 20000 chance of a trick coin, so you'll need an event of surprise about log2(20000)=14.28 coin flips in a row to make you consider the alternative.
GENERATION 1-i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.

User avatar
tomandlu
Posts: 1111
Joined: Fri Sep 21, 2007 10:22 am UTC
Location: London, UK
Contact:

Re: Weighted coin question and probability

Postby tomandlu » Sat Aug 20, 2011 6:46 pm UTC

What am I missing here? It will happen 1 in 32 times (1 in 64 if you pre-specify heads rather than just sitting down and immediately throwing 6 of a kind in a row). Isn't it then just a question of whether that probability makes you suspicious or not? It would probably make me wary if I was gambling, but I wouldn't convict anyone on it (IMHO convictions based on nothing more than probabilities are always unsafe - I'm not even sure why probabilities even feature in evidence).

What information beyond that can one work with? I'm being really thick, I'm afraid... can someone enlighten me as to why the answer is more complicated than that?
How can I think my way out of the problem when the problem is the way I think?

Tirian
Posts: 1891
Joined: Fri Feb 15, 2008 6:03 pm UTC

Re: Weighted coin question and probability

Postby Tirian » Sat Aug 20, 2011 7:10 pm UTC

It isn't more complicated than that.* You go into a hypothesis test with a notion of how unusual an sample has to be to make you reject the null hypothesis. If you want to convince yourself that a coin is weighted, you might choose a traditional alpha value of 0.05. This means that there is a 5% chance that you're rejecting the null hypothesis even though it's true because fair coins can have streaks. If you don't think a jury is going to be convinced at that level, then you choose a much smaller alpha value. But if you go too far, then you're going to cling to null hypotheses that aren't true. I assume that there is some sort of general notion of what sorts of mathematical confidences are stronger than "reasonable doubt", but I don't know what they are.

* Well, the solutions are more complicated for most of statistics, where you don't know the exact nature of the population distribution the way you do for an elementary binomial case like a coin flip. But it's the same base of starting with a null hypothesis, an alternative hypothesis, some statistic you can perform on the sample, and a critical value for that statistic that would make you reject the null hypothesis.

User avatar
gmalivuk
GNU Terry Pratchett
Posts: 26820
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

Re: Weighted coin question and probability

Postby gmalivuk » Sat Aug 20, 2011 8:22 pm UTC

tomandlu wrote:IMHO convictions based on nothing more than probabilities are always unsafe - I'm not even sure why probabilities even feature in evidence
Because probabilities are all we really have in the real world.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

User avatar
tomandlu
Posts: 1111
Joined: Fri Sep 21, 2007 10:22 am UTC
Location: London, UK
Contact:

Re: Weighted coin question and probability

Postby tomandlu » Sat Aug 20, 2011 9:42 pm UTC

gmalivuk wrote:Because probabilities are all we really have in the real world.


You are right of course... Thinking about it in depth, my real concern is when statistics are used not just to prove guilt, but to prove the existence of a crime.

The was a case here in the UK where a woman was convicted of murdering two children, since cot deaths only occurred in, say, 1 in 10,000. Therefore, argued the prosecution, it was a 10,000*10,000 chance that she hadn't murdered both children (or at least that's what the jury heard).
How can I think my way out of the problem when the problem is the way I think?

User avatar
Adam H
Posts: 1267
Joined: Thu Jun 16, 2011 6:36 pm UTC

Re: Weighted coin question and probability

Postby Adam H » Mon Aug 22, 2011 2:49 pm UTC

tomandlu wrote:The was a case here in the UK where a woman was convicted of murdering two children, since cot deaths only occurred in, say, 1 in 10,000. Therefore, argued the prosecution, it was a 10,000*10,000 chance that she hadn't murdered both children (or at least that's what the jury heard).
The defense should have had an easy retort. The correct question is 'assuming the kids are both dead, what is the probability that they both died of SIDS', and the 1 in 10,000 probability does not address that at all. The probability that they should have used would be the proportion of # of SIDS deaths to # of murders that looked like SIDS.

The prosecution must also prove that cot deaths of siblings are independent events uninfluenced by either genetics and caregiving.

So the problem isn't math. The problem is WRONG math. I agree that statistics are the 3rd sort of lie (lies and damned lies being the other 2). Probabilities, however, are absolute - only assumptions make them faulty.
-Adam


Return to “Mathematics”

Who is online

Users browsing this forum: No registered users and 11 guests