多项式的化简求法

前言:

作为一名OIer,数学推导一定不能差。

例子:

用尽量快的方法求以下式子:

  1. ∑ i = 0 n − 1 a i ∗ b n − 1 − i     ( n ∈ N + ) \sum_{i=0}^{n-1} a^i*b^{n-1-i}~~~ (n \in N_+) i=0n1aibn1i   (nN+)
  2. ∑ i = 0 n − 1 ( − 1 ) i ∗ a n − 1 − i ∗ b i      ( 2 ∣ n ) \sum_{i=0}^{n-1}(-1)^i*a^{n-1-i}*b^i~~~~ (2|n) i=0n1(1)ian1ibi    (2n)
  3. ∑ i = 0 n − 1 ( − 1 ) i ∗ a n − 1 − i ∗ b i      ( n = 2 k + 1 , k ∈ N + ) \sum_{i=0}^{n-1}(-1)^i*a^{n-1-i}*b^i~~~~ (n=2k+1,k\in N_+) i=0n1(1)ian1ibi    (n=2k+1,kN+)
  4. ∑ i = 1 n i 2 \sum_{i=1}^n i^2 i=1ni2

∑ \sum 只是为了好看,建议读者把求和式展开。

公式:

  1. a n − b n = ( a − b ) ∗ ∑ i = 0 n − 1 a i ∗ b n − 1 − i     ( n ∈ N + ) a^n-b^n=(a-b)*\sum_{i=0}^{n-1} a^i*b^{n-1-i}~~~ (n \in N_+) anbn=(ab)i=0n1aibn1i   (nN+)
  2. a n − b n = ( a + b ) ∗ ∑ i = 0 n − 1 ( − 1 ) i ∗ a n − 1 − i ∗ b i      ( 2 ∣ n ) a^n-b^n=(a+b)*\sum_{i=0}^{n-1}(-1)^i*a^{n-1-i}*b^i~~~~ (2|n) anbn=(a+b)i=0n1(1)ian1ibi    (2n)
  3. a n + b n = ( a + b ) ∗ ∑ i = 0 n − 1 ( − 1 ) i ∗ a n − 1 − i ∗ b i      ( n = 2 k + 1 , k ∈ N + ) a^n+b^n=(a+b)*\sum_{i=0}^{n-1}(-1)^i*a^{n-1-i}*b^i~~~~ (n=2k+1,k\in N_+) an+bn=(a+b)i=0n1(1)ian1ibi    (n=2k+1,kN+)
  4. ∑ i = 1 n i 2 = n ∗ ( n + 1 ) ∗ ( 2 n + 1 ) / 6 \sum_{i=1}^n i^2=n*(n+1)*(2n+1)/6 i=1ni2=n(n+1)(2n+1)/6

推导:

1.                     a n − b n = ( a − b ) ∗ ∑ i = 0 n − 1 a i ∗ b n − 1 − i     ( n ∈ N + ) ~~~~~~~~~~~~~~~~~~~a^n-b^n=(a-b)*\sum_{i=0}^{n-1} a^i*b^{n-1-i}~~~ (n \in N_+)                    anbn=(ab)i=0n1aibn1i   (nN+)

右 边 = ∑ i = 1 n a i ∗ b n − i − ∑ i = 0 n − 1 a i ∗ b n − i 右边=\sum_{i=1}^na^i*b^{n-i}-\sum_{i=0}^{n-1}a^i*b^{n-i} =i=1naibnii=0n1aibni
= a n ∗ b 0 − a 0 ∗ b n = a n − b n =a^n*b^0-a^0*b^n=a^n-b^n =anb0a0bn=anbn

2.             a n − b n = ( a + b ) ∗ ∑ i = 0 n − 1 ( − 1 ) i ∗ a n − 1 − i ∗ b i      ( 2 ∣ n ) ~~~~~~~~~~~a^n-b^n=(a+b)*\sum_{i=0}^{n-1}(-1)^i*a^{n-1-i}*b^i~~~~ (2|n)            anbn=(a+b)i=0n1(1)ian1ibi    (2n)

右 边 = ∑ i = 0 n − 1 ( − 1 ) i ∗ a n − i ∗ b i − ∑ i = 1 n ( − 1 ) i − 1 ∗ a n − i ∗ b i = a n − b n 右边=\sum_{i=0}^{n-1}(-1)^i*a^{n-i}*b^i-\sum_{i=1}^n(-1)^{i-1}*a^{n-i}*b^i=a^n-b^n =i=0n1(1)ianibii=1n(1)i1anibi=anbn

3. 类似2的证明。

4.          ∑ i = 1 n i 2 = n ∗ ( n + 1 ) ∗ ( 2 n + 1 ) / 6 ~~~~~~~~\sum_{i=1}^n i^2=n*(n+1)*(2n+1)/6         i=1ni2=n(n+1)(2n+1)/6

n 3 − ( n − 1 ) 3 = 1 ∗ [ n 2 + ( n − 1 ) 2 + n ( n − 1 ) ] n^3-(n-1)^3=1*[n^2+(n-1)^2+n(n-1)] n3(n1)3=1[n2+(n1)2+n(n1)]
= n 2 + ( n − 1 ) 2 + n 2 − n =n^2+(n-1)^2+n^2-n =n2+(n1)2+n2n
= 2 ∗ n 2 + ( n − 1 ) 2 − n =2*n^2+(n-1)^2-n =2n2+(n1)2n
n 3 − 1 3 = n 3 − ( n − 1 ) 3 + ( n − 1 ) 3 − ( n − 2 ) 3 … … + 2 3 − 1 3 n^3-1^3=n^3-(n-1)^3+(n-1)^3-(n-2)^3……+2^3-1^3 n313=n3(n1)3+(n1)3(n2)3+2313
n 3 − 1 3 = 2 ∗ ( 2 2 + 3 2 + . . . + n 2 ) + [ 1 2 + 2 2 + . . . + ( n − 1 ) 2 ] − ( 2 + 3 + 4 + . . . + n ) n^3-1^3=2*(2^2+3^2+...+n^2)+[1^2+2^2+...+(n-1)^2]-(2+3+4+...+n) n313=2(22+32+...+n2)+[12+22+...+(n1)2](2+3+4+...+n)
n 3 − 1 = 2 ∗ ( 1 2 + 2 2 + 3 2 + . . . + n 2 ) − 2 + [ 1 2 + 2 2 + . . . + ( n − 1 ) 2 + n 2 ] − n 2 − ( 2 + 3 + 4 + . . . + n ) n^3-1=2*(1^2+2^2+3^2+...+n^2)-2+[1^2+2^2+...+(n-1)^2+n^2]-n^2-(2+3+4+...+n) n31=2(12+22+32+...+n2)2+[12+22+...+(n1)2+n2]n2(2+3+4+...+n)
n 3 − 1 = 3 ∗ ( 1 2 + 2 2 + 3 2 + . . . + n 2 ) − 2 − n 2 − ( 1 + 2 + 3 + . . . + n ) + 1 n^3-1=3*(1^2+2^2+3^2+...+n^2)-2-n^2-(1+2+3+...+n)+1 n31=3(12+22+32+...+n2)2n2(1+2+3+...+n)+1
n 3 − 1 = 3 ( 1 2 + 2 2 + . . . + n 2 ) − 1 − n 2 − n ( n + 1 ) / 2 n^3-1=3(1^2+2^2+...+n^2)-1-n^2-n(n+1)/2 n31=3(12+22+...+n2)1n2n(n+1)/2
3 ( 1 2 + 2 2 + . . . + n 2 ) = n 3 + n 2 + n ( n + 1 ) / 2 = ( n / 2 ) ( 2 n 2 + 2 n + n + 1 ) = ( n / 2 ) ( n + 1 ) ( 2 n + 1 ) 3(1^2+2^2+...+n^2)=n^3+n^2+n(n+1)/2=(n/2)(2n^2+2n+n+1) =(n/2)(n+1)(2n+1) 3(12+22+...+n2)=n3+n2+n(n+1)/2=(n/2)(2n2+2n+n+1)=(n/2)(n+1)(2n+1)
1 2 + 2 2 + 3 2 + . . . + n 2 = n ( n + 1 ) ( 2 n + 1 ) / 6 1^2+2^2+3^2+...+n^2=n(n+1)(2n+1)/6 12+22+32+...+n2=n(n+1)(2n+1)/6

结论:

  1. ∑ i = 0 n − 1 a i ∗ b n − 1 − i = ( a n − b n ) / ( a − b )     ( n ∈ N + ) \sum_{i=0}^{n-1} a^i*b^{n-1-i}=(a^n-b^n)/(a-b)~~~ (n \in N_+) i=0n1aibn1i=(anbn)/(ab)   (nN+)
  2. ∑ i = 0 n − 1 ( − 1 ) i ∗ a n − 1 − i ∗ b i = ( a n − b n ) / ( a + b )      ( 2 ∣ n ) \sum_{i=0}^{n-1}(-1)^i*a^{n-1-i}*b^i=(a^n-b^n)/(a+b)~~~~ (2|n) i=0n1(1)ian1ibi=(anbn)/(a+b)    (2n)
  3. ∑ i = 0 n − 1 ( − 1 ) i ∗ a n − 1 − i ∗ b i = ( a n + b n ) / ( a + b )      ( n = 2 k + 1 , k ∈ N + ) \sum_{i=0}^{n-1}(-1)^i*a^{n-1-i}*b^i=(a^n+b^n)/(a+b)~~~~ (n=2k+1,k\in N_+) i=0n1(1)ian1ibi=(an+bn/(a+b)    (n=2k+1,kN+)
  4. ∑ i = 1 n i 2 = n ∗ ( n + 1 ) ∗ ( 2 n + 1 ) / 6 \sum_{i=1}^n i^2=n*(n+1)*(2n+1)/6 i=1ni2=n(n+1)(2n+1)/6

1~3 都 由 可 以 用 快 速 幂 从 O ( n ) 优 化 到 O ( l o g   n ) . 都由可以用快速幂从O(n)优化到O(log ~n). O(n)O(log n).

4由 O ( n ) 优 化 成 O ( 1 ) O(n)优化成O(1) O(n)O(1).

推广:

如果1~3要求取模,那就用快速幂+乘法逆元。

你可能感兴趣的:(多项式的化简求法)