Question

Write an algorithm to calculate the sum of the following series:           Sum =x-x3/3! + x5/5!...

  1. Write an algorithm to calculate the sum of the following series:

          Sum =x-x3/3! + x5/5! – x7/7! +…….     Stop when the term<0.0001.

very quick please.

Homework Answers

Answer #1

Algorithm

factorial(n){ //factorial method
if(n==1)
return 1;
return n*factorial(n-1);
}

-----------------------------------

start

Read Sum=0, i=1, term,d,x=2;
   while(true){
   term=pow(x,i)/factorial(i);
   d=round(term*100000)/100000;
   if(d<0.0001)
   break;
   if(i%2==0)
   Sum=Sum+d;
   else
   Sum=Sum-d;
   i+=2;
   }
       print(Sum);

stop

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1) Write an algorithm to calculate the sum of the following series:           Sum =x-x3/3! +...
1) Write an algorithm to calculate the sum of the following series:           Sum =x-x3/3! + x5/5! – x7/7! +…….     Stop when the                     term<0.0001.    2) An internet service provider charges its subscribers per month as follows:           Data usage (n), in gbs           charges (NIS)           0.0<n<=1.0                                250           1.0<n<=2.0                                500           2.0<n<=5.0                              1000           5.0<n<=10.0                            1500                   n>10                                 2000          Write a C program to read the usage(n) from a file and print the charges to be paid by...
sin(x)=x-x3/3!+x5/5! Below is the expansion of the Taylor series sin (x) function around the x =...
sin(x)=x-x3/3!+x5/5! Below is the expansion of the Taylor series sin (x) function around the x = [x] point. Please continue.
1- Write algorithm (in pseudo-code) for the following problem: sum of the series: 1 +2+3+…+N 2-...
1- Write algorithm (in pseudo-code) for the following problem: sum of the series: 1 +2+3+…+N 2- Convert an algorithm to a flowchart diagram. 3- Counting the primitive operations of the algorithm. 4- Determine algorithm complexity. 5- Write a complete C++ program for the previous algorithm where the program should contain the following:  Display messages.  Input any number;  Display the series.  Display the sum of the series.
Consider the power series f(x) =x + x2/2 + x3/3 + x4/4 +··· (a) What is...
Consider the power series f(x) =x + x2/2 + x3/3 + x4/4 +··· (a) What is the interval of convergence of this series? (b) Differentiate this series term by term and compare the result to one of the series that we found in the lecture to find the closed form of the series f(x).
write a java code. Write a program using loops to compute the sum of the 30...
write a java code. Write a program using loops to compute the sum of the 30 terms of the series below. 91/(3 + 2 + 2) + 92/(4 - 4 + 5) + 93/(5 + 6 - 8) + 94/(6 - 8 + 11) + 95/(7 + 10 + 14) + 96/(8 - 12 - 17) + . . . . Output: Term Ratio Sum 1 13 13 2 18.4 31.4 etc etc
Find the sum of the following series:∞∑n=2 5^n/13^(n+3) Determine whether the following series are con-vergent or...
Find the sum of the following series:∞∑n=2 5^n/13^(n+3) Determine whether the following series are con-vergent or not. Show your work!∞∑n=2 5n^2+ 5n/7n^2+ 3n+ 6
Consider the following linear program Max 5x1+5x2+3x3 St x1+3x2+x3<=3 -x1+ 3x3<=2 2x1-x2 +2x3<=4 2x1+3x2-x3<=2 xi>=0 for...
Consider the following linear program Max 5x1+5x2+3x3 St x1+3x2+x3<=3 -x1+ 3x3<=2 2x1-x2 +2x3<=4 2x1+3x2-x3<=2 xi>=0 for i=1,2,3 Suppose that while solving this problem with Simplex method, you arrive at the following table: z x1 x2 x3 x4 x5 x6 x7 rhs Row0 1 0 -29/6 0 0 0 11/6 2/3 26/3 Row1 0 0 -4/3 1 0 0 1/3 -1/3 2/3 Row2 0 1 5/6 0 0 0 1/6 1/3 4/3 Row3 0 0 7/2 0 1 0 -1/2 0...
Find the Fourier Series of the function: f(x)=0, -5<x<0, f(x)=3, 0<x<5 with a period=10. Write briefly...
Find the Fourier Series of the function: f(x)=0, -5<x<0, f(x)=3, 0<x<5 with a period=10. Write briefly about how such a series expansion could be used? For example, in digital to analog conversion?
Write code to evaluate the polynomial at the point indicated by using Horner’s algorithm. p(x)=x^5−x^4−3x^3−5x^2+10 at...
Write code to evaluate the polynomial at the point indicated by using Horner’s algorithm. p(x)=x^5−x^4−3x^3−5x^2+10 at x=2 (use MATLAB to code and show the results.)
5)Prove using Booth’s algorithm to show that -3 x 7 = -21. Consider the Multiplicand Q...
5)Prove using Booth’s algorithm to show that -3 x 7 = -21. Consider the Multiplicand Q as -3 and Multiplier M as 7. Show the step-by-step procedure in a neat tabular form