$35.00

Category: CSc 30100

Description

5/5 - (4 votes)

Calculate 3 .

You should use math.sqrt(3.0) for the value of 3.

Calculate using the two methods we discussed in class,

naive summation and compensated summation. Perform the

summations f

N

N

i

N

S

S

=

= ∑

567 8 9 or N = 10 ,10 ,10 , 10 , and 10 .

2

The City College of New York

CSc 30100 – Scientific Programming

Fall 2019 – Erik K. Grimmelmann, Ph.D.

Calculate the time of each summation using code such as

start_time = time.time()

end_time = time.time()

elapsed time = end_time start_time −

3

The City College of New York

CSc 30100 – Scientific Programming

Fall 2019 – Erik K. Grimmelmann, Ph.D.

Calculate the “exact” value of the sum using the expression

*math.sqrt(3.0)

For each of the that you calculate, determine the absolute

and relative errors of the results. Present your resul

N

N

S N

S

=

ts (including

the timing of your calculations) in a table.

Discuss your results. Are these errors consistent with the

expressions for errors that we discussed in class and that are

in the posted classroom presentations? How do the speeds of the

two methods compare?

4

The City College of New York

CSc 30100 – Scientific Programming

Fall 2019 – Erik K. Grimmelmann, Ph.D.

5

Include all of your analysis and discussion in your .ipynb file

and submit the file thorugh Blackboard. The name of the file

you submit should be

lastname_firstname_AS03.ipynb.

Do not clear your results after your last run so that I will be

able to see your results without rerunning your file.

If you collaborate with anyone on this assignment, be sure to

follow the collaboration guidelines in the syllabus.

WhatsApp us