Guest User

Untitled

a guest
Jan 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Question 2.
  2.  
  3. A. population.m
  4.  
  5. function [pop] = population(t)
  6. pop = 197273000./(1+exp(-0.0313.*(t-1913.25)));
  7.  
  8.  
  9. B.
  10.  
  11. >> population(2050)
  12.  
  13. ans =
  14.  
  15. 1.9458e+008
  16.  
  17. C.
  18.  
  19. >> PopApprox = population(2010);
  20. >> PopExact = 281421906;
  21. >> PercentDifference = (PopExact - PopApprox) / ((PopExact + PopApprox)/2) * 100;
  22. >> PercentDifference
  23.  
  24. PercentDifference =
  25.  
  26. 39.7182
  27.  
  28. D.
  29.  
  30. >> years = linspace(1790,2010,(2010-1790)*2);
  31. >> popCurve = population(years);
  32. >> plot(years,popCurve);
  33.  
  34. E.
  35.  
  36. >> title('George Hahn - G00207171');
  37. >> xlabel('Year');
  38. >> ylabel('Approximate United States Population');
  39.  
  40.  
  41. Question 3.
  42.  
  43. A.
  44.  
  45. >> n = [5:5:100];
  46. >> ApproxE = (1 + 1./(n)).^n;
  47.  
  48. B.
  49.  
  50. >> ApproxE(1,50/5) //Because we are counting by 5's
  51.  
  52. ans =
  53.  
  54. 2.6916
  55.  
  56. C.
  57.  
  58. >> PercentError = (ApproxE - exp(1))/exp(1)*100;
  59.  
  60. D.
  61.  
  62. >> plot(n,PercentError)
  63. >> title('George Hahn - G00207171');
Add Comment
Please, Sign In to add comment