|
Fn+2=Fn+1+Fn where F0=0 and F1=1∑n≥0Fn+2zn=∑n≥0Fn+1zn+∑n≥0Fnznmultiply by zn and sum over all n1z2∑n≥2Fnzn=1z∑n≥1Fnzn+∑n≥0Fnznre-index1z2(∑n≥0Fnzn)−F1z+F0z0z2=1z∑n≥0Fnzn−F0z0z+∑n≥0FnznF(z)z2−zz2=1zF(z)+F(z)F(z)−z=zF(z)+z2F(z)F(z)=z1−z−z2OGF of Fibonacci sequence! |
Observe
|
1−z−z2=−(z+√5+12)(z−√5−12)=(√5+12+z)(√5−12−z) |
Let
So
|
z1−z−z2=z(φ+z)(ˆφ−z)A(φ+z)+B(ˆφ−z)=z(φ+z)(ˆφ−z)partial fractionsA(ˆφ−z)+B(φ+z)=zB(φ+ˆφ)=ˆφB=ˆφφ+ˆφ=√5−12√5=1√5ˆφA(ˆφ+φ)=−φA=−φˆφ+φ=−√5+12√5=−1√5φ |
Therefore
|
F(z)=z1−z−z2=−φ√5(φ+z)+ˆφ√5(ˆφ−z)=−1√5(1−(−zφ))+1√5(1−zˆφ)=1√5(1−zˆφ)−1√5(1−(−zφ))=1√5∑N≥0(ˆφ−1z)N−1√5∑N≥0(−φ−1z)Nexpand OGF=1√5∑N≥0ˆφ−NzN+1√5∑N≥0(−1)N+1φ−NzN=∑N≥01√5(ˆφ−N+(−1)N+1φ−N)zNFN≡[zN]F(z)=1√5(ˆφ−N+(−1)N+1φ−N)=1√5((2√5−1)N+(−1)N+1(2√5+1)N)=1√5((2(√5+1)4)N+(−1)N+1(2(√5−1)4)N)=1√5((2(√5+1)4)N+(−1)2N+1(2(1−√5)4)N)FN=1√5((1+√52)N−(1−√52)N) |
◻
Source: Analysis of Algorithm
# posted by rot13(Unafba Pune) @ 8:28 PM
