Skip to main content

Engineering Probability Class 24 Mon 2020-04-20

1   Final exam

(Most of these points have been already announced.)

  1. Mon April 27.
  2. 24 hours to do.
  3. I intend to make it available on 4pm RPI time, and allow until 4pm April 28.
  4. Open book, open notes.
  5. You will need an internet connection.
  6. It will probably use gradescope.
  7. This exam is optional. It will replace exam 1 if higher.
  8. Course weights:
    1. exam: 40%.
    2. all homeworks: 60%.
  9. Letter grades will be eased by one category. E.g., 90% and above earns an A.
  10. You also have the right, after seeing your grade, to convert it to a pass/no credit.

2   Daily comic

The Born Loser by Art and Chip Sansom for April 19, 2020 is relevant to one of my statistics paradoxes from a few classes ago.

3   Homework 9

is online, due in a week.

4   Matlab tutorial

I was surprised that some students didn't know it, so I asked a few other profs. They tell me that you should have already seen Matlab in ECSE 1010 and 2010. Nevertheless, I'll do a tutorial. Matlab is a very useful package for engineers. As RPI students, you can install it on your own computers. If you have any free time, you might check other free SW that RPI has, play with it, and put it on your resume.

Some functions:

last 2 args usually are size of output matrix.   1 arg -> square.

randi(10,1,5) - 5 random ints in [1,10]
randn(1,5) - 5 random normals
random('unif',0,1,1,10)  - 10 random uniform [0,1]
rand(1,10) -  10 random uniform [0,1]


last 2 args are not size of output matrix:

normcdf([1 2 3], 0,1) - normal (0,1) cdf at 1, 2, 3
normpdf([1 2 3], 0,1) - normal (0,1) pdf at 1, 2, 3
randperm(6)
randsample(10,3) - random sample w/o replacement of 3 from 10.
randsample(10,3,true) - " w replacement

a=[1 2;3 4]
ai=inv(a)
a*ai            - matrix mult
a.*a            - element by element mult
a+a             - element by element add; mult was a special case
eye(3)          - identity
eig(a)          - eigenvalues
sin(a)          - usual functions, applied to each element
sin(a).*sin(a)+cos(a).*cos(a)   - identity
x = 0: .1 : 10   - sequence
y = sin(x)
plot(x,y)    - many options for prettifying it

2D plotting is messier:

[X,Y] = meshgrid(1:0.5:10,1:20);

  X is the list of x's repeated row after row
  Y is the list of y's repeated col after col

Z = sin(X) + cos(Y);  - computed element by element
surfc(X,Y,Z)

For the homework question, this is useful: https://www.mathworks.com/help/stats/multivariate-normal-distribution.html

e.g.:

xr = 1:5   - list of x's
yr = xr
[xm,ym]=meshgrid(xr,yr)  - mesh of (x,y)
p = [xm(:) ym(:)]  - list of pairs
mu = [0 0]
cov = [1 1.6; 1.6 4]
y = mvnpdf(p,mu,cov);  - multivar normal pdf
yr = reshape(y,length(xm),length(ym));
surfc(xm,ym,yr)

5   Statistics

  1. How many students have had statistics like this in highschool?
  2. 15-1 Why Non Parametric Statistics? (6.52) https://www.youtube.com/watch?v=xA0QcbNxENs
  3. Regression: Crash Course Statistics #32 (12:40) https://www.youtube.com/watch?v=WWqE7YHR4Jc