递推公式

\[F(n)=\begin{cases} 0&(n=0)& \\ 1&(n=1)& \\ 2F(n-1)+1 &(n>1)& \end{cases} \]

构造生成函数求解

\[\begin{array}{lcl} G(x)=1 \cdot x^1+3\cdot x^2+7\cdot x^3+15\cdot x^4 +\cdots\\\\ 2x\cdot G(x)=\qquad 2\cdot x^2+6\cdot x^3 +14 \cdot x^4\;+\cdots\\\\ G(x)-2x\cdot G(x)=x^1+x^2+x^3+x^4+\cdots\\\\ (1-2x)G(x)=\frac{1}{1-x}-1 \\\\ (1-2x)G(x)=\frac{x}{1-x} \\\\ G(x)=\frac{x}{(1-2x)(1-x)}=\frac{1}{1-2x}-\frac{1}{1-x}\\\\\\ \qquad\;\;=(1+2x+2^2x^2+2^3x^3+\cdots+2^nx^n)-(1+x^1+x^2+\cdots+x^n)\\\\ \qquad\;\;=(2^1-1)x+(2^2-1)x^2+\cdots(2^n-1)x^n\\\\ \Rightarrow F(n)=2^n-1 \end{array} \]

相关文章:

  • 2022-12-23
  • 2021-04-29
  • 2022-12-23
  • 2021-11-18
  • 2021-12-28
  • 2021-06-04
  • 2021-07-22
猜你喜欢
  • 2021-12-25
  • 2021-05-05
  • 2021-08-17
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案