Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
首先你的1级是错误的,应该是这样的:1级T(n) = 2 * ( 2 * T(n-4) - 15 ) - 15
T(n) = 2 * ( 2 * T(n-4) - 15 ) - 15
我会这样解决:
因为 T(1) = T(2) -> T(3)=T(4)→ ...-> T(2k+1) = T(2k+2),其中 k 是正整数
T(3) = 2*T(1) - 15T(4) = 2*T(2) - 15 = 2*T(1) - 1 * 15T(5) = 2*T(3) - 15 = 4*T(1) - 3 * 15T(6) = 2*T(4) - 15 = 4*T(1) - 3 * 15T(7) = 2*T(5) - 15 = 8*T(1) - 7 * 15T(8) = 2*T(6) - 15 = 8*T(1) - 7 * 15...-> T(2k+1) = (2 ^ k * T(1)) - ((2 ^ (k - 1) - 1) * 15)-> T(2k+2) = T(2k+1)
但这不是一个正式的证明。
First of all, your level 1 is wrong, it should be like this:Level 1T(n) = 2 * ( 2 * T(n-4) - 15 ) - 15
I would solve it like this:
Since T(1) = T(2) -> T(3) = T(4) -> ... -> T(2k+1) = T(2k+2), where k is a positive integer
This is not a formal proof though.
在推导公式时,一种好的检验方法是用已知的事例进行代入和检验。
在本例中,替换 1 会得到 T(1) = 25*2^((1-1)/2) - 15 = 10,但 T(1)应为 40。
T(1) = 25*2^((1-1)/2) - 15 = 10
T(1)
此外,在推导中,1 级推导应为 2( 2T(n-4) - 15) - 15 而不是 2( T(n-4) - 15) - 15。
2( 2T(n-4) - 15) - 15
2( T(n-4) - 15) - 15
When deriving formulae, one good way of checking is to substitute and check it with a known case.
In this case, substituting 1 results in T(1) = 25*2^((1-1)/2) - 15 = 10, but T(1) should be 40.
Additionally, in the derivation, the level 1 derivation should be 2( 2T(n-4) - 15) - 15 instead of 2( T(n-4) - 15) - 15.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
首先你的1级是错误的,应该是这样的:
1级
T(n) = 2 * ( 2 * T(n-4) - 15 ) - 15
我会这样解决:
因为 T(1) = T(2) -> T(3)=T(4)→ ...-> T(2k+1) = T(2k+2),其中 k 是正整数
T(3) = 2*T(1) - 15
T(4) = 2*T(2) - 15 = 2*T(1) - 1 * 15
T(5) = 2*T(3) - 15 = 4*T(1) - 3 * 15
T(6) = 2*T(4) - 15 = 4*T(1) - 3 * 15
T(7) = 2*T(5) - 15 = 8*T(1) - 7 * 15
T(8) = 2*T(6) - 15 = 8*T(1) - 7 * 15
...
-> T(2k+1) = (2 ^ k * T(1)) - ((2 ^ (k - 1) - 1) * 15)
-> T(2k+2) = T(2k+1)
但这不是一个正式的证明。
First of all, your level 1 is wrong, it should be like this:
Level 1
T(n) = 2 * ( 2 * T(n-4) - 15 ) - 15
I would solve it like this:
Since T(1) = T(2) -> T(3) = T(4) -> ... -> T(2k+1) = T(2k+2), where k is a positive integer
T(3) = 2*T(1) - 15
T(4) = 2*T(2) - 15 = 2*T(1) - 1 * 15
T(5) = 2*T(3) - 15 = 4*T(1) - 3 * 15
T(6) = 2*T(4) - 15 = 4*T(1) - 3 * 15
T(7) = 2*T(5) - 15 = 8*T(1) - 7 * 15
T(8) = 2*T(6) - 15 = 8*T(1) - 7 * 15
...
-> T(2k+1) = (2 ^ k * T(1)) - ((2 ^ (k - 1) - 1) * 15)
-> T(2k+2) = T(2k+1)
This is not a formal proof though.
在推导公式时,一种好的检验方法是用已知的事例进行代入和检验。
在本例中,替换 1 会得到
T(1) = 25*2^((1-1)/2) - 15 = 10
,但T(1)
应为 40。此外,在推导中,1 级推导应为
2( 2T(n-4) - 15) - 15
而不是2( T(n-4) - 15) - 15
。When deriving formulae, one good way of checking is to substitute and check it with a known case.
In this case, substituting 1 results in
T(1) = 25*2^((1-1)/2) - 15 = 10
, butT(1)
should be 40.Additionally, in the derivation, the level 1 derivation should be
2( 2T(n-4) - 15) - 15
instead of2( T(n-4) - 15) - 15
.