Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

Have roles been defined and assigned?

Answered: 1 week ago