 In today's lecture we will be discussing discrete numeric functions a discrete numeric function is a function from the set of natural numbers which consists of 0 1 2 and so on to the set of real numbers let us write the definition somewhat formally let N be the set of natural numbers that is N equal to 0 1 2 3 and so on and let R be the set of real numbers any function f from N to R is said to be a discrete numeric function is said to be a discrete numeric function in practice we do not write discrete numeric functions as usual functions what we do instead is that we write them as sequences. So let us start with the function f what we can do is that we can evaluate it at all possible points of the domain that is the set of natural numbers and write the sequence of the results. So when I evaluate f at 0 I get f 0 then I evaluate it at 1 so I get f 1 then I get evaluate it at 2 so I get f 2 and so on I go on and somewhere much later I will evaluate it at some R so I will write f R and go on like that and we can put this sequence inside the first brackets to delineate their beginning and end it is to be understood that these are essentially infinite sequences then somebody may ask me that since it is infinite why are we writing like that like this one now the answer is that although they are infinite I should have a way of obtaining the expression for the rth element in finite time no matter how large the element R is or how long we take to compute the value of value of f R the most important fact is that the computation time has to be finite no matter how large now again in practice we have a more convenient way of writing a discrete numeric function we will denote a discrete numeric function by a symbol let us say a which will be typically a lower case later in the alphabet so a b c d but when in print we will be writing bold face bold face lower case a bold face lower case b and so on and when we are writing by hand then we will write a and put a underline to specify that this is a discrete numeric function now this a is a sequence whose elements are given as a 0 then a 1 then a 2 then a 3 and so on the general element is given as a r and so on and we close the bracket now we shall be doing this for other letters as well like lower case b bold face or b with an underline and so on so these are discrete numeric functions for us and in other contexts these are also known as sequences so we could also say that a is a sequence of numbers a 0 a 1 a 2 with the general term is given as a r now let us look at a look at an example consider the sequence a let now this is something that we will be doing typically over and over again in this lecture we will say that suppose a is a discrete numeric function and it is defined by a r equal to let us say an expression in r and then we will write for all r greater than or equal to 0 well we implicitly understand that a r is the r th element of a and r starts from 0 so we have elements a 0 a 1 a 2 a 3 and so on a r and so on and r will keep on increase increasing over the set of natural numbers so suppose I would like to know the first few elements of this discrete numeric sequence discrete numeric function then I take the first element that is a 0 and that is 7 times 0 square plus 1 which is equal to 1 then the second element that is a 1 this is 7 times 1 square plus 1 which is equal to 7 plus 1 which is equal to 8 then the third element a 2 is 7 times 2 square that is 4 plus 1 and this is equal to 29 and we can keep on evaluating like this at this point we note that discrete numeric functions may not be defined by a single formula it is also possible that these functions are different are defined by different formulas over different regions in the domain so let us take an example now here I denote the discrete numeric function by D let D underline discrete numeric function defined by DR equal to now see DR equal to 2 plus r for 0 less than or equal to r less than or equal to 5 DR equal to 2 minus r for r greater than 5 and r odd and DR equal to 2 by r for r greater than 5 and r even so we have got three regions one region is between 0 and 5 inclusive of 0 and 5 and in which DR is 2 plus r if you would like to compute DR for these Rs and we can start with D 0 which gives me 2 and then D 1 which gives me 3 then D 2 gives us 4 D 3 gives us 5 D 4 gives us 6 and D 6 sorry D 5 which gives us 7 and we have to stop here because we have come to r equal to 5 when r is greater than 5 and r is even so that is the case now D 6 6 is even and greater than 5 then it is 2 by 6 so it is 1 3rd and D 7 this is 2 minus 7 so it is minus 5 D 8 this is 2 by 8 so we will have 1 by 4 and D 9 this is 2 minus 9 so it is equal to minus 7 in this way we can compute first few elements of the discrete numeric function that we have defined now we will we will come to manipulation of discrete numeric functions what we see here is that we if we have several discrete numeric functions then we can add multiply or subtract them with one another and also we can have the ideas of multiplying some scalars to this discrete numeric functions by scalars we mean real numbers we will also see that we can do some other operations on these discrete numeric functions but first we start with addition suppose a and b are 2 discrete numeric functions so a is given by a 0 a 1 a 2 so on up to a r and onward b is given by b 0 b 1 b 2 so on b r and onward a plus b equal to c is also a discrete numeric function defined as cr equal to a r plus b r for all r greater than or equal to 0 thus in short if we have 2 discrete numeric functions and we add them element wise that is add the first element with the first element second element with the second element third with the third and in general rth with the rth then we obtain another discrete numeric function which is called the sum of the first 2 discrete numeric functions next we define multiplication this multiplication is also term wise so I write in short c equal to a dot b is defined by cr equal to a r dot b r for all r greater than or equal to 0 so this is the multiplication next we define scalar multiplication now by a scalar we will mean any element from the set real set of real numbers so that is any element in r is called a scalar so let alpha be an element in r alpha is called a scalar alpha times a is equal to c is a discrete numeric function defined by cr equal to alpha times a r for all r greater than or equal to 0 so this means that if we take a real number and multiply each element of the discrete numeric function by that scalar number and obtain a discrete numeric function then that discrete numeric function that we obtain is called a scalar multiplication of the original function by the chosen real number we can also define absolute value of a discrete numeric function here take a discrete numeric function a bar c equal to absolute value of a bar is defined by cr equal to absolute value of a r for all r greater than or equal to 0 now we go over to some examples example we take two discrete numeric functions one is given by a r equal to 0 when 0 less than or equal to r less than or equal to 2 and 2 to the power minus r plus 5 when r is greater than or equal to 3 and b r this is equal to 3 minus 2 to the power r for 0 less than or equal to r less than or equal to 1 and r plus 2 for r greater than or equal to 2 now suppose we are interested in checking the sum of these two discrete numeric functions we have to compute the value of a r plus b r for all r now a r plus b r when r equal to 0 and 1 gives us the value 3 minus 2 to the power r this is when r is between 0 and 1 now when r is equal to 2 then ar is still 0 but br is r plus 2 but r is equal to 2 so we get 2 plus 2 which is equal to 4 for r greater than or equal to 3 this the sum will be 2 to the power minus r plus r plus 7 so ar plus br if we write as cr in the corresponding sequence c is the sum of the functions a and b as I have told before I will be using the word sequence and discrete numeric functions interchangeably from time to time now if you would like to know the product of these two numeric functions we will note that ar is 0 for r equal to 0 1 and 2 so the product ar into br is going to be 0 for r greater than or equal to 0 and less than or equal to 2 and then when r is greater than or equal to 3 the product ar dot br is equal to 2 to the power minus r plus 5 into r plus 2 which gives us ar into 2 to the power minus ar plus 2 to the power minus r plus 1 plus 5 r plus 2 so in short c is a dot b where cr is defined as 0 when r is between 0 and 2 r 2 to the power minus r plus 2 to the power minus r plus 1 plus 5 r plus 2 for r greater than or equal to 3 the next example is on absolute values for this we consider the discrete numeric function ar given by minus 1 raise to the power r into 2 by let us say r plus 1 for r greater than or equal to 0 now see if I put r equal to 0 so a 0 is 2 by 1 equal to 2 by 1 so it is 2 a 1 equal to minus of 2 by 2 which is minus 1 then a 2 is minus 1 raise to the power 2 2 by 3 so I have got 2 by 3 and a 3 is equal to minus 1 cube 2 by 4 so it is minus of half and so on now the absolute value of ar is simply 2 by r plus 1 for all r greater than or equal to 0 and if we define cr equal to absolute value of ar for r greater than or equal to 0 then the discrete numeric function c is called the absolute value of a so we have defined addition multiplication scalar multiplication and then absolute value operation on discrete numeric functions now we will define some other operations on discrete numeric functions which are called shift operations now we will be defining a shift operation by s s the question is what does it do we take a discrete numeric function a which is given by a 0 a 1 a 2 a 3 so on then we have ar and so on if I apply s on a I get a discrete numeric function which is called s a and which is simply 0 a 0 a 1 a 2 and so on if I apply s again I get a square a which is a discrete numeric function given by 0 0 a 0 a 1 a 2 and so on so the net effect is that s shift the whole sequence of the values of discrete numeric function by one position s s square shift by two positions and so on so I can think about si si a is 0 0 so on up to 0 I positions and then I have got a 0 a 1 a 2 and so on so if we would like to write down formally then we will write that si a is a discrete numeric function let us say b such that bi is equal to sorry not bi but should write br br equal to 0 for how many positions when r is greater than equal to 0 and less than or equal to I and then br is equal to a r – I for r greater than or equal to I here I instead of I we will have I – 1 because 0 to I – 1 gives me I positions so we could also call it a right shift operation in the same manner we can define a left shift operation which we will be writing in this way we take s and then we write s inverse so this is s inverse does something just opposite to s when it gets applied to a then we get a 1 a 2 a 3 and so on if I apply s to the power – 2 to a then I will get a 2 a 3 and so on and similarly so if I apply s to the power – I to a then my sequence will start from a i a i plus 1 and so on so we will write that the discrete numeric function b corresponding to s to the power – I of a is defined by bi equal to a of r here I am sorry it will be br br equal to a r plus I so let us check what happens so suppose I take b 0 b 0 what is it it is a 0 plus I is a I so this is the first element of s to the power – I a and indeed it is so these are equal then if I take r equal to this is for r equal to 0 if I take r equal to 1 then I have got b 1 which is equal to a 1 plus I which is again same as the second element so like this we will get all the elements of the shifted sequence and of course we will lose the first I elements now let us look at some examples of this shifting operation now we take a discrete numeric function a r given by 1 if 0 less than or equal to r less than or equal to 10 and 2 if r is greater than or equal to 11 and suppose we would like to know the discrete numeric function b given by s to the power 5 of a then as I have defined earlier br is equal to 0 for 0 less than or equal to r less than or equal to i – 1 so it is 5 – 1 which is 4 and then it is a r – 5 for r greater than or equal to 5 now we have to see what happens to a r – 5 so if r equal to 5 a r – 5 is a 0 which is equal to 1 now if r equal to 15 a r – 5 equal to a 10 which is equal to 1 here we have to know that according to the definition of a r first 11 values of a r is 1 and that is corresponding to r equal to 5 to r equal to 15 and when r is greater than or equal to 16 it is going to be 2 so we can write br more explicitly as 0 when 0 less than or equal to r less than or equal to 4 is 1 when r is greater than or equal to 5 and less than or equal to 15 and 2 when r is greater than or equal to 16 so these are the ways to write now if somebody tells me to take the other way round like take probably s to the power – 7 of a let us see whether we can solve that problem we recall again our discrete numeric function which is a r given by 1 when 0 less than or equal to r less than or equal to 10 and 2 when 11 less than or equal to r that is r greater than or equal to 11 now suppose somebody tells me to find out s – 7 of a it is of course a discrete numeric function be defined by br which is equal to a r plus 7 for r greater than or equal to 0 so what what happens in this case suppose r equal to 0 then we get a 7 now what is a 7 a 7 is 1 r equal to 1 we get a 8 8 is 1 r equal to 2 we get a 9 a 9 equal to 1 r equal to 3 we get a 10 8 n equal to 1 r equal to 4 we get a 11 which is equal to 2 and so on we will get keep on getting 2 after after this so I can write br as 1 for 0 less than or equal to r less than or equal to 3 and 2 when r greater than or equal to 4 this is a sequence shifted by 7 to the power – s to the power – 7 now we come to a pair of very typical operations on discrete numeric functions the first one is called the forward difference forward difference the second one is called backward difference so for the beginning let us start with the forward difference let a be a discrete numeric sequence be a discrete numeric function or a sequence whatever the forward difference is a discrete numeric function defined by the forward difference of a denoted by ? of a is a discrete numeric function defined by the rth element of this function is a r plus 1 – a r and that is why it is called the forward difference and this is for all r greater than or equal to 0 why forward the reason is that if you check the sequence values a 0 a 1 a 2 so on a r then a r plus 1 and so on so come to the first position I am looking forward I am looking forward and checking how much increment happens in the forward direction so I am writing a 1 – a 0 in the first place in the second position again I am looking forward I am writing a 2 – a 1 and at the rth position I am again looking forward and I am writing a r plus 1 – a r that is why it is called the forward difference the backward difference is when we look backward so it is like this we again start with a discrete numeric function a starts from a 0 a 1 a 2 a r a r plus 1 and we insert a r – 1 before a r and so on because we have to look backward now now when I come to the first position come to the first position I look backward there is nothing I write 0 when I come to the second position I look backward I find a 0 so I write a 1 – a 0 when I come to the third position that is a position corresponding to a 2 I look backward I see a 1 so I write the difference a 1 – a 2 and so on so here we will write the backward difference as this it is defined by the 0th position it is 0 and from 1 onward it is a r – a r – 1 for r greater than or equal to 1 this is the backward difference so if we start with with a forward difference sorry if we start with a backward difference the sequence will look like this is a backward difference the first one is 0 in the second one is a 1 – a 0 the third one is a 2 – a 1 we go on like this then we find a r – a r – 1 and after that if we venture forward we will find a r plus 1 – a r and so on if we apply S inverse on this S inverse will shift one step to the left I will get the sequence a 1 – a 0 in the 0th position a 2 – a 1 in the first position a 3 – a 2 in the second position and a r plus 1 – a r in the rth position and so on and just a brief recall of what we define just before in the name of forward difference we see that this discrete numeric function is nothing but the forward difference so this is nothing but this therefore we have a nice relationship between forward difference and backward difference as this in this lecture we have first discussed the definition of discrete numeric functions we have also shown the connection between discrete numeric functions and sequences of real numbers second we have studied some manipulations of discrete numeric functions we have checked addition multiplication scalar multiplication and taking absolute value then we have checked shift operations which are going to be very important in the context of discrete numeric functions shift operations and lastly we have checked the forward difference and backward difference and a relationship which connects the forward difference with the backward difference through the shift operation which is this this is one left shift of the backward difference gives me forward difference this is all for this lecture thank you