aez-notes

Catching the Greedy Counterfeiter

The king's minter boxes his coins n to a box. Each box contains m false coins. The king suspects the minter and randomly draws 1 coin from each of n boxes and has these tested. What is the chance that the sample of n coins contains exactly r false ones?

Each box presents a Bernoulli trial with probability \(m/n\) of success. There are \(n\) independent replicates of this so we have a binomial sample with \(n\) trials each with probability \(m/n\) of success. We want the probability that there are \(r\) successes

load(distrib)$

f(x) := pdf_binomial(x,n,m/n);

print(f(r));
/* binomial(n,r) (m/n)^r (1 - m/n)^(n-r) */

Author: Alex Zarebski

Created: 2022-04-15 Fri 12:29

Validate