Assess a Distribution and Derive Coin-Toss Expectations
CargurusData Scientist · Technical ScreenLast updated
This problem tests the ability to distinguish between Bernoulli and Binomial processes, calculate expected values and variances, and validate model assumptions based on observed sample data.
Part 1: Coin Toss Modeling
You are given a sequence of 100 independent coin flips, where 65 resulted in 'Heads'.
- Calculate the Maximum Likelihood Estimate (MLE) for the probability of landing Heads, denoted as
p_hat. - If this coin were tossed 10 times, what is the expected number of Heads? Provide the variance of this distribution.
- Identify the specific distribution being used and state the underlying assumptions required for this model to be valid.
Part 2: Distribution Diagnostics
You receive a new dataset containing 1,000 observations of the number of 'Heads' occurring in batches of 10 tosses each. Upon inspection, the sample mean is 5.0, but the sample variance is 9.0.
- Does this data follow a standard Binomial distribution? Why or why not?
- If the Binomial model fails to describe the variance, what phenomenon does this suggest, and how would you adjust your modeling approach to account for it?
Constraints & Considerations
- Assume the coin tosses in Part 1 are independent and identically distributed (i.i.d).
- For Part 2, justify your reasoning using the properties of the Binomial distribution
Var(X) = n * p * (1 - p). - Consider edge cases: What happens if the sample size in Part 1 was only 2 flips?
Hints
Hint 1
Recall that for a Binomial distribution with parameters n and p, the mean is n*p and the variance is n*p*(1-p).
Hint 2
Compare the calculated variance of a Binomial distribution (given the mean) against the observed variance of 9.0 in Part 2.
Hint 3
When variance exceeds the mean in count data, consider looking into overdispersion models like the Beta-Binomial distribution.
Follow-up questions
- How would you conduct a formal hypothesis test to determine if the coin is fair?
- If the coin flips were not independent (e.g., a 'streak' effect), how would that impact your variance calculation?
- How does the choice of a prior distribution in a Bayesian framework influence the estimation of p when the sample size is very small?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.