retagged by
375 views
0 votes
0 votes

somewhere at the end solving a recursive equation we get like - 

2^n+2^n-1+2^n-2+......+2^0

Someone please simplify in layman terms how come from 2^0 to 2^n we have (n+1) terms?

retagged by

1 Answer

Best answer
1 votes
1 votes
See, write 2 terms------------------ 2^1+2^2               -----------------------(a)

now write 3 terms------------------- 2^1+2^2+2^3            -----------------------(b)

NOw,write n terms------------------  2^1+2^2+2^3.......+2^n  ---------------------- (c)   

See,

IF i ask, how many terms for equation (a),you will say 2 terms.

IF i ask, how many terms for equation (b),you will say 3 terms.

IF i ask, how many terms for equation (c),you will say n terms.

NOW IN  equation C add one more term 2^0,it will be (n+1) terms

I hope its clear now.
selected by

Related questions

3 votes
3 votes
1 answer
1
sumit_kumar asked Jun 24, 2017
740 views
How to apply back substiution method on following recursive equation to find time complexity:T(n)= 2 T(n/2) + (n/log n) , where "n" is input.
1 votes
1 votes
1 answer
2
ItzDc asked Jun 3, 2022
2,986 views
I can't figure out how to proceed and which case it's falling under after calculating h(n)
0 votes
0 votes
0 answers
3
pk14697 asked Jul 2, 2018
333 views
To prove that the time complexity of equationT(n) = T(α n) + T((1 – α)n) + βnisΘ(n logn).
1 votes
1 votes
2 answers
4