反演原理

已知: f(n)=i=0nanig(i) f ( n ) = ∑ i = 0 n a n i ⋅ g ( i )

即: f(0)=a00g(0)f(1)=a10g(0)+a11g(1)f(n)=an0g(0)+an1g(1)++anng(n) { f ( 0 ) = a 00 ⋅ g ( 0 ) f ( 1 ) = a 10 ⋅ g ( 0 ) + a 11 ⋅ g ( 1 ) ⋯ f ( n ) = a n 0 ⋅ g ( 0 ) + a n 1 ⋅ g ( 1 ) + ⋯ + a n n ⋅ g ( n )

化成矩阵形式:

f(0)f(1)f(2)f(n)=a00a10a20an00a11a21an100a22an2000an3000ann×g(0) g(1) g(2)  g(n) ( f ( 0 ) f ( 1 ) f ( 2 ) ⋮ f ( n ) ) = ( a 00 0 0 0 ⋯ 0 a 10 a 11 0 0 ⋯ 0 a 20 a 21 a 22 0 ⋯ 0 ⋮ ⋮ ⋮ ⋮ ⋱ ⋮ a n 0 a n 1 a n 2 a n 3 ⋯ a n n ) × ( g ( 0 )   g ( 1 )   g ( 2 )   ⋮   g ( n ) )


反演求: g(n)=i=0nbnif(i) g ( n ) = ∑ i = 0 n b n i ⋅ f ( i )

即: g(0)=b00f(0)g(1)=b10f(0)+b11f(1)g(n)=bn0f(0)+bn1f(1)++bnnf(n) { g ( 0 ) = b 00 ⋅ f ( 0 ) g ( 1 ) = b 10 ⋅ f ( 0 ) + b 11 ⋅ f ( 1 ) ⋯ g ( n ) = b n 0 ⋅ f ( 0 ) + b n 1 ⋅ f ( 1 ) + ⋯ + b n n ⋅ f ( n )

考虑: f(n)=i=0nanig(i)=i=0nanij=0ibijf(j) f ( n ) = ∑ i = 0 n a n i ⋅ g ( i ) = ∑ i = 0 n a n i ⋅ ∑ j = 0 i b i j ⋅ f ( j )

即下列矩阵所有数字之和:

an0b00f(0)an1b10f(0)an2b20f(0)annbn0f(0)an1b11f(1)an2b21f(1)annbn1f(1)an2b22f(2)annbn2f(2)annbn3f(3)annbnnf(n) ( a n 0 b 00 f ( 0 ) a n 1 b 10 f ( 0 ) a n 1 b 11 f ( 1 ) a n 2 b 20 f ( 0 ) a n 2 b 21 f ( 1 ) a n 2 b 22 f ( 2 ) ⋮ ⋮ ⋮ ⋱ a n n b n 0 f ( 0 ) a n n b n 1 f ( 1 ) a n n b n 2 f ( 2 ) a n n b n 3 f ( 3 ) ⋯ a n n b n n f ( n ) )

即: f(n)=j=0nf(j)i=jnanibij f ( n ) = ∑ j = 0 n f ( j ) ∑ i = j n a n i ⋅ b i j

所以: i=jnanibij={0(jn)1(j=n) ∑ i = j n a n i ⋅ b i j = { 0 ( j ≠ n ) 1 ( j = n )

对于二项式反演: ani=Cin a n i = C n i

对于莫比乌斯反演: ani={1(n%i=0)0(n%i0) a n i = { 1 ( n % i = 0 ) 0 ( n % i ≠ 0 )

你可能感兴趣的:(数学)