Here's a problem I thought of that I don't know how to approach: You have a fair coin that you keep

gorgeousgen9487

gorgeousgen9487

Answered question

2022-07-14

Here's a problem I thought of that I don't know how to approach:
You have a fair coin that you keep on flipping. After every flip, you perform a hypothesis test based on all coin flips thus far, with significance level α, where your null hypothesis is that the coin is fair and your alternative hypothesis is that the coin is not fair. In terms of α, what is the expected number of flips before the first time that you reject the null hypothesis?
Edit based on comment below: For what values of α is the answer to the question above finite? For those values for which it is infinite, what is the probability that the null hypothesis will ever be rejected, in terms of α?
Edit 2: My post was edited to say "You believe that you have a fair coin." The coin is in fact fair, and you know that. You do the hypothesis tests anyway. Otherwise the problem is unapproachable because you don't know the probability that any particular toss will come up a certain way.

Answer & Explanation

sniokd

sniokd

Beginner2022-07-15Added 22 answers

EDIT: This answer was unclear for OP at first, so I tried to make it clearer through a new approach. Apparently it arose another legitimate doubt, so I tried now to put both answers together and clarify them even more. (Still I might be wrong, but I'll try to express myself better)
What you look for, is the expected number of tosses before we do a Type I error (rejecting H 0 when it was true). The probability of that is precisely α (that's another way to define it).
So P ( T y p e   I   e r r o r ) = α
Let X n be the event of rejecting n t h test.
Now, E [ X 1 ] = α stands for the expected number of games (a game is starting to test in the way we do a new coin) where H 0 was rejected on the first throw. E [ X 1 + X 2 ] = E [ X 1 ] + E [ X 2 ] is the expected number of games where H 0 is rejected either on the first or the second throw. Note that with most α this will be lower than 1, so the expectation for a single game is not to reject H 0 yet.
When do we expect to have rejected H 0 ? Precisely when the number of expected games in which we reject H 0 is 1. Therefore, we look for n such as
E [ X 1 + X 2 + . . . + X n ] = 1 E [ X 1 + X 2 + . . . + X n ] = E [ n X 1 ] = n E [ X 1 ] = n α = 1 n = 1 α
The other answer goes like this: Let the variable T count the number of tests before rejecting one. We look for E[T].
Also, using previous notation, P ( X n ) = α ( 1 α ) n 1 (I'm aware this implies independence between the events X n and X n 1 but since I'm looking for the expected value, for the linearity of the Expected Value, it shouldn't be a problem, though I'm aware I'm not being polite with notation).
E [ T ] = n = 1 n P ( X n ) = n = 1 n α ( 1 α ) n 1 = α n = 1 n ( 1 α ) n 1 = α n = 0 ( n + 1 ) ( 1 α ) n = α ( n = 0 n ( 1 α ) n + n = 0 ( 1 α ) n ) = α ( 1 α α 2 + 1 α ) E [ T ] = 1 α

Do you have a similar question?

Recalculate according to your conditions!

New Questions in College Statistics

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?