Question: . The double sum starts in the lower left corner, goes up the column 1 values, then down to the bottom of column 2 then

. The double sum starts in the lower left corner, goes up the column 1 values, then down to the bottom of column 2 then up, and so on.
In theory, the result should be more accurate as n gets large. BUT as n gets very large, the error actually increases!!
Indeed, the errors for n=5,50,500, and 5000 are listed below
Grid Size(n x n) Relative Error
n=51.28e-03
n=501.31e-04
n=5005.01e-06
n=50007.22e-02(WTH?)
Your Job: Add up the numbers f(x,y) in the grid in different way in order to reduce rounding error for large n.
New Strategy: (1) Introduce a new variable columnSum that is initialized as 0* in the outer loop, but before the inner loop. (2) Replace mySum = mySum + F(x,y) in the inner loop with columnSum=columnSum + F(x,y).(3) After the inner loop, but still inside the main loop, increment mySum: mySum=mySum+columnSum
Table 4: Errors for your revised method of adding the numbers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!