In this lecture, we are primarily going to discuss multidimensional arrays. How do you do array manipulations? When an array is defined to have multiple dimensions. Matrices in fact are two dimensional arrays. So, it is specifically discussed matrices and their manipulation because in all your subsequent science and engineering curricula, large amount of numerical computation that you would do would involve matrices. We will specifically look at matrix multiplication today. At the end, we will discuss another interesting notion of random number generator. This is a precursor to a simulation problem that we shall be attempting to solve in the subsequent lectures. So far, we have seen one dimensional arrays of integers. You will recall we had roll 100, marks 100 and so on. Instead of defining an array as an integer, I could define it as a float or double in which case each element can hold a float value or a double value etcetera. I can also define two dimensional arrays by merely adding one more dimension after the first square brackets. For example, int a 10 10. Now, this represents a two dimensional array which has 10 rows and 10 columns. So, 10 rows and 10 columns you will agree that resembles a matrix which is a 10 by 10 of course, when we say int each element must be an integer. It is not possible for an array to hold one integer value in one element, a floating point value in another element etcetera. All elements must be exactly of the identical type which is what is declared. An element in the array is referenced by simply writing the name of the array followed by an index for the first dimension and an index for the second dimension. So, a 4 3 as is written here will represent which roll number and column number in our conventional sense, third row and second column or fifth row and fourth column. Please remember that the array indices move from 0 to max value, 0 to max minus 1 value. So, if there are 100 elements, the last element is 99 and the first element is 0. Consequently, a reference to an index of 4 will actually mean the fifth row in a natural number calculation, first, second, third, fourth, fifth and this would mean fourth column.  It has a number of pixels in rows and columns and you get a feeling of continuous picture because all the columns simultaneously exhibit a property of a color and intensity. So, each pixel essentially holds a value which is color or intensity value. If instead of a two-dimensional picture, if I had a mechanism to project a 3D picture or 3D image, then an element of that three-dimensional image would be called a voxel and it would be determined by three different values each representing one of the dimensions. Take for example, marks of students in different evaluations. In this course itself, we have quizzes, assignments, mid-same, and same. We have seen how roll numbers of the students could be stored in a single-dimensional integer array. But I could, for example, declare a two-dimensional array. Suppose we have roll number and marks for quizzes, assignments, mid-same and n-same. So, here is a representation that I have shown here, where on the left hand side, the roll numbers are 1501, 1502, etcetera as you already seen. So, that is let us say one array that I define as a single-dimensional array. But the subsequent marks which are written against each roll number, remember we saw this as a record for a particular student. Now, all those marks together could be stored in an array called all marks. It would have 100 rows corresponding to maximum 100 students, let us say, and it will have as many columns as we have the different evaluations. Here, I have shown four columns, quiz, assignment, mid-same and n-same. So, I could define an array called int roll 100 and another array float all marks 104. This would mean the second array is a two-dimensional array which has 100 rows and four columns. Each of the columns can hold a floating point value, but it is our interpretation that the first column shall contain the quiz marks, the second column shall contain the assignment marks, etcetera. Obviously, at the end of the course, one would like to total up all the marks obtained by every student. I could then define another array to hold those. However, it is important before that to consider how will you access different elements of this array. I have shown two elements. The first element is the fifth element of the array which is referenced as roll four. It is vital for you to remember that c plus plus starts counting the elements of array from zero and not from one. It is a very tragic thing to occur in fact because in all our computations for arrays and their indices, we always start with natural numbers 1, 2, 3, 4, 5. When Carnegie and Ritchie defined the c programming language in early seventies, they somehow started counting from zero. Now, that is alright in most circumstances, but when it comes to array indices, we have to be extremely careful because in a mathematical notation, whenever we write a i j, we automatically mean i th row and j th column. However, a i j in c plus plus would mean i plus one th row and j plus one th column. As long as we remember that and provide for it in our computation of indices, we shall be okay. So similarly, you take the larger array, all marks 100 by 4. The fifth row second column element is all marks 4, 1. Here, I have tried to show another array, one dimensional array called total marks 100. Total marks 100 resumably is supposed to store all some of all marks scored by every student. So, there are as many rows or as many elements in this as many students are there. You will notice that I have shown fifth element of total marks 100, which is referred to as total marks 4 because the index will be 4 for the fifth element. And we would like to ensure that that element contains a value, which is the sum total of all the marks in the fifth row of the all marks. Is this clear? How will you store value? How will you represent values inside at the index computation column? Of course, there is one inadequacy. Here, the marks which are shown here resumably represented in our course do not contain marks for an important component of evaluation, which is that the project. We have quizzes, assignments, mid-same, and same, but we do not have projects. If you want to include projects, you will need to add one more column. Consequently, an array appropriate for storing marks for this course students would have to have five columns and not four columns. So, here is what I have defined, row 100, end students, i, j as integer, and all marks 100 by 5 and total marks 100 as float. You are already familiar with this simple level of array manipulation, where I first read in the number of students and then for i equal to 0 to i equal to end students minus 1. That is why the condition i less than end students in increment of 1 indicated by i plus plus. For each student I have to read the five marks associated with that student. So, I start another iteration for j equal to 0 to j less than 5 j plus plus. What does iteration within iteration mean? The execution will start with i equal to 0 in the outer loop. You will come to the for statement that for loop will be executed for j equal to 0 1 2 3 4, which means that the statement C in all marks i j will be executed for all marks i 0, all marks i 1, all marks i 2, all marks i 3 and all marks i 4. Then the inner loop will end. You will go back and i will be incremented by 1 and then you will read the next student marks, the next student marks etcetera. So, whenever you have a two dimensional array, you can actually access all elements of a particular row by setting up an outer iteration which goes over the row numbers and inside that iteration for each value of i which represents a particular row number, you can have another iteration which goes over all the columns of that row. This is a standard practice in handling two dimensional arrays. So, how do you access array elements? For example, we want to solve the problem of finding and printing total marks for each student. We have read all the marks. So, we set up that iteration again for i equal to 0 i less than n students i plus plus. For each student, I start with a total of 0 marks. Just like you initialized sum to 0 before adding to that sum incrementally over any iteration. So, I start with sum equal to 0 which is total marks i equal to 0 for i th student. Then in that total marks i, I add all marks for that student for which I set up an iteration over columns varying j from 0 to less than 5. So, 0, 1, 2, 3, 4 and I say total marks i is equal to total marks i plus all marks i j. Remember the marks are now represented by an element of a two dimensional array. So, I will have to refer to that particular element as all marks i j. The value of the j comes from the inner loop, but the value of the i is static for all execution of the inner loop which is the outer loop value. So, you will agree that at the end of inner loop, I would have compiled the total marks for i th student. So, at the end of it, before going back for the next iteration of i which means before going back to look at the next student, I will print the value of total marks for that student and that is why you have the C out statement which prints the i th roll number and the total marks i. You will agree that beyond this point, there is nothing going to be added to total marks i because i is now going to change once and for all. This is a standard method of setting up a nested iteration to access all elements of a two dimensional array. In this particular case, we have access them first in the row order and for a given row, going over all the columns. So, it is the row column order. I could have easily done the other way round. I could have done column row order also if I wanted. However, that will not make much sense here particularly in terms of printing the marks of the total marks of the i th student. If I do the j th column first and the i th row later, we now turn our attention to matrix. Matrices are two dimensional array. We call arrays as compatible arrays if they are the second dimension of the first array or first matrix and the first dimension of the second matrix are same. You all agree that such matrices can be multiplied with each other. So, consequently if I have a array m by n which is a matrix A and another matrix B which is n by P, then A B which is matrix multiplication of A and B which will be the resultant matrix C will be m by P matrix. All of you agree with this? This simple stuff all of you know matrices. More specifically if C is A by B, then every element of C is defined by the summation as indicated in the formula. You all agree with this then? C i j will be equal to sigma of A i k multiplied by B k j. So, for a given value of i and j, you go over all values of k which values k will take in terms of matrix the middle dimension is n. So, k will vary from 1 to n. So, when I sum up all the matrix elements all the all the multiplication elements going over the middle dimension from 1 to that maximum value which in this case is n. I would have found out the i comma j th element of the resultant matrix. How do I implement it in a C plus plus program? Simple, I can use exactly the same formulation, but I have to remember that whenever matrix A for example is m by n, then the number of rows and columns in that matrix will be indexed by 0 to m minus 1 and 0 to m minus 1. Consequently, when I say sum over all k in conventional mathematical formulation k will vary from 1 to n which is the common dimension, but inside C plus plus I must vary k from 0 to n minus 1. Simple stuff once you understand it, it is slightly difficult to remember because that is not how we naturally index matrices, but this is how C plus plus does and we are stuck with that convention. So, the matrix multiplication program could be written by first reading all the matrices. Next, we compute C as per the formula that we just now saw namely every element of C i comma j th element of C is actually summation over k of a i k multiplied by b k j. We already know how to set up iterations, we know how to set up iteration within iteration. So, we can easily set up a nested iteration where the outer iteration let us say varies i, inner iteration varies j and inside the inner loop I could add up the, I could now have another summation of iteration, which varies k. So, I will have three nested loops, you have to watch out for indices and the input output that you do because the matrix input output in this particular case when you calculate C i j this will be calculated for a specific value of i and a specific value of j, but calculation of C i j itself will require an additional iteration. So, we will have to correctly remember where to put our output statement and so on. C i j in our program will be output as soon as we compute it, we could hold till end and have a separate double iteration to print values of C i j that is a matter of choice. So, here is the matrix multiplication algorithm, I have not written this in the conventional program include i o stream etcetera etcetera. I hope by now you all know that that is the standard stuff. So, hence forth I will try and keep showing you only the relevant portion of the algorithm. It is to be assumed that this does not make the complete program, you will have to write the appropriate paraphernalia and in fact return 0 close etcetera etcetera. Sometimes if space permits I will do that, but otherwise this shall be the model that we will use. So, when I come to this point I presume that arrays a and b have been defined and have been read in, they have already been you have done the input function. So, you got a you got b inside the computers memory. Now, I set up an iteration for i, i varies from 0 to less than m in steps of 1, inside that I set up another iteration for j, where j varies from 0 up to p minus 1 in steps of 1. Consequently, when I come inside the inner loop I have some fixed value for i and some fixed value for j and I am guaranteed that any time I come here I will come here with different value of i and different value of j and all values of i and j will be covered. So, I know that at this point if I set up another iteration to compute the corresponding multiplication value for i comma j th element of c I am safe. Look at how that summation is done the sigma over k as we talked of here I start with setting up c i j to 0 and then now I run a third iteration varies k from 0 to n minus 1 recall that n is the middle dimension. So, this in fact represents sigma k over 0 to n minus 1 in steps of 1 and what am I doing inside that iteration for every value of k I pick up a i k and multiplied by b k j and whatever is the total multiplication that I get I added to the existing value of c i j which is the element I am computing. So, notice that c i j that element the final element of the product matrix will start with value 0 which is set just outside the iteration for k and within this iteration I will go over all the values of k such that I will do that sigma correctly when I come out of the inner iteration I would have computed c i j you agree with that I would have correctly computed c i j I can therefore output that c i j element which is what is done by the word c out c i j when I come over the next brass effectively what iteration I have finished when I come out here see when I come out of here I have finished the iteration for k when I come out here I would have finished what iteration iteration for j that means all columns I would have covered consequently this c out statement would actually print the i th row first element second element third element etcetera etcetera for all the p elements 0 to p minus 1 and then I am just putting a new line here. So, that the second row of the c matrix start from the next line and so on. So, is this clear how you can do matrix multiplication what is important here is to remember that you keep in mind the multiple iterations that you execute and you keep in mind the correct index reference and index computation knowing that indices vary from 0 to something minus 1 where something is the size of that dimension. In this context we consider magic squares all of your familiar with magic squares those of you have not heard of them a magic square is an n by n square matrix where the sum of elements of every row and every column is same. Does magic square exist for n equal to 2 anybody is there a 2 by 2 matrix where you can put in integer numbers such that the sum of rows sum of columns you cannot have it right, but for 3 you can have it for 4 5 6 etcetera you can have it. Here is an example of a 3 by 3 matrix 8 1 6 3 5 7 4 9 2 you add numbers in any row or any column you get the value 15 and you get the value additionally if you add the numbers in any one of the main diagonals that will also add to 15 4 plus 5 plus 6 8 plus 5 plus 2. This is an interesting mathematical entity there has been known for very many centuries to mankind the first reference appears in a Chinese reference where these were called low shoe square they were actually attempting to solve a different complex problem and they figured out that the solution depended on the layout of certain things according to such magic numbers. A 3 by 3 magic square is also was also known to Indians because during Vedic rituals references are seen more recently in the 10th century AD there is a magic square 4 by 4 magic square in a gen temple at Khajurao. The Europeans learnt about magic squares through Arabs who actually supposedly picked up this from the east and spread mathematics everywhere does not matter what the source is magic squares are interesting. There are algorithms to create magic squares of any given n a fairly complex mathematical structure has evolved around magic squares those of you are interested can go and look up Wikipedia there is huge amount of useful information on magic squares. Why are we bringing it here? Here we will try to solve a simple problem if somebody gives you a square matrix n by n square matrix you have to determine whether the contents in that square matrix add up to a fixed value or not. So essentially what we are going to do is we are going to look at the concept of matrix manipulation accessing various elements and find out how to calculate some of rows columns and diagonals and if all of those sums turn out to be same a fixed value which incidentally is known for any n through a formula we shall see that shortly. So if the sum amounts to the same value then we know it is a magic square. So determine if a matrix is a magic square I define a matrix as square 2020 n is the n by n matrix for which I will read the value of n from outside i j and sum i j are indices which I will use to go over the rows and columns of the matrix sum is just a value which should be the value of all rows and all columns sum. Additionally I define things like r sum c sum d 1 sum d 2 sum can you guess what these would represent r sum will be sum of a row c sum will be sum of column d 1 sum is diagonal 1 and d 2 is diagonal 2 we can take any one of the diagonal as 1 and treat this back. I set sum equal to n into n square plus 1 by 2 incidentally that is the formula for the constant sum of either row or column or diagonals of any n by n magic square. So I need to ensure that every sum that I compute should be equal to this sum here is how I calculate all the sums for i equal to 0 to n minus 1 and for each value of i for j equal to 0 to n minus 1 I do the following r sum is r sum plus square i j c sum is equal to c sum plus square j i. So what am I doing here I am calculating the sum of i a throw by adding all j elements and putting them together in r sum. What am I doing here yes what does c sum mean any idea well c sum supposedly denotes column sum but what is c sum doing inside the inner iteration. So what will be the value of c sum at the end of this particular iteration first iteration let us say i is equal to 0 what will be the value of various what will be the value accumulated in c sum first column will be added. At the end when I go out of this I am calculating d 1 sum plus equal to square i i d 2 sum plus equal to what is the question mark that I have put what will this do d 1 sum plus equal to this will take the main diagonal. Please note that the sum so calculated have to be checked against this sum I am not included those if statements here if anyone of the sums that I so calculate does not tally with sum then I will have a problem actually this algorithm has major problems I am surprised that you are not indicating that problem will it be alright to calculate c sum like this is there a single r sum and single c sum how many rows and columns does a magic square have n if it is n by n magic square it has n rows and n columns note that the sum of all elements of every row and of every column must be equal to the original sum consequently I must accumulate the sums for each row and sums for each column will my declaration r sum and c sum be adequate there because it represents only one value if I go through all these iterations r sum and c sum will have only one value r sum I am initializing before the j loop starts am I am not so if I complete all the iterations what will happen at the end I will get the sum total of all elements in both r sum and c sum which will be meaningless what is the correct solution ok he is saying that you initialize r sum and c sum within the I loop and check for them it will work for r sum because I is going over rows so for every row I can initialize r sum sum over all the j elements for that row and then compare that but I will have I cannot initialize c sum that is column sum at the end of I unless I compute things differently c sum plus square j I will calculate c sum correctly for which column because inner loop is varying j for a given value of I so for first row second column first row third column first row fourth column what does it do is second column 0th row second column first row 0th column second row so c sum will calculate correctly the sums for which column I th column so r sum and c sum as written here would correctly reflect the sum of I th row and j th column I th row and j th column when I come out of this iteration for just j consequently the solution which is correct is to set r sum equal to 0 and j sum equal to 0 just before the for loop those of you are not able to figure this out should actually have to work out in this specific example I am just going to discuss how do you calculate the diagonals sum so you will agree that I am adding something to d 1 sum is the first diagonal at the end of j loop because the diagonal really does not require two indices varying independent one diagonal is 0 comma 0 1 comma 1 2 comma 2 3 comma 3 4 comma 4 so whenever I have an iteration for I I can calculate the sum of that particular diagonal by just adding up I comma I th element of the I th this is what is being done in d 1 sum please note that instead of saying d 1 sum equal to d 1 sum plus square I I I I am using d 1 sum plus equal to square I which is the increment operator the question mark is what should be d 2 sum plus equal so forget the adding up of rows and columns let us just concentrate on diagonals you agree that d 1 sum will correctly calculate the sum of all elements of the diagonal represented by 0 0 1 1 2 2 3 3 n n n minus 1 n minus 1 right so what should be d 2 sum b what should accumulate here how are terms of a row added r sum is r sum plus square I j so for I equal to 1 j equal to 0 1 and 2 for a 3 by 3 example the I j this is 1 comma j because I is equal to 1 and j will vary over 0 1 and 2 so the square 1 0 which is 3 square 1 1 which is 5 and square 1 3 which is 7 will all be added here to get you 50 this is how you calculate the sum of a row so notice this is the outer iteration which fixes a value for I which is 1 in this case and this is the inner iteration which varies j from 0 to 2 for n equal to 3 and ultimately I will get the sum 50 similarly you can work out how the column sum is calculated in exactly similar fashion but it is important to remember what our friend said that r sum and c sum must be initialized just before the j loop to get to the correct value and they must be compared with the correct sum before you go over and go to the next row or next column however we come back to d 2 sum once again d 1 sum is calculated as square I comma I if that is so from the previous slide then how are diagonal terms sum here is that statement which he said d 1 sum plus is equal to square I I this will add what square 0 0 which is 8 square 1 1 which is 5 and square 3 3 which is 2 here is the quiz so while summing the main diagonal elements square I I sum of the other diagonal d 2 sum can be incremented by the term which I start with d 2 sum also equal to 0 initially square n minus I plus 1 I square n minus I square I n minus I minus 1 and none of these this must be done inside the earlier loop for j so let's see how many people think a is the right answer 1 2 3 4 5 6 7 how many people think b is the right answer a few people there how many people think c is the right answer very large number how many people think d is the right answer oh they are one or two people who think d is the right answer here is the analysis of the answers that you have figured out actually I will try what my colleague Dr. Sahana Murthy once mentioned I do not mind spending two minutes just on this experiment those of you who gave different answers if you are sitting next to each other use two minutes to convince your neighbor how your answer is correct so just talk to your neighbor and find out whether your answer in the neighbors answer was same if it was same keep quiet if not discuss argue and convince your neighbor that your answer was right of course there is a danger if both you and your neighbor had the same answer and that answer was wrong then you are nothing to convince so please argue with your neighbor in any case even if both of you have given the same answer try to find out what was the reason for giving that answer from your neighbor and convince yourself that that argument was right now not enough discussion taking place or you have no neighbors we are not discussing with anybody come on come on come on convince him of your answer even though it is same why is it same why is it why is it correct why do you think it is correct oh this is not a joke by the way it is a very serious business we are going to have such quizzes after the mid-sem remember that time you will not be raising your hands but you will be pressing a button on a clicker device so your neighbor won't even know what answer you gave and occasionally I will ask you to do this convince each other and then again answer the quiz and I will keep the second answer as your legitimate answer for marking so there is an advantage in discussing yeah no discuss with your neighbor so raise hand for both the cases when I ask okay so at least some discussion has happened if not much so now let's go over the quiz again when I sum the main diagonal element square ii the d2 sum what should I add to it square n minus i plus 1 i so how many people think the answer is a please raise your hands two people how many people think answer is b please raise your hands one person how can there be one person because everybody is supposed to talk to a neighbor so either you convince the neighbor or neighbor convinces you there cannot be only one one person giving anyone of the answer it has to be no pairs so this time is okay but next time you keep arguing till either you get convinced or you convince the other don't fight political battles but mathematical battles how many people think the answer is c and how many people think the answer is d nobody there are some people who genuinely believe that there are two correct answers to this place let's analyze exactly what happens by looking at how exactly what exactly do these values mean so here is an analysis of the quiz problem for n equal to 4 so I have taken n equal to 4 ii when I am putting up the main diagonal sum ii will take value 00112233 that is very clear I will get the sum of all elements across the main diagonal if my answer is a then for n equal to 4 n minus i plus 1 when i is 0 will be 4 minus 0 plus 1 and i is 0 so the first element added will be 5 comma 0 is that correct no that's not correct 5 comma 0 4 comma 1 3 comma 2 2 comma 3 will be the answers that I will get will that be the right answer no in fact I am not even referencing a valid element of the array by putting that index let us look at the next one n minus i i for n equal to 4 and i equal to 0 the first element picked up by the summation will be 4 comma 0 the next one 3 comma 1 next one 2 comma 2 last one 1 comma 3 is that correct is there any element called 4 comma 0 in a 4 by 4 matrix in c plus plus no elements are start with 0 1 2 3 0 1 2 the reason this is wrong is that the first element reference is not a valid element and that is why this choice is also incorrect the next one says square i n minus i minus 1 this when you put i equal to 0 1 2 3 you will get the indices as 0 3 1 2 2 1 3 0 isn't that correctly the second diagonal that's the reason why that is the correct answer the last answer says that none of these this must be done inside the earlier for j this is meaningless because i is varying j is also varying so if you put a diagonal summation inside you will get some extremely funny results there we call it meaningless by the way whenever you write any algorithm involving matrix multiplication you should be doing this kind of exercise just to confirm looking at the extreme value whether your indices are moving correctly or they are not moving correctly before we go further to look at so is this clear how you handle matrices and matrix indexes particularly so the right expression is d 2 sum is equal to d 2 sum plus square i n minus i minus 1 this is what we had written in the quiz however notice that I can use another symmetric expression so I can say d 2 sum is equal to d 2 sum plus square of n minus i minus 1 and i this will calculate the sum of the same diagonal elements but going the other way round is that clear so either of these 2 will work for n equal to 4 this symmetric equivalent will add terms in a different sequence with index values 3 0 2 1 1 2 0 3 and this will still get you the correct sum of that diagram the reason for going so elaborately over the seemingly simple problem is to ensure that we understand the intricacies of index value computation and index value variation in c plus plus all of this came from the unfortunate fact that the first row is called 0th row first column is called 0th column and nth row is called n minus 1th row in c plus this is tragic but we have to live with it large programs have been successfully written to do matrix computations involving these kind of indexing whether it is c plus plus or java this is the standard way of doing it and it is better that you your mind gets accustomed to this almost natural as I said before going further to the random numbers I would like to just draw your attention to the fact that matrices are extremely important later on in your subsequent courses in engineering and science when you do numerical analysis in the numerical analysis you will find matrices to be extremely useful it is not merely for conventional matrix manipulation there are complex computations done in engineering calculations for example solving partial differential equations a system of partial differential equations it is not always easy to find an analytical solution many of such systems are solved through complex numerical analysis method one of the methods for example is finite element method where for the structure on which you have these elements you actually consider that a plane is consisting of large number of finite elements and just like you did the summation of areas under the curve you do something for solving those partial differential equations I am over simplifying it but suffice it to say that very major design issues in the modern engineering are solved through such complex computations done in finite element methodology where you solve systems of partial differential equations so you do structural analysis using this people who are going to do civil engineering mechanical engineering aerospace engineering even chemical engineering structural analysis heavily depends upon these kind of computations here is an example that I want to show you when you design a car and build a car you have to ensure that if the car crashes against something either another car or a wall or a tree then it will not hurt the passengers inside so consequently the cars are actually crashed after manufacturing to test how do they break obviously they will break differently every time you actually crash them but initially itself you would like to confirm that they will break in a certain pattern the car crash pattern is often analyzed using finite element techniques where you use these matrices heavily here is a picture of the model of a car crash so it is a 3D model this is not the picture of a normal car what you see here are shown as elements as they will behave when the car crashes using this kind of methodology you can simulate car crashes you can simulate car crashes without actually crashing the car of course you do not know exactly but you know to quite a good extent how the car will behave when you crash there is a case of an Indian car manufacturer where each car actually has to undergo physical crash test and it was not uncommon for such car crashes to be conducted 10 to 12 times taking over a period of year because after every crash the manufacturer has to go back redesign the faulty elements and come back with the car this particular car which was designed in India they used heavy simulation for the first time and they could complete the certification exercises with only half the number of average physical crashes that are required and they could complete that exercise in three and half months instead of one year so you can see the enormous amount of cost saving and time saving that such beautiful maths can give you and to do that beautiful maths you need to master handling matrices this incidentally was a record time in the world at that time we will very quickly discuss the notion of random numbers we are not going to use it today so the examples will follow subsequently but just to see where random numbers are you are all familiar with the randomness that happens in the world in variety of human activities for example if you play any games of chance you are familiar with card games so when you deal the cards you effectively get some card randomly out of the deck of 52 when you throw a dice in a game of snakes and ladders you will get a number 1 2 3 4 5 or 6 but that is a random number every time you throw a dice another number may come and equally probably any of the numbers can come such random numbers are called uniform random numbers because the number is randomly chosen from the same set and each number has same probability of occurrence can we use computers to simulate any game of chance yes but if we do we need to generate random numbers now anything that we generate using a computer can be done only using a specified algorithm that means we write a program and that program when executed will generate whatever sequence of numbers that you want unfortunately for a fixed algorithm if a starting point is fixed the same sequence will be generated it may appear random when you execute it first time but next time you run that algorithm it will give the random so how would you like in a snakes and ladder you always get 1 2 1 2 1 2 because that was the sequence that was generated by a particular algorithm you do not want that to happen therefore such algorithms by the way are called pseudo random number generating algorithm that means the sequence is not strictly random in the random sense but it is pseudo random because it is generated by fixed algorithm to simulate true randomness what you do is you run the same algorithm but with a different starting point and you start with a different starting point then you may get a completely different sequence if the sequence is large enough say multiple million values then obviously the sequence will not repeat and effectively you will get random number this is the crux of using some initial seed value you can generate different sequences C++ specifically provides for generation of random numbers for example if you want to represent generation of toss of a coin head or tail I need a random number generator which will keep generating randomly either 0 or 1 or you could call it 1 or 2 or you could call it 5 or 6 or 0 or 10 whatever 2 number similarly if you want to simulate the throw of a dice you need a uniform random number in the range of 1 to 6 whenever you throw a dice you get either 1 or 2 or 3 or 4 or 5 or 6 so how do you generate these C++ standard library which is called CST lib C standard library this standard library include all the computational functions that we had once mentioned additionally it includes a function called RAND RAND open bracket close bracket it does not take any parameter so every time you call a RAND function a new random number is generated and given to you obviously it is a pseudo random number and as we already know the number sequence that is generated depends upon a seed value so if you run a computer program 10 times ordinarily you will get the same sequence 10 time to avoid that every time you can set up a new seed value for which there is another function which is called SRAND so this is seed for the random number generator so initially in your program you take one seed set it through SRAND and then if you keep executing RAND again and again and again you will get sequence corresponding to that seed consequently for different program executions you can actually start with a different seed and get different sequences of random number here is an example of a program to generate random numbers so include I O stream CST lib using namespace STD etcetera int main for int equal to int I equal to 1 2 4 sorry 1 2 5 plus plus I C out RAND NL what will this generate this will generate a random number how many random numbers it will generate yes it will generate 1 2 3 4 5 random number please note that random number generated is an integer number the full integer is 2 to the power 31 minus 1 so this will generate very large numbers we can't do much with it whenever you throw a dice you can't get any one of those numbers normal so you want to restrict the random number so generated within some range this can be done by using this RAND but doing something different so I am simulating dice throw what is difference between the dice throw and the normal random number the dice must get me value between 1 and 6 so here is how do I do I generate the random number and find out modulo 6 what will modulo 6 of any integer give me 0 1 2 3 4 or 5 if I add 1 to it I get this normal dice throw so that is how I said dice is equal to this and I can output the value of dice however every time when I execute this program I want to start with a different seed and to set up the seed I read a value of seed and I say SRAND seed this function execution will set up a different seed value I have shown some executions here with seed equal to 1 2 3 another execution with seed different seed you will get different value notice that you are getting 2 6 6 1 4 this is what actually will happen if you throw it only 4 or 5 times so how do you know it is uniformly generating random number that is the distribution is uniform well you should generate thousand times 6 thousand times 10 thousand times and find out how many times 1 is generated how many times 2 is generated etcetera this is done by the next program what it does is it defines a sum array of 6 elements every time I die dice is thrown it will add the corresponding element of that sum it will increment it by 1 so I do the exactly the same thing that I was doing in the earlier program inside this loop which is run from 1 to very large number of trials it could be 10 thousand 50 thousand whatever each time I generate a random number I calculate the value of dice and I add 1 to that element I increment that sum what will happen now if I run this trial 10 thousand times the first element will contain as many times dice throughout 1 second will contain as many times dice throughout 2 of course the element number will be 0 1 2 3 4 5 and if all these numbers are roughly same then I know that the random number generator is uniform so here is the last slide which says if I run this uniformity check program for 6 lakh times so if I run it for 6 lakh times generally each number should approximately come up 1 lakh time and this is the what is indicated by the generated numbers 1 2 3 4 5 6 are thrown 99 thousand times 1 lakh 83 times 1 lakh 90 times etcetera you will agree that these numbers are roughly similar and therefore the number generated are indeed uniformly generated random numbers will stop here now and will continue looking at some problems using all this stuff in the next Thursday lecture thank you.


Hi friends, welcome back to my channel and welcome. If you're new here, my name is Jen. I'm a certified weight loss and nutrition coach and I'm on the WWE personal points plan.  I have some exciting new food finds for you. So if you're excited for grocery haul, give this video a big, huge thumbs up and don't forget if you're new or you haven't yet subscribed. I would love to have you here. Hit the subscribe button and don't forget to click the bell right next to it. So you never miss a single video, a single grocery haul. Definitely hit the bell so you don't miss out. Check out the description box down below for my four recipe ebooks. They are all released. They are available. There's 15 recipes per ebook. So definitely check those out, as well as nutrition coaching, where I offer personalized macros and calories and one-on-one coaching. If you want to talk with me directly, links, discounts to all my favorite things. And don't forget to come over, join us on Facebook. We are doing a holiday card exchange. Lots of fun stuff happening over there. So head on over and join us. So let's jump in to the grocery haul. Poor Diesel's hair still hasn't grown back. Palmer, what do you have? Did mommy get you? Palmer, show mom. Cool, Palmer. So here is this week's grocery haul. I did Walmart grocery pickup. And then I stopped by one of our local grocery stores to pick a couple things up that Walmart didn't have. It is called Yokes. It is, again, local to my area. But let me show you what I picked up because I have some new exciting finds. The first thing I picked up, of course, is a 24-pack of Diet Coke for Troy. And then I did pick up some more of the Walmart hamburger buns. I like these buns. They're small. They're the perfect size. They're only three points and 100 calories because I am making hamburgers for my meal practice next week, a fun hamburger. So stay tuned at the end of the video for that. But I had to pick up some hamburger buns. Two pounds of ground turkey. I picked up one pound of 93% because I wanted a little bit fattier turkey for a recipe. And then I also picked up a pound of 99% for another recipe. Two pounds of 96% extra lean ground beef. This just sounded really good. So I grabbed it. This is the Pacific Foods organic roasted red pepper and tomato soup. It's actually really, really good. And it's getting chilly here. In fact, it was snowing but not sticking this morning. So soup sounded really good. My local grocery store had the Natural Bliss Pumpkin Spice Coffee Creamer. I can't find this a lot and I really, really like it. So I went ahead and picked it up. I also picked up two bottles of kombucha just because they were flavors I've never had. And the first one is the Love. And that is lavender, chamomile, and jasmine green tea. And the other one is the Super Berry, which is raspberry, blueberry, goji berry, and oolong tea. Some shredded cheese. Just for a couple of recipes, I needed a light fiesta blend. And then I picked up an Italian style blend as well. Diced ham for my meal prep. And then I actually ordered the La Croix Lemon Cello sparkling water because that's my favorite and they didn't have it at Walmart. So they substituted for the watermelon bubbly. So when I stopped by my local store, I went ahead and picked up the one I really wanted, which was the Lemon Cello. Here's a fun new holiday find. This is from Nutpods. And this is their almond and coconut creamer in Holiday Nog. Yes, please. I love eggnog. And this is only 10 calories per tablespoon. And I actually really like Nutpods. This particular one is found in the cold section with the other coffee creamers. I needed some more poultry seasoning because I was completely out. I picked these up for us just for kind of a fun festive treat. These are the Pumpkin Spice cookie dough with premier white morsels. They're only 90 calories per cookie, which I thought wasn't bad at all. Troy is on vacation this next week.  So I did grab a pack of the bean and cheese burritos. And then I also got a lot of lean cuisines. I have a lasagna, a fettuccine Alfredo with chicken and broccoli, a rigatoni and a spaghetti and meat sauce. Here's a fun little new festive food find. I saw this again at my local grocery store this is from the brand Sanders. And this is their Small Batch Wonders Pumpkin Spice milk chocolate sea salt caramels. They're open because I had one and these are incredible. You can have two caramels for 90 calories. So they're only 45 calories a piece. And I'll take one out and show it to you. They're actually really good size and they are so good. So here's the size of them. I mean not bad for the calories and the points. Walmart didn't have ham hawks and I need this for a recipe. So this is the main reason I stopped by my local grocery store because of course I found lots of other new things. A big pack of center cut bacon. I need this for a dinner recipe. And then I always just cook the whole pack up. So we have pre cooked ready to go bacon on hand restock of the country crock light for Troy. This is the butter that he prefers Walmart was out of my happy eggs. I was so sad. So I went ahead and grabbed the Pete and Jerry's organic eggs. These ones are really good. It's just a happy egg I think is a little bit better and a little bit more affordable. But these are really good and they're a good alternative to the happy egg. A loaf of Italian bread. This is for my breakfast meal prep. Some light cool whip for my meal prep. Wait till you guys see the three recipes I'm doing this next week. And of course I had to pick up my favorite earth's best kids chicken nuggets. I rave about these. They're so good. They have pretty good ingredients and they are just delicious. They're very low in points. I like to chop these up and pop them on a salad. I like to put them into a wrap and I do find this particular brand the earth's best at Walmart. And like I said they're really really good and affordable. I think the big value pack bag of these which is a pound is only six dollars and some change.  This is for my meal prep. I was almost out of onions.  I need four onions for one recipe this next week. So I made sure that I picked up another big bag of onions and then I just have a clove of garlic and a red bell pepper. So that is everything in this week's grocery haul. So let's go ahead and jump in to my dinners for the week as well as what you'll be seeing on Monday for meal prep. So here is what is on my menu for this week. So of course today Saturday we are actually going out to dinner with some friends that we haven't seen or went out to dinner with since oh before 2020. So we're looking forward to that. Sunday I'm making hamburgers with cabernet wine and onions.  Monday I'm going to throw some turkey and meatball soup in the crock pot so we have a quick and easy dinner. Tuesday is going to be meatloaf and then Wednesday we're going to have leftovers because we need to finish up all this stuff from earlier in the week because on Thursday we are heading to Leavenworth Washington for our birthdays and our anniversary. I'm definitely vlogging it this year so stay tuned for a super fun video. We're excited. We didn't get to go last year because everything was closed. So we are anxious to get back to Leavenworth which is our tradition every year for our birthdays and anniversary. And here's what you'll be seeing on Monday in my meal prep. For breakfast I'm doing a loaded breakfast casserole. This has bread and bacon and cheese and all the good things. For lunch I'm actually making ham and beans soup. I wanted something comforting, warm for my lunches this next week and then for dessert I'm making caramel pumpkin cookies. Cannot wait for this so stay tuned on Monday to see all three recipes. Thank you for joining me on another weekly at WW grocery haul. I hope you enjoyed seeing all the good stuff that I picked up for the week, my dinners I have planned, what you'll be seeing on Monday for meal prep so definitely stay tuned for that video. If you enjoyed this grocery haul don't forget to give it a big thumbs up and of course subscribe. If you're not I would love to have you here. Check out that description box down below for my four recipe ebooks, nutrition coaching, links, discounts to my favorite things and lastly don't forget to come on over join us on Facebook. Happy Saturday friends, happy weekend and I'll see you in tomorrow's extra special video. Bye!


All-Survivee starring Mr. and Mrs. Ronald Coleman. This is Ronald Coleman. Anita Coleman. Inviting you to join us again on the campus of Ivy College. The loose ends of any normal week. But Dr. William taught us the action of having every which he's celebrating with his wife, Victoria, as he tops off his luncheon with, of all things, some apple pie. The apple pie order, because there's something so neat and finished looking about one. And when it's neat until you see it, then it's soon finished. Well, well, Vicki, I'm afraid you and apple pie are my two great weaknesses. I have a failing for sweetness and neatness. However, the, the origin of apple pie order seems to be obscure. Even Mitford Matthews in his monumental Dictionary of Americanisms has passed it by. He mentions the apple pandoudi. Oh, I love that apple pandoudi. But you know, references to the apple are not confined to us or our times. Take the classics. Hercules sought the golden apples of the Hesperides for their immortality giving qualities. And the apple of discord led to the Homeric Trojan War. And Isaac Newton was quite struck with one too, conked on the bean. I doubt if Mr. Newton thought it funny. He was too involved with the, with the gravity of the situation before. The references to the apple are too frequent to mention. The tomato was once called the love apple.  And, oh, please credit me with enough restraint to avoid the cliche about an apple a day keeps the, et cetera. Particularly since the green ones will bring him running. However, it is true that the potassium in the apple is a highly essential mineral in the human body. So the saying may have more than a car of truth in it. Anyway, Vicky, that was excellent pie. Oh, Louisa, beg your pardon in another piece of pie. Oh, I'm sorry, but there isn't any more pie. The young man phoned while you were out, Dr. Hall, said he'd like to see you this afternoon. Glad you liked it, Mrs. Hall. Oh, the pie, yes, yes. Did he give you his name, Louisa? Yes, he did. Mm-hmm. Is that all, Dr. Hall? Well, I, um, there's some reason why. Mr. Bichatti, what was his name? Harry Carter. Oh, he must be Nelson Carter's son. Didn't say who his father was, Mrs. Hall. It didn't seem to come up. Try to clear the table now. You do it and the doctor likes more coffee. William? Yes, thank you. I will, just a little more, please. Yes, too, Louisa, please. I had a nice voice. I told him to call about three. Who? Oh, I, uh, thank you. Louisa, this is wonderful pie. I hope you'll get another one soon. Yes, Mrs. Hall. Apricot's good, too. Not too sweet. After all, my sister's husband hasn't worked a day in the last 15 years. Not as good as the apple, though. Patient, my sweet. Louisa will drop another clue when we're least expecting one, but I wonder what young Carter wants to see me about. What a freshman usually comes to see you about. Big problems. And I wouldn't be surprised if this one's about money. Oh, surely not with Jerry Carter, Vicki, why his father's one of Ivy's wealthiest graduates. Well, maybe he'd run through his allowance. But a week or so ago, he borrowed 30 cents from me. Oh. He gave me a lift home in his car and I used the word car out of pure courtesy. It's what I would call a lukewarm rod. Because it promptly ran out of gas and he didn't have enough money to buy one gallon. Excuse me, but here's your coffee. Oh, thank you, Louisa. Now, I don't want you to misunderstand. They've always been very happy together. It's just his rheumatism. Go ahead, Todd, you take it. My turn. Um, your sister's husband, Louisa? Yes, Charlie. Uh-huh. Brilliant. Well, we've now identified him by name. Well, that's a great help. But, uh, let's table Charlie for the moment and come back to Jerry Carter. Uh, he's a pleasant, unassuming young man, Todd. He is, yes, and a reputation of the popular notion that young people with his background must necessarily be arrogant and presumptuous. He hasn't asked a favor of us since he's been here. Oh, I think that's because he's self-conscious about his father's money. Even if it's a big dramatic point about only borrowing enough money from me for one gallon.  Well, Shakespeare and I both approve of his attitude. Neither a borrower nor a lender be for loan off loses both itself and friend, and borrowing dulls the edge of husband trade. Well, he must have heard about that. He borrowed from the wife, and I want to see the husband. Well, I, uh, maybe you've forgotten, but I haven't. I owe you for that gallon of gas. Have you got changed for 50 cents? Well, uh, you're not with me, but I'm sure Dr. Hall has. Oh, hello, Jerry. Good afternoon, Dr. Hall. Oh, William, have you got 50 cents and change? Well, yes, I think so. Um, well, there we are. Oh, good. Thank you.  And William, you lost 30 cents, and now I owe you 20 cents. See? If you'll write down the details of this transaction, darling, I'll submit the problem to Professor Carlson of the mathematics department. And Jerry, thank you for your thoughtfulness in driving Mrs. Hall home the other day. After what happened, Dr. Vole, I not only ran out of gas, I didn't even have the price of a gallon. I felt like crawling under the hood. Oh, it wasn't that dire a situation, was it? I thought I'd never live it down, but instead of that, I've suddenly become top man in my fraternity. When I went out to get my car the next day, there was a sign on the front seat reading, Mrs. Hall sat here. Oh, wow. Very flattered, you know. You know, confidentially, Jerry, I've only thought of placing similar placards all around the house and garden. Yeah, we could charge 25 cents admission and then show people where I fell down the cellar stairs. And the closet I locked myself in to try to hide your Christmas present. Excuse me, Mrs. Hall, I've got Charlie on the phone. Did you say apricots? No, Louisa, I just chose it. Oh, no, I mean, I'm sorry, Louisa, no, make it apple. We'll try to apricot some other time. Well, it seems we've gotten rather away from the subject, whatever the subject was. At the moment, all I can think of is an apricot locked in a closet. Is that all, Dr. Hall? Yes, I think that's quite enough, Louisa. By all means, make it apple. Oh, Vicky, I'm afraid my discourse at luncheon on the subject of apples started off a chain reaction. Yes, you have to excuse us, Jerry. It's much too involved to try and explain to you. Well, unless you happen to know who Charlie is, in which case you could be of great help. No, Mrs. Hall, I'm still back in the closet with the apricot. You see, our housekeeper is a verbal economist suffering from a slight case of ellipsis. Fortunately, she drops words instead of dishes.  Tell me, how's your father? Fine, and he wanted me to give you both his best regards, which is one of the reasons I came to see you. But Dr. Hall, I've been wondering, could you tell me, as long as I'm here, would it cause a lot of trouble if I change my English one from 1030 to 930, my economics one from 930 to 1030? Well, I hardly think it would upset the university's schedule, but that would mean you'd have to change instructors. I know, and I'd be sorry to lose Professor Huntley in English. Yeah, then I gather you wouldn't miss Professor Hamlin in economics. Frankly, Mrs. Hall, I wouldn't. And I'm sure he wouldn't miss me either. I don't think I'm getting very much out of the course. Oh, well, I've always considered Hamlin a first-rate instructor. Well, it's not very interesting stuff to begin with, and sometimes I don't think Professor Hamlin is any more interested in it than I am. Well, I have known professors who have apparently been bored but the sound of their own voices. In fact, there is a famous legend of the undergraduate who, when his professor yawned during his own lecture, said, the professor confirms our judgment, but usurps our prerogative. I don't... I think this would apply to Professor Hamlin, Jerry. Oh, no, no, I'm sure you're mistaken. He's profoundly interested in his subject. He may be, but he certainly doesn't sell it to me. Well, last week he talked for an hour about the physiocratic theory, and it was as dry as baked swordfish. That wasn't Professor Hamlin's fault. It was the physiocrats who were arid. Carl Isle once called economics the dismal science. Whether it is or not, I don't believe Professor Hamlin could spice up the subject even if he wanted to attempt it. Well, I guess the real truth is I don't think Professor Hamlin likes me. No. Every time he calls on me to recite it, he seems to delight in getting me rattling. I end up by making a fool of myself. And then the other day, he really went out of his way to embarrass me when I was with my girl. Well, I don't know why I should bother you with all this, because this is my province, Jerry. The failure of a student to interest himself in a subject or the failure of a professor to communicate his knowledge. These are the primary concerns of a college president. After all, a student who is not being stimulated, interested, challenged is not being educated. You said Professor Hamlin embarrassed you, Jerry. How? Well, I was walking across the quad with Marge, my girl, when we met him. I'd cut his class, and he could see I wasn't ill, so I tried to brush it off. I said, I'm sorry, I wasn't in class this morning, Professor. Did I miss anything? Hardly the language of diplomacy. What is he saying? He said, you didn't miss anything you would have understood. I thought it was kind of a nasty crack, but Marge thought it was funny. Maybe I'm just being juvenile, but it's got me. I really want to make a change. Have you spoken to your faculty advisor about this? Yes, sir. But both he and Dean Smith rejected my petition for a transfer, so that's why I came to you with it. I'm not often inclined to overrule faculty decisions, Jerry, but before I give you an answer, I'd like to make a suggestion. Go to the college library and ask for a copy of the 1932 annual. Read the dedication and tell me what you think about it. I will, sir. I'll be busy for the rest of the afternoon, but perhaps you can come by this evening. All right, Dr. Hall, thanks for listening to me. I hate to ask favors. Well, goodbye, sir. Goodbye, Jerry. Goodbye, Mrs. Hall. Goodbye. And thanks again for the 30 cents. Oh, that's all right. Now, Toddy, you're almost as cryptic as Louisa. What's in the 1932 annual? The entire edition was dedicated to Professor Hamlin, and the dedication was written by Jerry's father. Nelson Carter gave his economic professor credit for his economic success and said that he was the one man who had taught him to think. Oh, you are cunning and crafty. Do you think that would make Jerry feel differently? I mean about Professor Hamlin, not about his father. Oh, I'm not sure. I'm not sure we can change Jerry's mind for him. That easily. He regards Professor Hamlin as an obstacle, and he's looking for an easy detour. Now, we've got to find a way of changing the obstacle into a challenge. As my father used to say, a man is on his way to an education when he can tell the difference between a stumbling block and a stepping stone. In this re-broadcast presentation of the Halls of Ivy, starring Mr. and Mrs. Ronald Cullen. It's early evening, and Dr. Hall has placed a long distance telephone call to Nelson Cotter, Jerry's father. And while waiting for the operator to call him back is improvising at the piano. See you early, Debussy. No. As a matter of fact, very late Hall. I just thought of it this moment. What are you going to call it? Variations. Variations on the theme of Victoria while waiting for the phone to ring. Oh. I told Louisa to answer the phone. And thank you, darling. That's lovely. Now do a variation. Variations are infinite. Even when I listen to Bach, Beethoven and Mozart, it's either the... Oh, the Pasacaglia and Fugue in C, Vicky Major. Or the Victorian symphony. Or the William Todd Hunter Televature. Or the Sinfonia Victoria concertante. Oh, the Lever study. Just as long as I'm in your musical library, darling. The loveliest album I... Don't worry, darling. Louisa will get it. The loveliest album I ever acquired. You know, I have a theory that music started with the first man who ever said to the woman he loved. There are no words to tell you how much I love you. And so he hollowed out a read. Or fashioned a loop. Or perhaps simply pounded on a drum to tell how he felt. Then they go. Excuse me, Dr. Hall. But the long-distance operator still can't raise Mr. Nelson Carter. I see. Well, thank you, Louisa. And Charlie wanted me to tell you how much he appreciated it. Charlie? Oh, oh. Charlie, yes. Well, what did I do? He used you for a reference because you liked it. And he signed up two fraternities already. Uh, Vicky. Apple pie? You want apricot? I assembled the necessary elements. At the risk of being, uh, tautological, I... Oh, I always thought you were taut at Ivy. Oh, no, Vicky. I gather that Charlie, your sister's husband, has contracted for the delivery of apricot pies to two fraternity houses on the strength of my enthusiasm at the lunch table. That's what I said. Oh. My sister does all the baking. Now, if you'll excuse me. Operator says she'll keep on crying that number. Charlie just makes the contacts. I've only made contact with Louisa. Well, at the moment, I prefer to have made contact with Nelson Carter. I don't usually like to shift responsibility, Vicky, but in the case of his son, I think it advisable. Jerry has expressed a common complaint of the student who would like to change instructors when the going gets hard. I can't make an exception of him. But, darling, do you think that it is just an ordinary complaint? If it were, wouldn't Jerry have come to you a long time ago? And if he were one of the clever campus politicians, you can be sure he'd have found ways and means of changing instructors without you even knowing anything about it. Well, that's why I would rather not make this decision in my official capacity. I wonder if... What if I were to assume the role of a father in absentia, in local parentis? You've been in more places. Well, after all, knowing Nelson Carter as well as I do, I don't think he would object if I... That's probably your foster son right now. Now, don't bother, Louisa. I'll get it. Good evening, Mrs. Hall. Hello, Jerry. Come right in. Good evening, Dr. Hall. Hello, Jerry. Well, what did you think of the 1932 annual? It was very interesting, Dr. Hall. I'm sure Dad meant what he said about Professor Hamlin. But to be honest with you, it doesn't solve my problem. Even though your father admitted that he had had a similar difficulty when he first studied with Professor Hamlin? I guess I have a mental block. I hate to quit, but he's got me on the run. I'm just a student, so there's no point in my trying to fight back. Yeah, but perhaps that's exactly what Professor Hamlin would like you to do. Why, Mrs. Hall, so we can end up my flunking me? Jerry, I didn't want to mention this to you before, but what if I were to tell you that your father has been partially responsible for Professor Hamlin's attitude? Well, how could he be Dad's... Say, wait a minute. Do you mean that he put Professor Hamlin up to this, that he asked him to give me the works? Jerry, I know your father well, and you're very much like him. He grasped things so quickly as a student that he didn't have to sink very hard, and that can lead to mental laziness.  Did you say suppose? Well, you know your father. What do you think? Yes, yes, that must be it. You know, Dr. Hall Dad is quite a guy. Really tough. I remember the first time I ever asked him for a bicycle. Brother, how I had to sweat to get that bike. And brother, I'll bet you appreciated it when you got it. And I appreciate my father, too. I should have guessed. This is all part of Dad's toughening up process. You all right then? I'm taking on Professor Hamlin starting right now. No holds barred. I don't promise to like him, but he can't crowd me out of a class if I decide not to be crowded. Now, that's splendid, Jerry, but don't be too hard on the professor. Now, he wouldn't want to see you up for assault and battering. Professor Hamlin may never win any student popularity polls, but he's a fine teacher. And you will never forget him. I promise you this, Dr. Hall. I'll keep an open mind. I get it. Oh, no. That's your call, William. You better take it. Hello, Dr. Hall speaking. Just a moment. Hold on, please. Yes, Jerry. Now, what were we... You're busy, so I'll be on my way, Dr. Hall. Yes, yes. Come again soon. Bill, what's the matter? Just a moment, please. Jerry, if you'll excuse me. Oh, of course. Goodbye. Goodbye. And Mrs. Hall, if you ever need a taxi, just give me a rail. I promise to have the tank full. After all, the least I could... Yes, yes, yes. That would be just wonderful. I'll ask you to the door. Hello, Nelson. How are you? Fine, but I'm not so sure about you. Well, Nelson, the truth is that I was just about to be caught red-handed in the middle of a big, well, small misrepresentation with your boy. Hey, Jerry there. Let me speak to him. No, no, no, Nelson.  Because I didn't want him to hear me tell you what I told him you had done. Are you keeping something for me? Is Jerry in a jam? No, no, no. He's been having Professor Hamlin trouble, just as you once did. Really? And I was hoping that you and I could get together on this, but he came here this evening before I was able to reach you.  Thank you. You've just made me an honest man again. Tell me. Well, I'd rather put it this way. It's working. He's a fine boy, Nelson, and I believe that when... Thanks for all you've done. Goodbye. Goodbye. Vicki, that was Nelson. Yeah, I know, I know. Nelson Carter, Jerry's father, who really did what you told Jerry he probably did without knowing he's really done it. But he seems to have done before you even said he did it. And when you get time, darling, you might extract the subject and predicate from that sentence and mail them to me in a plain envelope. Well-intentioned prevarication is a risk I would not often recommend. One's intuition can be wrong, you know. Not yours, darling. Your virtue is so flawless that even when you attempt to tell a lie, it turns out to be the truth. Based on a story idea by Clyde W. Park, professor of English, emeritus, University of Cincinnati. Music was composed and conducted by Henry Russell.