Question: Let, 0 Write a function in Python by the name Fsum that can calculate the value of fx) where 'x'is the input to the function.

Let, 0 Write a function in Python by the name Fsum that can calculate the value of fx) where 'x'is the input to the function. x'can be a scalar, a vector or a matrix and must be a numpy array. Allow your function to accept a second input argument'n' (which is a scalar positive integer), which will indicate the maximum number of terms to be added in the series, i.e., for n 4, 0 Terminate the sequence summation when either the maximum of the absolute value(s) of the k-th term is less than 0.0001 (include the k- th term in your result) or 'n' terms have been added. Your answer should be rounded off to 4 places of decimal A sample input and output is: >>>res-Fsum(np.array([1,2],[2,0]]),100) >>>re array(I-0.8415,-0.6985], [-0.6985,-1.0000 l1) What is the output of your code for the following inputs. Enter the answer as an array without the word "array" and without any spaces, rounded to 4 decimal places. For example: (0I-0.8415,-0.6985],(-0.6985,-1.0000]]) What is your answer for the following inputs: (insert in sequence) print(Fsum (np.array([[5,0],[7,6]]),20)) print(Fsum(np.array ([8,4]),10)) print(Fsum(np.array([3,0]),0))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
