 Hi again, and welcome to this final video in a series on linear homogeneous recurrence relations. In this video we're going to outline and then use a technique for finding closed formula solutions to linear homogeneous recurrence relations of orders one and two. This technique first requires that we have a linear first or second order homogeneous recurrence relation with initial conditions this time. So the steps for finding a closed formula solution are as follows. We're first going to find the characteristic equation for the recurrence relation like we saw in the last video. Then we're going to use algebra which could be partly factoring and partly the quadratic formula to find the characteristic roots for the recurrence relation. We're going to call those just for the time being r1 and r2 and as we mentioned in the last video we're going to assume that those r1 and r2 are different distinct roots. If you had a first order equation that you were solving realize that would only be one root. Finally we're going to do the following. We're going to set up the following framework for our closed formula solution. a to the nth power equals c1r1 to the nth plus c2r2 to the nth where r1 and r2 were the characteristic roots we found in step two. This leaves only c1 and c2 as undetermined numbers and our job is to find the values of c1 and c2 that satisfy the initial conditions. So let's look at an example where we have a sub n equals three times a sub n minus one and a single initial condition of a1 equals two. We've already seen that r minus three equals zero is the characteristic equation for this recurrence relation and therefore r equals three is the one characteristic root that we have. Now we're going to use our framework to set up this equation a n equals c1 three to the nth. There is only one root here so only one c and only one term in the framework formula. Our job now is to find the value of c1 so that the initial condition is satisfied. We do that by noticing that when n equals one, a of one is equal to two because that's what the initial condition is. But at the same time the framework says that a1 is c1 times three to the first by plugging in n equals one into the formula for the framework. For the two and the c1 three to the first are equal to each other. And that means that I can solve for c1 and get c1 equals two thirds. Now we can go back to the framework and put in two thirds where we saw c1 to get our closed formula solution. You should take the time now to stop and check that the solution really works using the solution checking techniques that we discussed in class. Our second example is a little longer. It's this recurrence relation we've seen earlier but we're going to add the initial conditions a0 equals one and a1 equals zero. Now we saw earlier that the characteristic equation for this recurrence relation is r squared minus 5r plus 6 equals zero. And so the characteristic roots are three and two. These are distinct roots and so we can set up our framework by just plugging in the roots but leaving the c1 and c2 undetermined. Our job is to find the values of c1 and c2 that make the initial conditions, both of those initial conditions, satisfied. And there are two initial conditions to consider. When n equals zero, we know that a of zero is equal to one by definition. And so a zero is also equal to this, which is what we get by taking the framework formula and plugging in n equals zero. Likewise, a of one is equal to zero by definition, but a one is also equal to the expression we get when we plug n equals one into the framework. So what we have here are two linear equations that are simultaneously true. Otherwise known as a system of linear equations. Back in algebra or perhaps more recently in linear algebra, if you've taken that course yet. We've learned a number of techniques for solving systems of linear equations. I'm going to use a very simple and crude technique for solving one of the equations for one of the variables. Substituting it into the other equation and then solving for the remaining variable, that gives me C2 equals negative two. If I plug that back into the other equation, I'm going to get C1 equals three. Now I can take both of those constants, C1 and C2, and put them back into the framework formula, and get my final closed solution, which is this. Again, it is well worth your while to stop and just check if the solution really works. Finally, a tip for using technology. On Wolfram Alpha, you can enter in recurrence relations just like you would on paper, except you should use function notation and specify the initial conditions. For example, here is the recurrence relation with initial conditions that we saw on the last slide. When you enter this in and hit enter, Wolfram Alpha will solve the recurrence relation for you. Using Wolfram Alpha in this way, you can practice solving recurrence relations almost infinitely. Just make up recurrence relations and make sure they're linear and homogeneous in either first or second order. Solve them by hand using the technique you've just seen and then check them with the computer. Some parting notes here. First, this technique does not work if the characteristic roots are duplicated, only if the roots are different. There is a variation on this technique if the roots are repeated, but we will not study it in our class. Secondly, an analog of this technique also works for third and fourth and higher order recurrence relations as well. We're just going to stick to the first and second order cases for the sake of simplicity. Thanks for watching.