Math, asked by baseball1907, 1 year ago

A sequence is defined recursively using the formula f(n + 1) = –0.5 f(n) . If the first term of the sequence is 120, what is f(5)?

Answers

Answered by anoopbarthwal123
13

Originally Answered: A sequence is defined recursively using the formula f (n + 1) = –0.5 f(n). If the first term of the sequence is 120, what is f(5)?

Your question can be rewritten as:


A sequence is defined recursively as follows:


If n = 1, then f(n) = 120


Else if n > 1, then f(n) =-.5f(n-1) . What is f(5)?


Here are three ways to get the answer:


(I) using hand calculations:


f(1) = 120


f(2) = -.5f(1) = -.5(120) = -60


f(3) = -.5f(2) = -.5(-60) = 30


f(4) = -.5f(3) = -.5(30) = -15


f(5) = -.5f(4) = -.5(-15) = 7.5


Therefore the 5th term of the sequence is 7.5


A derived formula from method (I) is :


f(n) = (-.5)^(n-1)*120 for n > 1.


(II) using the derived formula:


f(5) = (-.5)^4*120 = 7.5


(III) using a python (2.7) program with a recursive function:


print "Program To Find The 5th Term of a Sequence Defined Recursively:"

print " f(1) = 120, and f(n) = -.5f(n-1) for n > 1."

def f(n):

if n == 1:

return 120

else:

if n > 1:

return -.5*f(n-1) # Recursive call to f().

print""

print "Your answer is: ", f(5)

The program output:


Program To Find The 5th Term of a Sequence Defined Recursively:


f(1) = 120, and f(n) = -.5f(n-1) for n > 1.


Your answer is: 7.5


Of course, you can modify the program to find any term of the sequence.


Good luck

DO like that

Similar questions