 In today's lecture we will be discussing generating functions we have already discussed in our previous lecture the idea of a discrete numeric function we recall that if we have the set of natural numbers 0 1 2 3 and so on and the set of real numbers then any function from N 2 R is called a discrete numeric function. Now we have also seen that a discrete numeric function is written in a somewhat different form than a than an usual function that is we write it in form of a sequence we write in print we write a bold letter small a otherwise we may write a and put an underline on a and this is a sequence a 0 a 1 a 2 dot dot a R and so on it is understood that this a represents the concern discrete numeric function and a 0 is its value at the point 0 a 1 is its value at the point 1 a 2 is the value at the point 2 and so on given a discrete numeric function like this we can write a power series type of expression which is called the generating function corresponding to the discrete numeric function the generating function corresponding to a is gx equal to a 0 plus a 1 a 1 x a 1 x plus a 2 x square plus and so on up to a R x to the power R plus and so on in a compact notation we can write this as sigma R equal to 0 to infinity a sub R x to the power R we will see that given generating functions we can add and multiply by scalar and also we can mutually multiply the generating functions so suppose hx is another generating function corresponding to a discrete numeric function B which is the function having the values B0 B1 and so on so we get a generating function of this type or in our compact notation R from 0 to infinity Br x to the power R then addition is defined as hx plus gx equal to sigma R equal to 0 to infinity a R plus Br x to the power R in other words this is a 0 plus B0 plus a 1 plus B1 x plus a 2 plus B2 x square moving onward to the general term a R plus Br x to the power R plus and so on now if we remember the discussions on the previous lecture we showed that generating functions can be added so if we have the generating function a 0 a 1 a 2 a R and so on and B as B0 B1 B2 and so on the general term Br and so on we have seen that the sum of the of these two discrete numeric functions is a 0 plus B0 a 1 plus B1 a R plus Br and so on and from what we have seen just now this discrete numeric functions generating function is hx plus gx in the similar way we can define scalar multiplication by alpha which is an element of R if we take a generating function hx then alpha times hx is simply alpha a 0 plus alpha times a 1 x plus alpha times a 2 x square and the general term alpha a sub R x to the power R and so on and so we see that this is this corresponds to the discrete numeric function alpha a 0 alpha a 1 alpha a 2 and alpha a R and so on thus we see that the operations on generating functions correspond to the operations on discrete numeric functions parallely now we define another operation on discrete numeric function which is called convolution products now if we take as before the discrete numeric function a and the discrete numeric function B then the convolution of a and B is defined as a discrete numeric function given by a star B let us say it is equal to C where the elements of C R C 1 C 2 C C 0 C 1 C 2 and so on up to C R where C R is a I B R – I I running from 0 to R for example we see that if R equal to 0 C 0 is a 0 B 0 C 1 is a 0 B 1 a 1 B 0 C 2 is a 0 B 2 plus a 1 B 1 plus a 2 B 0 and so on now we ask that what is the corresponding operation on generating functions of these discrete numeric functions now as we see that this operation is nothing but the product of the two generating functions so we take capital Hx and capital Gx as the generating functions of B and a so let us write a fresh suppose gx is equal to a 0 plus a 1 x plus a 2 x square plus a r x to the power r and Hx is equal to B 0 plus B 1 x plus B 2 x square plus and so on B r x to the power r and and so on if we take the product gx into Hx gx into Hx then this is product of these two sequences a 0 a 1 x a 2 x square plus a r x to the power r plus and so on multiplied by B 0 plus B 1 x plus B 2 x square and so on B r x to the power r plus and so on now this is equal to see the first term is by combining a 0 with B 0 so I have got a 0 B 0 the second term is the indeterminate x along with the coefficient a 0 B 1 plus a 1 B 0 it goes like this so I have a 0 B 1 plus a 1 B 0 x then the third term is a 2 B 2 sorry a 0 B 2 then a 1 B 1 plus a 2 B 0 alright and so on and we have to find the expression for the rth term if you look closely we will find that the expression of the rth term is the rth term sigma a i B r minus i i running from 0 to r thus we see that the of course just to be more specific this will be the rth term is has x to the power r with it so the coefficient of the rth term is sigma a i B R minus i i runs from 0 to r therefore we see that the coefficient of x to the power r in the product gx times hx is the convolution product of a and b now this product has several interesting applications the first application is very useful in writing generating functions in compact closed forms now we take two generating functions one is given by gx is equal to 1 minus x the other one is given by hx is equal to 1 plus x plus x square plus x cube and so on up to x to the power r and then onward now if we multiply gx and hx then we get 1 minus x multiplied by 1 plus x plus x square plus x cube plus and so on up to x to the power r plus and so on so if I now multiply the first term 1 to all the terms in the second factor I will get 1 plus 1 into x x plus x square plus x cube plus plus and so on up to x to the power r and onward and then the second term of the first factor minus x is multiplied to the to all the terms in the second factor and we obtain minus x minus x square minus x cube and so on minus x to the power r and so on so we see that there are many cancellations in fact all the terms will cancel except one therefore we will have 1 minus x into 1 plus x plus x square plus x to the power r plus and so on equal to 1 and therefore we we can write 1 plus x plus x square plus so on up to x to the power r and so on as 1 minus x inverse because this infinite series 1 plus x plus x square plus x to the power r when multiplied by 1 minus x and in fact we can check that the order doesn't matter it may be 1 minus x and the series or the series into 1 minus x in both the cases we get 1 therefore this series is the inverse of 1 minus x and therefore can be written as 1 minus x inverse and we can even write it as 1 minus 1 by 1 minus x here we see that we are not putting any numerical values in the place of x so these infinite series that we obtain as generating functions of discrete numeric functions are purely symbolic or formal so there is no concept of convergence that we get in real analysis so there is nothing called divergence nothing called convergence it is only important that these series should be well defined that is if you give me an R no matter how large I should be able to compute the coefficient corresponding to the up to R in finite time and that's all what I need therefore I can have an agreement of writing 1 plus x plus x square and so on as simply 1 upon 1 minus x we see here that x is a pure symbol so x can be replaced by anything else and for example if I took 3x instead of x then I would have got x plus 3x plus 3x whole square plus and so on up to 3x to the power R and so on this is equal to 1 minus 3x we can check that by multiplying according to the rule of multiplication that we have defined so if we now process the left hand side of the equation we see that 1 minus 1 by 1 by 1 minus 3x is equal to 1 plus 3 times x plus 3 square times x square plus and so on up to 3 to the power R times x to the power R and so on therefore we see that the generating function corresponding to the discrete numeric function 3 to the power 0 3 3 square and so on 3 to the power R and so on let us call this a the generating function corresponding to this a is 1 upon 1 minus 3x thus we have seen how to get a generating function of a discrete numeric function in its closed form suppose we were given this discrete numeric function we then could have written this expression as generating function and by using the rules that we have derived already we could have come up to this we can now move on to another example of finding discrete numeric function corresponding to generating functions so let us look at this generating function let us call it gx which is equal to 2 upon 1 minus 2x 1 plus 2x which is of course equal to 2 upon 1 minus 4x square so it is possible that somebody tells me that look there is a discrete numeric there is a generating function gx which looks like this find out the discrete numeric function corresponding to this gx for that we will first factorize the denominator and write in this form and then decompose it in terms of partial fractions let us do that 1 minus 2x 1 plus 2x if we decompose in terms of partial fractions then it will be like this a upon 1 minus 2x plus b upon 1 plus 2x and we have to find the values of a and b so we write 1 minus 2x 1 plus 2x and in a numerator it is a plus twice ax plus b minus twice bx this is equal to now since this is an identity therefore we must have a plus b equal to 0 and a minus b equal to 0 a minus b equal to 0 means a equal to b I am sorry this is not 0 but it is 2 because we must remember that this expression should be identically equal to 1 minus 2x 1 plus 2x so therefore 2 is equal to a plus b and there is no x in the left hand side so the coefficient of x should be 0 therefore I have got a minus b equal to 0 and a plus b equal to 2 so from a minus b equal to 0 we have got a equal to b and therefore from this equation it is clear that a equal to b equal to 1 thus we have the decomposition of 2 upon 1 minus 2x 1 plus 2x as 1 by 1 minus 2x plus 1 by 1 plus 2x now by using our previous rule we can expand each of the terms of the right hand side into power series which will correspond to the generating function so it will be 1 plus 2x plus 2x whole square plus 2x whole cube plus so on 2x to the power r and so on and the other term will give me 1 plus minus 2x plus minus 2x whole square and so on up and the rth term is minus 2x raise to the power r and we can process it in this way we can write this is 1 plus 2x plus 2 square x square and so on up to 2 to the power r x to the power r and onward and 1 plus minus 2 of x plus minus 2 square x square plus and so on plus minus 2 raise to the power r x to the power r and so on so the coefficient of the rth term for r greater than or equal to 0 is some cr equal to 2 to the power r plus minus 2 to the power r for all r greater than or equal to 0 thus the corresponding discrete numeric function is I write here some C which is equal to C 0 C 1 CR as that CR is 2 to the power r plus minus 2 to the power r for r greater than or equal to 0 now we will start discussing some more operations on generating functions we have seen in case of discrete numeric functions that we have operations now if we a discrete numeric function a given by a 0 a 1 a 2 and so on a r like this then one right shift denoted by SA is the function 0 a 0 a 1 a 2 a r and so on if we apply a square to a then we have two right shifts which is 0 0 a 0 a 1 and so on now in case of generating functions it will be just multiplication by x so consider the generating function corresponding to a g x equal to a 0 plus a 1 x plus a 2 x square plus a r x to the power r and so on now we apply x on gx that is we multiply x to gx then we will get x times a 0 plus a 1 x plus up to a r x to the power r and so on this is equal to a 0 x plus a 1 x square and so on then I have got a r x to the power r so see now the coefficient a r becomes the coefficient corresponding to x to the power r plus 1 therefore the corresponding discrete numeric function will be 0 a 0 a 1 and so on a r and so on where this is in the r plus 1th position thus this is nothing but SA similarly we get a square a if we multiply by x square and in general if we want to find the discrete numeric function corresponding to s to the power i a by using generating function then we must multiply gx by x to the power i oh this is i gx which will give us a 0 x to the power i plus a 1 x to the power i plus 1 plus and so on a r x to the power r plus i and so on now we can also talk about the left sheet operation and we can in fact derive it starting from applying s to the power minus 1 to the discrete numeric function a so a is a 0 a 1 a 2 a r and so on so I know that s inverse a or I should I should not say s inverse but probably I should say s to the power minus 1 corresponds to one left shift it is a 1 a 2 and so on so the generating function gx is given by a 0 plus a 1 x plus a 2 x square and so on up to a r x to the power r plus and so on if I multiply by x to the power minus 1 gx then I get a 0 x to the power minus 1 plus a 1 plus a 2 x plus and so on we have a r x to the power r minus 1 plus and so on and then we may like to transpose this first term to the right hand side to obtain x minus 1 gx minus a 0 x to the power minus 1 equal to a 1 plus a 2 x and so on up to a r x to the power minus 1 and onward and the right hand side becomes now it is clear that the discrete numeric function corresponding to the right hand side of this identity is a 1 a 2 and so on in the r minus 1th position we have a r and move onward which is equal to s to the power minus 1 of a therefore we see that x to the power minus 1 gx minus a 0 is the discrete numeric function correspond a sorry is a generating function corresponding to s to the power minus 1 of a now what happens if we multiply gx by x to the power minus 2 we check that this is x to the power minus 2 into gx is a 0 x to the power minus 2 plus a 1 x to the power minus 1 plus a 2 x to the power 0 plus a 3 x and so on up to a r x to the power r minus 2 and we move on therefore we will see that transposing the first two terms of the right hand side to the left hand side and taking the common factor x to the power minus 2 out we get x to the power minus 2 gx minus a 0 minus a 1 x is equal to a 2 plus a cube x plus and so on a r x to the power r minus 1 2 and so on which is of course the generating function corresponding to the discrete numeric function s to the power minus 2 a now we have a rule the rule is that the generating function corresponding to s to the power minus i a is x to the power minus i gx minus a 0 minus a 1 x minus a 2 x square minus and so on up to minus a i minus 1 x to the power i minus 1 and it ends here so we have a finite 6 series that has to be subtracted from gx and then we multiply by x to the power minus i and we obtain the generating function of s to the power minus i a this is all about generating functions for today as a last topic in the discussion of discrete numeric functions and the generating functions corresponding to this discrete numeric functions we discuss the asymptotic notations here for convenience we will denote discrete numeric functions as usual functions so we denote a function f from n to r which is a discrete numeric function and we are interested in knowing the growth of f so f takes values f 0 f 1 f 2 so on in general let us say it takes a value fn and it goes on we would like to know about how it grows so we compare f to certain other functions let us say g which is also a discrete numeric function we say that fn is equal to ? of gn if there are positive integers c1 and c2 and positive integer n0 such that c1 gn less than or equal to fn less than or equal to c2 gn for example if gn is simply n2 and this will mean that there exists positive integer c1 c2 and n0 such that c1 n2 less than or equal to fn less than or equal to c2 n2 for all n greater than or equal to n0 here also we have to say that for all n greater than or equal to n0 so in language it means that if f is ? n2 then I should be able to find two constants which must not vary c1 and c2 and a constant n0 all positive such that for all n greater than or equal to n0 the value of f is bounded above by c2 n2 and bounded below by c1 n2 there are other notations involving this idea we say that fn is equal to b go of gn if there exists c1 c2 and n0 greater than n0 all positive integers such that fn is less than or equal to I am sorry we do not need two constants over here we just need c1 and n0 so it is only c1 and n0 such that fn is c1 n less than or equal to c1 n for all n greater than or equal to n0 and we say fn is equal to capital omega gn just one correction in the previous statement we have to say that this is equal to c1 gn all right and fn is capital omega gn if there is there exists c1 and n0 greater than 0 such that fn is greater than or equal to c1 gn for all n greater than equal to n0 and finally we say that fn is small o of gn if they are if given any constant given any constant c greater than 0 there exists n0 greater than 0 a positive integer such that fn is less than or equal to c times gn for all n greater than or equal to n0 it can be shown that this happens if and only if limit n tending to infinity fn by gn is equal to 0 these are the four asymptotic notations which are used very commonly to discuss the growths of discrete numeric functions. So in this lecture we have discussed generating functions of discrete numeric functions we have also discussed several manipulative techniques of generating functions like addition scalar multiplication convolution product then shift operations on generating functions apart from this we have learned how to write a generating function in a closed form. So closed form representation we have also seen in case we are given a closed from representation of a generating function how to get the corresponding discrete numeric function and finally we have discussed the necessary notations used to study growth of discrete numeric functions these are called asymptotic notations among this asymptotic notations we have discussed the most important four asymptotic notations is capital Theta big O then we have capital Omega and lastly small O this is all for today thank you.