Someone flips a coin 50 times and gets 50 heads in a row. You suspect it is a 2 headed coin. Write the null and alternative hypotheses. Use the binomial theorem to get a p-value of getting exactly 50 hears in 50 trials.

To write the null and alternative hypotheses in this scenario, we need to define the question being addressed statistically.

Null hypothesis (H₀): The coin is fair, and there is an equal probability of getting a head (H) or a tail (T) on each coin flip.
Alternative hypothesis (H₁): The coin is not fair, and there is a higher probability of getting a head on each coin flip.

Now, to calculate the p-value using the binomial theorem, we need to determine the probability of getting exactly 50 heads in 50 trials under the assumption that the coin is fair.

The binomial theorem states that the probability of obtaining k successes in n independent Bernoulli trials, where p is the probability of success in a single trial, is given by the binomial coefficient formula:

P(X = k) = C(n, k) * p^k * (1-p)^(n-k)

In this case, we substitute n = 50 (number of trials), k = 50 (number of successes), and p = 0.5 (probability of success for a fair coin).

Using this formula, we can calculate the p-value by summing the probabilities of all possible outcomes that are as extreme or more extreme than the observed outcome. In our case, we only have one observed outcome: 50 heads in 50 trials.

P(X ≥ 50) = P(X = 50) = C(50, 50) * 0.5^50 * (1-0.5)^(50-50)

Using the binomial coefficient C(50, 50) = 1, we can simplify the equation to:

P(X ≥ 50) = 0.5^50 ≈ 7.88 * 10^(-16)

Therefore, the p-value of getting exactly 50 heads in 50 trials, assuming the coin is fair, is approximately 7.88 * 10^(-16).

If this p-value is very small (commonly considered below a predetermined significance level, like 0.05), it suggests strong evidence against the null hypothesis and favors the alternative hypothesis that the coin is not fair.