Options

Recursive Function Example

edited May 2018

The recursive function is $$f(n)= \begin{cases} 0, & \text{if x \le 0}.\\\\ f(n-1) + n, & \text{otherwise}. \end{cases}$$ Assume $$f$$ is of the form $$\frac{n(n+1)}{2}$$; then $$f(0) = \frac{0(0+1)}{2} = 0$$ $$f(n) = \frac{n(n+1)}{2} = f(n-1) + n = \frac{[n-1]([n-1]+1)}{2} + n$$

• Options
1.

This is only true of recursive functions that work on numbers.

Comment Source:This is only true of recursive functions that work on numbers.
• Options
2.

Sorry, what?

Are you commenting on the content or the format?

Comment Source:Sorry, what? Are you commenting on the content or the format?
• Options
3.

Just the content. lol

Comment Source:Just the content. lol