Find the Probability Two Muffins Are Sufficient
SIG (Susquehanna)Data Scientist · Online AssessmentLast updated
This problem tests binomial probability distributions and the cumulative probability of independent discrete events.
Problem Statement
A small café receives an average of 5 customer requests for muffins per morning. Assume that each customer independently decides whether to request a muffin with a probability of 0.5, and the café has a fixed capacity of 2 muffins per morning.
Calculate the probability that the café has enough muffins to satisfy all morning requests. That is, find the probability that the number of requests is 0, 1, or 2.
Constraints
- The number of customers is fixed at n = 5.
- The probability of a customer requesting a muffin is p = 0.5.
- Assume requests follow a Binomial distribution
B(n, p).
Example
If n = 2 and p = 0.5:
- P(0 requests) = 0.5^2 = 0.25
- P(1 request) = 2 * (0.5^1) * (0.5^1) = 0.5
- P(2 requests) = 0.5^2 = 0.25
- Total probability = 0.25 + 0.5 + 0.25 = 1.0
Provide your answer as a simplified fraction or a decimal rounded to three decimal places.
Hints
Hint 1
Recall the formula for the Binomial probability mass function: P(X=k) = C(n, k) * p^k * (1-p)^(n-k).
Hint 2
Calculate the individual probabilities for k=0, k=1, and k=2 using n=5 and p=0.5.
Hint 3
Sum the individual probabilities to find the cumulative probability P(X <= 2).
Follow-up questions
- How does the probability change if the number of customers increases to 10, while the capacity remains at 2?
- If the café wanted to ensure they can satisfy demand with at least 95% probability, what is the minimum number of muffins they should stock for 5 customers?
- How would the calculation change if the probability of a customer requesting a muffin was not constant (e.g., if early customers influence later ones)?
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.