Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Write a program called sinseries . py to compute the following sum: s = x - x 3 3 ! + x 5 5

Instructions
Write a program called
sinseries.py to compute the following sum:
s=x-x33!+x55!-x77!dots+x2n-1(2n-1)!(-1)(n-1)
Where 0x6.28 is a real number. The value of n, which is to be determined by
the program, must be the smallest positive integer that satisfies the inequality
x2n-1(2n-1)!d where n1,d is a very small positive real number (less than 1). The
values of x and d must be provided as inputs to the program. n! is the factorial of
n.
The expected input/output behavior of the program is illustrated below for three
example inputs:
Enter a real number x between 0 and 6.28, inclusive: 0.52
Enter a small positive real number d1:0.0001
s : 0.49688013020186006
Enter a real number x between 0 and 6.28, inclusive: 1.57
Enter a small positive real number d1 : 0.001
s : 1.0000032058668369
Enter a real number x between 0 and 6.28, inclusive: 3.14
Enter a small positive real number d1 : 0.001
s : 0.0016136360330223744
Hint: Add the terms of the sum one at a time. Stop when the last added term is
found to be less than or equal to d
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 9th International Conference Dasfaa 2004 Jeju Island Korea March 2004 Proceedings Lncs 2973

Authors: YoonJoon Lee ,Jianzhong Li ,Kyu-Young Whang

2004th Edition

3540210474, 978-3540210474

More Books

Students also viewed these Databases questions