Question 1 (6 marks)
The function plotted below has roots at x = 2.5, x = 4.6, and x = 5.7.
8
6
4
2
0
-2
-4
2
2.5
3
3.5
4
4.5
5
5.5
6
6.5
7
i) Suppose that a bisection search is started with xLOW = 5 and xHIGH = 7. Complete the following table. Step
XHIGH
XLOW
XROOT
EMAX
1
5
7
6
1
2
5
6
5.5
0.5
3
5.5
6
5.75
0.25
0.5 mark for consistently picking XROOT properly
1 mark for each correct wall movement (2 marks total)
0.5 mark for EMAX column ii) How many ADDITIONAL steps would be required to reduce EMAX to 0.0001? total guesses required = 14.2877 (from formula with Δx0 = 2, EMAX = 0.0001) can't have fractional guesses, therefore 15 total guesses required
12 additional steps required. check: 0.25/2^13 = 0.00003 < 0.0001
1 mark for the correct answer, 0.5 marks for a small slip
iii) Assuming that function f corresponds to the function shown above, what would happen if the following Matlab command were executed? x = fzero (f, [4, 6]);
An error message ("function signs at end points must differ") will be output.
1 mark for indicating precisely what will happen (correct error message).
0.5 marks for just recognizing that an error will occur.
(iv) Would a bisection search started with xLOW = 2 and xHIGH = 6 find one of the roots and, if so, which of the roots would it find? You must provide enough of an explanation that it is clear that your answer is not just a guess.
It would find the root at 2.5. The initial guess would 4, the high wall would move down, and after this there would only be only root within the interval.
1 mark for giving both the root that will be found and an clear explanation
0.5 marks for giving the right root but not explaining things very well no marks for the wrong root or no explanation at all
Question 2 (3 marks)
Assume the following system of three simultaneous equations.