recurrence equation

2008-07-12 10:01 pm
f(n){ n if 0<n<=2;
f(n-1) x n if n>2;

How to solve f(n)?

回答 (1)

2008-07-13 7:20 am
✔ 最佳答案
Formally, you should use induction.
Want to show f(n) = n! for n>0:

f(1)=1=1! , f(2)=2=2! by definition.

Assume there is a k>1 such that f(k)=k!.
Then f(k+1) = f(k) x (k+1) = k! x (k+1) = (k+1)!.

Therefore, by induction, f(n) = n! for n>0.

Finished~~~

Note:
In the induction assumption we need to assume k>1 so that k+1>2
and hence the recurrence relation can be used.


收錄日期: 2021-04-14 19:23:59
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080712000051KK01204

檢視 Wayback Machine 備份