- #1

Goldenwind

- 146

- 0

**[SOLVED] Recursive formulae**

## Homework Statement

Determine whether each of these proposed definitions is a valid recursive definition of a function f from the set of nonnegative integers to the set of integers. If f is well defined, find a formula for f(n) when n is a nonnegative integer and prove that your formula is valid.

a) f(0) = 1, f(n) = -f(n – 1) for n >= 1

## The Attempt at a Solution

f(1) = -f(1 – 1) = -f(0) = -1

f(2) = -f(2 – 1) = -f(1) = 1

f(3) = -f(3 – 1) = -f(2) = -1

I can see that it is a valid recursive definition.

Why is it asking me to find a formula for f(n), when we were given it (= -f(n-1))?

Are they asking for a nonrecursive formula that also applies?

In this case, it would be f(n) = (-1)^n.

Is this what they want?