Re: Setting up a probability problem

*To*: mathgroup at smc.vnet.net*Subject*: [mg22177] Re: [mg22150] Setting up a probability problem*From*: Daniel Lichtblau <danl at wolfram.com>*Date*: Thu, 17 Feb 2000 01:24:10 -0500 (EST)*References*: <200002160735.CAA18039@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Ron Lenk wrote: > > I'm having trouble figuring out the mathematical formulation of this > problem. I have n events, each of which has probability P (say 20%) > of occurring at any given time. How large does n need to be in order > to give me a confidence level c (say 90%) that I have m (say 5) events > occurring simultaneously? Help in clarifying my thinking would be > appreciated. I'll change the language a bit to be more in accordance with standard terminology (as best I remember it). We'll refer to n "trials" (or experiments) for each of which we might have a "success." Regard time as being fixed at some given instant, so it is not part of the formulation. (i) What is the probability that exactly the first 5 trials are successes and the rest not? It is (1/5)^5 * (4/5)^(n-5). (ii) What is the probability that we have exactly 5 successes, not necessarily from the first five trials? Just notice that there are Binomial[n,5] ways to pick the 5 successful experiments from among the n trials, and each has the same probability as in (i) above. So we get Binomial[n,5]*(1/5)^5*(4/5)^(n-5) (iii) What is the probability that we have at least 5 successes from n trials? It is the sum of probabilities that we have exactly five successes, exactly six successes, etc. (this is because these are all mutually exclusive events). Let us set up a function that is slightly more general, in that various parameters are now given as variables rather than hard-wired constants. We are given that the probability of a trial being successful is some value, "ev." We want to find the probability of at least "min" successes from among n trials. Then we have probm[n_,ev_,min_] := Sum[Binomial[n,j]*ev^j*(1-ev)^(n-j), {j,min,n}] Last, we want to find the value of n for which this probability is equal to 9/10 (more correctly, we want the smallest integer value of n for which the probability meets or exceeds 9/10). We do this using a root-finder. In[79]:= probm[n_,ev_,min_] := Sum[Binomial[n,j]*ev^j*(1-ev)^(n-j), {j,min,n}] In[80]:= FindRoot[probm[m,1/5,5]==9/10, {m,6}] Out[80]= {m -> 37.8877} This tells us we'll need 38 trials in order to guarantee a probability of at least 90% that we obtain at least 5 successes. To code this a bit more generally, we allow the threshhold probability (your "confidence level" c) for our m successes to be given as a parameter. minTrials[conf_,ev_,min_] := Ceiling[m /. First[FindRoot[probm[m,1/5,5]==conf, {m,6}]]] In[84]:= minTrials[9/10,1/5,5] Out[84]= 38 Daniel Lichtblau Wolfram Research

**References**:**Setting up a probability problem***From:*"Ron Lenk" <Ron.Lenk@fairchildsemi.com>

**Re: Contour curves & sections onto a surface**

**Re: solving third order equation: bad result**

**Setting up a probability problem**

**Re: Setting up a probability problem**