# Easy probability question (brain is failing me)

• filter54321
In summary, the conversation discusses the calculation of sample size for a widget factory to be 95% sure that no more than 83 widgets (2.5% of the population) are defective. The solution involves using a normal approximation to the binomial distribution and finding the value of p (83/3300) to solve for the sample size. Two different methods, the Agresti-Coull interval and the Clopper-Pearson interval, are mentioned for calculating the sample size.
filter54321
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.

filter54321 said:
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)

## 1. What is probability?

Probability is a measure of the likelihood of an event occurring. It is expressed as a number between 0 and 1, where 0 indicates impossibility and 1 indicates certainty.

## 2. How do you calculate probability?

To calculate probability, divide the number of ways an event can occur by the total number of possible outcomes. This is known as the probability formula: P(A) = Number of favorable outcomes / Total number of possible outcomes.

## 3. What is the difference between theoretical and empirical probability?

Theoretical probability is based on mathematical calculations and assumes that all outcomes are equally likely. Empirical probability is based on actual observations or experiments and may vary from the theoretical probability.

## 4. What is the addition rule of probability?

The addition rule of probability states that the probability of two mutually exclusive events occurring is equal to the sum of their individual probabilities. In other words, if event A and event B cannot occur at the same time, the probability of event A or event B occurring is P(A) + P(B).

## 5. How can you use probability in real life?

Probability is used in various real-life scenarios, such as predicting the weather, making financial decisions, and analyzing data in scientific research. It can also be used to understand and make predictions about the likelihood of certain events, such as winning a game or getting a certain job.

Replies
7
Views
1K
Replies
4
Views
7K
Replies
4
Views
2K
Replies
6
Views
5K
Replies
2
Views
2K
Replies
21
Views
3K
Replies
1
Views
1K
Replies
6
Views
3K
Replies
1
Views
2K
Replies
5
Views
2K