Chebyshev's inequality to find minimum
I'm trying to solve this: In a factory, 5% of scrows are faulty (independently).
Each shipment contains 10K of scrows, and is eligible for a refund in case more than r scrows are faulty. Using Chebyshev's inequality, find the minimum value of r so that no more than 1% of shipments will be eligible for a refund.
So if X is the number of faulty scrows, then X~$B(10K, \frac {5} {100})$. It means $\mathbb E(X)=500$ and $var(X)=475$.
Now I'm not sure how to use chebyshev's inequality. Will $\mathbb P(|X-\mathbb E(X)|\geq r+1)$ give me what I need?
Thanks!
Solution 1:
I attempted this using Chebyshev's inequality, but didn't get the right answer. The right answer is $551$. I calculated it using the binomial distribution:
$$\text{Pr}(X \leq k) = \sum_{i=0}^\text{floor(k)} \frac {n! \space p^i (1-p)^{n-i}}{i!(n-i)!}$$ $$\text{Pr}(X \leq r) = \sum_{i=0}^\text{floor(r)} \frac {(10,000)! \space (0.05)^i (0.95)^{(10,000-i)}}{i!(10,000-i)!}$$ I computed this answer with wolfram alpha (in case it doesn't load, there's a picture at the end of this answer):
$\text{Pr}(X \leq r) > 0.99$ when $r$ is $551$.
(and it's $<0.99$ for $r=550$ and lower)
By a quick sanity check, we can already see that r will be at least $500$ (because on average, an order of $10,000$ screws will contain $5$% or $500$ faulty screws. Half (50%) of the orders will have more, half (50%) will have less; the problem asks for 99% to have less than r faulty screws).
Chebyshev's Inequality: $$P(|X-\mathbb E(X)|\geq a) \leq \frac {\text{Var}(X)}{a^2}$$
Of course, this will become (for the random variable $X$, $0 \leq X \leq 10,000$):
$$P(|X-500|\geq a) \leq \frac {\text{Var}(X)}{a^2}$$
We must compute $\text{Var}(X)$. This is easy, since we know each screw independently has a $5$% chance of being defective. In a form similar to the pythagorean theorem, the variance of a sum of random variables is the sum of their variances! So, find $\text{Var}(X)$ like so:
$$\text{Var}(\text{probability of defects in just one screw})=(\sum_i {p_ix^2_i}) - \mu^2$$ $$=(0.05)(1^2)+(0.95)(0^2) - (0.05^2)$$ $$=0.05-0.05^2=0.0475$$ Now, we multiply the variance of $r$($1$ screw) by $10,000$ to find the variance of $10,000$ screws: $$\text{Var}(X) = (0.0475)(10,000)=475 \text{ screws}^2$$
We would like the probability of $X$ being greater than $500$ to be less than or equal to $1$%. So,
$$\frac {\text{Var}(X)}{a^2} = 1\text{%} = 0.01$$
$$\frac {475}{a^2}=0.01$$ $$47,500=a^2$$ $$a=50\sqrt {19} \approxeq 217.9$$ EDIT: I realize now what the error was in my thinking: $a$ represents the distance from the mean that the random variable has a chance of being. I only care about the chance of the random variable being more than its mean, not less, so the number found by this method will be larger than necessary, but probably not exactly twice as large as necessary. Since the floor of $a$ is $217$, and $a$ is a distance from the mean ($500$), this means that Chebyshev's inequality gives: $$r \leq 717$$
which isn't exactly satisfying.