Question: python program: answer all questions and use comments to explain code (Demonstrate cancellation errors) A cancellation error occurs when you are manipulating a very large

python program: answer all questions and use comments to explain code  python program: answer all questions and use comments to explain code
(Demonstrate cancellation errors) A cancellation error occurs when you are manipulating a

(Demonstrate cancellation errors) A cancellation error occurs when you are manipulating a very large number with a very small number. The large number may cancel out the smaller number. For example, the result of 100000000.0+0.000000001 is equal to 100000000.0. To avoid cancellation errors and obtain more accurate results, carefully select the order of computation. For example, in computing the following series, you will obtain more accurate results by computing from right to left rather than from left to right: 1+21+31++n1 Write a program that compares the results of the summation of the preceding series, computing both from left to right and from right to left with n=50000. Ideally, your program should use one or more functions. QUESTION 4 Functions and Lists (Sequences) Here is the definition of a sequence: - The first, second, and third terms are 1. - The nth term is the (n1) th +(n2) th term +(n3) th term. So the 4th tem is the sum of the 1th2nd, and 3rd tems, and the 5th term is the sum of 2nd,3rd, and 4th terms etc. Thus the sequence looks like this: 1,1,1,3,5,9,17,31, ... Write a function call sequence( n ) that takes in an integer n and returns a list containing all of the terms in this sequence from 1 up to the ntit term. You will need to also write a short program to call and test this function

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!