Loading [MathJax]/jax/output/HTML-CSS/jax.js
Google
 
Web unafbapune.blogspot.com

Sunday, December 29, 2013

 

Fibonacci via OGF

  Fn+2=Fn+1+Fn where F0=0 and F1=1n0Fn+2zn=n0Fn+1zn+n0Fnznmultiply by zn and sum over all n1z2n2Fnzn=1zn1Fnzn+n0Fnznre-index1z2(n0Fnzn)F1z+F0z0z2=1zn0FnznF0z0z+n0FnznF(z)z2zz2=1zF(z)+F(z)F(z)z=zF(z)+z2F(z)F(z)=z1zz2OGF of Fibonacci sequence!
Observe
  1zz2=(z+5+12)(z512)=(5+12+z)(512z)
Let
  φ=5+12ˆφ=512
So
  z1zz2=z(φ+z)(ˆφz)A(φ+z)+B(ˆφz)=z(φ+z)(ˆφz)partial fractionsA(ˆφz)+B(φ+z)=zB(φ+ˆφ)=ˆφB=ˆφφ+ˆφ=5125=15ˆφA(ˆφ+φ)=φA=φˆφ+φ=5+125=15φ
Therefore
  F(z)=z1zz2=φ5(φ+z)+ˆφ5(ˆφz)=15(1(zφ))+15(1zˆφ)=15(1zˆφ)15(1(zφ))=15N0(ˆφ1z)N15N0(φ1z)Nexpand OGF=15N0ˆφNzN+15N0(1)N+1φNzN=N015(ˆφN+(1)N+1φN)zNFN[zN]F(z)=15(ˆφN+(1)N+1φN)=15((251)N+(1)N+1(25+1)N)=15((2(5+1)4)N+(1)N+1(2(51)4)N)=15((2(5+1)4)N+(1)2N+1(2(15)4)N)FN=15((1+52)N(152)N)

Source: Analysis of Algorithm


Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?