Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

THE ALTERNATING HARMONIC SERIES The alternating harmonic series converges to the

ID: 3705269 • Letter: T

Question

THE ALTERNATING HARMONIC SERIES The alternating harmonic series converges to the natural log of 2: y_i_ = 1-2+?4+5-...-In(2) = 0.6931471806 Because of this, we can use the alternating harmonic series to approximate the In(2). But how far out do you have to take the series to get a good approximation of he final answer? We can use a while loop to solve this problem. 1. State the Problem Use a while loop to calculate the members of the alternating harmonic sequence and the value of the series until it converges to values that vary by less than.001. Compare the result to the natural log of 2. 2. Describe the Input and Output Input The description of the alternating harmonic series

Explanation / Answer

a = 0

n = 1

while (n <= 100)

a = a + ((-1)^(n-1))(1/n)

fprintf('value is %d ', a)