

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


This question assesses week 8 (āReview the application of linear algebra to physical prob- lemsā, āUnderstand the built-in matrix manipulation functionsā and āApply matrix methods to problems in linear algebra...ā), week 3 (āWrite user-defined functionsā), week 4 (āUnder- stand the matrix datatypeā) and week 7 (āCalculate the accuracy of statistics drawn from limited populationsā)
(a) (3 marks)
g b c
(b) 3 marks
A=[0.07^2 0.07 1; 0.53^2 0.53 1; 0.85^2 0.85 1]; y = [0; 2; 6]; gbc = inv(A)*y
(c) 2 marks function g = calcg(t) % This function computes the acceleration due to gravity, based on % an experiment that includes sensors placed at 0, 1 and 2 m A=[t(1)^2 t(1) 1; t(2)^2 t(2) 1; t(3)^2 t(3) 1]; gbc = A[0; 2; 6]; g=gbc(1);
(d) 2 marks disp([āg = ā num2str(mean(g)) ā +/- ā num2str(std(g)/length(g))])
(a) (3 marks)
(^00 )
100
200
300
400
500
600
700
(b) (4 marks)
clear trials=1e5; for n=1:trials results(n)=sum(round(rand(1,10)+0.1) ==1)<2; end disp([āProbability of less than 2 heads: ā num2str(sum(results)/trials)])
(c) (3 marks) Decreasing the number of trials to 1000 would mean that the probability returned would only be given as a percentage to 1 decimal place and would be highly variable.
(4 marks) (a) t = [0:0.01:2]; x = exp(-t); y = t.*(2-t); d2 = x.^2+y.^2; t(d2==max(d2))
(b) i. (2 marks) 4 4. ii. (2 marks) 4 7 iii. (2 marks) 8 9