#include #include using namespace std; // A large elevator can transport a maximum of 9800 pounds. Suppose a // load of cargo containing 49 boxes must be transported via the // elevator. The box weight of this type of cargo follows a // distribution with a mean of mu = 205 pounds and a standard // deviation of sigma = 15 pounds. Based on this information, what is // the probability that all 49 boxes can be safely loaded into the // freight elevator and transported? // The central limit theorem (CLT) states that, for a large enough // sample (n), the distribution of the sample mean will approach normal // distribution. This holds for a sample of independent random // variables from any distribution with a finite standard deviation. // mu' (mean) = n * mu // sigma' (stddev) = sqrt(n) * sigma int main() { int n = 49 /* boxes */; int mean = n * 205 /* lbs */; // mu int stddev = sqrt(n) * 15 /* lbs */; // sigma // Probability P(X <= x) auto normalCDF = [](double x, double mean, double stddev) { double val = (x - mean)/(stddev * sqrt(2)); return 0.5 * (1 + (erf(val))); }; double answer_1 = normalCDF(9800 /* lbs */, mean, stddev); cout << fixed << setprecision(4) << answer_1 << endl; }