Ass7

pdf

School

Alabama A&M University *

*We aren’t endorsed by this school

Course

101

Subject

Mechanical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

14

Uploaded by BailiffRock13777

Report
Ja’Reione Melton Engineering Programming Assignment 7 Alabama A&M University Dr. Gadalla ME 104-01
Q1 A. Define a bin of 20 pound each starting from 100 to 340 , find the frequency, relative frequency, scaled frequency histogram Y = input ('please enter raw data in bracket'); X = 100:20:340; hist(Y,X); ylabel ('Absolute frequency'); xlabel ('Strength'); title ('Absolute frequency for 20 tests'); % relative frequency Y1 = hist (Y,X)/38; figure(2) bar(X,Y1); ylabel ('Relative frequency'); xlabel ('Strength'); title ('Relative frequency for 20 tests'); % scaled frequency area = Y1*20; t_area = sum(area); Y_scaled = Y1/t_area; figure(3) bar(X,Y_scaled); ylabel ('scaled frequency'); xlabel ('Strength'); title ('scaled frequency diagram'); grid on 1
2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
3
B. What is the probability the a student is picked and his weight 165 pound or less % fitting a normal probabilty curve mu = mean (Y_raw); s = std(Y_raw); fprintf ('\n average of the data = %6.2f, standard deviastion %6.2f', mu,s); n = input ('\n please enter 1 for bigger or equal 2 between two number 3 less than or equal'); if n == 1 % bigger than or equal %calcilating probabilty that input number is bigger than or equal bin b1 = input('\n please enter the treshhold number'); P1 = 1 - (1+erf((b1-mu)/(s*sqrt(2))))/2; elseif n == 3 % less than or equal 4 b1 = input('\n please enter the treshhold number');
P1 = (1+erf((b1-mu)/(s*sqrt(2))))/2; else % betwwen two numbers b1 = input('\n please enter the first treshhold number'); b2 = input('\n please enter the second treshhold number'); P1 = (erf((b2-mu)/(s*sqrt(2)))-erf((b1-mu)/(s*sqrt(2))))/2; end fprintf ('\n the probabilty is %6.2f precent',P1*100); average of the data = 187.97, standard deviastion 45.51\n please enter 1 for bigger or equal 2 between two number 3 less than or equal3 \n please enter the treshhold number165 the probabilty is 30.69 precent>> C. What is the probability that a student is picked and his/her weight is bigger than 300 % fitting a normal probabilty curve mu = mean (Y_raw); s = std(Y_raw); fprintf ('\n average of the data = %6.2f, standard deviastion %6.2f', mu,s); n = input ('\n please enter 1 for bigger or equal 2 between two number 3 less than or equal'); if n == 1 % bigger than or equal %calcilating probabilty that input number is bigger than or equal bin b1 = input('\n please enter the treshhold number'); P1 = 1 - (1+erf((b1-mu)/(s*sqrt(2))))/2; elseif n == 3 % less than or equal b1 = input('\n please enter the treshhold number'); 5 P1 = (1+erf((b1-mu)/(s*sqrt(2))))/2; else
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
% betwwen two numbers b1 = input('\n please enter the first treshhold number'); b2 = input('\n please enter the second treshhold number'); P1 = (erf((b2-mu)/(s*sqrt(2)))-erf((b1-mu)/(s*sqrt(2))))/2; end fprintf ('\n the probabilty is %6.2f precent',P1*100); average of the data = 187.97, standard deviastion 45.51\n please enter 1 for bigger or equal 2 between two number 3 less than or equal1 \n please enter the treshhold number300 the probabilty is 0.69 precent>> D. What is the probability that a student is picked and his/her weight is between 200 and 240 pound % fitting a normal probabilty curve mu = mean (Y_raw); s = std(Y_raw); fprintf ('\n average of the data = %6.2f, standard deviastion %6.2f', mu,s); n = input ('\n please enter 1 for bigger or equal 2 between two number 3 less than or equal'); if n == 1 % bigger than or equal %calcilating probabilty that input number is bigger than or equal bin b1 = input('\n please enter the treshhold number'); P1 = 1 - (1+erf((b1-mu)/(s*sqrt(2))))/2; elseif n == 3 % less than or equal b1 = input('\n please enter the treshhold number'); P1 = (1+erf((b1-mu)/(s*sqrt(2))))/2; else 6 % betwwen two numbers
b1 = input('\n please enter the first treshhold number'); b2 = input('\n please enter the second treshhold number'); P1 = (erf((b2-mu)/(s*sqrt(2)))-erf((b1-mu)/(s*sqrt(2))))/2; end fprintf ('\n the probabilty is %6.2f precent',P1*100); average of the data = 187.97, standard deviastion 45.51\n please enter 1 for bigger or equal 2 between two number 3 less than or equal2 \n please enter the first treshhold number200 \n please enter the second treshhold number240 the probabilty is 26.93 precent>> Q3 A. Define a bin of 2 inches each starting from 60 to 76, find the frequency, relative frequency and scaled frequency histogram Y = input ('please enter raw data in bracket'); X = 60:2:76; hist(Y,X); Y1 = hist (Y,X)/33; ylabel ('Absolute frequency'); xlabel ('Strength'); title ('Absolute frequency for 20 tests'); figure(2) bar(X,Y1); ylabel ('Relative frequency'); xlabel ('Strength'); title ('Relative frequency for 20 tests'); % scaled frequency 7 area = Y1*2;
t_area = sum(area); Y_scaled = Y1/t_area; figure(3) bar(X,Y_scaled); ylabel ('scaled frequency'); xlabel ('Strength'); title ('scaled frequency diagram'); grid on
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
9
B. What is the probability the a student is picked and his/ her Height 60 inch or less % fitting a normal probabilty curve mu = mean (Y_raw); s = std(Y_raw); fprintf ('\n average of the data = %6.2f, standard deviastion %6.2f', mu,s); n = input ('\n please enter 1 for bigger or equal 2 between two number 3 less than or equal'); if n == 1 % bigger than or equal %calcilating probabilty that input number is bigger than or equal bin b1 = input('\n please enter the treshhold number'); P1 = 1 - (1+erf((b1-mu)/(s*sqrt(2))))/2; elseif n == 3 % less than or equal 10 b1 = input('\n please enter the treshhold number');
P1 = (1+erf((b1-mu)/(s*sqrt(2))))/2; else % betwwen two numbers b1 = input('\n please enter the first treshhold number'); b2 = input('\n please enter the second treshhold number'); P1 = (erf((b2-mu)/(s*sqrt(2)))-erf((b1-mu)/(s*sqrt(2))))/2; end fprintf ('\n the probabilty is %6.2f precent',P1*100); average of the data = 187.97, standard deviastion 45.51\n please enter 1 for bigger or equal 2 between two number 3 less than or equal3 \n please enter the treshhold number60 the probabilty is 0.25 precent>> C. What is the probability that a student is picked and his/her Height is bigger than 74 % fitting a normal probabilty curve mu = mean (Y_raw); s = std(Y_raw); fprintf ('\n average of the data = %6.2f, standard deviastion %6.2f', mu,s); n = input ('\n please enter 1 for bigger or equal 2 between two number 3 less than or equal'); if n == 1 % bigger than or equal %calcilating probabilty that input number is bigger than or equal bin b1 = input('\n please enter the treshhold number'); P1 = 1 - (1+erf((b1-mu)/(s*sqrt(2))))/2; elseif n == 3 % less than or equal b1 = input('\n please enter the treshhold number'); P1 = (1+erf((b1-mu)/(s*sqrt(2))))/2; 11 else
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
% betwwen two numbers b1 = input('\n please enter the first treshhold number'); b2 = input('\n please enter the second treshhold number'); P1 = (erf((b2-mu)/(s*sqrt(2)))-erf((b1-mu)/(s*sqrt(2))))/2; end fprintf ('\n the probabilty is %6.2f precent',P1*100); average of the data = 187.97, standard deviastion 45.51\n please enter 1 for bigger or equal 2 between two number 3 less than or equal1 \n please enter the treshhold number74 the probabilty is 99.39 precent>> C. What is the probability that a student is picked and his/her height is between 65 and 69 % fitting a normal probabilty curve mu = mean (Y_raw); s = std(Y_raw); fprintf ('\n average of the data = %6.2f, standard deviastion %6.2f', mu,s); n = input ('\n please enter 1 for bigger or equal 2 between two number 3 less than or equal'); if n == 1 % bigger than or equal %calcilating probabilty that input number is bigger than or equal bin b1 = input('\n please enter the treshhold number'); P1 = 1 - (1+erf((b1-mu)/(s*sqrt(2))))/2; elseif n == 3 % less than or equal b1 = input('\n please enter the treshhold number'); P1 = (1+erf((b1-mu)/(s*sqrt(2))))/2; else 12 % betwwen two numbers b1 = input('\n please enter the first treshhold number');
b2 = input('\n please enter the second treshhold number'); P1 = (erf((b2-mu)/(s*sqrt(2)))-erf((b1-mu)/(s*sqrt(2))))/2; end fprintf ('\n the probabilty is %6.2f precent',P1*100); average of the data = 187.97, standard deviastion 45.51\n please enter 1 for bigger or equal 2 between two number 3 less than or equal2 \n please enter the first treshhold number65 \n please enter the second treshhold number69 the probabilty is 0.10 precent>>