Chapter 1 Recurrent Problems


Warmups

Homework exercises

1.8

List Q1 through Q6, we could find out that Q is periodic.

Qm=α;Qm+1=β;Qm+2=(1+β)/α;Qm+3=(1+α+β)/(αβ);Qm+4=(1+α)/β,for m{0,5,10,}.

1.9a

x1xn(x1++xn1+xnn)nby (n1)xn=x1++xn1x1xn((n1)xn+xnn)nx1xn1(xn)n1x1xn1(x1++xn1n1)n1.

1.9b

x1xnxn+1x2n(x1++xnn)n(xn+1++x2nn)nby P(2):x1x2(x1+x22)2((x1++xn+xn+1++x2n2)2n2)n(x1++xn+xn+1++x2n2n)2n.

1.9c

For example, P(5) follows from P(6) from P(3) from P(4) from P(2) which is proved to be true. And whenever n>1, P(n) is finally based on P(2).

1.10

It’s clear that Qn=2Rn1 if we

  1. move n1 disks counter-clockwise;
  2. move the largest disk clockwise;
  3. move n1 disks counter-clockwise again.

Then Rn=2Rn+Qn1+2 if we

  1. move n1 disks counter-clockwise;
  2. move the largest disk clockwise;
  3. move n1 disks clockwise;
  4. move the largest disk clockwise again;
  5. move n1 disks back counter-clockwise.

Plug Qn=2Rn1 in, then Rn=Qn+Qn1+1.

1.11a

Move a double (n1)-tower, then move the two largest disks, which takes 2 moves, then move the double (n1)-tower again. Let An be the minimum number of moves, hence An=2An1+2=2n+12.

1.11b

Let Bn be the minimum number of moves to move a double n-tower in the original order; Hn be the minimum number of moves to move a double n-tower except for the bottom disk. Then we have Bn=Hn+1+Bn1+1+Bn1 and Hn=Bn1+1+Bn1.

Insert Hn to the Bn equation, we could get Bn=4Bn1+3=4n1.

By referring to the answer, I found out that my approach above wasn’t correct. I’ve made a mistake that I postulated all disks never change the order during their moves, which is not necessary.

It can be shown that no strategy does better than Bn=An1+2+An1+2+Bn1. This strategy changes the order of bottom two disks twice but doesn’t care whether the upper disks keep the order during their moves, which is also the reason why we use An here. Thus, Bn=2n+25.

1.12

A(m1,,mn)=2A(m1,,mn1)+mn.

This is an equation of the “generalized Josephus” type, whose solution is (m1mk)2.

1.13

We already know n straight lines define Ln=n(n+1)2+1 regions on a plane, and when the n-th line is added in, n new areas are created.

Let the zig-zags be extremely narrow to be seen as straight lines to some extent. So when the n-th zig-zag is added in, n new areas are created “in the straight line manner.”

We could also see that when two zig-zags intersect, 8 new areas are created “around their intersection” in the way shown below:

And when the n-th zig-zag is added in, there are at most n1 new “intersections.” So

ZZn=ZZn1+n+8(n1)=92n2+72n+1.

1.14

n new areas are created when the n-th line is added into the plane, which is equal to the maximum number of line segments created by splitting a line with n1 points. Analogously, Ln1 new pieces of cheese is created when making the n-th slice.

So, in recurrence form

Pn={1,if n=0;Pn1+Ln1,if n>0.

We have P5=26.

1.15

The function I has the same recursion relation as J, but with different boundary values, which are I(2)=2,I(3)=1.

Thus, we cannot find a unique I(1) that satisfies this recurrence. So we have to split it into two cases, one with I(2)=2 and one with I(3)=1.

Let’s represent in terms of n=2m+l, and let β0=1,β1=1. The recurrence unfolds, binary-wise:

I((bmbm1b0)2)=2I((bmbm1b1)2)+βb0=2m1I((bmbm1)2)++2βb1+βb0.

Then we can stop here, so far the function I have the same form as J, and the two leading bits (bmbm1)2 are enough to contain the two cases:

J(2)=1,I(2)=2I(n)J(n)=2m1;J(3)=3,I(3)=1I(n)J(n)=2m.

That is to say

I(n)={J(n)+2m1,if 0l<2m1;J(n)2m,if 2m1l<2m.

1.16

Express g(n) in the form

g(n)=A(n)α+B(n)β0+C(n)β1+D(n)γ.

Let g(n)=1, which implies (α,β0,β1,γ)=(1,2,2,0). Then

(1)A(n)2B(n)2C(n)=1.

Let g(n)=n, which implies (α,β0,β1,γ)=(1,0,1,1). Then

(2)A(n)+C(n)D(n)=n.

Let (α,β0,β1,γ)=(1,2,2,0), which gives g(n)=3m. Then (note we’re representing in terms of n=2m+l)

(3)A(n)=3m.

Let (α,β0,β1,γ)=(0,0,1,0). Similar to the binary expansion in the Josephus problem, we have

(4)C(n)=(bm1b0)3.

I also checked that for (1)(2)(3) and (4),

|1220101110000010|0.

The recurrence is solvable; hence

A(n)=3m;B(n)=(3m2(bm1b0)31)/2;C(n)=(bm1b0)3;D(n)=3m+(bm1b0)3n.

Then

g(n)=3mα+(3m2(bm1b0)31)β02+(bm1b0)3β1+(3m+(bm1b0)3n)γ=(α+β02+γ)3m+(β0+β1+γ)(bm1b0)3β02nγ.

Comments

Powered By Valine
v1.5.2