 Welcome to this session, we will be studying our first abstract data type which is one of the most simplest one and which you are all familiar with which is natural numbers. So, natural numbers is one of the most frequently occurring data type, it is used for many different purposes. So, typically used for counting, how much money you have in the bank, how many students are there in a course. So, number denotes the amount of certain quantity there and similarly it is also used for denoting many other objects. So, we use telephone numbers for identifying users, similarly IP address for identifying computers, room numbers to identify rooms. So, these are numbers used to identify objects and operations on numbers depend on what they are being used for. So, if you are counting things using a number typically you will add and subtract things to that number whereas if you are using it to denote certain objects you will probably be doing comparison more than adding or subtracting. So, there are many different operations that occur that are used on numbers and different purposes for which numbers are being used. But what are natural numbers? So, informally we know 0, 1, 2, 3 are natural numbers, but to be precise and to avoid any ambiguity we need to define them formally in a mathematical way. This allows us to give a clear specification to those who want to implement the natural number data types. So, they know exactly what we want and exactly what are the operations to be performed. So, this ensures that whatever programs are written using that type are correct because the specification of the operations is clearly given and the value and exactly that is being implemented. And this can also be used to formally prove properties of numbers and then once you know that numbers satisfy certain properties you can use that to write better programs. So, you can simplify your programs using properties of numbers maybe make it faster and so on. So, let us look at what is the formal definition of numbers. In mathematics these are called axioms and this particular set of axioms is called piano axioms for defining natural numbers. So, this says that the set of natural numbers satisfies the following three properties 0 is a natural number. So, we specify that there is a particular value called 0 which belongs to the set of natural numbers. If some value n belongs to the set of natural numbers then there exists another number called next of n which also is a natural number. And the third property is the crucial one which says that if any set satisfies the first two properties that is it contains the element 0 and for every element n it also contains next of n then this set includes all natural numbers. So, we look at it in more detail late soon, but here next n is an operation on numbers that we assume exists that is part of our assumption informally denotes the number n plus 1. So, for every number n there is a number that follows it which we denote n plus 1 or here we will call it as next number and all properties of numbers now follow from just three assumptions about the numbers. So, we will see how. So, let us look at the meaning of these piano axioms what do they say. So, they specify that 0 is a natural number the first axiom says that we have a number called 0 which is a natural number. If n is any natural number then next n is a natural number and the third property essentially says that all natural numbers can be obtained from 0 using the next operation. So, because 0 is a natural number next of 0 is a natural number next of next of 0 is a natural number and so on. So, we can keep applying the next operation to these and generate more and more natural numbers all of these are natural numbers and exactly these are the natural numbers there is nothing else. So, note that if you look at real numbers also for every real number x x plus 1 is a real number, but this is natural numbers do not include all real numbers because we are saying that every natural number can be obtained from 0 by applying the next operation. So, we will denote next 0 by 1 next of next 0 by 2 and so on and these are the only values that will get generated if you start from 0 and keep applying the next operation. And how do you define operations and numbers we are only given the next operation that is part of our definition of natural numbers for every number n there is a next n which generates another number. Any other operation on number can be defined using it and how do you define it? We define it first for 0 which is a natural number that we have assumed exists and now assuming the operation is defined for number n we define it for the number next of n and this ensures that it defines for all numbers why? Because if you look at the set of numbers for which it is defined it includes 0 because we have defined it for 0 and by the second property it ensures that if it is defined for n it is defined for next of n. So, the set of numbers for which it defines includes all natural numbers and therefore it gets defined for all we will soon see examples of these of defining many other operations on number. But numbers is an example of what are called recursive definitions which you will come across very often in computer science right. So, recursive definition essentially specifies an initial starting value in this case it is 0 and it gives you operations for constructing new values. So, in this case we only have a next operation which takes a number and generates another number which is another value. So, all recursive definitions will be of this kind you will have some initial values given and you will have some operations which will generate more values of this kind and almost all examples of data types that you see in computer science will be defined recursively in this fashion. We may also specify that these operations must satisfy certain properties that they are not arbitrary operations but satisfying certain things and a idea closely related to that of recursive definition is mathematical induction. So, this just Tiano axioms or recursive definitions just say that you can use mathematical induction to define operations and prove properties of numbers or any other recursively defined data types. So, we need to do it for the base case which in this case is 0 and assuming it is done for a particular value n we define it for a value constructed from it in this case its next 10 is the only way of constructing a value from n. So, assuming it is defined for n we define it for next n and this will give a general method for defining all data types that will come across later. So, this idea of recursive definition is crucial for many problems in computer science and you should try and become very familiar with it. So, here is an example we want to extend the definition of natural numbers now to all integers. So, integers can also be negative natural numbers are only positive 0 1 2 3 up and so on integers can be minus 1 minus 2 and so on. So, this can be done by defining another operation called minus which generates a new value. So, if you take minus of 1 it should generate minus 1 but we have the next operation and a minus operation but these must satisfy certain property. So, minus of 0 we must define it to be 0 itself. So, otherwise minus of 0 would be considered to be some new value. So, minus is an operation which generates a value just like next generates a value but we want to specify that minus of 0 must be the same as 0. So, minus 0 we define as 0 and there is a relation between the next operation and a minus operation that must be satisfied. So, if you want to precisely define the set of integers there is a relation between the next operation and a minus operation. What is that try to think over it and we will see next time how that can be used. So, a minus operation is not completely independent of the next operation for it to define actually the integer minus i you need to ensure that it satisfies some property. So, what exactly is the property that it must satisfy. So, in the next session we will look at lots of examples of defining operations of numbers and proving properties of numbers. Thank you.