Question: 1. Complete the following exercises using the numpy module. (a) Create a uniform subdivision of the interval -1.3 to 2.5 with 64 subdivisions. (b) Generate

 1. Complete the following exercises using the numpy module. (a) Create

1. Complete the following exercises using the numpy module. (a) Create a uniform subdivision of the interval -1.3 to 2.5 with 64 subdivisions. (b) Generate an array of length 3n filled with the cyclic pattern 1, 2, 3 (c) Create an array of the first 10 odd integers. (d) Create a 10 x 10 array of zeros and then "frame" it with a border of ones. (e) Create an 8 x 8 array with a checkerboard pattern of zeros and ones using a slicing+striding approach (f) Evaluate cos and sin on the interval [0,1] and then stack the results into a tall array with rows being the cos(x) and sin(x) entries. (g) Create a random 3x5 array using the np. random.rand (3, 5) function and compute: (i) the sum of all the entries, (ii) the sum of the rows and the sum of the columns. 2. Use the matplotlib.pyplot module to produce a plot of the function f(x) - e-x/10 and g(x) xeover the nterval [0,10]. Include labels for the x- and y-axes, and a legend explaining which line is which. 3. The sine function can be approximated by a polynomial according to the following formula: 2j+1 The error in the approximation S(x;n) decreases as n increases. The purpose of this exercise is to visua the quality of various approximations of S(x;n) as n increases. Complete the following (a) Write a function s (x,n) that computes S(x; n) (b) Plot sinx on [0,4] together with the approximation S(x1),S(x; 2), S(x;3), S(x; 6), and S(x; 12)

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!