MPD78
10-06-2009, 08:53 AM
Hello all,
In Jay L. Devore's book "Probability and Statistics for Engineering and the Sciences" 3rd Edition, there is a set of tables for the cumulative binomial probabilites and numerous other probabilities.
Can the Binomialdev::dev() function be used to recreate the cumulative binomial probabilities table?
For example,
(This is a paraphrased version of Example 3.31 on page 108 of Devore's book.)
20% of all copies of a textbook fail a binding strength test. There are 15 randomly selected copies that fail. X has a binomial distribution with n=15 and p=0.2.
Find the probability that at most 8 fail.
Soution
From the tables with x = 8, n=15, and p=0.2 the probability is 0.999.
Here is my attempt.
#include "ran.h"
Int pause; // Dummy variable to keep the output screen visible
Int myans; // binomial deviates answer
int main()
{
Binomialdev mybinomial(15,0.2,8);
myans = mybinomial.dev();
cout << myans << endl;
cin >> pause;
return 0;
}
Obviously, I have something incorrect because the return type of dev() is an Int when I am looking for a Doub return type. Correct?
Also, the returned answer is 7 not 0.999.
I think I am off in space cadet camp ...
Any help would be appreciated.
Thanks
Matt
In Jay L. Devore's book "Probability and Statistics for Engineering and the Sciences" 3rd Edition, there is a set of tables for the cumulative binomial probabilites and numerous other probabilities.
Can the Binomialdev::dev() function be used to recreate the cumulative binomial probabilities table?
For example,
(This is a paraphrased version of Example 3.31 on page 108 of Devore's book.)
20% of all copies of a textbook fail a binding strength test. There are 15 randomly selected copies that fail. X has a binomial distribution with n=15 and p=0.2.
Find the probability that at most 8 fail.
Soution
From the tables with x = 8, n=15, and p=0.2 the probability is 0.999.
Here is my attempt.
#include "ran.h"
Int pause; // Dummy variable to keep the output screen visible
Int myans; // binomial deviates answer
int main()
{
Binomialdev mybinomial(15,0.2,8);
myans = mybinomial.dev();
cout << myans << endl;
cin >> pause;
return 0;
}
Obviously, I have something incorrect because the return type of dev() is an Int when I am looking for a Doub return type. Correct?
Also, the returned answer is 7 not 0.999.
I think I am off in space cadet camp ...
Any help would be appreciated.
Thanks
Matt