So, today we are going to cover 6 of the video lectures, however 4 of these are you know can be gone through fairly quickly. So, we will go through those fairly quickly. So, it should take the same amount of time may be 35, 40 minutes, but we want to basically cover the logical unit ok. So, the first one is introduction to software engineering. So, software engineering is you know let us just quickly. So, there is a lot of description here you can go through that, but sort of the kind of point that I want to highlight is that in general the software that you are going to design you know probably your project is going to be the first such software that you will design. It will typically be of large size, have complex functionalities, will hopefully be used by many people and will also be developed by many people and it requires significant time and effort. So, you know this is the important point that large coordinated effort is required to build operate and maintain software and I think your project is the first such instance of that. And what we are going to see in the next few slides is some things that we have you know repeatedly said during the course, but it is now documented there and things that we expect you to follow as you are going about with your project ok.  So, for this purpose these are some of the metrics that are used to understand how complex a software has become. So, one is this lines of code, the other is function points and you know depending on lines of code or number of function points there are other metrics also that characterize the complexity of a software, but lines of code is often very commonly used and we say lines of non-comment codes you do not count the comments as lines of code. So, that kind of gives you a typical idea. So, we expect your project to be around you know maybe thousand lines of code thousand lines of non-comment code written properly and the effort is often measured in terms of how much effort was put in by a person if that person was working alone how many months would that person take.  And this involves the when we try to quantify the effort we take the whole thing into account you know it is not just writing the piece of code, but testing documentation ensuring that all the you know error handling is done properly all diagnostic messages are given out properly all of that and this is kind of you know 15 to 25 lines of code per day would I think be considered you know bare minimum that you if you are working in a professional environment. So, they said we expect around thousand lines of code for your project the amount of effort is 3 or 4 of you working over a period of one month, but of course not working full time. So, you are probably working you know whatever one hour a day something like that ok. So, this is the usual life cycle this is what we have recommended you to follow for your project. So, there is a conceptualization aspect detailing all functional requirements. So, this is kind of what we have asked you to submit by Sunday at least the conceptualization at least some detail of the functional requirements if not all details then you design the system you develop the software and then you have also got to do testing and quality assurance and finally, you know just because you have developed a software does not mean that it is ok it has to be accepted by the client for whom ever you wrote the software. In the case of your project by us if you have written your project does not mean your job is over you have to do something which makes us accept it. And then of course, you know there is maintenance you know once you write a software and deploy it you know maintenance for it is going to be an ongoing process. Maintenance includes gathering bugs so, how many of you I mean all of you have been using code blocks in the C compiler. So, have you encountered any bug with the compiler the G plus plus compiler which is running at the back end have you seen an instance where it is doing something that it is not supposed to do nobody. So, the point I am trying to say is that I have personally not encountered any bug in the GCC compiler G plus plus compiler however, I have read papers which report about bugs in this compiler and then there are websites which report about bugs. So, it is a fairly robust piece of software developed over so many years by so many users, but still that has bugs you know and so to guarantee that a piece of software has absolutely zero bugs is a fairly tall claim of tall order I mean things which have been tested developed used for so many years so many decades actually still have bugs. However as time goes on the rate of bugs keeps decreasing and the software becomes even more and more reliable. So, at least for your project we would like you to do some corner case stress testing to make sure that you know some obvious bugs have been taken care of, but still there will probably be bugs present and for those who are contesting for the AP grade I mean certainly your code will be tested for lots of corner cases to expose bugs in the code and then of course you could enhance the functionality of the code I mean you might have designed something today and then there is demand for enhancing the functionality and you could also you might also want to interface it to other software applications which are coming up. So, this typically constitutes a very large percentage you know up to 80% of the total cost of a software's entire life cycle and this sort of emphasizes the fact that we must write or we must try to write very high-quality software in the first place. So, you know I mean some very grave consequences of software errors just completely programming errors that have happened was that around 15 years back there was an Ariane 5 rocket which was launched to go to space and it just exploded a few minutes into its takeoff and this was because there was some there were sensors which were picking up you know some acceleration data from the rocket as it was moving and there was a bug in the conversion of the data from one metric system to another metric system and because of that bug and of course the software was tested through a lot of things and it was certified as okay, but there was that corner case bug and that got triggered and the entire rocket just exploded. So, there are similarly cases of when you go to a hospital and for example have any of you seen a city machine, city scan machine or at least a picture of a city scan machine? Yeah, so it's basically you know a machine through which the patient's body goes through and x-rays are passed and you take a lot of images. So, it basically shows you as the body would appear if you were to cut a section through the body without of course cutting the body, but this is actually exposing the patient to a lot of x-rays and so there is software which is controlling how much of x-rays are pumped into the patient's body as the patient's body is passing through an x-ray machine and bugs in that software have actually caused some patients to be overexposed to x-rays which have caused other kinds of complications in there. So, the more we become dependent on software the more it's important to write high quality software and of course when you're writing software coding style is important. There are recommended coding styles, variable names should be written in a certain way, type name should be written in a certain way, function name should be written in a certain way, indentation should be done in a certain way. This is to ensure that it is readable, understandable, others can take up your code and modify it if needed and there are several references which are there which you can look up. So, are there any questions about this? I mean this is more like what good programmers should do and we expect all of you to be at least moving in that direction and so we expect you to keep these in mind. So, I mean as I said you know a very large percentage of the cost of developing a software actually goes in maintaining it and if you can write code which is good quality make sure that bugs are few you actually cut down that significant part of the cost. Okay, so if there are no doubts about this let us move on to the next topic. You know our first glimpse of what is called object oriented programming and we are going to start off with structures. For those of you who have gone through the video lectures of course you know this should be fairly straightforward but for those of you who haven't let me just say that you know here we are trying to design a book checkout return claim management system of a small library like in our central library when you go you say I want to issue a book, I want to claim a book or I want to return a book. So, there are three kinds of operations that we will define checking out a book, claiming a book and returning a book. Checking out means you give a book and then the book is issued to you right and so in this case a pattern can check up to three books at any time claiming a book means if I have not already checked out three books and if I want a book and that book is currently with somebody I can place a claim for that. So, when the book is returned I am going to get it and returning a book is of course returning. So, how do we go about writing code for such a library management system? So, one option the bad option the non-recommended option is to just jump into writing the code and then keep adding variables arrays functions as in when you need. So, for each book as you will realize there are lots of information that you want to keep you know some title and authors these would be character arrays, price, accession number, checkout status, claimants ID and so on. So, what one and similarly for each pattern there are lots of you know things that one might want to remember name address number of books checked out and so on. So, what one could do is that if the library has thousand books it is a very small library. So, then I could say that well I am going to keep a thousand sized array where each element of the array is a string or a character array representing the title of a book. So, there are a thousand books. So, these are thousand sized arrays each element of the array is going to store information about a book. So, I could have an array of character arrays storing the book title and array of another array of character arrays storing the author's names and array of doubles storing the prices of the different books and so on right. But I mean you will appreciate that this is not a natural way to represent the information right. The information about the same book I am splitting it across into 6 different arrays this is probably not a very desirable way to do it. And in particular if I ask you to do the following if I can say that can you find the claimant for the book with some accession number 1, 2, 3, 4, 5, 6 then what would you have to do you would have to go and look up the accession number array and then you have to go and search that array to find out where 1, 2, 3, 4, 5, 6 is and then you have to pick up that index where you found out 1, 2, 3, 4, 5, 6. So, suppose that is the 5th index. So, then you would know that well the 5th book is the one with accession number 1, 2, 3, 4, 5, 6. Now you will have to go to the claimant array and look up what the 5th entry there is. It is a very convoluted way of figuring out who is the claimant for a book with accession number 1, 2, 3, 4, 5, 6. So, we do not want to do that. So, what we would like to do is we would like to group all the information about a book together into a book entity. So, all of it name, title, author's name, who has claimed it, what is its price everything we would like to put together into one coherent entity and then we would like to have an array of these entity. So, then if I want you to find out who is the claimant of book with accession number 1, 2, 3, 4, 5, 6 I will just search through this array and each element in this array is this entire entity containing all information about a book. So, the moment I reach an entity whose accession number matches 1, 2, 3, 4, 5, 6 for that same entity I will just read off the claimant information. So, if we could group things together then we could do this in this much nicer way and similarly I could group all information about a pattern into one pattern entity and keep an array of these pattern entities. So, this would be a more logical, more natural way to program and actually first provides us some facilities to do this. So, for example, it provides us this facility called a structure. So, you say struct then you give a name for the structure and so this is a structure book which can have all of these things related to a book. So, as we will see shortly I can actually define a variable of type book and what that variable represents is this entire collection of information, that variable will have something called a title, that variable will have something called authors, it will have something called price and so on. So, by grouping things together we are saying that let us put everything that logically appears coherent that is related to each other for purposes of our programming assigned for programming task. Let us put them together into one entity and then we can deal with these entities. So, this I believe will be very important for your projects. You know when you are doing your projects you would want to group information, related information together and so structure should be important. So, that struct is a C++ keyword and book whatever I have said here is the name of the structure type. This is just like integer character data just like the names of other types. So, essentially now we are defining our own types rather than depending only on the types provided by the C++ standard and then you know these different things title, authors, price these are called members of the structure book and members can be arrays as well as variables. So, for example, these members are variables, these two members are arrays and for a particular member the name that we give to that member is called the member name and the type is the member type. So, it is like declaring variables within a structure and then I am going to declare variables of this structure type. So, I am grouping things together and then saying let us take this whole as one logical entity and we can then declare variables arrays whatever we want to. So, how do I declare a variable of type book? You know just like the way we would declare a variable of type int we say book in place of int and then we give the name of the variables just like I would use int my int your int whatever. Similarly, for array I just like for integer I would say int roll numbers 1000. So, here I can say book library shelf 1000. So, this name book that we have used along with this struct this becomes the name of a type just like integer character double whatever. So, this is an array of 1000 elements where each element in the in this array is an object of type book. So, each element in the array has so many information pieces along with it. Each element in this array is this composite thing inside which there are so many other things right because we want to access an element in the array and we want to say that is book number 5 and associated with book number 5 there is so much information. So, we want all of that to be present in that entity itself. So, similarly for patterns I could define a structure basically I am grouping together all the relevant information of a pattern together. So, this is basically you know sort of in one slide what we mean by object oriented programming that when you are given a programming task you first identify these entities which could be physical entities like a pattern or a book or it could they could even be conceptual entities you know like a rectangle or a geometric object or you know whatever you are trying to program about. So, you identify these entities that are involved in the working of the system. So, these entities are also called objects that is why the name object oriented programming comes about and then you think of the relations between these entities. So, the overall functionality of the system can be thought of as interactions between these entities and operations on these entities. So, pattern will come and check out a book a book will get claimed by another pattern. So, these are relations interactions between entities and you also abstract away or hide the details that are not necessary to be exposed for a particular operation. So, for example, I mean we will see examples where you know when I am doing a particular maybe return operation I do not need to expose some of the details. So, I want to abstract or hide them away and of course, you know as I am building these entities and their interactions this allows me to build the overall system functionality in a modular incremental way. And we expect all of you to do your projects in this way they are not just one monolithic piece of code, but identify the entities how they interact and program your projects so that it captures that it reflects that interaction between entities. So, this is what object oriented programming is about. So, the object contains information about you know one logical coherent entity. So, it can have information which is relatively fixed usually does not change as objects interact for example, the name of a pattern or title of a book or it could also have information that changes as objects interact. So, for example, the checkout status of a book you know the moment a pattern checks out a book that information changes and of course, an object must have unambiguous well defined boundaries. It is not that at some point of time you want to store something in the object and at some other point of time you do not want to store that as part of the object it must have completely well defined boundaries. You should understand very clearly what information is within the object, what information is within another object, what is the interaction about. So, this actually I mean writing something in an object oriented way also forces you to think in a structured and disciplined way. So, this is certainly the preferred way to go about programming. Interactions between any two objects should ideally happen through very well defined cases you know as in the textbook professor Abhiram Ranade's textbook he says that when you are looking at a television right there is a lot of complicated electronic circuitry inside the television, but when you are interacting with the television you just have a remote in your hand you have a few operations that you can do and that is all by which you can interact with the television inside a lot of stuff is happening. So, when you are trying to change a channel you do not go inside and change a capacitance and change a resistance and change an inductance to change a channel. You just press a switch and internally a lot of things are happening right. So, that is what we mean by well defined interfaces pressing that switch as a well defined function it is meant to change a channel and only change a channel you take that action and inside behind the scenes a lot of stuff is happening, but that is not your concern right you have hidden away that information presented well defined interfaces and all interaction should happen through those interfaces. So, this hiding of information is also called abstraction or data encapsulation. So, we will cover this later in the course. So, are there any doubts about what we just said this is some very simple idea of how you group related information together and that is kind of the foundation stone of object oriented programming. No questions good. So, let us see some usages of this. So, here is our simple library example that we just saw here is the structure book and the structure pattern they have different kinds of members and as we said we can declare you know an array called library shelf which has 1000 books in it and an array called library patterns which is 200 patterns in it fairly small library. You know since the structure book has so many things inside it the question is if I want to find out the price of a book what should I do you know I can I may know that this is the fifth book in the array library shelf, but then how do I go and find out the price of the book or whatever the accession number of the book. So, C++ actually provides this dot operator for this purpose. So, once you have a variable my choice let us say of this type book. So, my choice is a variable of type book. So, basically this variable has all of these information title authors price accession number and everything in it. So, now if I want to access a specific member I use this dot operator. So, I say my choice dot price this access is the member named price of the object my choice ok. So, very convenient way of representing just put a dot and then you can go inside that structure and access a particular member and once you put the dot and you know sort of constructed this my choice dot price this is like any other variable in a program. Because you are now accessing this member inside the structure and that member is a double typed member. So, you can use it like any other double typed member. So, for example, I could read in my choice dot price I could add 20 to my choice dot price I could print out my choice dot price is just like any other double valued member double valued variable right. Similarly, I could access the name member which is actually a character array by just saying current pattern dot name right. So, this dot allows me to go inside the structure and access any particular member by the name of that member. So, I could write code like if current pattern dot name which is referring to a character array and if the first element in that character array is capital S then I am going to print out that name. So, this is just like using any other character array right. So, the moment I say current pattern it is referring to that object which is all of that information dot name means I have gone inside that and access that particular member name which is a character array and now I can use it just like any other character array fine. So, it is a very convenient way of accessing members of grouping related information together and then accessing the relevant information. How do I initialize structures? So, this is how we might want to initialize integers or characters just say equal and provide the value. So, in structures also we do pretty much the same thing except that you know when I am trying to initialize a structure I have to specify a value for each of these members. So, I say current pattern is a variable of type pattern it is initialized to within braces you give the values for each of these members in exactly the same sequence in which they have been defined over here. So, the first is the initial value for name the second is the initial value for address the third is the unique ID the fourth is the number of books checked out the fifth is the initial value for claimed book accession number right. So, it is pretty much the same and sort of logically if I am trying to initialize a group of things I must specify the initial values of everything there. So, I have to specify it in the same order that is important right. If you specify IIT Bombay India first and Shashi they have next then of current pattern dot name will get set to IIT Bombay India right. The computer does not know that IIT Bombay India does not look like a name whatever value you give there it will get initialized to that yeah. So, that is what I just said and then I could even copy one structure to another. So, for example, here is an example of copying integers. So, I set I to 27 and then copy I to J. So, now J gets the value 27. So, I could do a similar thing. So, I could say current pattern is whatever we initialized earlier and then I could say previous pattern is assigned current pattern you know just like we would assign one variable to another of integer or character type we can do exactly the same thing with these user defined types right and what this will do is you know. So, current pattern is an object which has lots of members previous pattern is also an object which has lots of members. So, this assignment will copy the value of each member of current pattern to the corresponding member of previous pattern. So, you will basically get an exact copy of the object on the right hand side of the assignment statement right. So, this is also natural this is to be expected when I am copying all the members here should get copied to all the members there. So, the values of all these members will be copied there. So, is that clear the dot operator? So, now let us look at a programming example with you know whatever we have learned. So, this is the library management system again. So, what we are going to do is we have this structure book and we have defined an array called library shelf which has 1000 books and let us say to begin with we will say the checkout status of every book is false and the claimant ID which is if somebody has claimed this book is initialized to minus 1. Let us say that initially when we start off the system when we run our program initially every object of library shelf has these members initialized appropriately the title author price and accession number of the book, but these two are initialized to false and minus 1. And then we have an array library patterns of patterns let us say there are 200 patterns and each such pattern of course, have all of these members and once again we will assume that when we start off num books checked out for each pattern is set to 0 and the claimed books accession number is set to minus 1. This is the how we are starting off the system and name address unique ID are whatever initialized according to the patterns details. Now we want to write a C++ function for checking out a book. So, let us say there is a variable current pattern which denotes a pattern who wants to check out a book and the book that she wants to check out is in this variable current book. So, current pattern is of type pattern current book is of type book and current pattern wants to check out current book. So, this is what we will have to do. So, we said that each pattern is allowed to check out 3 books. So, we have to first check if the pattern is already checked out 3 books. If so we will say you cannot check out any more books. Otherwise we have to check if the current book has already been checked out. If so then we have to print an appropriate message. Otherwise we have to see if the current book has not been checked out, but if it has been claimed by somebody already then we cannot issue it. So, then we will have to print an appropriate message and if the current book is not checked out and not already claimed then we can issue this book. So, in that case we will increment the value of the num books checked out member of current pattern because the current pattern will now have one more book issued to her and will update the check out status of current book to true because now this book is being checked out fine. And of course, we want these changes to these members to persist after the current book has been checked out. So, basically we will need to have functions to which we will have to pass parameters by reference. So, that even of the function returns the members of the corresponding current book and current pattern will would stay updated. So, here is how it might look like. So, in the main function I am saying check out books library. So, the ith pattern is checking out the jth book and here is check out book to which I have passed these two parameters by reference. And what do I do in the code for checking out a book? I first check if the num books checked out member of current pattern is less than 3 which means if the current pattern has not already checked out 3 books then I will allow the current pattern to check out a book. Otherwise, I will say that you know sorry you have already checked out too many books. So, what do we do here? How do we check out a book? So, if the number of books checked out is less than 3 we will have to check if the book has already been checked out by somebody. So, if the check out status of the book is true then it means the book is already with somebody. So, then we can say that well sorry this book is already checked out. So, you cannot check this book out. Otherwise, we have to do something else. What do we do? We check whether this current book is already being claimed by somebody. So, this claimant ID is a member of the current book object and if this is not minus 1 then it has the ID of a claimant. So, if current books claimant ID is not minus 1 it means somebody has already claimed this book. It could be that this current pattern itself has claimed this book. So, we will also check that that if the claimant ID is not minus 1 and if the current patterns ID is not the claimant ID which means that somebody is claiming this book and it is not the current pattern then we will have to say that there is already a pending claim you cannot get it now. Otherwise, we can allow the pattern to check out the book. So, we will just set the check out status member of current book to true increment num books checked out of current pattern by 1. So, notice that I am you know once I use the dot operator and have access to the members of the structure I am using them just like variables that is the whole purpose of using the dot operator and then if the current books claimant ID is the pattern's unique ID which means the pattern had actually claimed this book. So, the current books claimant ID is the same as the patterns ID then we will set now that the book is being issued to the pattern we will set the claimant ID of the book to minus 1 and we will set the claimed books accession number of the current pattern to minus 1. So, note that I am actually updating different members of current pattern and current book in the process of checking out a book right. Some information is stored within the current pattern because it logically makes sense to belong there claimed book accession number is something that is particular to this pattern. So, it is stored with the pattern claimant ID is something that is specific to the book. So, it is stored with the book check out status is specific to the book, num books checked out is specific to the pattern. So, I have grouped this information together and then the checkout function is updating the appropriate things appropriate members of the appropriate objects ok. So, yeah and since we pass the parameters by reference. So, whatever changes we are doing here are really changes happening in the variables the objects in the arrays that were passed from the main function. So, they are going to stay even after the function returns is this fine. So, now we will just see the last part of today's lecture which is how to implement the checkout and return functionality. So, checkout we just saw claim and return ok. So, so I want to claim a book a current pattern wants to claim a current book ok. So, what should we do? I mean so, this is kind of the design phase where you are saying that well I want to implement claiming of a book by a pattern. So, what is it that I have to do? So, I have to sort of write it down you know what is the kind of pseudo code or algorithm that I write it down and then I go ahead and implement it right. So, I have to check if the current pattern has already checked out three books or already has a pending claim. So, if she has already checked out three books then of course, no question of putting another claim and if she already has a pending claim first that claim should get cleared then she can put another claim. So, if so, we will print an appropriate message and return otherwise we will have to check if the current book is not already checked out by anybody and if the pattern is trying to claim this book. So, if the book is not already checked out it is in the library and the pattern wants to claim this book I mean why claim the pattern can just check out this book it is there in the library right. So, we can print the appropriate message that please check out there is no need to claim otherwise if the current book is not already claimed by a different pattern then if the current book is already claimed by a different pattern we cannot allow another claim on that same book you know the simple library allows only one claim on a book. But if the current book is not already claimed by a different pattern then I will have to place the claim of current pattern on current book. So, how do I do that? I store the ID of the pattern in the claimant ID of the book. So, once again say I am updating different members of the different objects to store the relevant information within the relevant object boundaries right I do not want to mix them up the claimant ID of the pattern is being the ID of the pattern is being stored in the claimant ID of the book and the accession number of the book is being stored in the claimed book's accession number of the pattern right. So, information that is specific to a pattern will stay within the pattern's structure information that is specific to a book will stay within the book structure ok. So, how do we claim a book? So, this is what we just said if the pattern has already checked out three books or if the pattern already has made a claim to another book. So, if the claim book accession number is not minus 1 which means the current pattern has already claimed some other book then we say that you cannot claim any further book otherwise if the book has not already been checked out if the book is in the library. So, the checkout status of the book is false then we say that it is not yet checked out. So, there is no need to claim you can check out the books straight away right otherwise if this book is already being claimed by somebody and that somebody is not the same as current pattern then we have to say that this book is already being claimed by a different pattern you cannot claim it. So, once again notice that I am accessing different members of different structures basically I want to access that information but depending on which object boundary it is in I have to use the appropriate object and then finally if I am trying to claim the book I set the current books accession number to the claim book accession number of pattern I set the current patterns ID to the claimant ID of the current book and I return ok. So, what you see is that this actually allows you to think more logically you are talking about the claimant ID of you know you can think of this dot operator as saying claimant ID of current book claim book accession number of current pattern right hand side of the left hand side for the dot operator right and that is what we want to say claimant ID of the current book should be set to unique ID of current pattern. So, this is exactly how we write it you see plus plus and how do we return a book. So, you know we just see if the number of books checked out for the current pattern is greater than 0 then we decrement it and set the checkout status of the book to false and here is a very strange situation. So, suppose a pattern has come to return a book, but the number of books checked out for this pattern is already 0 which means this pattern had not really checked out in a book, but the pattern is trying to return a book right. So, that is a funny situation. So, we say that well are you trying to return somebody else's book right and you know. So, this strange scenario happens if a pattern tries to return a book checked out by somebody else and why does this happen that is because we did not keep track of all the information that we could have remembered in our objects right. So, in particular when a pattern checks out a book the ID of the pattern was not recorded with the book we simply said the book has been checked out the checkout status was set to true, but we did not record who has checked out this book right and similarly the accession numbers of the books checked out by a pattern were not recorded with the pattern and that is why if a pattern comes to return a book I do not have any way to check whether this pattern had herself checked out that book right. So, if you keep track of the above information we could sort of you know avoid these strange situations and so hope you know presumably we want to add a borrower ID member to the book structure. So, that when a book is borrowed by somebody we can put the ID of that borrower there and we want to since a pattern is allowed to check out three books. So, we want to have an array of size 3 containing the borrowed books accession numbers, but the point is that now that we have defined our structure wrote some program for checking out claiming returning how do we change things now do we go back to square one and redesign everything. So, this is once again where object oriented modular programming is actually very useful we have already encapsulated things saying that a pattern has these these things a book has these these things we want to add additional things there. So, we can go ahead and add those additional things for example in the book structure I can add this additional member in the pattern structure I can add this additional member and whatever I had defined earlier library patterns is an array of size 200 of patterns that continues to stay as it is except that each object here now also has this additional member. So, no change is needed in this part of the code where I was declaring a library of 1000 books just that every book additional member because I have sort of augmented or change the definition of the structure and I could initialize those to minus one and then I could go back to the functions that I wrote and you know whenever accessing checkout status of current book those things can stay just as they were because the members that had seen earlier are still there I have added some additional members. So, I could simply write some code which operates on those additional members the previous code can still stay as it is. So, for example here when I am checking out a book I have to iterate through this borrowed accession number member array of current pattern and whenever I see an empty entry there which means borrowed accession number i is minus 1 then I am going to store the accession number of the current book that is being checked out over there and break. And similarly I will store the id of the current pattern in the borrower id of the book. So, I am just adding this additional piece of code the other code that was there is untouched right. So, this is incremental software development that you think of some feature later on do some things as that you do not need to change most of the code that you have written you just write the code that takes care of this additional functionality. And similarly you know so in the slides it is given you can similarly change claim book this was the earlier code now that becomes a special case you have to check whether the borrower id is the same as the unique id and then you can print out some message. So, this is additional code that I incrementally write to improve the functionality and similarly for returning the book. So, this main part which was there stays as it is, but there is some additional part that comes in. So, that is the summary. So, we have actually covered six lectures in 48 minutes. And I hope all of you understood I did not speed through the lectures. Okay are there any doubts about it? No? No doubts? Okay let us go to the quiz then. Okay so that is the first question consider the structure definition struct x int y char z. So, if var is a variable of type struct x the member y of var is accessed in which of the following base next question which of the following is or are true of structures defined in C plus plus all members must have the same data type cannot have arrays as members cannot have two different members with the same name cannot have more than 1000 members. So, consider the structure definition struct x int y z. So, y and z are both members of type int. So, if we declare and initialize a variable my var as x my var equals 0 comma 1 the initialized values of the members of my var are which of the following options. So, this option means y is initialized to 0 z is initialized to 0 y is initialized to 1 z is initialized to 0 and so on. Suppose x and y are two variables of struct my struct the assignment statement x is assigned y is what it is an illegal statement in C plus plus makes the addresses of x and y the same copies values of all members of y to corresponding members of x and none of the above. So, suppose struct x is a structure with an integer member named y. So, the declaration x a b c 10 declares an array of objects of type struct x. So, which of the following accesses the member y of the fifth element of the array member y of the fifth element of the array which of the four given four options accesses the member y of the fifth element of the array. So, let us quickly go through these and see what the right answers are. So, here I believe all of you have figured out var dot y is the right answer accessing member y of the variable var. So, here members need not be of the same data type it can have arrays of as members, but you cannot have two different members with the same name because when you put dot and the name there would be ambiguity about which member you are referring to and it can certainly have more than 1000 members there are no restrictions on number of 1. So, here the initialization y will get initialized to 0, z will get initialized to 1. This is certainly not an illegal statement it will simply copy the values of all members of y to the corresponding members of x and here I am accessing the fifth element of the array. So, it is a b c 5. So, this is the fifth element and then you access the member y of it. Now, let us start the practice question. So, how many of you know about binary trees? Nobody good.  So, let us see if this question becomes easy. So, a binary tree. So, as you just saw in that library example right when we are trying to design something which is a bit more complex we would want to group things together we would try to represent relations between objects and so on. So, binary tree is a data structure whereby a data structure we really mean a way of representing information in which data items are related by a parent child relationship satisfying certain conditions right. So, it is a way of representing information such that the data items have a parent child relationship and there are some conditions that are satisfied in this parent child relationship. So, what are the conditions that there is a designated data item which we will call the root which has no parent it has no parent data items every other data item has one unique parent data item. So, there is one guy who does not have any parent everybody else has exactly one unique parent every data item has at most two children data items. So, remember there is a parent child relationship. So, every data item has one unique parent it has two children data items these two children are also unique they are not the same and there are then there are designated data items called leaves which do not have any children for them. So, here is a representation of a binary tree. So, that yellow thing there is the root data item and then these two blue things are what we will call the these are the two children of that root data item. So, we will call this the left child of the root and the right child of the root this arrow does not denote any pointer or anything it is just denoting the relation that this is related to this through the this is the parent this is the left child this is the parent this is the right child and I have sort of drawn the arrow there to sort of make this very explicit visually and then of course, this in turn has two children one left one right that has further children and look at these guys they do not have any children.  So, in this case there are four descendants of A similarly there is one descendant of B of course, everything is a descendant of the root is this clear. So, each box here is like some data item the arrows are some kind of relations between the data items and the relation is sort of organized in this way. So, this is what we called a binary tree okay is this clear okay good. So, now consider the following structure definition struct tree node int value int left child and int right child okay. So, we can think of an object of type tree node you can visually think of it as having three members one is the value one is the left child one is the right child all of these three are integer valued members okay there is a structure of the type that we just studied is this clear I would request you to just note this down because I have to move to the next slide where we will need this because just the definition of the structure struct tree node int value int left child and int right child. So, now we want to use an array A of objects of type struct tree node right. So, that was our struct tree node. So, this was kind of an object of type tree node. So, we want to use an array of these objects and let us call that array A. So, we want to use an array A of objects of type struct tree node to represent a binary tree. So, how are you going to represent it? We will say a 0 remember every object has these three members the top one is the value is the left child is the right child right. So, we will say a 0 is the root okay that is a data item that is the root and we will see what value the left child member has if the left child member has value 3 we will say a 3 is the left child of a 0 if the right child member has the value 7 we will say a 7 is a right child of a 0 is that clear. So, that is what these arrows are representing. So, if this is 3 it means the left child is a 3 the right child is a 7 a 3 itself has a value it has its own left child has its own right child if I have minus 1 for the right child of course minus 1 cannot be an index in an array it just means that there is no right child for this data item right and similarly a 7 is the right child of the root it has no left child it has a right child which is a 9. So, I hope you will agree that I can actually represent a binary tree by just filling in the values of left child and right child you are now given an array A of size 100 of re-node objects such that the values are already sorted. So, a 0 dot value is less than or equal to a 1 dot value is less than or equal to a 99 dot value and the values of left child and right child of every element is set to minus 1. So, basically these are like individual data items without any parent child relationship. However, their values are all sorted and it is sorted in this order. So, you are required to write a function we will call that function heapify which will take that array of tree nodes right and array of tree nodes is of type tree node pointer that array name is of type tree node pointer we saw it in last class. So, this function will take that array of tree nodes and it will fill in the values of left child and right child members of all elements such that using those left child and right child members I am going to get a binary tree and in that binary tree the value of every node is less than or equal to the value of all its descendants. If you remember what a descendant was children, grandchildren, great-grandchildren and so on right. So, I want the value of a node to be less than or equal to the value of everything below that node and we want you to fill in the values of left child and right child appropriately. The value fields are already sorted a 0 dot value is less than or equal to a 1 dot value is and so on. So, you can assume that the root is a 0 and of course, the absence of children is indicated by putting minus 1 in the corresponding member. Is the question clear? You are given an array of tree node objects each tree node object is like this right. So, this is an array of size 5 of tree node objects the value fields are already sorted for example, this could be 10, 11, 14, 17, 19. These are all initialized to minus 1 so you will be given this array this is the array a which will be passed to your function epify your function is supposed to go ahead and fill in values in these places the left child and right child members of all objects in that array such that so for example, right. So, this is a 0 this is a 1 this is a 2 this is a 3 and this is a 4. So, suppose I filled in 2 here and I filled in 1 there suppose just for the heck of it. So, what would this mean? It would mean that a 0 is the root because we have said that assume that the root is a 0 and its left child is a 2 its right child is a 1. So, its left child is a 2 and its right child is a 1 right what is the value for a 0 10 what is the value for a 2. So, actually let me not put 1 here let me put let us say 4 suppose I put in that over there. So, a 0 is the root its value is 10 left child is a 2 value is 14 right child is a 4 value is 19. So, if I filled in 2 and 4 here and now let us say for a 2 I fill in this as 1 and I keep that as minus 1. So, then what would this mean that its left child is a 1 and what is the value of a 1 11. Now, you see that a 2 has value 14 but its child has value 11. So, that violates the condition that we have there that the value of a node must be less than or equal to the value of its descendants. This is a descendant of that, but its value is less than or equal to its strictly less than the value of that right. But what we needed is the value of a node should be less than or equal to the value of its descendants that is violated here. So, if you fill in like this then it is not a correct answer right what could be a correct answer. For example, if I had put a 1 over here like I had done first. So, then a 1 is 11 right and let us say I put minus 1 minus 1 here and here I put 4 and 3 let us say right. So, this would be a 4 and that would be a 3 what is the value of a 4 a 4 is 9 value of a 3 is 17 and these could be minus 1 right. So, now, the value of every node is less than or equal to the values of its descendants 11 is less than or equal to 19 11 is less than or equal to 17 10 is less than or equal to the value of everything all its descendants and so on. Is this clear what we want clear everybody what we want. So, now, that is what we want you to do. So, you are going to be given an array a of size 100 where a 0 dot value till a 99 dot value are all sorted in increasing order all the left and right child that initialize to minus 1. You have to fill in the values of left child and right child members such that value of a node is less than or equal to value of all its descendants. So, there is a trivial solution to this which is a correct solution. So, please do not think very complicated there is a very very simple solution to this at least the question that we have asked as a very very simple solution and if all of you come up with that solution I am going to complicate that question a little bit more. So, here is Saransh solution it is a perfectly correct solution. So, he is saying he will just keep the right child minus 1. So, there are no right children and he is just setting the left child of a 0 to be a 1, the left child of a 1 to be a 2, left child of a 2 to be a 3 and so on. So, it is the array is already sorted. So, obviously everything I mean the only descendants of a 0 are a 1 through a 99 the only descendants of a 1 or a 2 through a 99. So, of course that condition is trivial limit right. So, you can see that Saransh solution requires 100 generations to accommodate all these 100. If you want to accommodate all these children in the least number of generations basically if you look at this tree it has a height of 100. If I want to minimize the height so that is the minimal number of generations sort of the number of descendants may be more what could be I think that is the next one. You know so basically here what in Saransh solution there is no node with two children right. So, now if I tell you that you have to maximize the number of nodes with two children which is the same as minimizing this height of the tree right. So, if you look at this solution that is the root there will be exactly one leaf which will be a 99 and come from the root to the leaf you will have to cross whatever 99 elements right. So, now the next version of the question is it is exactly the same thing, but now you have to have as many nodes with two children as possible that will automatically reduce this height of the tree is the question clear. So, for example this tree did not have one child per node there were several nodes with two children right and in fact this tree is such that with five elements there are two nodes having two children and this is the maximum that you can do maximum number of nodes with two children has to be two strategy is something like this. So, a 0 is the root and then he wants to put a 1 and a 2 then a 3 a 4 a 5 a 6 and so on. So, clearly this will maximize the number of nodes with two children's he is always giving two children to nodes as long as it is possible. And so, he has to come up with this numbering scheme says that the left child of 0 is 1, the right child of 0 is 2, the left child of 1 is 3, the right child of 1 is 4 and so on. So, if you just see this eyeball this for a few minutes you should be able to see a pattern here. So, Saransha of course done it in the following way. He has a loop here where he is saying while k is less than or equal to 99. So, he starts off with int i is 0 and in the loop he is going to set a i dot left child and a i dot right child and increment i and he is just going in this order. So, he starts off by setting k to 1 and he associates the next number.  So, it is like saying 0, 1, 2 and then you take 1 that is 3, 4 you take 2 that is 4, 6 you take 3 that will be 7, 8 you take 4 that will be 9, 10 and so on. And then of course, he is doing some checks if k is not equal to 100. So, basically you do not want to put values here which are greater than 99. So, if they are becoming greater than 99 you put minus 1 there which means that you have exhausted all the nodes after assigning 2 children. So, another way of doing this is what Govind has done which is basically if you see the pattern here the left child of the ith node is 2 i plus 1 the right child of the ith node is 2 i plus 2 and that is exactly what you will get from here also from this loop also you will get exactly that same thing. So, that is a very simple solution if you look at it. So, what we will get at the end of it is a tree like this and as you can see every node in the tree must have a value and it must have some information about who is the left child and who is the right child and that is most conveniently done using a structure. You want to store a value and you also want to store information about who is the left child and who is the right child. So, that is most conveniently done using a structure. So, therefore, you can now represent all kinds of different relations between data items here it was a binary tree relation. You can represent different kinds of data relations between data items using structures you can use specific members of the structures to represent information about the relation. And as we just indicated as I just said that this kind of a data structure is also called a heap and in this case of course the values of A were all sorted to begin with. So, we are basically getting this heap quite easily. You have studied about selection sort and merge sort. So, there is another sorting technique called heap sort which basically tries to build a heap out from unsorted elements and the process of trying to build a heap is to basically build a binary tree which satisfies that property value of every node is less than or equal to value of all its descendants and if you can ensure that for the whole thing then you have the array sorted. So, we will stop here.


Everybody Matt here for late in sports cards ripping 2023 panini Donneress baseball hobby four box break number six random teams Here we go We'll randomize three times. Good luck One two and three poyan H down to Dave K and three times on the teams One two and three A's down to brewers. All right. We have Poyan H A's Chris B mariners and Royals Cory B Rockies Chris B Giants Rob V Dodgers Daryl W Yankees Chris G Guardians Chris B Braves Matthew B Red Sox Timothy M Cubs Ryan M twins Jim J White Sox Mets Chris B Padres Daniel V Raze Chris B Astros Ryan M Pirates Chris B Orioles William D Tigers Chris B Phillies Dbacks Angels and Marlins Seth D Reds Daryl W Cardinals and Blue Jays Michael P Nationals Chris B Rangers and Dave K Brewer's All right Get these results posted Here's a link to the results Shrink that down so I can see it There we go. All right, let's do it my first chance at ripping 2023 Donneress baseball let's get that next one filled up when did we have on 18 to go on the second of these four boxers all-card ship regular bases divided evenly Between all spots. So whether or not you get a good team.  What's going on here? Yuri Perez diamond Kings Kirby Pucket Gary Sheffield blue foil Steve Carlton, that's red 2023 and Hoyt Wilhelm Hoyt Wilhelm to 999. That is Royals 90s style auto Bobby Whit jr. There you go KC just There's Bob lemon blue blue lemon Tamar and Drew Jones rated prospect. Sorry guys my hands are shaky right now. They'll settle down. That's um Independence Day Jim Palmer Eddie Matthews Paul Molliter red 2023 Owen Murphy history makers a rod Adele Amador to 2023 rated prospect William Lance Berkman blue Jordan Lawler rated prospect blue and James Wood This is 100 number to 100 rated prospect Mara's and Davis as we have 16 to go on the next break. Let's get that filled up. Yeah, and I have been Hazard. I Think they need leadership change. This is 85 style rated prospect auto That's said on a Raffaella red socks or say Don Raffaella George Valera rated prospect blue Raffaella Palmero It's a Liberty parallel Bobby Whit jr. Blue and Kumar rocker red 2023 Eddie Murray Johnny bench to 125 Diamond Kings. That's Lou Brock Mr. 3000 number to 999 Indira Rodriguez Blue there's having Carter blue foil McGuire. Hey, what's up Rob? Yep Sean Green to 100 at his Pete Kraw Armstrong Unleashed to 149 Your prospect Louis on Hella Cunha to 2023 Larry Dobie throwback Yeah, I thought 90 was a much better design year than 89 anyway, although the 89 Griffey rated rookies my favorite of his rookies. There's Kevin Perotta That's the 75 that is on fire rated prospect Gilbert blue Gilbert. I kind of get a feel for this as we go here First one might take a little longer. There's Tom Siever dominators to 999 Ichiro to 2023 Randy Johnson Diamond Kings to 2023 Jacob Barry rate of prospect blue. Oh There's a Yoshida rate of prospect hunters off camera. He's top loading King Griffey jr Naturals Nolan Ryan, that's a cool insert cool Papa bell to 2023 Grave Maddox blue as a rosky Marcella Meyer to 279 Locked and loaded to 99 Jose Ramos Blue stars and Ellie Dela Cruz rated prospect blue foil. That is Diego Cartia jersey Dodgers Daniel Seussac blue foil Bert Bleileven. That's red foil to 2023 can call your Rated prospect 2023 Jordan Lawler Mar Johnson Duke Snyder Noah Schultz 100 Bert Bleileven 349 Ricky Henderson blue foil Zach Vien red foil to 2023 it's hollow red Ricky Tiedemann red or hollow red Bert Bleileven Bobby Dure Diamond Kings It's a Von Rodriguez Diamond Kings blue Yeah, it is. I don't know prompted to change York It's Griffey bottom squad 349 Jacob Melton blue Brandon Davis blue hollow rated prospect. Oh, yeah, that's right. They don't have a players association one more Viscale So hollow red Kirby Puckett blue Gilbert coming attractions Duke Snyder 2023 and Moise Salud blue Oxtramirez blue and Eddie Matthews. It's the 124 Oh, yeah, there's a unleashed Drew Jones to 149 Jace hollow red Titan Just make like a couple cards per Dodgers that is red ice rated prospect auto Diego Cartaya Go Dodgers. It's low-numbered rated prospect auto. There's parada Diamond Kings There's a blue Jays rated prospect auto Josphair Zulweta Sure, I nailed the pronunciation there. There's a Bob Lemon and Quinn Priester rated prospect hollow blue Soriano, Zack Neto 377 Luller, this is Cubs dominators 349 Billy Williams Andy Pajas Hollow red rated prospect and Tremar. This is Giants to 35 rated prospect auto aqua Kyle Harrison. Actually, I think that's Carolina blue Kyle Harrison. Nice one Giants good prospect It's an old Ryan Diamond Kings wire Grant McCrary hollow red Jordan Lawler foil Zardo Kevin parada 500 12 to go on the next break. You're a Perez Hoyt-Wellhelm to 999 and rated prospect blue hollow or hollow blue Drew Jones Drew that is Red Sox Jersey Carl Yastremsky You'll Boston Raleigh Fingers hollow blue and weight box hollow red Mickey Mantle Diamond Kings red or hollow red 2023 Frank Biola. There's no one for Mar and Griffey 184 we have one more of these four boxers and then eight box divisionals There's Tom Siever dominators to 999 Cal Ripken that is red to 2023 hollow red Pete Rose Joe tinker Hollow red was a tinker to Evers to chance There's cam Collier hollow blue That's a famous double-play combo He goes rated prospect blue stars cam Collier could be Puckett Diamond Kings blue Vlad senior 499 or 449 Pedro blue blue Brock just 3,000 to 999 Kirby Puckett hollow red Kyle Harrison hollow blue a prospect Hollow red Jason Dominguez Very Perez hollow blue Don Sutton hollow red Zach vane Joe Morgan Just a 400 Frank Thomas hollow blue. There we go box number three elite Willie Stargill to 999 Don Sutton hollow red Quinn Priester 11 to go On our second four boxers six in each of our divisionals eight box divisionals. It's a Wade Boggs hollow red Eddie Matthews Hollow Mickey Mantle Diamond Kings hollow red Jacob Melton hollow blue Eddie Matthews Diamond Kings to 500 Nullarion Diamond Kings hollow blue Mr. 3000 nap Lashway 999 PCA rated prospect blue stars and Orlando Sepeta hollow blue Lots of number cards in these boxes almost like every box is a hot box. It's a Jackson Churio Jersey Brewer's He's already called up and MLB the show And What am I on late? I think late July or late June? Ripken hollow red Tyler black hollow blue. I won last night Not to brag or anything. There's a penance Joe Carter. That's a cool card Kirby Puckett hollow red and Kyle Manzardo hollow blue Are you going to half way the season yet? No, I'm almost at the half way point Yeah, yeah, I think I won last night 48 48 to 1 or something. There's a babe Herman 75 Raleigh fingers hollow blue Yeah, Brandon. Yeah, it's now LSE to there's unleash Grayson Rodriguez Jason Dominguez hollow red and Cam Cogger It's hollow blue Comes a one-of-one blue Jays rated prospect gold vinyl auto Ricky Tiedemann. Congrats to Rano Hey, Tony showed up and we pulled a one-of-one auto. We go gold vinyl for the blue Jays There's a Ricky Tiedemann hollow blue See who had Toronto Daryl W. It's cow Ripken Ponytail Derek. Yeah, Pete Rose. I kept calling him ponytail Daryl Thanks, Tony appreciate it. Yeah, I love Doritos. I do have a firm no Doritos before noon rule though It's a Ricky Tiedemann to 217. I'll give you wrong. I'm not above eating chips before noon Ben Kedurna Yeah, ladies ladies aren't a bad breakfast chip What do you guys think what what are the best breakfast chips? I'm talking like potato chips. There's a burp Y11 Cooper's Town Lance Berkman hollow red Kirby Puckett Diamond Kings pick up the pace a little bit here. This is a 75 rate of prospect auto hollow blue Griff McGarry That is Philly's Marvis Kelle Liberty Diamond Kings weight box Ricky Tiedemann hollow blue and Zach Netto hollow or that was hollow red. I'm sorry, and then Netto hollow blue Fritos. Yeah, that's actually not a bad. That's not a bad call.  Oh Yeah, this honey barbecue twist are awesome There's Owen Murphy hollow red Don Sutton hollow blue Joe Tinker Hollow red and Brennan Davis hollow blue It's Al K line to 399 there is no shame in liking junk food Magliore don't know her done. Yes 90 hollow Nice, that is Marvel's to 249 Jordan Walker You go Cardinals one been show hollow red and Marcello hollow blue Jordan Walker or Jim. How's it going? Red and Alex Ramirez hollow blue is Ray Lankford blue stars Good to see Lankford in a modern product Can't complain even on a Monday that sounds like a pretty good start to the week. There's a chipper Jones hollow blue We have nine to go on the next break nine left. Let's get that filled up Yep, Wednesday is release day for 2023 top series to that's gonna be awesome Great rookie checklist. So Willie Sturgill on Fire 75 and Zach being hollow blue All right last box nine spots left for the next one in just 1999 a spot on these and then we do have two Eight box half case the visionals Sparky Anderson Cooper stout in a 99 Bobby a brave blue stars and Jordan Lawler 90 hollow Jason Dominguez Jersey to 99 Yankees. Yeah, this isn't This is a little there's Orlando sepada Rafael Palmero red The red ice um Let me see. I pulled one just a little bit ago. No, I don't see it. I don't see it on the checklist Gordon Rasefo Red foil and George Brett blue foil.  It's a Kyle Harrison That is presidential collection number to 46 Blue Brock Mr. 3000 Ricky Henderson and Nick Yorke red foil Maglio Jim Palmer red foil tomorrow Diamond Kings stars blue stars Bobby Dure and Indie Rodriguez hollow blue it's Curtis Mead To 390 so season stat line Tim Reigns hollow blue Billy Williams to 999 cubs Jim tommy 90 hollow red and Johnny bench hollow blue. There's Mason win rate of prospect hollow red and McCable hollow blue Dylan Lesko hollow red Eddie Matthews one gone And there's a career stat line Larry Walker hollow blue No, I'll be a I'll be ripping four or five days a week Carlton Fisk That is to 50 America parallel Gordon Grissett and Gracefoe I'll be I guess my normal schedule will be Sunday daytime. I think I'll be doing personals and then Monday morning Wednesday morning and Friday night unleashed 149 Henry Davis It's Robin yelp red for the 2023 and Mike you've seen it. I'm sure we will at some point. I'm not sure Winner how often nice nationals to 35. That's rated prospect auto Carolina blue James wood There you go. Nice one nationals Kyle Harrison blue foil Wade box Cooper's town to 999 and Mason win rated prospect blue stars Robin yelp Diamond Kings blue foil Bobby of radio red foil to 2023 and Paul Molliter Luke foil our cello Meyer that thing has banged up. I think it was badly creased Snagged in a machine or something. There's Frank Thomas blue stars Bobby wit jr. blue foil We a few minutes behind schedule. This is a little bit longer rip Gavin Williams blue stars and say Don Raffaella foil I guess that's independent today. They want to keep calm blue stars Evan Carter That is on fire to 75 chipper foil Unleashed Jack lighter That's the 349 Rhino Diamond Kings red foil and Kyle Menzardo blue foil 25 rated prospect auto orange Kevin pirata nice one Mets Well, nice low-numbered autos in this box Sotr strong Two packs to go Buster Posey It's um Liberty Daniel Susak hollow red and Omar Viscale All right last pack Michael Bush rated prospect 500 Moise Saloo Alright just a second here. We'll do a hit recap Relics we had Yankees to 99 Jayson Dominguez. What's up, Julio? There's a Brewers Jackson chariot red Sox Carly Strimski and Dodgers Diego Cartaya Autos that's blue Jays Yosferre Zulietto Royals Bobby wit jr. That's interesting that they have a wit auto Mets Orange Kevin pirata red Sox orange say Don Raffaella Philly's blue Griff McGarry Giants Carolina blue Kyle Harrison Nationals Carolina blue James Wood Dodgers that's rated prospect auto red ice to 23 Diego Cartaya and Blue Jays one of one gold final auto Ricky Tiedemann That'll do it for the break. Thank you everybody. We have number seven coming up next


N-P-TEL is today one of the biggest repositories of technical courses in engineering and sciences in the world. These courses are freely accessible on the portal nptel.ac.n and are distributed under the Creative Commons CCBYSA license. N-P-TEL toh sikhcha ke chhetra mein ek bhoothi bade krangti hai. N-P-T-E-L, yani National Program on Technology Enhanced Learning ki ye pehel, gaun aur desh ke bade chote shaharon ke un bachon ke liye hai, jinae bhetareen shikshakon ya sansthanon se padhne ka mokka nahin bilpata. Iske tahit text, audio aur video ke madhyam se kai courses uplabdh kerae ja rahin hai. Jinae desh ke IIT aur IIS ke professors ne tayar kia hai. 1-July 2015 se online certificate course ke shirwaath ho rahi hai. Jisme computer science, aerospace samed, 24 courses shamil kye jaayenge. Ye sare courses puri tarha se free hai aur koi bhi registration kar ba sakta hai. Vishesh jankari online courses.nptel.ac.in par uplabdh hai. The one question that many parents, students and other teachers have asked is that why redo the effort. There are video lectures available from many other websites, many other platforms, etc. Why redo it? The answer is simple. To me the answer is very simple. The way I teach it in India because I know what is the background these students come from, what is being covered in class 11 and 12, what can be the lacuna of them. That is not possible for an American or an European or a Singaporean or a Hong Kong or somebody anybody outside this Indian education system to guess or no. So, their lectures may be useful or may not be useful. But I am sure, at least all of us, all of my fellow colleagues and teachers and me, at least we are aware of the shortcomings and what is being taught in the schools, etc. So, for Indians we require an Indian system by an Indian. I am Shantanu Bhattacharya and you may recall that I have been teaching this course on manufacturing systems technology part one. This course was being supported by the NPTEL initiative. I do remember about how after each lecture there would be an editing of the video and there would be a comment which would be invited by the speaker and accordingly and commensurately the changes be made. So, really the whole level of perfection that is needed from a studio to the final lecture delivery which you guys have seen that walkway or that journey has been a phenomenal journey. मेरा नाम ताखुबद्सिंग है और में कान्पूर से आया हूँ पीस आटी से और वहांपर as a management faculty हूँ MBA में अपरेशन लिस्चाद चाओरी स्टर्टिष्टिक सबज्ट्स को में डिल काता हूँ. उनको पुरा पुरा बनिष्ट में लेई. तवाशाद नाम सीमेतोग бы मेंँगर। करनावाणाशा करनाटिक मुसीक है वेड गुगर have been working with NPTEL for the last six years. इस और इसलचए तब समथ बगर नावाणाशी थूँ. बफींगा, ऎन्ळे।, और आगिए आदादक, तब विय। तब लक्च्ऩ pack. तब आप मेभ नहीं और पावश्थ को वहुज चिबस्छा है. उशीव वियावक रहा, एक अदीं वियावक तब बैव, वियाव यहावोग तब यहावावक बरह्डु. अगर दियान जुल्येक ही नहीं आप नहीं श़quer work like professionals and it is well organized as such तो से बारच्जाआ अज़। शव़ाज़े बी आप भी बागावागागागागगागागंगगगगग the N P T L i o rgenicians usch for conducting the type of courses. Definitely once you get hooked onto this particular process of learning, you will find that you can learn it at your own pace and time, and you will also be benefited with a certification which is also what a case separate by Industrial and therefore you will find it is employment facilitator. I hope it reaches as many students as possible, and best wishes to all the students who want to participate in this effort. थिसे स сначала ल�只有 में चॆ 않아 की तो वल दिश्वाद कौते हाँरочка drawing ko tu bhara kariru jaias te presents the problem of the people of Snipala. आवप्टर ब्घर का तो अगी को तौचेची स॑ना चाँचा दो की छुटєो़ साथा।a sansgod par tohi rowin asas producers of newspapers and souvenirs of starsker tonight.


Hi there, we're now going to talk about contingency tables and the test for independence. If you were able to handle the goodness of fit test, the good news is it's basically the same process for this test for independence. So a contingency table, it displays a frequency distribution as a table with row and columns to show how two variables may be dependent or related to each other. For instance, you could look at the number of people who own dogs and cats and break it up by males and females, and you could look at those different frequencies to determine if there's a relationship between someone's gender and whether they own your dog or cat. A test of independence tests the null hypothesis that in a contingency table, the row and column variables are independent. Remember, independent means they're not related to each other at all. The hypotheses for a test for independence are as follows. The row and column variables are independent. That would be your null hypothesis, and then the alternative hypothesis would be the row and column variables are dependent. I remember that just means not independent. These are always the hypotheses when you run a test for independence. The requirements to use the method we're about to use is that the data must be randomly sampled. The sample data are represented as frequency counts in a two-way table or a contingency table, and for every cell in the contingency table, the expected frequency, not the observed frequency, is at least five. All right. So notation, big O represents the observed frequency in the cell of a contingency table, big E represents the expected frequency, R represents the number of row categories, and C represents the number of column categories. So to run a test for independence, we have our two hypotheses. The null is that they are independent. The alternative is that the variables for categories are dependent. P values will be provided by technology, Google Sheets in this case, and then critical values can be found from the chi-square table. The degrees of freedom for a test for independence would be the number of row categories minus one times the number of column categories minus one. Test of independence, they are chi-square tests, therefore they are right-tailed. So do a test for independence, go to the chi-square tab in Google Sheets, we'll select independence for our type of test, and then we'll type in our information, our contingency table into the spreadsheet, it'll give us our P value, our test statistic, it'll also give you degrees of freedom. So does it appear that the choice of treatment affects the success of recovery of a broken foot? Use a .05 level of significance to test to claim that success is independent of treatment group. Here you have surgery, weight-bearing cast, non-weight-bearing cast for six weeks, non-weight-bearing cast less than six weeks, and a number of people or a number of successes or recoveries and a number of failures. So our hypotheses are always straightforward, the row and column variables are independent, the row and column variables are dependent. So the null hypothesis basically the translation there is that treatment does not affect recovery, and then the alternative is that treatment does affect recovery. We basically know our claim is the null hypothesis, that's what they said, but we just need to type this information into Google Sheets, get our P value, compare it to alpha and be done with this. So we'll go to Google Sheets, we will go to the chi-square tab, you will change the type of test to independence, please don't forget to do that, it will slightly affect your answer, because degrees of freedom vary based on the type of test. We need to have room for four row categories and two column categories, which is basically success and failure in this case. Alright, so I'm not going to really write out the every single row category, but I'll put surgery, I'll put weight-bearing, I'll put six weeks for the non-weight-bearing cast, and then put less than six weeks for the non-weight-bearing cast. So literally type in your table, starting in cell E2, you'll begin typing your data, 54, 41, 70, 17, and then failures, 12, 51, 3, and 5, and let the spreadsheet do the calculations, please give it some time, it does take a little bit of time to do everything, well at the end of the day, you have your test statistic, 58.39, if they ask for that, there it is, degrees of freedom is 3, and p-value is 0, that's what we need. Alright, so the p-value is 0, what happens when we compare it to alpha, it's definitely less than, so we reject the null hypothesis, we are under the limbo bar, so we reject the null hypothesis, which means we reject our claim. There is evidence to warrant rejection of the claim that success is independent of treatment, so basically what that means is that choice of treatment does affect the success of recovery of a broken foot, so here you have a medical application of statistics, pretty cool right? The only other thing I want to comment on is that if you were asked to find the critical value of a test for independence, the degrees of freedom is always going to be the number of row categories, minus 1 times the number of column categories, minus 1, so that's 4, minus 1, times 2, minus 1, 3 times 1, which is 3, and your spreadsheet told you the degrees of freedom, but I just wanted to show you how to calculate it by hand, because sometimes they'll just tell you what the row and column categories are, it'll tell you what the degrees of freedom are, and they'll tell you to look at the chi-squared table that we use for the goodness of fit test, remember you just look at your significance level and you look at your degrees of freedom in the chi-squared table to find the critical value, critical values for chi-square are always found from the table, use alpha, use degrees of freedom. In this last example, we want to know does it appear that gender affects party voting preference? We'll use a .05 level of significance to test the claim, there's the hypothesis test keyword, that gender is independent of party voting preference, we have our hypotheses that the row and column variables are independent, so gender does not affect party voting preference, that's our claim, and then the row and column variables are dependent, so gender does affect party voting preference. So basically remember what we need to do here is we just need to type this information in the Google Sheets, get that p-value, make a comparison to alpha, and be done with it. So let's do that now. Google Sheets, you only have two row categories, you have male, you have female, and then you have three column categories that you're working with here. So the first one's Republican, Democrat, and then you have independent, then you'll type in your numbers, let me clear out what's already here. So starting in cell E2 we have the males that are Republican, 210, females that are Republican, 240. Make sure you push enter after you enter each data value, 140, 200 for Democrat, and then 45 and 50 for independent. Please give the spreadsheet some time to calculate. Looks like the chi-square test statistic is 2.68 in this case, and the p-value's 0.2612, degrees of freedom is 2.2612. And how does that compare to alpha? It's definitely greater than, so we're not under the limbo bar, we fail to reject the null. We fail to reject our claim. So as a result, there is not sufficient evidence to warrant rejection of the claim that gender is independent party voting preference. It does appear that gender does not affect party voting preference, that's what we can basically conclude here. And remember, if you were to have to find a critical value, you would use alpha equals 0.05, degrees of freedom, row categories minus one times column categories minus one, two minus one times three minus one, which is one times two. You get two, and that's from the spreadsheet too. So two degrees of freedom, alpha equals 0.05, use the chi-square table to find the critical value if they ever ask you to. But anyway, that's all I have for now. I appreciate your time. Thanks for watching.


Hi guys, it's Monica. I'm gonna share a couple of things with you that I'm super excited about. Many of you have asked me to kind of narrow down my favorite lipsticks.  My favorite lipsticks are all drugstore with the exception of what I buy at the Color of the World. So I would say, if I'm looking for my top favorite, I don't have a ton. So I think it's really hot. I mean, some people will come on as their favorite mascara. They favorite this or that, and they have like 20 of them, right? It's like, okay, but what is really your favorite? So I do have a number of different lipsticks, but what is my overall favorite? So if you're curious, stay tuned. I've often talked about Color of the World. I am not an affiliate with them. I'm not sponsored. They don't even know I exist. I have a discount code, nothing, but I love these lipsticks. I bought them, I think, two or three times. Three times, well, tail end of 2019 and into 2021, three times, make three orders. My all time favorite of the Color of the World and their colors, my all time favorite is independent. More often than not, when I'm putting my lipstick on, I'm putting on independent and I top it with my favorite gloss. I have a lot of different glosses that I like, so I'm not really hooked up on it, but this is, I don't know if you can see it. I think independent, it's kind of a, it's, I don't know, you know, I don't know whether I would, I wouldn't really call it a mauve, but it's sort of a neutral to me. It isn't pink, it isn't mauve, it isn't purpley, it isn't peachy. It's like a darker without being dark because I don't do red, neutral. I love it. I just think this is awesome. So my all time favorite in the Color of the World has to be this particular one and this is empowerment. I love it. My second favorite in Color of the World and both of these, by the way, I have bought a number of times. My second favorite is independent. An independent just has a little bit more. Independent is the bottom one right there. A little bit more of a, for me, a mauve, a mauve color, maybe a little bit pink or purpley in it, but a mauve color. And so both of these, I just opened this one up not too long ago, which is why it's still pretty full, but both of these are well-loved and well-used and my top favorite of all my lipsticks, except they're really not drugstore, are they? So when we get into drugstore, my ultimate favorite in drugstore that I have bought, this is probably the fourth, maybe fifth time I've repurchased this particular color. This is a Maybelline lipstick and this is number 450 and this is Romantic Rose. It is more rosy, but not that bad. It's kind of like that perfect. It kind of reminds me of empowerment, but a little bit more rose, it's on the bottom one. If you put them up together, you can see it's more pink on the bottom. I really like Romantic Rose. So Maybelline, this is it, no more Romantic Rose is definitely it. The second one that I love in Maybelline is this one, it's number 665 and it is Lust for Lush. In that, a little bit more rosy, a little bit more pinky, but I just love it. I just think these colors, I think these are just really, really pretty. So as you can tell, use these over and over again. So my four talk lipsticks would definitely have to be these four and I have many other lipsticks. I have some really expensive lipsticks that were sent to me for Octley for review. I have a number of expensive lipsticks but those are still my favorite in their drugstore. My all-time favorite that I use to lighten up any color that's too dark because I don't like red, I don't like dark lipstick. And this one, I don't even know if you can get this, I haven't seen it in a while, this is Rimmel and this is number 45. I really like it. So I use that to lighten up whatever lip color I have on. My favorite lip glosses of choice this past year has been Sephora. I consider Sephora, their brand, it's like Ultra Brand, I consider that like drugstore, you know, brand. So I love these Sephora and I'll list the name below because these are not the glosses you can get everywhere in Sephora. Sometimes they run out of these, they're not their normal glosses. These are just really pretty. I really like them. I've only had good luck with ordering them online. Every time I go, they're sold out. The two colors that I like are sold out. And I happen to like, like 01 and 02. And this darker one is the one I wear more often. I have the top, I believe it or not. And I'm gonna put that right on top of here. So you can see, it has a lit little bit of a color. So you can wear it alone and lots of times I do wear it alone. I don't always wear it with a color underneath. And then you have this lighter one. See where I can put this. Just clear. Just clear with a light, tiny, tiny tinge of pink. So that is, I'm gonna have to swatch this and wipe this all off. That is my drugstore favorite lippies. Actually not drugstore, my all time favorite lippies. I love these lippies. I have all the lipsticks I have and I have a ton. Like I said, these are the ones I just gravitate to all the time. So yeah, I just wanted to make this video. Many of you have asked and short little video about my favorite drugstore. Very affordable, lipsticks. Thank you so much for joining me. Let me know in the comments below. What are your favorite shades? Don't mention any reds, cause I just don't do reds. I just don't do reds. Don't like them on me. I think the red lipstick looks beautiful on other ladies but on me, I feel it ages me. And at my age, I don't need to be aged any more than I already am. So thank you guys so much for watching.


From the Phoenix Convention Center in Phoenix, Arizona, it's the Q. At the Grace Hopper Celebration of Women in Computing, here is your host, Jeff Frick. Hi, Jeff Frick here. We're on the ground at Phoenix, Arizona at the Phoenix Convention Center. The Grace Hopper Celebration of Women in Computing is 8,000 women and a couple hundred men, really in the 14th year of this event, which includes inspirational speaking, it includes an education component, it includes a job, fair components, there's a lot of stuff going on at the show, so we wanted to come out and bring you the story. So I'm joined next by Catherine Krim, she's from the marketing group, she's got a long title but she said that was good enough at Microsoft and you're involved in the hackathon and all of these big shows now have a hackathon component. So tell us a little bit about the hackathon component that's going on here. Yeah, I'd love to. It's so exciting to see what's happening here at the event. We have, there was an open source codathon yesterday and we're continuing that with a hackathon on Saturday that is the kickoff for the International Women's Hackathon. We'll have among 20 universities and 2,000 women coding on Saturday worldwide and they're all connected via Skype and Link. And what we're working to do is really encourage women to just get started in coding at their universities and know that they can make a difference. So we have a coding for a cause, we have three great challenges. One is for direct relief, one is for the nature conservancy and one is an open challenge to make the world a better place. And what we're doing is really starting out with toolkits where women can go back to their university, keep that energy alive from this event and host their own hackathon at their university. So we were talking a little bit offline before we came on camera and it's interesting, you know, your perception and really using the hackathon thing, if you will, the hackathon mojo to help people understand that coding can be fun and it can make a difference and it has that collaboration effort. So talk a little bit about, you know, your experience with that and how that's played out in other examples. Yeah. So I'll give you a little background. I think you heard that this morning that only 18% of women, 18% of computer science graduates are women and, you know, we, all of us collectively want to help balance that out. Right, right. So we want to help. Right. So they don't know that they can make it in computer science, they don't know that they can make a difference and make the kind of impact they want in their careers. Right. But really coding is the ultimate creative canvas. And if you look at what is happening in technology, this is a chance to change the world. Right. And it's really writing, right? I mean, coding at the end of the day is kind of basically writing. It's like writing.  Exactly, yeah. And I think the thing that's interesting about all of the hackathons that are happening now in the world, they, they're one day and they're really about getting together and learning. Right. And what we're also trying to do is how do you then bring that forward? So we have opportunities now like, I don't know if you ever heard of the humanitarian toolbox. I have not. That's a program that has been designed to help people bring their code forward after hackathon. So they can go to a hackathon, code for a cause, check in their code, and then we have engineers, volunteer engineers that will help bring that forward, pick the best code. And right now they're writing a crisis check in app that is going to be used by NGOs worldwide for response after a disaster. And is this a Microsoft initiative or is this a separate kind of an organization? It's a separate organization. We were supporters and some of our people are on the board, but it's a nonprofit that's kind of been just supported by us. And that's kind of the same model we're doing with the International Women's Hackathon. We're working to get it kicked off, but then we're just providing a toolkit and resources and mentors and technical support and training so that women at universities can host their own hackathon and bring their communities in and just kind of get it off the ground. Yes, so dig into that a little bit more. We talked about it before we came on air. And it's kind of interesting. So you're literally giving them a toolkit. If you want to host a hackathon because it's a cool thing to do and you can change the world and you can hang out with your peers and your friends, you're basically giving them a hackathon in a box, right? Exactly. So and what are all the pieces that are in there? It's the same sort of thing you'd see like in a startup weekend toolkit, not quite as well polished as theirs is, but we kind of use their model. We have everything from here's how to do mixers and introduce people to here's how you get sponsors to pay for the food for your event. Yeah. And you know. The real basic stuff, right? Real grassroots to help them get it off the ground. Exactly. You got to have pizza. You can't have a hackathon without pizza. Without pizza. Exactly. And then, you know, how to get prizes. And then what we really want is we want to see what people are building, help them build their resumes, help them bring their projects forward. So we'll provide mentors if requested. Our MVPs, we're getting volunteers for mentoring everywhere. And then we're asking people to post their projects up to Challenge Post so that they can share it with the world. That's great.  But the other thing, like you said, usually it dies, right? The conference is over and everybody goes home, they take home their awards. You guys are really trying to keep it going, keep it going, keep it going. You got it. Yeah, that's great. Well, Catherine, thanks for stopping by. And on short notice we kind of grabbed you out of the hall, which is what we like to do. We go out to events. We extract the signal from the noise. We try to find really smart people, ask them good questions and bring that information back to you. So, Catherine, again, thanks for stopping by. And so where are you going to be on Saturday? I'm going to be in Phoenix at the hackathon, kicking it off. Like a big knock with all the watching the Git code come in. You got it. Yeah. LinkedIn and Skype. I'm so curious to see what's happening around the world on that day. Excellent. Well, thanks again. Thank you. So, Chef Rick here at the Grace Hopper, celebration of women in computing.