# Easy probability question (brain is failing me)

I'm getting a masters in pure math so my family assumes I know everything there is to know about numbers. My dad asked me about something he ran into at work...something straight out of freshman stats, and I didn't have a clue - it doesn't have enough delta and epilsons.

Imagine a widget factory. Every month they produce a truckload (population) of 3,300 widgets. If defective widgets are normally distributed, how many widgets must they examine to be 95% sure that **NO MORE THAN** 83 widgets (2.5% of the population) is defective? What is the answer? How does this generalize?

From another point of view, if the quality control widget guy decided that he only wanted to inspect 100 out of 3300 widgets, it would seem that he could be 95% certain that the total number of defects was bounded in some way. How does this work? What is the answer?

This sounds like a Z-test or T-test thing but since the population isn't set, I'm incredibly rusty, and Wikipedia is failing me on this one.

Related Set Theory, Logic, Probability, Statistics News on Phys.org
CRGreathouse
Homework Helper
From another point of view, if the quality control widget guy decided that he only wanted to inspect 100 out of 3300 widgets, it would seem that he could be 95% certain that the total number of defects was bounded in some way. How does this work? What is the answer?
It's actually not all that easy! See Interval Estimation for a Binomial Proportion.

I use the following code (in Pari) to construct what Brown, Cai, & DasGupta call the Agresti-Coull interval:
Code:
binomialIntervalAC(n,k,conf=.05)={
kappa=ierfc(conf/2)*sqrt(2);
kest=k+kappa^2/2;
nest=n+kappa^2;
pest=kest/nest;
};
I also use the Clopper-Pearson interval:
Code:
binomialIntervalCP(n:int,k:int,conf=.05)={
my(a,v,flip,result);
if (k==0, return([0, solve(p=0,1,(1-p)^n-conf)]));
if (k==n, return([solve(p=0,1,p^n-conf), 1]));

conf = conf/2;
if (k + k > n,
flip = 1;
k = n - k;
);
a = if (k*8 < n - 10, .5, 1);

v = vector(k+1,i,binomial(n,i-1));
result = [solve(p=0,.5,1-conf-sum(i=0,k-1,v[i+1]*p^i*(1-p)^(n-i))),
solve(p=0,a,sum(i=0,k,v[i+1]*p^i*(1-p)^(n-i))-conf)];

if(flip,[1 - result[2], 1 - result[1]], result)
};

I'm not so sure about the program the previous guy posted, but this seems like it could be solved using a normal approximation to the binomial distribution.

So we know that if something is normally distributed, then it has a mean and variance associated with it. However, in this case, we have only binomial trials we are dealing with (whether a widget is defective or not). You stated that the desired probability of finding a defective widget is 83/3300 or about 2.5%. So, let p=83/3300.

A binomial distribution has mean= n*p, where n is the number of trials (population of widgets) and p is the probability of the trial occurring (whether you choose a defective widget) and variance n*p*(1-p). We can use the central limit theorem, which you're probably familiar with, to justify our use of a normal approximation to this distribution.

So now, instead of our defective widgets having unknown mean and variance, these parameters are now defined.

Now, if we want to choose a sample such that we are 95% sure that no more than 83 of these widgets are defective then we look at the probability: P(D<83)= .95
Since, the trials are normally distributed, we look at a Z-table and find that
P{Z<(83-np)/[(np(1-p)/sqrt(n)]}= P{Z<(83-np)sqrt(n)/[np(1-p)]}= .95

Next, (using the Z-table) let Z=1.645=sqrt(n)(83-np)/[np(1-p)]. We know the value, for p (p=83/3300). Do a little bit of algebra and you should be good.

Hope this helps! (This is my first post by the way, so sorry if anything is a bit awry)