In: Computer Science
A shipping pallet holds 10 boxes. Each box holds 300 parts of different types. The part weight is normally distributed with a mean of 1 lb and a standard deviation of 0.2 lb.
a. Compute the mean and standard deviation of the pallet weight.
b. Compute the probability that the pallet weight will exceed 3015 lb.
Program plan:
a. To find the mean and standard deviation of the pallet weight using matlab.
b. To compute the probability that the pallet weight will exceed 3015 lb.
Program:
%**********************************************************
%A matlab code is written to find the mean and standard
%deviation of the pallet weight in the ten boxes using
%matlab. The probability that the pallet weight will exceed
%‘3015 lb’ is found using matlab.
%**********************************************************
%Declaration of constant
mu=1;
%Declaration of constant
sigma=0.2;
%Computes the value
mu_pallet=10*300*mu;
%Display text
disp(\'The mean is \');
%Display value
disp(mu_pallet);
%Computes the value
sigma_pallet=sqrt(10*300*sigma^2);
%Displays text
disp(\'The standard deviation is\');
%Display value
disp(sigma_pallet)
%Computes the value
p=(1-erf((3015-mu_pallet)/(sigma_pallet*sqrt(2))))/2;
%Display text
disp(\'The probability of the pallet exceeding weight 3015lb is \')
%Displays value
disp(p);
Output:
>> Untitled
a.
The mean is
3000
The standard deviation is
10.9545
b.
The probability of the pallet exceeding weight 3015lb is
0.0855
a.
The mean is
3000
The standard deviation is
10.9545
b.
The probability of the pallet exceeding weight 3015lb is
0.0855