I'm learning discrete math and didn't have any trouble with any recurrences in the examples I went over through the chapters on it, but this one problem at the end of the first chapter is killing me, and there's no solution in the book. There's got to be some trick to it that I'm just not seeing. Below is the recurrence and how I'm trying to solve it.
So, right off the bat this one confuses me because a0=1. So, if I try to solve for a1 just by plugging in a0, I get 1. This continues on and and on and on for an as n increases. So, I tried using iteration to go up to a5 to find a pattern.
I get:
a5=3(a4)−2=3a50−2(34)−2(33)−2(32)−2(3)−2. Now, this kind of looks like a geometric sequence, but it's all subtracting vs adding, and if I plug one in for a0, I get 1−2(34)−2(33)−2(32)−2(3)−2. Is my closed form then an=1−2(3n−1)? This just doesn't seem right to me.
Then if I try to solve by induction to try and check my answer, I get:
Basis: (used 0 since I don't know 1) for n=0, an=1−2(3n−1)=1−2(30−1)=1 which is true.
NTS: nK+1=1−2(3k+1−1)
so, nk+1=3ak−1−2=3(1−2(3k−1))−2 <-- and then I get stuck here, so I can't verify by induction.
Thanks, any input is highly appreciated. I'm ripping my hair out over this.
Answer
Just iterate:
an=3an−1−2=3(3an−2−2)−2=32an−2−3⋅2−2=32(3an−3−2)−3⋅2−2=33an−3−32⋅2−3⋅2−2⋮=3kan−k−3k−1⋅2−3k−2⋅2−…−3⋅2−2⋮=3na0−3n−1⋅2−3n−2⋅2−…−3⋅2−2=3n−3n−1⋅2−3n−2⋅2−…−3⋅2−2=3n−2n−1∑k=03k∗=3n−2⋅3n−13−1=3n−(3n−1)=1.
The starred step just used the formula for the sum of a geometric series.
Of course properly speaking you should now go back and prove by induction that an really is 1 for all n.
Note that you really didn’t need to unravel the recurrence in order to solve it: once you calculate a1 and a2, say, it should be obvious that the calculation is identical each time and that you’re going to get an=1 for all n. Once you make that easy guess, you can go ahead and prove by induction on n that it’s correct.
Another elementary technique that you can use on recurrences of the form xn=axn−1−b is to make a substitution, shifting the variable by a constant amount. I’ll illustrate with your example
Let bn=an−d for some constant d that will be determined in a bit. Then an=bn+d, and the recurrence an=3an−1−2 can be rewritten as bn+d=3(bn−1+d)−2=3bn−1+3d−2, which simplifies to bn=3bn−1+2d−2. If we set d=1, this becomes simply bn=3bn−1. You probably recognize at once that the solution to this recurrence is just bn=3nb0. And since an=bn+1, we’ll have the solution an=3nb0+1 as soon as we determine b0. But that’s easy: b0=a0−d=a0−1=0, so an=1 for all n.
No comments:
Post a Comment