# two types of coins, decide which type it is based on 100 flips

I have two types of coins, one is fair(0.5 chance to fall on H), and the other is biased(0.7 chance for H). I have a coin, and I need to determine, based on a 100 flips - which type is my coin. the hypothesis is that the coin is fair only if it fell on heads no more than 62 times out of 100. what are the chances that I got to the wrong conclusion and the coin is fair? what are the chances I got to the wrong conclusion and the coin is unfair?

I tried to calculate the chances but I got some prety ugly numbers...

• Can you lay out your calculations? – bi_scholar Apr 11 '19 at 10:22
• I am trying but still can't get how to write math equations here...sorry. in words: sum K from 0 to 62 of: 100 choose k * 0.5^k * 0.5^100-k.(for the first part) – Benaya Trabelsi Apr 11 '19 at 10:36
• "the hypothesis is that the coin is fair only if it fell on heads no more than 62 times out of 100. " This is a strange and unclear hypothesis. What do you mean with this sentence? Maybe you meant something like "the decision rule is to accept the hypothesis that the coin is fair when it fell on heads no more than 62 times out of 100" – Sextus Empiricus Apr 11 '19 at 12:40
• "what are the chances that I got to the wrong conclusion and the coin is fair?" You can not compute this with the given information. Did you maybe mean "what are the chances that I got to the wrong conclusion if the coin is fair?" – Sextus Empiricus Apr 11 '19 at 12:44
• yes martin, sorry about my wording. – Benaya Trabelsi Apr 15 '19 at 14:51

Based on your comment, you're nearly correct for the first one, you just need to subtract the value from $$1$$ since for having wrong decision if the coin is fair you need $$>62$$ heads (let $$W$$ be having the wrong decision, $$F$$ be the fact that coin is fair, and $$X$$ be the number of heads appeared): $$P(W|F)=1-P(X\leq62|F)=1-\sum_{k=0}^{62}{100 \choose k}0.5^k0.5^{100-k}$$
Replicating the analysis for the unfair case: $$P(W|F')=1-P(X>62|F')=1-\sum_{k=63}^{100}{100 \choose k}0.7^k0.3^{100-k}$$
Note: Your seem to ask for "having wrong decision and the coin is fair" for the first one (same situation for your second question), which means $$P(W\cap F)$$, not $$P(W|F)$$ as found above. So, if you need $$P(W\cap F)=P(W|F)P(F)$$, you need to use $$P(F)$$, which you didn't provide.