小马的世界

【离散数学】笔记-台湾清华赵启超13A13B Recurrence Relations

2021-08-13 · 7 min read
离散数学 数学

这是台湾清华赵启超教授离散数学13A13B课程的笔记。

Guessing Particular Solution

anc1an1c2An2ckank=fna_n-c_1a_{n-1}-c_2A_{n-2}-\dotsc -c_ka_{n-k}=f_n

Forcing Sequence(fnf_n) Trial Sequence(PnP_n)
b0b_0 B0B_0
b1n+b0b_1n+b_0 B1n+B0B_1n+B_0
bmnm+bm1nm1++b0b_mn^m+b_{m-1}n^{m-1}+\dotsc +b_0 Bmnm+Bm1nm1++B0B_mn^m+B_{m-1}n^{m-1}+\dotsc +B_0
b0λnb_0\lambda ^n B0λnB_0\lambda ^n
(b1n+b0)λn(b_1n+b_0)\lambda ^n (B1n+B0)λn(B_1n+B_0)\lambda ^n
(bmnm+bm1nm1++b0)λn(b_mn^m+b_{m-1}n^{m-1}+\dotsc +b_0)\lambda ^n (Bmnm+Bm1nm1++B0)λn(B_mn^m+B_{m-1}n^{m-1}+\dotsc +B_0)\lambda ^n
b0cos(nθ)b_0cos(n\theta ) B0cos(nθ)+B1sin(nθ)B_0cos(n \theta)+B_1sin(n\theta)
b0sin(nθ)b_0sin(n\theta ) B0cos(nθ)+B1sin(nθ)B_0cos(n \theta)+B_1sin(n\theta)
b0λncos(nθ)b_0\lambda ^ncos(n\theta ) B0λncos(nθ)+B1λnsin(nθ)B_0\lambda ^ncos(n \theta)+B_1\lambda ^nsin(n\theta)
b0λnsin(nθ)b_0\lambda ^nsin(n\theta ) B0λncos(nθ)+B1λnsin(nθ)B_0\lambda ^ncos(n \theta)+B_1\lambda ^nsin(n\theta)

Example 1
an2an1=na_n-2a_{n-1}=n for n1n\ge 1 with a0=1a_0=1
The general solution to the associated HRR is α12n\alpha _12^n
Let the trial sequence for a particular solution to the NRR be Pn=B1n+B0P_n=B_1n+B_0
that is (B1n+B0)2(B1(n1)+B0)=n(B_1n+B_0)-2(B_1(n-1)+B_0)=n
so B1n+(2B1B0)=n-B_1n+(2B_1-B_0)=n
that is B1=1,B0=2,Pn=n2B_1=-1, B_0=-2, P_n=-n-2
The general solution to the NRR is an=α12nn2a_n=\alpha _12^n-n-2
For n=0,1=a0=α12n=0,1=a_0=\alpha _1-2 that is α1=3\alpha _1=3
Therefore, an=3×2nn2a_n=3\times 2^n-n-2 for n0n\ge 0.

Example 2
an+24an+1+4an=2n,n0a_{n+2}-4a_{n+1}+4a_n=2^n,n\ge 0 with a0=a1=0a_0=a_1=0
HRR: an+24an+1+4an=0a_{n+2}-4a_{n+1}+4a_n=0 characteristic equation is r24r+4=0r^2-4r+4=0. r=2,2r=2,2
So the general solution to the associated HRR is α12n+α2n2n\alpha _1 2^n+\alpha _2n2^n
Try the trail sequence Pn=B02nP_n=B_02^n for a particular solution to the NRR.

B02n+24B02n+1+4B02n=2nB_02^{n+2}-4B_02^{n+1}+4B_02^n=2^n

that is

B02n(48+4)=2nB_02^n(4-8+4)=2^n

that is 0=2n0=2^n. It is a contradiction.
Then try Pn=B0n2nP_n=B_0n2^n

B0(n+2)2n+24B0(n+1)2n+1+4B0n2n=2nB_0(n+2)2^{n+2}-4B_0(n+1)2^{n+1}+4B_0n2^n=2^n

that is

B02n(4n+88n8+4n)n=2nB_02^n(4n+8-8n-8+4n)n=2^n

that is 0=2n0=2^n. It is also a contradiction.
Now try Pn=B0n22nP_n=B_0n^22^n

B0(n+2)22n+24B0(n+1)22n+1+4B0n22n=2nB_0(n+2)^22^{n+2}-4B_0(n+1)^22^{n+1}+4B_0n^22^n=2^n

that is

B02n(4(n+2)28(n+1)2+4n2)=2nB_02^n(4(n+2)^2-8(n+1)^2+4n^2)=2^n

that is 8=2n8=2^n.B0=18B_0=\frac{1}{8}
so Pn=18n22nP_n=\frac{1}{8}n^22^n is a particular solution to the NRR.
Hence the general solution to the NRR is an=α12n+α2n2n+18n22na_n=\alpha _12^n+\alpha _2n2^n+\frac{1}{8}n^22^n
For initial conditions,

0=a0=α10=a_0=\alpha _1

0=a1=2α1+2α2+140=a_1=2\alpha _1 +2\alpha _2 +\frac{1}{4}

α1=0,α2=18\alpha _1=0, \alpha _2 =-\frac{1}{8}

an=18n2n+18n22na_n=\frac{1}{8}n2^n+\frac{1}{8}n^22^n

so solution is an=n(n1)2n3a_n=n(n-1)2^{n-3} for n0n\ge 0.

In general, if the trial sequence mentioned above fails, multiply it by n. Try again. Repeat this procedure as often as necessary to find a particular solution.