The value of a can be determined by the series equation: 1 1 1 1 That is, a = 4* sum, where sum= Iteration - Using the w

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

The value of a can be determined by the series equation: 1 1 1 1 That is, a = 4* sum, where sum= Iteration - Using the w

Post by answerhappygod »

The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 1
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 1 (30.36 KiB) Viewed 44 times
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 2
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 2 (38.64 KiB) Viewed 44 times
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 3
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 3 (36.81 KiB) Viewed 44 times
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 4
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 4 (36.79 KiB) Viewed 44 times
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 5
The Value Of A Can Be Determined By The Series Equation 1 1 1 1 That Is A 4 Sum Where Sum Iteration Using The W 5 (23.36 KiB) Viewed 44 times
The value of a can be determined by the series equation: 1 1 1 1 That is, a = 4* sum, where sum= Iteration - Using the while loop • Write a C program that finds an approximation to the value of x, to 4 decimal places. x1 = cili The program displays the value of at and the number of iterations used to find this approximation. x2 => x4 = 19 Each term in the series, beginning with the second is generated as follows: Analysis In general the ith term is generated by the following expression:
Generating new values xold 1 -0.3333 0.2000 0.5333333333333333 3 2 0.2000 -0.1429 0.34285714285714286 -0.1429 0.1111 0.25396825396825395 0.1111 -0.0909 0.20202020202020202 -0.0909 0.0769 0.16783216783216784 0.0769 -0.0667 0.14358974358974358 4 5 6 7 -0.0667 0.0588 0.12549019607843137 8 0.0588 -0.0526 0.11145510835913312 -0.0526 0.0476 0.10025062656641603 0.0476 -0.0435 0.09109730848861283 9 10 MARGIN_OF_ERROR = 0.05 xnew abs(xnew-xold) •j=1 xold ....(your initial guess) *xnew= ...... (generate new value using the expression) false Print result abs(xnew-xold) > MOE true sum-sum + xnew i++ xold = xnew xnew... (generate new x value) Note: MOE means Margin Of Error MARGIN OF ERROR: 0.05
This type of problem requires you to: Analysis • Compare the absolute value of the difference of two successive terms. • If the value is less that the threshold or margin of error, then the last new value generated is the approximation to the actual value. . In other words, while (|xnew-xold | > some margin of error) { } sum the new value to previous amount save the new as old. generate the new value, xnew Analysis In this example let the margin of error between two successive values be 0.05. • In addition, each new term may be generated as follows expression: pow(-1.0, n)/(2* n + 1);
Sketch of the program /* Define any constants. For instance MARGIN_OF_ERROR = 0.05 */ // Include any necessary file. For instance include stdio.h /* Declare any necessary variables for instance double sum; int iterate; */ Initialize the variable sum. That is sum = 1; /* You may want to define a function that finds each new term. For example public double findXnew(int n) { return pow(-1.0, n)/(2* n + 1); Analysis (cont) Your code details the while loop construct // Details to come..... while (abs(xnew - xold) > MARGIN_OF_ERROR) { // Complete............ }
Example void findPi() { } int i = 1; double xold = 2.0; // Choose a value double xnew=findXnew(i); while (abs(xnew - xold) > MARGIN_OF_ERROR) { } sum = sum + xnew; xold = xnew; i++; xnew = findXnew(i); iterate= = i;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply