 So, I registered myself into CS 101. Now, you can see that on Moodle there is very little information. In any case, you will not be able to access this because you are not authenticated by the Institute LDAP. So, what Professor Ranade has done is that the Moodle was actually CS 101 Moodle was very notional. The course was taught in different batches as I said they were 650 students. So, he had different Moodles for batch 1, batch 2, batch 3 and so therefore, nothing appears here if you can see. In the respective batches there would be assignment submissions and discussion forums and so on. But what he did is he created a home page for the course. So, this is the course home page for CS 101. This is a public page. So, you can access it from absolutely any internet site. This is the course which Professor Abhiram Ranade taught in, in fact you can go to his home page here and you can see the way he has organized this almost Moodle like thing except that it is the course which Professor Abhiram Ranade taught in, in fact you can go to his home page here. And you can see the way he has organized this. So, notice what he says. This course provides students with an entry level foundation in computer programming. The goals of this course are to develop the programming abilities in students and to improve their proficiency in applying the computing fundamentals to the field of study. Topics include overview of high level languages, introduction to CC plus plus library, basic data types, function definitions and declarations, conditional and iteration statement, array and string manipulation, recursive programming, introduction to searching and sorting, introduction to structures and pointers. You can see this roughly matches the syllabus that we have seen in the first course anywhere. Notice that C and C plus plus reference appears only in this line. And it is specifically stated that this is not a course in C and C plus plus but it is a course in programming. This is the formal course syllabus, utilization, develop fundamentals, it is not developer fundamentals, develop fundamentals such as editor, integrated programming environment, unique shell, modules, libraries, programming features and applications. Text book is by Kohun and David Sun. I saw this reference at many places. Frankly neither he nor I think that this is the best book program but there are not very many good books. I saw the other popular book was Karnatkar. In most places Karnatkar's book appears as a reference. Probably students like Karnatkar's book a lot better because they must find it simple in terms of examples and the breadth etcetera. We will therefore keep Karnatkar's book in mind when we describe this. Like Karnatkar's book is out of places. There are some objections against Karnatkar's books also. I strongly believe that book very well corrupts the concepts that students find. While teaching everything to turbo C windows and I don't call it C but some corrupted version of C where they teach that C has both master reference and master value. So these kinds of concepts take a very long time even 3 years. I have read Karnatkar's book because I used to be a mechanical engineering student and I used to come to science and everybody in our department told us we should not see Karnatkar's book in your hand we will be thrown out of the department. Do remember what I said the first time that if there are M teachers teaching programming there are N opinions and N is usually larger than M. You will find people holding a lot of contrary view about Karnatkar's book particularly large number of teachers and students. So let's first understand what we are planning to do. Our planning is exactly the graph that you remember I had you. It was about hard work and grasp. Now consider the graph being drawn between the present practices which teachers and students follow and the environment in which they work. And what we want is that the present practices to be aligned with and the students activities to be aligned with what is done at best other places. That is our ambition so we want to reach there. But starting point is this. So imagine there is a point which represents a teacher or a student who swears by Karnatkar's book and students who read only that book. It is easy to say don't read that book but can you get rid of that legacy overnight? Can you remove that mental block from let's say 500 teachers who are using this overnight by a fiat? Particularly when the official fiat from that university is that book is a textbook. You cannot remove that fiat. What you can do is you can tell them that this book will corrupt the minds like this, this, this not using those words because we should not belittle the efforts by any author. There are while you may say this I have also read Karnatkar's book by the way. There are several examples which are well written there. There are several examples which are written in a very simplistic fashion which students find very useful and easy to understand. So just like as I said good and bad there are some good points. What we should stress in our efforts is that each of the books has some good points and some bad points. What we are trying to do through this course is to bring the best in all these books and additionally something which is not there in any book. Sana as some observation please. The other thing to classify the books is going back to what I mentioned about the learning objectives that if this is what we want to emphasize then such and such is a good book or if our university focuses on this aspect of programming then that would be a good book. Sana our battle is precisely with the universities not with the universities per se but with the university straight jacketing of syllabus and things like that. Syllabus but let's say when you are saying best and good and bad or best and not so good. So it has to be along some dimension. I think it needs to be explicit along what the example of the ten random teachers you gave. This teacher is good for such and such a thing. That teacher is good for that. I think that's a good point. So in fact that's another exercise that all of us can carry out. Use the textbooks that you have been using and just make a list of points and examples which you think are useful. We will not look at the bad points at all. Why say bad things about everybody? But we will say if we say these, these, these are good things in this book. These are good things in this book. And we have tried to bring together the concepts and examples from all these plus we have added our all. I think that may be a more positive way of looking at it. You look at other references. I was very happy to see Polia and Drume's book. If you have not read Polia's book I recommend you read it. Polia was a great mathematician in last century by the way. And at the age of 92 he wrote one of a, one of his great research papers. Some hundred pages long research papers. He was a maths person, not an engineer, mathematics person. But extraordinary insight into thinking of human being. How to solve it is a legendary book. It is 1957-56. But still it is almost like a Bible on the basic philosophy of teaching learning. On problem solving actually. You can see that Karnatkar's book is mentioned here. Now if great Abhiram Ranade feels like mentioning it. He is one of the greatest teachers by the way amongst all of us. So there must be some merit in it. And I am sure that the merit must be twofold. One, this book is popular among students. Even I had issues of Ushasur. And second, therefore there must be something useful that the students find. So as long as you restrict your attention to that I think that should be good enough. Anyway what I want to show you was not this. But consider, okay these are, now this all was by the way put up. And it was incrementally modified as the, as this course progress. So here is our lecture schedule. So everything is stated here. The timing, the lab schedule, how many batches? We have 40 batches for the lab. And he had, I will have, I think how many batches we have said? 850 students. So we may have perhaps 60 batches. I have asked for 65 Ts. Let's see how many I get. We have problems of scale of our own. But everybody is going to have this problem. I am sure that this additional reservation will increase the number of students in all of your institutions as well. Or it was already there. Or it was already there. Only IITs and national institutes have started it now. So that's okay. You are lucky then. Meaning you don't have additional scaling problem. You have the existing scaling problem. Tutorial hours are optional here. They are defined that these will be the hours. Office hours are defined. The office hours are there. Either the teacher or some of the senior TAs will be available guaranteed. This is outside the classroom. Many of the colleges have found that it is not usual to notify such timings. I would humbly suggest that we should amongst ourselves inculcate the habit of announcing that I shall be available. Either I or a colleague of mine shall be available to answer questions during this time. It may be a very short duration. It may be just two hours in a week. But I think we should announce that. I want to start this during our workshop. So later on when we work out the activities, how do we put that in schedule? It will be a very compressed schedule. As I said it will be a two week program but not ten days. It will be fifteen days. Two weeks is all fifteen days. Half month is a better description. And there we should accommodate such additional things and so on. Let's go back to resources. So there are tutorials. We have basics. We have quick reference. Linux commands. DDD tutorial. This you may find in fact additionally useful from an end user's perspective. There are useful links given here. Instructions on how to run X11 programs remotely from Microsoft windows. Some of you might have Microsoft windows. So how would you run X11 libraries from there? Wikipedia has sorting algorithms. It is actually a better textbook in some sense. In terms of explanations and so on. A whole lot of things. There is an online book chapter. Beginner C++ is an easy resource. We don't easily find such resources put together. So he has taken a lot of efforts to actually put them together. And wherever information is in open source, after all what we are doing is also going into open source. So we should actually do this. Now what I want to suggest is if anyone of you have such open access web links even within your institutions for anything pertinent to programming, it will be useful. And even if one is not there, I would recommend you create some pages like this. So that it is accessible to everyone. Then lectures and problem sets. So lecture slides for the topics covered in the course. Now I don't know whether I showed you, take this Newton-Raphson method. This is from Kuhn chapter 4.9. Did he show you these slides? No, he did not. This is just a sample. What I like is, so you look at his evolution of a lecture by this. This is a typical lecture. So more examples of four statements. Evaluating e to the power x, Hemchandra numbers and Newton-Raphson method. Look at it. Right up front he is making it clear what he is concentrating on. He is giving you two problems. Hemchandra numbers by the way is what we popularly call Fibonacci series. It is not known. I think most of you do not know that Hemchandra who precedes Fibonacci had evolved these numbers in a different context. And this Aviram Ranade said he himself did not know. But a teacher who teaches at Princeton actually came and gave a talk here. And during that talk he gave that example. So it was on the musical beats, some matras and so on. And to explain that he actually had brought tabla with him. So he played tabla during the lecture and showed what he meant by these matra calculations and how they relate to actually Hemchandra numbers, who had discovered and described them. You see is about the point that making that talk interesting. And then Newton-Raphson methods. And then of course you define functions. So you see C, C++ programming becomes implicit as a part of the larger problem solving. And that is the style that we would like to follow at least so far as giving teachers. So what we do is to make sure that everybody finds something useful. Remember we cannot move away from that concept. We will have a lot of examples and problems and solutions which we will not necessarily discuss during the lectures or tutorials. But we will give them and we will tell them this is a self-study in the nights. When the teachers go back from your center home, they will have their dinner but they are not allowed to sleep for couple of hours. They are required to examine these problems and their solutions and come prepared next day. So lot of gola giri. Here is the series explanation. We will evaluate the series for some 10 terms. Ith term is xs to i divided by i factorial. How can we calculate it quickly? The direct method write a loop to calculate xs to i and also i factorial then divide. So this will require loops within loops. Better idea. Ith term is this. Therefore it is i minus 100 term into x by i. Now this is a simple derivation which many people will know but it is good to explicitly state that. So we calculate i term from the i minus 100 term calculated earlier rather than directly. It is a better idea. And this is the program. So he gives a program, float x whatever float term initiates the term to 1. Answer initially set to 0 and then he assembles that answer is plus equal to term etc. Is it good that we give what we say is a handout to the students regarding all the practicals that we are going to do for the whole semester. Like even including the algos. Not necessarily. You can give the list of practicals. Yes. Because there has to be something that should come fresh to them. Okay. Let us say questions. You know we talk of open source. We also talk of secrecy of question papers. Question papers must remain secret till the point an examination is conducted. They must become open source immediately after exam is conducted including the answers. So some of the problems which you wish to state you should prepare them but you obviously should not put them on them. As it is our compendium will have thousands of 1000 problems. So setting of papers is going to become difficult for all of us real. Some people may still use solved problems in their examination. No problem. Okay. People hopefully will evolve later. But as far as lab is concerned the detailed labs they should be ready with you before the session. I am talking about below every student who does not know where to start from. If in case my algo is help would keep you away from getting frustrated like I do not know where to start from. So will it be helpful? Do that starting point in the at the beginning of the lab in actual lab not at ahead of thing. You must put the following comment to your program. After i-th iteration i terms of the series have been summed up. Notice we mentioned about commenting. Yes. Check that this is true by inspection and add a statement to print after each iteration and then check. So it is showing methods of confirming that things are working. Here is another program. Okay. He is putting remarks there. If we calculate this independently we will need about 2 i arithmetic operations in each iteration. In our program we just need 2 in each iteration. Idea of reusing what was calculated in the previous iteration is very important and also very commonly useful. At the same time in a nutshell he is throwing 2 important concepts. A complexity analysis. So he is showing that this would be an order n algorithm whereas this would be an algorithm with constant number. Okay. Or order n square and order n whatever. He is not using that terminology but he is giving that concept of efficient algorithm. And he is also telling you that the basis of this is reuse of whatever you have done previously. These are Hemchandra's problems. This problem was 12th century AD by you. So suppose I have to build a wall of length 8 feet. I have bricks 2 feet long and also 1 foot long. In how many ways I can lay the bricks so that I fill the 8 feet. So these are the various possibilities that he writes. And then suppose I am designing a poetic meter with 8 beats. The meter is made of short syllables and long syllables. Short syllable is 1 beat long syllables is 2 beats. How many ways are there of filling 8 beats? So he is an example of poetic meter. This is a Marathi song actually which he has given as an example but he is showing the beats. You know long and short beats. And Hemchandra's solution he says in his writing. Hemchandra is writing in 15th century. He says by the method of Pingala. Pingala was a saint who came much earlier. He says by method of Pingala it is enough to observe that the last beat is long or short. You can figure out. Pingala is a mathematician poet from 500 AD. Hemchandra who is giving credit to someone who lived 1500 years before him. Interesting historical information and stressing the fact. Copy but give credit. There is nothing to be seen but you see how naturally this is coming. Just one sentence. Good enough to make some impression in the minds of people. This is the Hemchandra's solution. So S is the class of 8 bit patterns with short last beat. Class of 8 bit patterns with long last beat etc. He goes through all this and then he defines various patterns. Algebraically then he represents h n is the number of patterns with n bits. So h n is h 7 plus h 6. In general h n is h n minus 1 plus h n minus 2. Does this help us compute h n? We need to know h 7, h 6 for which we need h 5 and so on. So he is actually bringing out the Pingala's original method explained by Hemchandra and later explained by Fibonacci. He is the algorithmic idea. So h 1 is the number of patterns with 1 bit is 1. h 2 is number of patterns with 2 bits is 2. So h 3 is this, h 4 is this, h 5 is this. And then he says program to compute h n. So h previous is 1, h current is 2 and then he says h next is h previous plus h current. Set h current to h previous, set h next to h current. This is the preparation for next iteration and carry on. Code is tricky. So need a comment. Now there could be different style. I would first write the comments, but I find this very interesting because he is emphasizing the need for comment after giving an example which is bad actually from a comment's point of. So this is also useful. At the beginning of an iteration h current is h i minus 1, h previous h i minus 2 where i is the value of the variable i. Can you prove this? Will mathematical induction help? Proving this is enough. h next is this plus this. Hence correct answer will be generated. Proof by induction. So he gives proof by induction. Notice that through majority of these slides he is not talking about C.S. Vanoma. But also notice that he is implanting the most important concepts on programming through this example. And ultimately what is evolving is actually the algorithm and its explanation. The series is very interesting. This represents number of petals in many flowers. You see petals if you see flowers particularly jandu if you see or any flowers which are layers. You can see inner layer, outer layer, outer layer etc. They follow the Fibonacci itself. I mean there are many examples on the net we can pick up. Ratio of consecutive terms tends to eliminate the golden ratio. What are these numbers more commonly known as? Known as Fibonacci numbers. And then to rub the salt on the wound he says him chandra lived much before Fibonacci. And mathematics from poetry. So he is connecting mathematics to poetry and ultimately showing that maths is the basis of many of our algorithms in it. I found this particularly meaningful. In fact I have asked him would he be willing to release all of this in open source. He said he has no problem but he is not sure whether everything is correctly stated etc. So if he joins our group because he has just taught this course last time it will probably be a very useful thing. Anyway so method to find root of fx is Newton Raphson thing. So that is find x such that fx is equal to 0. Method works if fx and f dash x can be easily calculated and a good initial guess is available. These are the two important requirements for Newton Raphson. So find the square root of k. Use fx is equal to x square minus k f dash x is 2x. fx and f dash x can be calculated easily. Two or three arithmetic operations are required. Initial guess you can take an arbitrary guess. So you take x0 equal to 1. This will always work and you can prove it by putting x equal to 1. You get some answer which is either positive or negative. It may not exactly be 0 depends on k but you can go ahead with it. How to get better xi plus 1 given xi? So how do you get the next one? Now here he shows by an example. So this graphics he drew by the way all of this. So he says he draws this. This is your x, this is fx, this is the curve for fx and he says initial guess is this whatever x. Now he says point a which is xi comma 0 is known. Therefore this is point a which is say xi. Calculate f of xi. So point b which is xi comma fxi becomes known. So that is b. He draws that immediately. Then he says effectively what we do is draw a tangent. So approximate f by tangent c which is intercept on x axis. So draw a tangent here and wherever it intercepts here that be the next point. Because you are going closer to 0 basically. So approximate f by tangent c is the intercept on x axis. So the next point c is xi plus 1 comma 0. So he actually draws that graph and he shows this is my point c and these are the coordinates. Would you not agree that this will clarify things to students much better than just algebraically stating that concern. But this requires extra work. Now imagine if this work is done by all of us like if he agrees to give this in open source. Any teacher anywhere can just take this slide and use this slide itself in giving the example. Even if there are no slides I have to go by chalk and blackboard. I have a very beautiful way of explaining it. I can use it there. The fact of life is many of us teachers may not be aware of how beautifully to show some concern. That is the power of collaboration. I was not aware of this way of explain. I have taught Newton-Raphson method many times in my life. But I feel this is better and each one of us can make it still better. So animation Saana talked about there is a colleague of mine. I do not know whether I gave you this site Oscar did I mention. I think you should look at that site. Project Oscar which Professor Sridhar Iyer is a colleague of mine in the department of CSE. He started this collaborative. This is basically open source collection of animation or something like that. So there are lot of educational animations. Now coming back to our slide here. You just go to Oscar you search. You do a Google search of Sridhar Iyer or just go to Sridhar Iyer's homepage in the department of CSE. You will get to know the Oscar site. I do not remember the exact Oscar site thing. We will try and search that. But that contains lot of animations which have been developed by final year projects of various groups in the country through our Eklavya project. So they keep compiling, they keep adding and they provide some animation tool kits and so on. There is a huge effort that is going on. There is no reason why our students cannot take some of these projects and add to the repository of animation. Meaningful to individual courses. So coming back to this Newton-Raphson. You can see that instead of just showing this in step by step. If additionally I show these and later on I additionally show how this process converges by showing subsequent points one after another. Drawing it is not going to be easy. But I can animate it and if I can control the speed of animation people will get a better understanding. Particularly if I have discussed this part earlier. So he writes down the formula for f dash xi which is AB upon AC which is f of xi divided by xi minus xi plus 1. And that becomes the next point xi plus 1. So this is nothing but xi minus f of xi divided by f dash of x. Simple principle which is well known. What I like about this is he is trying to do what Sana said of combining different ways of the same representation. He has a graphical representation here. He has a conceptual explanation and he has a algebraic representation here as well. So combining all of these in a logical sequence I thought it was a very useful thing. See these nice things you will not notice unless you analyze how from a teacher's perspective. There is a lot of thought which has gone into such preparation. So square root of A k you find it like this. Starting with x naught equal to 1 we compute x1 etcetera and then of course he goes into the core. So initial guess known to work then 10 iterations and out of 10 iterations whatever you get here. Another way initial guess known to work do this until error in the square is at most 0.000. So this is another way of doing things yet another way. Then he introduces a wild statement. So wild condition loop body check condition then execute loop body if true repeat. If loop body is a single statement then need not use brasses. Always putting brasses is recommended because if you insert a statement you may forget to put them later. So do it at the beginning. Simple concept of good programming practice is introduced in the context of a problem not as an independent rule number 13 B or 15 N. Because people find it easier to remember rules if they are explained through examples. Then he has a comparison slide on fall versus why when to use what. If there is a control variable with initial values update rule and whose value distinctly defines each loop iteration use fall. If loop executes fixed number of times use fall. Personal test could be another reason break and continue. So read from your book. So you see he is giving pointers the most important pointer is here. If this is so you must use fall. You can simulate fall using a while also but that is meaningless when you are. So you are now distinguishing between two different approaches of setting up iteration and stating that both are equivalent. However in one case this may be better in another case this may be better. Then he has some other explanation about procedures with written values procedure for square root additional notes. You will always find that there is a slide with notes which sort of summarizes. So you would have explained these things in the course of description of the earlier steps. But he sort of repeats just to strengthen what is there in execution mechanism. Further notes math library. So include C math. Now you see this stage has been set as to why do I need C math. I need C math because somebody has done the Bholagiri and done all this work for me. So I will reuse that rather than doing math. That is the purpose. It is not a syntactical rule that I must say include STD in or include this or include this just like that. What is the purpose behind those inclusions is also state and then there is homework. So this is this is the style. I just thought I will go through this just to explain. Do you agree that this style would be a useful style for our lectures provided we back it up. With adequate simpler examples, graded examples, quizzes etc etc which people can use. Let us go to Moodle. So I have gone to the Moodle for one particular batch there. News forum assignment 8, assignment 9. There was something on the mid-same. I do not see the mid-same here. Here it is. Mid-term with solutions. So here is the mid-term paper with solutions. The solutions have obviously been put up after the mid-term was over. So this is a closed book. No clarifications exam. No clarifications means no clarifications. So here is a problem. A number is said to be perfect if it is the sum of its all possible factors except itself. For example this, write a function that determines whether a given number is perfect. This is the answer. So this is the question which came. This is the answer. Now this also tells not only TAs but also to students how these have been marked. Syntactically correct function definition, 5 marks, return value is correct or correct message is printed, 3 marks etc. Key point, when you are asked to write a function, usually you are expected to return the result, not print it. This time we gave marks for printing the result also, but from now on we expect a proper value to be returned. If a value is returned, the function can be used by other functions. Printing gets done only rarely. A very important concept, a paragraph is spent on this. But people are permitted to make mistakes first and then they are told that now onwards you will not do this. This emphasizes the concept far more than either stating it bluntly here or there because they should understand. The first impulse of a student is to print the result in any program that they write. Simple examples like that. Like that there are, what I will do is, I will get at least permission to get the midsem.pdf out of their model and no, this is on the web page. So you can access this directly. We generally do not have time to do this kind of analysis for our exams, but we will agree that it will be worthwhile because this itself becomes a learning point. See if I have 60 students, I may explain these answers there, but if they are available and recorded and available and accessible to people, many people individually will go back and examine this and they will raise questions. This is also useful administratively, particularly when TAs correct papers or even if I correct papers, I will make a mistake in the correction. Now ordinarily when I get back the answer book, I will assume that I have made a mistake. But if I know this is the parameter and if I have made a mistake as a teacher, that student will come back to me saying, sir you said this on the notice, but this is what you have given me. Okay, I will correct. So these are advantages like openness and transparency. So like that all problems, this is a problem in graphics. This figure does not relate to problem three. I think they have done some space saving. Problem three is completely independent, but this figure is for the next question. Here is the question. A sequence of three drawings is given above. In these three drawings there are squares of three sizes and these are side lengths of one, three and nine. Draw what you think is the next cactus drawing in this sequence. If there is a lot of repetition, you can just draw parts. Write a function that makes these drawings before giving the code state the precondition and state the post condition. So this is the question. So here is a cactus. This is the first one, then next one, then next one. So these sizes are one, three and five. What he is saying is each square repeats three times and a larger square is drawn here. This whole pattern repeats three times and a larger square gets drawn. So the next pattern is also indicated. Obviously doing this recursively will perhaps be meaningful, but let people do whatever they want to do. What he wants people to find out is what is the precondition and post condition at any drawing. So here is the answer. Then three smaller square attached to each smaller square in the third drawing after the entire drawing scaled up by a factor of three. So give five marks even if nothing said about the size of squares. No text is really expected. Pictures will suffice. So if people draw a picture, they are solving a problem. Remember that they are not doing programming. They are solving a problem first and then writing program. In fact, this is going to be our theme and I hope you agree with me that the theme is about problem solving and programming the most important part automatically comes in solving the problem. So here is of course a solution, then preconditions. Like that for every problem you will notice that there is enough write up on what is important, what is less important, et cetera, et cetera about the problem. I would like you to look at the course page which is if you have noted it is www.csc.iitb.sc.in slash tilde cs101. That is an open page you can also look at it. So we will stop now.