Skip to content

Practice: Counts and trials: the binomial distribution

The skills: checking whether a situation is really binomial, computing the chance of exactly k successes, using the n-times-p shortcut, and handling “at least” with a complement. Keep a scratchpad.

Six short questions. Answer each in your head before opening the collapsible.

1. What four conditions make a situation binomial?

Show answer

A fixed number of trials n; each trial has two outcomes (success/failure); a constant success probability p; and the trials are independent. If any fails (p drifts, or trials influence each other), the simple binomial does not apply.

2. In the formula P(exactly k) = C(n,k) x p^k x (1-p)^(n-k), what does each piece do?

Show answer

p^k is the probability of the k successes; (1-p)^(n-k) is the probability of the (n-k) failures; C(n,k) counts how many ways the k successes can be arranged among the n trials. You multiply the chance of one arrangement by the number of arrangements.

3. What is the expected number of successes, and why?

Show answer

E[X] = n x p. With n trials each succeeding a fraction p of the time, you expect n times p successes on average. Five predictions at 80% accuracy gives an expected 4 correct. It is a long-run average, not a guarantee for any single run.

4. Why is “exactly k” different from “at least k”?

Show answer

The formula gives exactly k. “At least k” means k or more, so you must add the probabilities of k, k+1, …, up to n, or use a complement. “At least one” is easiest as 1 - P(zero) = 1 - (1-p)^n.

5. What does C(n, k) represent?

Show answer

The number of ways to choose which k of the n trials are the successes (“n choose k”). For 3 coin flips with 2 heads, C(3,2) = 3, because the 2 heads can land as HHT, HTH, or THH. Dropping this factor undercounts the probability.

6. How is a model’s accuracy a binomial count?

Show answer

On a test set of n examples, the number correct is a binomial count: n trials, each correct with probability p (the model’s true accuracy), assumed independent. This is why accuracy on a small test set is noisy and why estimating confidence in it (the next phase) is a binomial question.

Try it yourself: compute the binomial probability

Section titled “Try it yourself: compute the binomial probability”

A service makes 4 independent API calls. Each succeeds with probability 0.9.

1. What is the probability that exactly 3 of the 4 calls succeed?
2. What is the expected number of successful calls?
Show answer
1. n = 4, p = 0.9, k = 3:
C(4, 3) = 4 (the one failure could be any of the 4 calls)
P(exactly 3) = 4 x (0.9)^3 x (0.1)^1
= 4 x 0.729 x 0.1
= 0.2916 (about 29%)
2. E[X] = n x p = 4 x 0.9 = 3.6 successful calls on average.

Note the expected value is 3.6, even though any single run gives a whole number of successes (0 to 4).

Try it yourself: is it binomial, and an “at least one” question

Section titled “Try it yourself: is it binomial, and an “at least one” question”
A. Is this binomial? Drawing 5 cards from a deck WITHOUT replacement and
counting the hearts.
B. Is this binomial? A fixed 10-question true/false quiz answered by random
guessing, counting the number correct.
C. Using the API service above (4 calls, each succeeds with probability 0.9),
what is the probability that AT LEAST ONE call fails?
Show answer
  • A: not binomial. The trials are not independent and p is not constant: removing a card changes the chance the next is a heart. (This needs the dependent-event tools, not the binomial.)
  • B: binomial. Fixed n = 10, two outcomes (right/wrong), constant p = 0.5 per question under random guessing, independent guesses. All four conditions hold.
  • C: use the complement. “At least one fails” is the opposite of “all succeed.”
    P(all 4 succeed) = (0.9)^4 = 0.6561
    P(at least one fails) = 1 - 0.6561 = 0.3439 (about 34%)
    Reaching for the exact-k formula here would be the wrong tool; the complement is one step.

Eight cards. Click any card to reveal the answer. Use the Print flashcards button to lay out the full set as one card per page for offline review.

Q. What four conditions define a binomial situation?
A.

Fixed number of trials n; two outcomes per trial (success/failure); constant success probability p; independent trials. If any fails, the simple binomial does not apply.

Q. State the binomial probability formula for exactly k successes.
A.

P(exactly k) = C(n,k) x p^k x (1-p)^(n-k): the number of arrangements times the chance of one arrangement (k successes and n-k failures).

Q. What does C(n, k) count?
A.

The number of ways to choose which k of the n trials are the successes (‘n choose k’). For 3 flips with 2 heads, C(3,2) = 3 (HHT, HTH, THH).

Q. What is the expected number of successes in a binomial?
A.

E[X] = n x p. Five predictions at 80% accuracy gives an expected 4 correct. A long-run average, not a guarantee for one run. (Variance is n x p x (1-p).)

Q. P(exactly 2 heads in 3 fair coin flips)?
A.

C(3,2) x (0.5)^2 x (0.5)^1 = 3 x 0.125 = 3/8 = 0.375. Confirmed by listing: HHT, HTH, THH out of 8 equally likely outcomes.

Q. How do you handle 'at least one success'?
A.

Use the complement: P(at least one) = 1 - P(zero) = 1 - (1-p)^n. Far easier than summing the probabilities of 1, 2, …, n successes.

Q. Why is a model's accuracy a binomial count?
A.

Correct predictions on n test examples = n trials, each correct with probability p (the true accuracy), assumed independent. So accuracy on a small test set is noisy, and its confidence is a binomial question.

Q. What happens to a binomial as n gets large?
A.

Its bar chart smooths toward the normal bell curve (the normal approximation). This is a first glimpse of the central limit theorem in the next phase.