Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(a) Explain why all numerical calculations suffer from \'\'round-off\'\' error a

ID: 663389 • Letter: #

Question

(a) Explain why all numerical calculations suffer from ''round-off'' error and why in some calculations it is unimportant but in others it dominates the results. (b) Why is it important to know how arrays are stored in a computer's memory? (c) The following ScI/MATLAB code uses a Monte Carlo simulation to estimate the volume of a cube that has a spherical hole in its centre. Running the code above a number of times the following results are obtained for the volume-7.4640, 7.5840, 7.4960, 7.4080. Why is there a different solution for the volume each time the program is run? If the code produces different results every time it is run then how is the true volume found?

Explanation / Answer

a) Rounding error is the error which is difference of exact mathematical value and approximation of value.

Several numerical calculations dont need exact mathematical value since it may have more tha 64 deciml values.

In some calculations round off is important..like matrix operations. It doent need more than 3 decimal values to do calculations. If more decimal calculations then time taken to do atrix opertaions will increaes.

In some calculations roundoff may suffer..means not recommended....calculations regarding physical equations or money related calculations. In such calculations each and every decimal values vary a lot. So in these type of situations round off makes suffer.

b) Generally the data in computer memory stored as contigous memory blocks in terms of arrays structure. So it is very important to know how they stored whether contigous block or partial block...and also it does matter in type of datatypes used.

c)

In your above code you used x=2*rand(3,1)-1

rand function given some random always.....you are generating random value and using in caalculating volume...thtas why it was giving always different values...ofcourse they are nearer to each other.

If code produces different results...then take average of all volumes ..which gives approximate value of volume..