Write a function to compute the sum of the first k terms of the series expansion for the sine function (-1)” (2n +1)! 2n +1 sin(x) = TL 0 The first three terms (k = 3) of the expansion are: 1 1 73 + sin(x) = 2 ਕ 5 Function specification: Your function should be called series sine(x, k) where x is the argument of the sine function and a total of k number of terms from the expansion should be summed. You are not allowed to import a factorial function (or anything else) from any of Python’s libraries – you don’t need it and it’ll slow down your function significantly! For example: Test Result import numpy as np 1.571 # Uses your series_sine to calculate sin(pi/2) with 1 to 3 iterations. 0.925 ans_literation = series_sine (np.pi/2, 1) 1.005 print(f'{ans_literation:.3f}’) ans_2iterations – series_sine (np.pi/2, 2) print(f'{ans_2iterations:.3f}’) ans_3iterations = series_sine (np.pi/2, 3) print(f'{ans_3iterations:.3f}’) Correct! ans = series_sine (1.6, 11) if abs (ans – 0.9996) < le-4: print(“Correct!”) else: print(“Wrong answer.”) print(f”Your answer was: {ans}”)
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more