Submit homework as a ".m" script file. Commands should be in order and the file should be executable. Open a new .m file and type a command like a=5. Execute the command (on a PC) by going to the debug menu and selecting Run.
% This is a comment
m=4*5; % this is a matlab command with a comment after it.
Please ask questions if you don't understand any part of the assignment, by email or in class.
Do:
Compute the dot product of y and y2 in four different ways. 1) Using the dot() command. 2) Using a for loop. 3) Using the sum() and .* (the pointwise multiplication operator). 4) Using matrix multiplication * and transpose ' operators.
Extra Credit: Simulate the following problems
Birthday problem: What is the probability that at least two people share a birthday in a room with 45 people?
Game Show problem: consider a game show. The host tells you there is a prize behind one of three curtains, A, B, C. You guess A and tell the host. The host then opens curtain B and shows you there is no prize behind that curtain. The host then offers you the opportunity to switch from A to C. Should you switch or stay put or does it matter at all?