Estimating the number of US males taller than the average NBA player. To estimat
ID: 3877266 • Letter: E
Question
Estimating the number of US males taller than the average NBA player. To estimate the number of US males taller than thresholdHeight (inches) Assign maleHeightSample with 1000000 normally distributed samples with mean maleHeightMean and standard deviation maleHeightStdDev Assign percentage Taller with the percentage of samples in maleHeightSample taller than thresholdHeight Assign male TallerHeight with an estimate of the number of US males taller than thresholdHeight by multiplying maleUSpopulation h percetangeTaller Your Function save C Reset MATLAB Documentation 1 function maleTallerHeight - EstimateTallMales( thresholdHeight) 2% EstimateTal!Males: Estimate number of U.S. males taller than input height 3% Inputs: thresholdHeight - height threshold 4% Outputs : maleTallerheight - estimated number of U.S. males taller than 51% threshold height 71 maleHeightMean maleHeightStdDev=6.01; %(in.) maleUSpopulation = 119.4; % millions 69.3; % (in.) 1e % Initialize random number generator 12 rngdefault'); 13 14 % Assign maleHeightSample with 1000000 normally distributed samples with 15 % mean maleHeightMean and standard deviation maleHeightStdDev 16 17 maleHeightSample=1; % FIXME 19 28 21 % Assign percentageTaller with the percentage of samples in maleHeightSample % taller than thresholdHeight percentageTaller = 0.10; % FIXME % Assign maleTallerHeight with an estimate of the number of US males taller 23 % than thresholdHeight by multiplying maleUSpopulation with percetangeTaller 241 maleTallerheight=1; % FIXME 25 26 end 27Explanation / Answer
Answer :
% The "FIXME" part has been solved as per your requirement.
% Following will be the code :
function maleTallerHeight = EstimateTallMales(thresholdHeight)
maleHeightMean = 69.3;
maleHeightStdDev = 6.01;
maleUSpopulation = 119.4;
rng('default');
% Initialised random number generator
maleHeightSample = normrnd(maleHeightMean, maleHeightStdDev,[1 1000000]);
% Create row vector of size 1000000 containing normally distributed height data
percentageTaller = sum(maleHeightSample > thresholdHeight)*100/1000000;
% Calculate the percentage
maleTallerHeight = sum(maleHeightSample > thresholdHeight);
% Calculate the number of males above threshold
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.