Now I will see there are quite a few hand raises 1 1 0 5 I think this is mitte minakshi Bangalore over to you. Sir in F 1.2 F 1.2 I could not get where we have to take Q is equal to mcv delta t and mcp delta t so you told that it is a stirrer work you should not take mcv delta t but I am not understanding sir please explain clearly sir. F 1.2 first thing it is a rigid container so rigid container means W expansion is 0 that does not mean W is 0. We know the initial state final state can be computed the heat absorbed is given assume air to be an ideal gas etc etc final temperature change in internal energy and work done the first law has to be written as Q equals delta E plus W Q is given so we have no issue with it it is absorbed 195 kilo joules so this is equal to plus 195 kilo joules substitute in this delta E we assume delta E equals delta U that has to be an assumption then since W expansion is 0 the only other component which seems to be present is the stirrer work while it is stirred so this becomes delta U plus W stirrer since delta expansion is 0. So here an assumption is W equals W expansion plus W stirrer W expansion is 0 because it is a rigid container and there is no hint of a third or fourth component of work. Now we are asked to assume air to be an ideal gas with CV that given value. Now since air is an ideal gas we can write delta U is m into CV into delta T that is T2 minus T1 and T2 can be calculated if you draw the two diagrams the two diagrams would be a system diagram 3 kg air there is a stirrer work since it is rigid you can write W expansion is 0 Q is specified and there is no piston or anything rigid and on the P V diagram everything is going to happen at a constant volume this is the initial state this is the final state what is given is 75 degree C from 5 bar 75 degree C to 12 bar. So this is going to be the 75 degree C iso bar this will be the iso bar for T2 this pressure and this pressure are given 5 and 12 bar since we know the pressure and volume the pressure and temperature at this point it is constant volume so if we know the pressure at this point temperature at T2 temperature T2 can be determined. The moment you determine T2 you can determine delta U because m is given to be 3 kg value of CV is specified and then in the first law the derived form we remember we always start from this form the final derived form will be Q equals delta U plus WST delta U has been calculated Q is given so WST is the only unknown. I hope that satisfies you over to you. Sir what is the order of law 0th law 1st law 2nd law you told that 1st law 0th law and 2nd law you see these are these are the 3 laws and we just call them as 1st law 0th law 2nd law purely for historical reason I said historically 2nd law is 1st because the 2nd law is based on the original thoughts of Karno and Karno's work even precedes the work of Joule and Benjamin Röhmfeld. So historically the thinking process pertaining to the 2nd law or which ended up at 2nd law began 1st the process thinking process thought processes which led to the formulation of the 1st law began later a few decades later and thought processes leading to the 0th law began still later. Instead of that we could have called it may be the 2nd law could have been called Karno's law the 1st law could have been called Joule's law in which case there would not be any question of 1st, 2nd and things like that. This is just the way we arbitrarily assign signs to directions we have assigned names to these laws or numbers to these laws that is it over. Last question in F1, F1.1 so I am not understanding that the system is brought back to its initial state by non quasi static process. See in F1.1 we have a process since if there is a mention of expansion let us assume that it is a cylinder piston type of arrangement and this is our system. So there is definitely an expansion work but there could be some other work also. There could also be some heat transfer actually there is also heat transfer. Now this is only a generic thing we are not going to this only shows us the scheme. The actual process is on some say on a PV diagram we are given that it initially executes a constant pressure process from an initial state 1 to a final state 2 expanding from 2 meter cube to 2.25 meter cube against a constant pressure of 1.5 bar. It is a constant pressure so at least on the PV diagram it seems to be something like this a quasi static process it is given it is a quasi static process. So this is the process 1 let me call it 1A2. The system is brought back to its initial state the initial state was 1. This was the final state for the first process. It is brought back by some non quasi static process just link this up by some dotted line. This is process B just to remove clutter and for clarity I have shown it above A. You could have shown it below A nothing wrong you can even shown it crossing A any number of times but dotted line so the position of the line is meaningless. So 1A2 is the first process. The second process is 2B1. Is that clear now? Over. We understood the concept sir formula we are unable to get it sir but the answer we are getting. There is no formula you apply first law for the first process you apply first law for the second process. For example if you take the first process in the first process what is given it absorbs 80 kilo joules of heat. So the specification is Q1A2 is plus 80 kilo joules. It expands from 2 meter cube to 2.25 meter cube against a constant pressure of 1.5 bar. So W is W expansion plus W other and W other is 0 but this you need to assume and W expansion is integral p dv you can integrate it because it is quasi-static and because it is constant pressure this becomes p into V2 minus V1. P is specified V2 is specified V1 is specified so we know W. This is W1A2. So now apply Q equals Q1A2 is delta E1 to 2 plus W1A2. This is calculated this is calculated so this is now known. Now come to the second part of the process. In the second part of the process what is given system is brought back to its initial state. So that means delta E21 will be equal to delta E12. Why? It is the same in the other direction. One is E2 minus E1. This is E2 minus E1 whereas this will be E1 minus E2. Finally is one initial is two and then apply we are given the heat it rejects 100 kilo joules of heat. What is the work done? You have to apply first law because first law is the only law which relates Q to the rest of the world. So Q I will write it completely. Second process Q2A1 equals delta E21 plus W21. Delta E21 is minus delta E12 which has been calculated so this is known. Q2A1 is given minus 100 kilo joules. So the only unknown is W21. There is another way to solve this problem before somebody asks a question. Notice that 1A2 followed by 2B1 is a cycle. Now for a cycle delta E is 0 because it comes back to its original state. Initial and final state are the same. So Q cycle will be delta E cycle plus W cycle. Delta E cycle is 0. Q cycle can be written down as Q1A2 plus Q2B1. Both are given. W cycle is written down as W1A2 plus W2B1. This is to be determined. What about W1A2? W1A2 is W expansion 1A2 assume W other 1A2 is 0. This assumption is something which we have made already. W other is 0. So the same assumption needs to be made here. And because it is a constant pressure process this is to be evaluated exactly as it was evaluated here. So once you evaluate that you will notice that in this expression only 2B1 is the unknown which you extract. In this case we do not have to go through the intermediate stage of determining delta E12 and delta E21. That is not asked. So you can use the alternate method also. But if delta E were to be asked you would have to use the first method over. Sir in which case work done will be more sir? Was it static or unconscious static process? There is nothing. There is no such idea that in one particular case work done is more. Work done and heat transfer and the change of state have to be such that the first law of thermodynamics has to be satisfied. Q equals delta E plus W has to be satisfied whether it is quasi static or not. So do not be under an impression that work done in a non quasi static process is higher or lower or anything like that. There is no relation between the amount of work done and whether the process is quasi static or non quasi static. If it is quasi static then you can evaluate the work done because area under that curve in the appropriate process diagram may be the work done. Over and out. Hello 1 2 2 at Loyola. So go ahead. Good afternoon sir. Myself Queen Florence Mary, Assistant Professor in Mechanical Engineering Department. I have solved question number 4 F 1.4 but I want to know whether the steps I have followed is correct or not sir. It is given it is perfectly insulated. So it is an adiabatic process. So Q equal to 0. Right. First we have and two work is there. One is expansion work and another one is stirrer work. So first I have found out the expansion work using PDV equation and to find the volume I have used T 1 divided by V 1 equal to T 2 divided by V 2 because pressure remains constant. Right. You are right. So I got the answer V 2.11 meter cube and then to find CV I used 1 by gamma minus 1 into R. Gamma value 1.4 is given to find R I used the formula universal gas constant divided by molecular weight. Right. So I got the answer for CV and then del U it is CV into del T using that I have found out del U. Right. And then Q we know it from first law of thermodynamics that is del E plus W net. Right. That is expansion plus stirrer work. Using that first I found out the W net and then W net is equal to expansion plus stirrer work using that I have found out. Wait, wait, wait. How do you get the stirrer work? You cannot find out network. You write, you wrote Q equals delta E plus W. That is right. Okay. Q is 0. What did you do? Q is 0. What? Del U I got from CV. No, you have to assume that delta E is delta U. Yes, sir. I assume that delta E equal to delta U and then I have substituted the value. Then delta U I have calculated as CV. Yes, that you calculated. Substuted the value. Right. Yes, sir. And from that I have found out work. From first law. From the, from actually that work is expansion work plus stirrer work. Let me say that look F 1.4. In F 1.4 you wrote Q equals delta E plus W. Under the assumption that delta E is delta U, you expanded W. This became delta U plus W expansion plus W stirrer. W expansion you calculated, delta U you calculated, Q is given to be 0. I think it is adiabatic and hence W stirrer is extracted. Is that the method you followed? I think if network is also asked that means first you calculate this and then extract the, subtract the W expansion, you will get W, W stirrer. I think that is okay. I did actually instead of expansion and stirrer work I have put network. Yes. And then I have expanded network is equal to expansion work plus stirrer work and from that I have found out the stirrer work. Yes, that is perfectly alright. Over and out. 1175 Thruba College, Bhopal. Sir, I want to ask question number F 1.7. Consider the action of an air gun. Right. The gun consists of a chamber of volume VC connected to a long cylindrical barrel of volume BB. Right. Sir, I do not understand this question. Okay, I think the question is simply this. If you start sketching the diagram that becomes easier, you have a chamber of volume. This is VC, V chamber. We have a long barrel of this gun and the volume from this point up to this point is VB. That is the import of the first two sentences. Initially compressed air at pressure PC and temperature TC is filled chamber. So here the initial state is air at PC, TC. The bullet is located at the chamber end of the barrel. So let us say this is the bullet and is held in place by a stopper. There is some mechanism which keeps it there. Then we press the trigger. The bullet is released that the stopper does not stop the bullet. So now out here there will be some ambient pressure and key not ambient pressure if you read the. So initially the ambient pressure acts on the other side of the bullet. So since there is a lower ambient pressure on one side and higher chamber pressure on the other side, the bullet will start accelerating, moving and the air will expand because as the bullet moves, more and more volume will be available for the gas or the air in the chamber. When the bullet is released, the air in the chamber expands into the barrel and accelerates the bullet.  Air expands adiabatically and air behaves like an ideal gas with constant specific heats. Now this is the system diagram. Let me start by saying that to begin with my system is the air in the chamber and the volume of the system expands as the bullet moves. So for example if the bullet is here, my system will expand right up to the inner surface of the bullet. Finally when the bullet leaves, this will become an open system but it would expand. But we will consider the process up to that. If I consider for my system which is shown by the dotted line here and show it on a PV diagram, my initial volume will be simply VC. Final volume, the final state when the bullet just leaves, I will consider up to that point because once that is done, the total whatever remaining pressure will be just dissipated and the bullet will not get affected by this because it is not confined within the barrel. So the final volume will be VC plus VB. The initial pressure is PC. So this is the initial state 1 of our system. We are asked to determine something. We are asked that the bullet behaves like a leak proof frictionless piston. Air expands adiabatically. Let us also assume that the expansion process can be modeled as a quasi-static process. In that case, this will turn out to be some expansion like this. So this is the state 2. Of course depending on where VB is compared to VC, your atmospheric pressure P naught could be here or could be even higher than 2. There is a hint as whether there is an optimal length of the barrel. It has something to do with where the atmospheric pressure lies. Now what will happen is the air expands as it expands adiabatically, quasi-statically and if you assume that there is no other work, there is no mention of a stirrer or electrical work, then this expansion under these assumptions will turn out to be PV raise to MI is constant. So given VB, VC, you can write down the expansion for the work done by the system on the bullet. That is one part of the process. Now what happens to the work done by the system on the bullet? Consider bullet as your system now. When you consider bullet as your system, let us see what happens to it as it moves through the barrel. As it moves to the barrel on one side, there is the pressure P of the gas. On the other side, there is a pressure P naught of the atmosphere. So the net force on the bullet is P into the area of the piston, area of the bullet on the gas side, P into area of the bullet on the air side. This expands so there is some amount of work done. This amount of work interaction is W gas. There is another amount of work interaction from this side. I do not think I am showing the thing which is W naught work done against the atmosphere. Now if this is your system, for this system write Q equals delta E plus W. Now it is not given here but there is, I think it is given here that frictionless bullet, frictionless piston. So there is no work done against piston. So you will have to assume the following. We will have to assume that delta E for the bullet is delta U plus delta E kinetic. And we will say since there is no friction and the bullet is small, we will assume that there is no change in the temperature of the bullet. And we will assume that delta U of the bullet is 0, leading to delta E of the bullet being delta E kinetic. We will also assume that the interaction between the gas and the bullet is only a work type of interaction. So we will assume that the bullet is essentially adiabatic. So that gives you delta E kinetic of the bullet plus W is 0. And W will be work done by the bullet. So this will be work done by the bullet on the ambient plus work done by the bullet on the gas. And this particular term is the negative of the term, sorry this will be minus work done by gas on the bullet which is something which we have calculated in this scheme and that essentially is the area under this curve. And with a small assumption that the volume of the bullet is negligible compared to the volume of the barrel, the work done by the atmosphere on the bullet, sorry bullet on the atmosphere would be this. And this is also obtained as volume of the barrel multiplied by the atmospheric pressure. This is obtained. So we have obtained W which would be a reasonably negative number. Substitute that here. So you will get delta E kinetic and delta E kinetic will be half mass of the bullet into V muzzle. That is when it leaves the barrel minus half mass of the bullet V initial. I think V muzzle is called V naught there, V initial squared. Since initially the bullet is held in place, this V initial is zero. So once you calculate delta E which is delta E kinetic, you can calculate V naught the muzzle velocity of the bullet. This is a idealized but one of the standard first problems which you solve when you solve internal ballistics. External ballistics is what we do in school determining the projectiles and ranges etc. Internal ballistics is what happens inside a gun or a cannon or a pistol and this is one of the simplest first steps in internal ballistics. Over and out. 1241 NRI, I hope you are able to talk today. Over to you. Good afternoon sir. This is Sonil Thapia from NRI group of institutions Bhopal. Sir, when I teach first law of thermodynamics, I use the equation delta Q is equal to delta W plus DE because heat interaction and work interaction are path function, they are in exact differential. Whereas when I saw your lecture today morning, you have used DQ is equal to DW plus DE. So would you please throw some light on it sir? You are bringing me to a rather sensitive part and my students will see first law can be applied to a process element. It can also be applied to a full process. By process element, by full process we mean something like this from state 1 to state 2 by some way or the other. By process element, we mean we take 2 neighboring states changing by some small delta V and some small delta P or whatever it is. This is the process element part whereas this is the process part. When it comes to process element, we write the small amount of heat which is absorbed by the system. Turns out to be the small amount of work which is done by the system plus the small increase in its energy. Since we know that work is a path function and heat also is a path function, we quite often write D prime W or D cross W etc. That is a question of nomenclature. If you do not want to write it, it is perfectly okay. But you should remember that this is an exact differential and these two are inexact differentials. By integrating this, you can come to the process equation. When you integrate DE over a process, you will get delta E. When you integrate DW over a process because it is an inexact differential, the integral of DW will depend on the path and you will only get an interaction which we call W. We never call it delta Q or W2 minus W1. Similarly, on the left hand side, DQ is an elementary interaction. You can integrate it out appropriately over the path. But when you integrate it over a process, all that you will get is the total amount of heat transfer Q not delta Q or Q2 minus Q1. So this is only the differential form of our first law. This is the corresponding integral form for the first law. I am very particular when I tell my students that never make the mistake of writing delta Q or delta W. That is something which bugs me a lot and my students suffer very significantly if any one of them dares write delta Q or delta W. Over to you. One more question sir. Sir, today morning you explained very beautifully that heat is a path function. But we use the concept that work done by a diabetic system from state 2 is independent of path. Now what I wanted, if I try to explain by a PV graph, it is very easy for me to explain that work is a path function. But is there any graphical way of explaining to students that heat is a path function? I cannot use the concept of entropy and TTA's diagram here because when I am teaching first law of thermodynamics, the student do not have the background of entropy. See I understand the difficulty that with graphical methods using for example the PV diagram, you can show that work is obviously a path function. Graphically it is difficult for us to show that heat is a path function only when we use the first law of thermodynamics. After studying the second law of thermodynamics, we will have a relation between the heat interaction and the area in the TTA's diagram. We will use that appropriately. But all that we can say is out here since delta E is a state function but W is a path function. Since right hand side has at least one path function involved, the left hand side is also a path function. That perhaps is the only thing we can explain to the students just now. In fact in thermodynamics, we always get into this situation. Thermodynamics as a whole is a complete science. Actually if possible one should simultaneously be appreciating 0th law of first law and second law. And that is what has been done by a few developers of formulations of thermodynamics particularly Hexopolis and Kinan and to some extent by Giles absolutely purely topological formulation. But those formulations are very difficult for us to absorb and very very difficult for us to teach to students in the first and second year of engineering. That is why we have to follow the more or less traditional path of one law after another. So what happens is there are some links which we have to keep floating as forward links and then come back to it and say that look this is what we for example even Boyle's law and Joule's law. Later on we will show that if the ideal gas equation is of this type then from that it necessarily follows that if equation of state is of PV equals RT type then your U will be a function only of temperature. But initially we have to keep those two things at separate. Over to you. One more question sir. In thermo how to develop the interest of the students in thermodynamics because in thermodynamics we always present thing in a mathematical form. Energy we change in energy we define as delta Q by delta W. Then enthalpy also we define in a mathematical form U plus U. Then entropy also we define in a mathematical form integral DQ by T. The student asks I want to see entropy. What as a teacher? I am basically a teacher of engineering drawing. For the first time I am teaching thermodynamics and it is very mathematical sir how to bring physics in it. The student asked me sir I want to see entropy. I am helpless sir. You are helpless everybody is helpless. In fact mathematics is the tool which we use. Physics is the basic scheme on which we work. So deriving something as an exact differential and integrating is mathematics. But Juhl's experiment and hence the generalization that W adiabatic between two states is independent of the path is physics. Similarly later on when we go to the second law till we come to the definition of entropy we will be using mathematics throughout but those efficiencies of engines, their comparisons, possibilities and impossibilities of transfer that is all physics. But the actually the difficulty everywhere is particularly in thermodynamics is you cannot feel velocity. You cannot feel temperature we feel as hot and cold but internal energy entropy enthalpy it is something which we cannot feel. But we can apply things and see the result. In fact the problem 1.7 the bullet problem came out came a few years ago because a student with a background in the navy asked me sir why is it that always we sketch our thing at cylinder piston and he made a funny statement saying hardly anything in life or in engineering in cylinder and piston and I took objection to that and saying that look you draw your car or your scooter from your home to this place he stays in the naval quarters of few kilometers from a state at that time and he said the car engine is nothing but a set of cylinders and pistons with other mechanisms and I said you use a gun you use a cannon you use a torpedo the basic mechanism everywhere there is a cylinder and piston even in a household situation or a medicine situation you go to a doctor he inject something into your vein or in your muscle that injection is a cylinder and piston at home or near your office you pump air in your car tire or scooter tire that is a cylinder and piston. Earlier we used to have kerosene stores and we used to have a crude reciprocating pump for pulling out kerosene that is a cylinder and piston so one should give them illustrations of situations which are as near our situations are possible but that is possible only when you start solving problems and by including such problems like guns and particularly when it comes to open systems we will have large number of real life problems but when it comes to basic development we have to consider ideal and semi-ideal situations and it is difficult for a few students and perhaps even a few faculty members to link physics with reality but I appreciate your concern over to you. Thank you sir. One more suggestion I want from you what type of industrial tools means to which industries we should organize to so that at least a student feel that thermodynamics is really very much needed at present to develop the interest on at present to develop the interest of students in thermodynamics we say them that it is important important from competitions point of view like gate and Indian engineering services but what I feel is that if some type of industrial tools can be conducted at the starting of thermodynamic course so which industry we should visit. Okay you do not really have to go to industry a few years ago I took a tour of a few students just around the campus if you take them to your hydraulic slab particularly as you teach them open thermodynamic systems where you talks of pumps turbines blowers compressors in your hydraulic slab you have enough of these illustrations the second stop should be the central air conditioning plant now in central air conditioning plant you have compressors you have pumps you have fans you have heat exchangers and mark and show each one of them and on a pad or on a notebook show each one of them and sketch out the corresponding open system show the inlet outlet the flows and streams as they go in generally when we teach thermodynamics the students have to some extent learn part of fluid mechanics sometimes so fluid mechanics they are able to appreciate but do not go into the details of heat exchanger because heat transfer is a subject which I think almost invariably follows thermodynamics in our scheme of teaching but if you have a reasonably laid out and equipped campus I think in the campus itself you have good number of illustrations which you can show to students of thermodynamics but remember just do not take them there before going to taking them to that place go there yourself find out what the systems are sketch out some things inlet outlet flows etc and then take the students there we have to do some homework before we take the students and over and out let me go to some other centre now 1210 Gokte Institute Udhyambakarnataka over to you good afternoon professor so this is Guru Raj I am asking a question about the first law sir during the first session throughout the session I have not heard anything called as a conservation of the energy is the first law does not other the name of the first law is the conservation of energy even not a single word I heard about it I agree with you and but you should also agree with me that we have developed first law and we have solved number of problems without talking of conservation of energy now conservation is a very very common word and conservation of energy means conservation of X means generally means like for example conservation of mass the traditional Newtonian thing says conservation of mass means mass cannot be created mass cannot be destroyed and if a system changes it mass or if you find that a system has changed its mass if it has increased that means mass from outside the system must have come in and if it has decreased that means mass from within the system must have been extracted or must have flowed out or moved out of the system. Our first law we can say is a conservation of energy but if you really want to look at it is remember that we have Q equals delta E plus W conservation of energy would essentially mean delta E equals 0 just the way for a closed system conservation of mass would mean delta M equals 0 but now if you want to have delta E equals 0 that means what you would have to say is if system is isolated then this implies no interaction W is 0 Q is 0 and that implies delta E equals 0 and then that in traditional physics would mean conservation of energy is implied but it essentially is for isolated system. In fact the conservation of energy even in physics is a idea which is somehow enforced because if you consider mechanics or if you consider the field theory in physics they always have so called a conservative force field and a non-conservative force field. There are conservative forces like gravitation there are non-conservative forces like friction. They say conservative forces like gravitation because if you go along a loop Fds in a gravitational force field would be 0 but if friction is present F into the appropriate displacement across friction will not be 0. We consider that friction now to be an interaction so all that we say is turning this equation around we can say is delta E is Q minus W. This is another form in which first law will often be written nothing wrong in it it is just a transposition of terms and that means is if there is a change in energy that is because of input of energy in the form of either heat or extraction of energy in the form of W. You can argue that it represents conservation of energy but you need not even talk about conservation of energy but it was a good question because I generally do not use the word conservation of energy or conservation of entropy or conservation of mass but it is common and we will use it when it comes to open thermodynamic systems. But when I thought or when I discuss first law I think perhaps by design or on purpose I do not use the word conservation of energy because there is no need to over to you. Sir, another question. So, I hope by the last session the first law is I have not seen anything called as a PMM one so far. Because those are things which needs for the second law sir. Even in second law we do not have a PMM and I will not be talking of any PMM1 or PMM2. These are all interpretations of terms used by other people. Sir, my question is general sorry to interrupt you sir. Generally in any of the syllabus of the any of the university in India the PMM1 and PMM2 are the integrated part of the syllabus. That is I am a bit upset here it is integrated part because it has been decided to keep it there for the last 100 years. It is not an integrated part of an IIT Bombay or any other IIT thermodynamics thing. Just because it was there in 1857 does not mean it has to be there in 1957 and it does not mean it has to be in 2012. If you just want to do copy and paste as somebody did yesterday in the Moodle discussion even to Wikipedia and just cut some five lines and put it in the Moodle. And I shouted at him saying this is plagiarism. So essentially talking about PMM1 and PMM2 is not plagiarism but that is I would say that is resistance to change. And what I propose is if you have understood your first law properly then archaic concepts like PMM1 and PMM2 you should be able to take in your strike. And if you believe that look those are archaic concepts and we need not talk about it anymore. You know influence your nearest members of your committees or board of studies to rewrite your thermodynamics. Why are you using 100 year old terms? Why are we not discussing caloric theory in thermodynamics anymore? Because it is considered no need to talk about it. So I think I should go to some other centre over and out. 1144 KCB Technical Academic Indoor, over to you. Sir my question is that as we know that Cp upon Cv is equals to gamma. And why is that the function of temperature? Okay, gamma is defined as the question is why Cp by Cv is gamma? Now again there are many parameters and combinations in thermodynamics which come up again and again, thermodynamics and related downstream fields. For example in compressible flow perhaps the most common symbol you will be using perhaps is gamma apart from the normal English letters. So the ratio of Cp to Cv turns up so often in thermodynamics and many other related branches of physics and engineering that it is useful for us to shorten it to a symbol like gamma. Just the way the partial derivative du by dt at constant volume comes up so often that we have started using Cv as a short form for that or even h means u plus pv. Why it comes so often? We will see when we come to open thermodynamic systems. Now for Cp and Cv will be functions of temperature and may be some other parameter for a general gas but so this will be in general Cp of say temperature and volume, Cv of temperature and volume and this implies gamma is a function of temperature and volume. This is general for an ideal gas again gamma is Cp by Cv but Cp is a function only of temperature Cv is a function only of temperature this implies gamma is a function of temperature. For an ideal gas with constant specific heats well gamma will simply be which is defined as Cp by Cv but since all the specific heats are constant this will turn out to be that set. Remember that many of our expressions for example an ideal for an adiabatic process quasi-static only pdv were to be done for an ideal gas only when it is constant specific heats that we can write it as pv raise to gamma is constant. If the specific heats are not constant we cannot integrate it out straight away assuming gamma to be a constant and get an expression in this closed form over to you. Sir is it possible that Cp and Cv both are the function of temperature but gamma is not a function of temperature. Is it any there any case in which it is possible? See that will be I do not know whether it will be possible because you know even if you consider a gamma even if you consider an ideal gas but non-constant specific heats Cp is Cv plus R so if you expand it like that this becomes gamma becomes 1 plus Cv by R so the moment Cv is a function of temperature gamma will be a function of temperature and when Cp and Cv become functions of temperature and temperature and something else then gamma does not remain constant and if gamma is not constant well its importance sort of reduces because we cannot we are unable to get closed form expressions in terms of gamma. See we feel gamma is important because we quite often even in gas dynamics assume that Cp and Cv are reasonable constants or can be replaced by their average values over a range and then treat their ratio as gamma constant value and go ahead with it. The advantage of using it is under certain simplifying assumptions you can get closed form expressions that is the only advantage of gamma otherwise there is nothing special about gamma. Over to you. In some book it is explained that Cp and Cv are linearly dependent on temperature. Is there only linear dependency on temperature? Nothing see the thermodynamics does not say how a property should behave. Later on when we say 2 days later when we derive property relations it will be clear that thermodynamics will never dictate the value of a property. At most it will say that if property X varies like this property Y with respect to something else has to vary like that. It restricts the variation of property with respect to each other but it will thermodynamics will never say that Cp will have to be a linear function of temperature or anything like that. It so happens that for most of our gases and fluids of common occurrence over a reasonable range over temperatures which we come across that means a few bars of pressure or maybe a few tens of bars temperatures going from maybe minus 50 to plus 200. Most of these variations are slow enough for us to be able to modulate them as linear. But there are situations for example if you go to high pressure water, supercritical water the Cp and Cv values they vary in a maddening fashion. Again assumptions are linearity or approximations which we invoke to be able to do our mathematics and calculus in a similar way. Otherwise there is nothing special about linearity. Over to you. Sir gamma is Cp upon Cv. Mathematically we can also write gamma equal to del H upon del U. What does it mean sir? Over to you. What does gamma have to do with partial of H with respect to U? The definition of gamma is Cp divided by Cv. If you want you can expand it. Cp is partial of H with respect to temperature at constant pressure and Cv is partial of U with respect to temperature at constant volume. But the two derivatives are under two different circumstances. If you want to derive it further you will have to go through the complicated property relation. Do not ever think that gamma is the ratio of delta H to delta U or anything like that. Thank you.


Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you what is the difference between malloc and calloc functions available for dynamic memory location in C programming. So first I will be demonstrating the use of malloc, then I will be comparing it with calloc so that you can understand the difference. Before starting, you can note my information. You can connect with me by following these details which are available in front of you. You can open my YouTube channel by searching my name in YouTube search that is Sanjay Gupta. My channel will be available there. You can open it. Here various programming related playlists are available. You can improve your programming skills by watching these videos which are available in different playlists. You can follow my YouTube channel by subscribing it by clicking on this subscribe button. Do subscribe my YouTube channel so that you can follow me. Now I am going to implement first malloc function. Then I will be implementing calloc. So for these functions, I have to include two header files. First is stdio.h and then stdlib.h. Now I am going to define main function here. First I have to declare a pointer p then n and then i variable. Now I have to receive size of memory blocks from user. So I am going to print the message enter size on console then to receive that size from user I am writing scanf. So scanf will read that size and that will be stored inside n variable. Now for memory location, I am calling first malloc. So this is the implementation of malloc function and this is for dynamic memory allocation. So malloc is function which I have called here I have passed n into size of n. So n is number of blocks and size of n means size of each block which will be allocated through malloc. So this multiplication value will be passed in malloc. So malloc will create a memory block whose address or you can say base address will be returned. That will be typecasted into integer pointer through this return type and then that will be stored inside p. So p will be containing base address of the allocated memory block. Now malloc after allocation of memory fills garbage values in each block that is allocated through it. So now I am using printf statement first to display the message elements are so this message will be displayed on console. Now with the help of this loop, I am going to display the elements that will be allocated. Sorry, I will be displaying displaying the memory blocks which is allocated through malloc. So each memory block will be containing garbage value. So that will be displayed for that purpose. I am using printf function and notation asterisk p plus I so p is containing base address. I have added I into it so that it can move to different different locations available in that memory block and asterisk will be de referencing each block so that value can be displayed on console. And after this for loop I can call free function. So free is for dynamic memory de allocation and then return zero. So now I am going to execute this code. It is asking size. So I am entering seven. You can see the output. It is showing garbage values on console seven times only because seven blocks are created. So this is the use of malloc. Now I can convert it into caloc. So instead of malloc, I am using caloc and in caloc, we have to pass two arguments and then comma size of it. So first in malloc, it was only one argument with the help of multiplication sign. Now in caloc, you have to pass two arguments and rest of the code will remain same. But caloc automatically initializes zero in each block of that memory block. Now I am again executing this code. Again, I am entering seven is size. You can see the output. All blocks are printing zero as output. So friends, this is the difference between malloc and caloc.  But in case of caloc, all blocks fills with zero value. So this way, I hope you have understood the difference between caloc and malloc. And also I have used free function to free the dynamically allocated memory so that it can be used by any other application after get freed. So this is all about caloc and malloc. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel. That is Sanjay Gupta underscore tech school. You can download my programming app Techimus that is available on Google Play. Thank you for watching this video.


امام جاعة فارر ابن محمد صادق من أبي الذي قلت when the noble prophet had completed his morning prayers he would continue to face the qiblah until the sunrise at this time امير المؤمنين امام علي would come forward and sit behind him and everyone would come and gather up behind him because they know after jama'at that Allah will be doing a few of the ad'ayah and they obviously want to see the du'as from no man better than him so they just hold that behind him and he used to supplicate the du'as and stuff like that there are many narrations that once that happens and once the companions actually sit behind them before they even left the jama'at so it's a very beautiful du'a the words are quite simple I mean the meaning of it it's just our Allah I seek protection from you from grief and sorrow weakness and laziness mizziness and cowardness turning away from the truth and idle talk of men wasting time and negligence so basically is Allah or Allah I ask you from anything negative to be pushed away from me so I wanted to protect my eyes and what they see my ears and what they hear my mouth and what it says and my actions and what it does اللهم إني أعوذ بك من الهمي والحوز والعجزي والك والبخلي وضل عديني وغلبتي وبواري والذلتي والقصوة والعيلة بذبك من نفسي لا تشبه ومن قلبه ومن عينه ومن صلاته من امرأته تشيبني قبل أوان مشه من صاحبه يأتان أفشه تجعل لي فا


Everybody for a syrup in 2023 gold standard case number one 12 box full case number one random team style Find the results on your screen anytime a late sports cards calm. Let's go ahead and get started. Let's do it Come on double eagle. Let's go Links and chat as well if you want to see the results there Yeah, just follow us tonight guys Just follow us trying to get that filled up. If you don't get a fill it tonight. It'll go tomorrow Good ground on it plus it's gold pack for spots about 60 to 60 to 80 bucks a pack I would say I Just I just like how that's how that sits. Look at this. This is good. I like that Next year gold standard release. I'm dressing up as a prospector. Yo 70 Sam out here He's not prospector, but but still Number to 75 is Derek Henry for the Titans Starting off as an opulence rookie for the Giants Jalen Hyatt to 24 My start my start there's an SP right off the rip Giants, there you go Jalen Ramsey patch card to 49 gold gear for the Dolphins Hendon Hooker rookie Jersey card at 399 for the Lions the first we've seen of him tonight actually which is very strange Detroit Bunch of soul notification on eBay. What is going on go away? Good news, I guess but Motherloader Jersey card at 299 for the Bengals at Jamar Chase saying how you doing? Whoa, what is that next one? Yo might as touch auto Michael Vick to 99 It's like Like I'm watching Winnie the poot.  There's an SP.  What if they're gonna do a Origins this year because origins is normally out before this this stuff. I think 75 out Pierce Colts Rookie to 99 will Anderson junior Texans.  I'd say Will Anderson junior rookie Jersey to 399 for the Texans Browns goldmine patch card two of 24 Nick Chubb We start talking about that that card here comes again Dorsey Levin's might as touch auto to 49 Packers and Lions rookie auto Sam LaPorta to 199 So again, it's just a follow us tonight. Personals are all full got quite a few in a queue She for now it'll go tomorrow night after group breaks at least I'm like pretty sure it will There's a chance to go tonight, but I I really doubt it hurts the 24 Eagles To 49 is Deontay banks Giants rookie Malcolm Rodriguez patch to 49 Lions goldmine Jackson Smith and jigba Ricky Jersey to 399 Seattle newly minted. Oh, we have flawless basketball remaining Flawless basketball Gold pack for spot on the two white gold Jags Jersey Trevor Lawrence at 299 Packers good as gold Jersey auto to 199 is AJ Dylan and Saint to Jake Hainer rookie Jersey auto out of 149 Told Shane. I'd do my best again. We get here. I see like Michael Wilson 101 to 99 Mack Jones Patriots 24 rookie Michael Mayer Raiders That is a Pacheco Jersey to 299 for the Chiefs Bryce young rookie Jersey to 399 Panthers Raiders here. You've got a gold rush Jersey to 299 Devontae Adams Gold fingers auto four of 10 is TJ Hawkinson Vikings Minnesota and a Chase Brown rookie Jersey auto bangles to 199. Come on Colorado. Let's go Yes, never done the goal line That is AJ Dylan a 75 the Packers with a Clayton to rookie to 99 Zona Miles Garrett patch to 24 for Cleveland Yeah, the assets a ones are really sick That's embedded the fourth rookie Jersey to 399 for the Rams It's a good like the good stuff to kind of like collect because they don't go for like super big premiums a lot of them So if you like obviously like the big names will if you get like a big quarterback or like a Jerry Rice like that it will but Some of the other ones just you know Not gonna pay a huge premium on because not flawless or like NT or IMAC Austin Eckler Jersey Carter to 299 for the Chargers Problem being Patriots fan is like all their stuff is expensive too. Yeah. Oh, this guy's pretty good too I forgot I forgot about him Marta Mapu rookie out of the 49 for the Patriots. He's pretty solid Patriots and Marvin Mims rookie Jersey auto Broncos to 149. It's a penny national VIP gold pack So they give him out Like if you go to the national VIP party you get a box It is self like 12k the box itself that's under 50 gold packs Like a one-of-one like they're not one of one like a gems box some other stuff Yeah, they have Autos they have different parallels or just chrome. They're kind of look kind of like Prismal most But you can hit like women Yama. You can hit like, you know, it's multi-sport. So it's everything that pinning he does wrestling UFC basketball baseball football It's a 49 zero waller out of 99 is Ricky G. Jartavius Martin commanders Skymore Jersey to 299 for the Chiefs Raiders newly minted rookie patch of 24 Tyree Wilson. They suffer about 60 to 80 bucks As I guess as I got a single pack Tyree killed Jersey Carter to 99 is Dolphins Gold Rush DJ Turner rookie autograph to one 99 bangles And a Jalen Hyatt's seven of ten rookie patch auto giants Giants have done very well Hyatt is like their chase like is like the one player that they You're really looking for I guess Slim chance, but they've gotten the op-ed not yet opulence and a low-numbered RPA here Halfway now don't forget guys 10 a.m. Start time with Jake and Kyle over on fanatics live Well, we're coming University pick your team all day To 75 a sauce gardener jets and the 99 is Ricky Garrett Williams for the Cardinals There's the promo going where I believe it's this the Saturday Saturday standouts you get a Saturday standouts super fractor I think the entire break is free for everybody that's in it So I remember seeing white gold Jersey Zach Erz to 299 for the Cardinals Plus, yeah, it's pick your school pick your team pick your school.  You're just looking for Florida State Ole Miss whatever it may be By that skip the letter part Austin Echler motherload Jersey card to 299 Chargers Patriots again, Rookie Otto Chad Ryland out of 24 Chiefs Rookie Otto Felix Ando D. K. Ozama 38 of 49 and Packers Ricky Jersey Otto Sean Clifford to 199 Solid here for the Packers. This market's decent He's solid you top of tomorrow as well. It's a 99 Joe Burrow bangles 75 Ricky Emmanuel Forbes commanders Pops up you out the dry man Saw Skarner five-way patch card at 24 for the Jets motherload I'm on Ross St. Brown patch to 10 for the Lions gold gear. He's back, right? 12 out of the field Colorado. Come on Got a redemption tank down rookie Jersey Otto triple Texans No shields yet. No Michael Strayhan golden oldies Otto one of ten for the Giants Giants hit Sean Clifford Rookie Otto to 199 Packers Packers doing well also a lot of stuff in the way the TV aren't in there. Yeah You need to get that thing mouse like right there Yeah, it makes sense because they'd be done by 21 if they got it. I'm gonna get it. You got it Dude get across the goal line. What are you doing? No, I was traveling Trade Tucker Rookie to 14 for the Raiders and Burrow to 49 bangles. How did he not? Oh, maybe he got hurt. That's why I broke his arm or something. He got hit right there Skymore Jersey to 299 Chiefs Right here right here. He gets it. You took a shot to the same place twice Yeah, I feel I don't know. I feel like the first one you probably should have tried to make a miss rather than like Try to go over room Sam LaPorta rookie Jersey to 399 Lions, I don't know. I Wouldn't have made it. I Would have a not I probably would not have caught the ball your Lions. You got a to a tongue of a Loa Dolphins mother load Jersey to 299 We do need to hit a shield though Tucker Kraft rookie Otto Raiders to 199 and Quentin Johnston Wow dual Patrick you out of the 49 Chargers. That's a cool looking one Chargers moving along here a few more boxes Rookie to 24 Nolan Smith Eagles the Mack Jones number to 99 Number 99 Darren Waller Jersey to 299 Giants Zach Charbonnet rookie Jersey to 399 for the Seahawks 49ers Brock Purdy Goldgear Jersey to 299 Bears rookie Otto Tyler Scott to 199 and Golden Dave use auto five of ten Chiefs for a she rice He actually scored a touchdown in his debut Nice rushy rice nice rice Chiefs solid hit good stuff number to ten two more boxes. Let's go. Let's go Got the business case after this and then We're still trying to get flawless filled if we don't get a fill tonight. It'll go tomorrow guys Rookie to 24 rushy rice Going to the Chiefs out of 75 as Nick Chubb Browns Brown's patch to 299 Amari Cooper Jaden Reed rookie Jersey to 999 or 399 excuse me hackers Justin Fields gold gear Jersey to 299 Bears Alec Pierce good as gold patch Otto to a 49 Colts And I can't stop hitting Rishi rice now. We can't stop to 149 triple Jersey rookie Otto Chiefs Rishi rice. Let's see what should I can do now shoulder Maybe I'll buy a Colorado rookie to 30 is Christians all his Patriots 75 is K-Dot and Bucks White gold Jersey Zach earth to 299 for the Cardinals Anthony Richardson rookie Jersey to 399 Colts newly minted White gold Jersey Devonte Adams to 299 for the Raiders Ram is Byron young rookie Otto to 24 and Titans rookie Otto to 199 Taijai Spears. Give me a moment Not the best case Started off super hot start with SP's and relics the opulence of Jalen Hyatt's Relics of Bryce young Smith and Jigba Waller Reed Fields Cooper Hill Echler Purdy Charbonnet La Porta Bennett Devonte Adams Isaiah Pacheco will Anderson Anthony Richardson Devonte Adams Hendon Hooker That was Jamar Chase Isaiah Pacheco To a tongue of my loa Malcolm Rodriguez Skymore Zach Erts Skymore almond Ross ain't brown to 10 saw scarter to 24 Echler Erts Tyree Wilson at 24 chubbed the 24 year at 24 Trevor Lawrence and Jalen Ramsey numbered to 49 Autos in a Texans Redemption Tank Dell rookie Jersey Otto triple Byron young Taijai Spears Sean Clifford Felix on a DK Ozoma Tyler Scott Chad Rylans DJ Turner Tucker crafts Marta Mappu Sam La Porta Jake Hainer Rishi Rice Michael Strahan Marvin Mims Chase Brown Sean Clifford Dorsey leavens Michael Vic Rishi Rice AJ Dylan Alec Pierce TJ Hawkinson Quentin Johnston Jalen Hyatt to 10 and Anthony Richardson to 199 Thanks again everybody moving on now to full case number two


Hello people! Oh, I hit my head! Hello people of Beeps and that my name is Johnny and welcome back to Ferti's Pizzeria! I'm fortunate enough to be recording this right after episode one lovely blue bunny right here bonding bunny, and now lovely chicken and this handsome looking fox! So, what's a load game? Slot one, level three and let us... Hey, that looked like the characters in Petscop! What a great reference! Uh, we saw from Slot the last episode and now we just saw Petscop, right? That's incredible! Hey, what's going on over here? Y'all, seems to be like our newest private beholder by his... This is Snake Pink for the Ultimate Custom Night Voices episode, which by the way I was about to say it's coming soon but I haven't even gotten close to recording it Oh, are you two... Oh, are you there? TV, welcome to Ferti Fazbear's Land O' Pizza! Uh, well, thank you My name is actually... Chica's voice! Right, um... I don't even want to attempt it, so I'm just gonna... Because I know the second I try to do a hype, it's just gonna go right down that hill you know? It's like that snowball effect It's gonna start off really, really bad and it's just gonna keep getting worse and I'll give it an attempt! Gonna be extremely embarrassed but whatever, and now I've hyped it up for too much Nope, I don't even want to try it Hey, hey, hot stuff You're the new Pizza Tender phone guy told us about, right? Uh, yes, he told me you guys would come Yay, I can't believe we get to work with such a hardy-surfing as Pizza Wait, this is the best thing ever? You know what, I'm gonna do, um... Felix's... Edgar's voice You look the part of a good cook of a good cook But sure, you be up to the cooking standards of old fans, remember? I can certainly try Got anything in mind for your order? Ha! Oh, Chica's enthusiasm Oh, oh, do me, do me first I'm starving Gata, gata to me Alright, well, what can I get you? Hmm, don't know I just wish I could turn voice to Chica Don't expect it to be consistent You don't know?  I sure would like some advice Bored lads or loves to be upgrade to Chica Get her something from our menu that'll make her happy That to be enough to satisfy her Happy pizza then Happy Type Pepperoni party, fishy business Gentle, giant, or fun guys Let's go with fun guys It really sounds like a rip-off of five guys early We found a Euro train wreck in the back alley one day This was the result Suffice to say, it's a marginal But awesome, ingredients Three cheese, two tomatoes One, two, three One, two tomatoes Five mushrooms One, two, three, four, five Three greenies One, two, three And then two Olives, yes Nope, that's onions One, two, that's exactly all I can hold Oil, oil Two, two, two, two, three And stop That doesn't look right I'm just gonna say that doesn't look right One, two, three One, two Five mushrooms, one, two, three Four, five Three greenies and then two olives One, two, three Two olives, one, two Oil One, two, three Is that it? That doesn't look right at all Yay Yatta That's it, hot stuff What? This'll do just nicely Glad you liked it Say, lad, how are you Spiced a little green bird flying around You side of the sea today What? Is he talking about? I can barely understand him Me bird, lad, that there That there old sea dog Is he running a rig on Captain Foxy Yesee I can't find him anywhere in this room On this here forsaken fortress Of cheese and chicken Me thinks he must be hooting Some air vent to the sky Just laugh at me self Like I'd be some kind of friend Either that there or He'd be actually lost In case me then, I must find him at once So are you looking for a bird Or just me bird What could he for? Definitely bird, rat Foxy's talking about his parrot Bloody hot snubs We've been looking for him all day Did you happen to see him? Oh no not really, I only got here Two hours ago Wait, is this parrot an actual living parrot Or another robot like you guys Completely real Foxy adopted birdie after phone guy left the back door Of the restaurant open for one night The little dude just snuck in and started eating all the olives He got a bit sick afterwards Oh my god, what's wrong with you But Foxy just Oh that's your natural icon It looked like you were like Believing Foxy just took him and noticed him In fact he'll fall ill for no time Now you be one of them Outside performances anyway Yay, yada We aren't really allowed to perform alongside A wild animal on stage Or at least phone guy says so Dog got a brilliant idea Can you cook me one succulent treat To bait me bird to come out hiding Bait, you mean Bait? Bait you mean, I mean sure Which one do you have in mind Me mate likes the green demon Then he's a lot He'd probably get something Failed to the bone So something green and filled with vegetables Got it Something green and filled with vegetables We'll bottom No, flavor Something green and Green Green Green face Oh god Green and vegetables Yellow, no G What's green face I think that was the one I looked at Gentle giant Six cheese, four tomatoes, three mushrooms I think I'm gonna go with the other one Green face Two cheese, three tomatoes, three mushrooms, five greenies One olive and one onion One, two Ooh, we could try and make it big But we'll do that afterwards If we have enough One, two, three tomato One, two, three mushroom Five greenies One, two, three, four, five One olive And one onion Can we fit more? We can, one onion One olive, five more greenies One, two, three Five Sorry, what am I doing? Three, one, two Three, three tomatoes And two cheese Three instant cheese Fits perfectly One, two, three That's beets lad This here be the perfect bait For such a scurvy and sneaky bird I'll just be off For a moment to place this right here Where it needs to be, be right there Holy And there we go Hey hats lad, let me ask you Why do you want to walk in this place anyways? Me?  No reason You just look A bit familiar I guess If you don't want to say why that's funny We can just talk about it Something else, like what? Well, what do you think of Phone Guy? You've been talking with him a lot right? What's your impression of him? Phoney, well he's cool I guess A bit of a tight kind of He's a stotus, a bit He's not really annoying, he's a Well I mean, he has a phone for a head Let me know I didn't say that though Maybe in a different way Guy has a Gigantic red phone In place of the head It's not even like One of those new smarty Pantsy phones That you've got to touch the screen to play around with It's like a really old one Do they even make those anymore?  Isn't this a family Friendly restaurant? Yeah sure it is But anyone who comes here nowadays Swear it's like a sailor themselves As long as you don't do it in front of a phone face It'll be alright Except well Also don't swear in front of children Of course Who knows, one might eventually Happen to wander around Keep your eyes open Sure, I'll keep that in mind Speaking of sailors I see Foxy coming around this door now I love this game But one thing I wish it has A wish it had was a multiple choice So it's like You know, oh let's change the subject What do you want to talk about? Family, career I wish it had that Yo ho ho What to be the topic of conversation You lot to be engaged in Under a while I've been away Oh nothing much We were just wondering why home has a phone Anything about that? No anything about that? Er G.I. have noticed that their Supervision of ours does have A mighty jolly look Even for a walk and talk With a hook and an app At That there does look kind of I once tried to ask Him about it Directly to myself But to the scurvy dog Be as delicate as I see Maybe just Change the topic to something Ridiculous like oh I've been Responsible for the little paper boats That they clog in the bathroom sink Yeah sure you didn't Though I'd be guessing If he was Closed by a holy creature of the sea To have a piece of plastic and see Heads full of western technology He'd be pretty touchy about it as well There you have it Stop calling it that Some of us really Know what's up with the phone guy Oh well it's not like I'm dying to know answers Hey you'll finish with your pizza Would you like another one? Eee another one Well uh yeah why not Yeah just Foxy let me share it with you We can order one launch for the both of us And we can trust in yourself Yeah I'm sure right now What's in you mind last Oh oh something spicy Something big and spicy I want to try a big spicy Something big and spicy Coming up then Big and spicy type Um Why is there not one food spicy Uh oh heat George oh that's how it gets spicy Gotcha So For those that wish to eat a flesh of it Maybe we don't do that one Green face no yellow demon So even the absolute monsters Can have something to eat in our menu What does that mean Fishy business Gentle giant I'm guessing spicy means charged So I'm going to go with Um yellow demon Devil because why not it's charged And it needs to be big So six cheese one two three Four five six Two tomatoes one two Three four Four ham There it is One two three four Five six seven Here we go and then six pineapples Like twelve I got this One two three four Five six seven Three Enough This So We can't do that Ah shoot Alright so we need to find one that's simple That's sixteen cheese You can't do that Three uh Let's see six Ten Twenty Six twenty eight there we go we can do that one Three cheese Three four five six Two tomatoes one two One two five mushrooms One two three Four five one two Three four five Three greenies and two olives One two three One two three Two olives one two one two So charge And that's it One two three Four three four five mushrooms I can just go until it's full That's five one two three four Five three greenies and two olives Dot Cook it one two I don't get this Do we need something Hey you can't do that many ice Or can you Sixteen Two I mean Enjoy Slightly confused Twenty mode Uh That's funny Pizza sandwich I get it Oh that's a line from pizza sandwich Let's give us good references Alright I'm gonna find a pizza that walks And I will be right Back So it's been all about two seconds And I just decided hey why don't I try Sorting my flavor I found spicy This is the one I This is the one I had One two three One two three One two Two at least I think this is the one I had Oh no it's not Two all no three greenies One three greenies Two olives one two One two Two onions Oh come on And then six ice Charged oil and then also Can I find the thing again I'm so confused Comedy Special I guess I can't even do that one Mosh pit That one's impossible so it has to be Trainwreck I mean that's funny but I don't Get this one two three Six One two three greenies No six Two olives Two onions And then ice One Oil charged I actually am super confused Right now I'm just going to keep losing money Spicy Are you freaking kidding me That's what it means by burnt I thought you had to wait more than Three seconds Freaking mad right now I love so much money because of that Oh man this one looks like a mess I wonder what it says One way to find out A couple lots of places to be around here you see We'll catch up later After pretty some talking with you With your hot stuff so And so if you're around Oh well time to take a break I guess Trusty, trusty phony Phone please don't run out of batteries on me It's four Let's save And we're going on to level four now Alright then Eggheads What Time to compete and change lives I meet what I should probably just try to Just quite smell of rotten crock Wait then They didn't walk on this crock Well welcome I welcome a yellow devil then That's a great cameo by the way Yeah they are Walking on their other Here you go Nixon Ah yes this would do just nice Sweet and salty things can mix well together And it's not like you are You have to put the thing in the oven first But it's still food But tomatoes are also, I see how it is You don't have to subject yourself By its cover much Heck yeah I am If that book's cover says something like this book What if you actually do it Then that book should have had a better Fruits cover something that just doesn't make me Me or Theo is a dude But he stopped coming after the god Hey as long as the people get 6x 100 Are the newest models to apologize I just got excited Fries, lasagna, ice cream, soda And even sometimes they are Also much less bulky I just don't get the hell you can Keep such a little technology it doesn't even have The second bring it up to my bar I like healthy things I guess I also do it although I'm more interested in the software and operating system There was this one that could track you It's supposed to just Yeah it's supposed to just be for fun I gained a following though Since not many people distributed Despite a quite silly mod It was very serious Friday fell off stage And even after getting out For a very long time between couple of people Or Theo now He kind of puts in closure He does draw on apologize His name? Oh I don't know We can hear you do that score It's a bandana One Two Onions I'll see you again tomorrow Back again I want your money Well that turned out Direct Doggo right here It's a dog I did look at his abilities By your eyes Look at these best pizza Comedy specials Why did you give that dog He was asking for something Employee that's a dog It's five already Oh no I don't even Try preparing your station Make a good impression Well I suppose Alright then let's save And that is going to be it The final showdown That will be next episode Episode 3 episode Here we go Nope we are going to quit And we are going to end it here Thanks for watching Hope you guys enjoyed There was a lot of cool cameos We got Nixon The creator of a lot of games That he made Gory creation I was the one that made Who made one I know he made Gory creation There was Amiel who made the candy series Direct Doggo Pretty cool


Welcome folks, we have the Dow Industries down 205, NASDAQ is up 55, S&Ps are down 13, Gold Contract up $14, trading $17.18 an ounce, we have Silver down 13 cents, $17.75 an ounce, LightSuite crewed up 86 cents, $39.05 a barrel, notes and bonds. We've got the 10-year right now up 13 ticks, trading $137.23, the 30-year is up a point and a half at $174.10 and $Kingdala, $Kingdala is down 277 ticks, trading $96.340, the Euro is at $113, the yen is at $107.75 and the British pound is at $127 to one the U.S. dollar. But get over to the NDX100 folks, it's pretty amazing what we have out here. So the NDX has hit $10,005 this morning and inside that NDX, the big move is out here, it's about as large as you can get too. You get Apple right now, major breakout, up $10.32, Amazon, same set-up, Amazon is up $92 when you talk about a major breakout. So you get a breakout or a breakdown folks, a major breakout is you get overall the highs after basically a consolidation and then you just really fly away from those highs and that's what both Amazon as well as Apple has done. If we go take a look at Microsoft out here, Microsoft does have a high volume high, you're up a buck 68, you're trading $190.05, that thing wants to get $190.70, oh my god it hit it. So check it out, that actually hit it right to the tee, this is pretty amazing actually.  If we take a look at what's taken away from the NDX, you get United down 8.5%, you get Expedia up 5%, Marriott's up 5% and Fox is off 4%. Stay right there folks, come right back, next 60 minutes of trading, we're wrapping this day up down, down right now, down to 16, NASDAQ is up 52, S&Ps are up 14, come right back.


All right, welcome back to one week before your operating system's final. Isn't that scary? So, lab six, I told Satau to start marking them ahead of time so that if you're done, you get your mark back, you know you're done, you don't have anything to worry about for the week leading up to it. So, ask away, otherwise you know, watch the YouTube recording. So, anything we want to particularly go over, otherwise we can just go over final questions ahead of request from, to do our midterm virtual memory question. Any preferences to what I do? So, spoke up first, so here let's quickly go over our virtual memory question. So, system page size of 64 kilobytes. Here I told you what the size of one kilobyte is in powers of two, just in case you forgot. So this is, whoops, that's a big one. This is two to the six, so two to the six times two to the ten is two to the sixteen. So that is our page size, PTE size is sixteen bytes, which is two to the four. So system supports a giant physical address, so that relates to how big our page table entry size needs to be, so that's why it's sixteen bytes. Here are some truncated page tables, so that just means I don't show you all the entries, just the first few, and I show you below then first question. How many page table entries can you fit in a single page? Well page size divided by PTE size. So, two to the fourteen divided by two to the four, that's two to the twelve, right? Two to the twelve, two to the sixteen, sorry, two to the sixteen divided by two to the four, two may fours. So, two to the twelve, good on that. Alright, so if we only have a single level page table that fits on a page, what is the maximum size of bits of the virtual address we can support? Well, it would be VPN, it's always VPN and then offset. If we only have a single level of page table, well then guess what? We just have like a whole L zero here. And the number of bits we need to, for our index is essentially two to the what power is how many entries I can fit on a page, so that's how many things I have to index in my page table. So, this would be twelve bits and this would be sixteen bits because of the page size. So, if I add them together, well then that is twenty-eight. Right. Alright, so then for the system with a single level page table, assume the root is at PPN A, which means remember the physical address always looks like this as well. So, PPN offset, so in this case, well if it starts at paid PPN A, that means this is A and it fills the entire page so that offset can be any number because, well the whole page table fits on that. So, if we were to draw or to note the starting address of that, we would start at address zero, just like for arrays it all starts at index zero. So, in this case we have a sixteen bit offset, so that's three hex zeros. So, it would start at address A 000. So, if we try to translate this address where this is the virtual page number and this is the offset, then while we don't have to translate the offset and this is where we would look up our L zero index in this case. So, we would look it up at index one, so the page table at A 000 is this one and then what is that index one, well it's this. So, we would get, see that it is valid, so we can use it for translation and the PPN is E, so that is our final translation. We just take the VPN, replace it with the PPN which is E and then keep the offset the same as 777. Good so far, all right. So, same setup above except I'm using the virtual address this. So, all that changes is this which is the L zero index, otherwise it's exactly the same. So, if I try and translate that address, same thing I go to the same page table and I look at index two, oh guess what, it's valid bit is zero, so I can't use it to translation, I'd get a page fault and in my program I'd probably seg fault or something like that. So, I would seg fault at that because the valid bit is zero. So, still good, still with me. All right, next one. So, we do this with two levels of page table, same thing, each one fits on a page, maximum size of virtual address. So, now we have L zero, L one and then our offset. So, this is still 16 bits, this is now 12 and this is 12 as well. So, we just add them all up together. So, then if we do that we get 40 bits, right? All right, so now for that page table with the two level page table, assume the root page table of process 100 is ppnb. So, that means it starts at address b-0-0-0-0. So, I'll just go draw it here. So, this is the L one page table for process 100 is this one. So, if we translate this address, 1-7777, what physical address do we get? Well, if we draw that all out and fill it with all the padding, everything has leading zeros. So, this 0-0-0 would be our L one index, then 0-0-1, then 7-777. 0 index and then offset. Well, my writing is getting bad. All right, so in this case I look at my L one index is 0. So, I go look at its page table, look at address, or sorry, index 0. That means the ppn is d and it is valid. So, that means L one's level zero page table starts over here. So, L zero for process 100 starts here. And if I go back and look, well, the L zero index was 1. So, the L zero index was 1 that corresponds to this entry. So, since it is in my L zero, that's the final ppn I use for that virtual address. So, it is 9 and it is valid. So, I would just substitute this whole VPN for the ppn, which I would get just 9 and then the offset 77777. Right, okay, that's the same system for question, yeah, all good so far. All right, then same system for question 24. Assume the root page table for process 101 is C. So, it would start over here, L one for process 101 is C. If we translate the virtual address 1, 2, and then that is the offset, what physical address do we get? So, our L one index is 1, our L zero index is 2, and our offset is 4789. So, in this case, if we look at the L one index, we get this. So, at index one, it says it's valid and says the ppn is at D. So, it turns out that the L zero for process 101 is also here. And then it also asks that we have to do the rest of the translation. So, the L zero index now is 2. So, we get to look at this one. So, it is currently not valid, so we would get a page fault. If it was valid, then our final address would be 82789. But it's invalid, so we have a page fault at our L zero lookup. All right, good, any questions about that? So, now it says, given our processes with the root page tables, are there any issues to make sure they have completely independent memory? Explain why or why not? Well, there is an issue because they're both sharing an L zero page table. So, if you allocated memory in one process, it'd be allocated in the other process. Like if it got a physical page for it, you could see it in the other process. They're sharing pages and since they're sharing the page tables, all their translations will be the same. So, if I tried to translate anything at address in process 100, if I tried to translate something with an L one index of zero and then in process 101, if I tried to translate anything with an L zero, oops, an L one index of the 001. Because those map to the same L one page table, or sorry, L zero page table, anything I put here, any memory that has the same L zero index in both of them will map to the same page. So, this, let's just make up a number, zero, zero. That maps to the same physical page because they use the same page table. So, it'll always map to the same physical page. As long as their indexes are the same. So, if I have this and like that, that also maps to the same physical page because it's using the same L zero page table. So, good, any questions about that? Yep, so the question is why did we say the system can support a 128 bit physical address? Because it wasn't even to trip you up, it was to justify the PTE size. The PTE size is 16 bytes, which is gigantic. So, the PTE, remember what two things does a PTE have to have in it? Yeah, physical page number permissions and the permission should at least be a valid bit. So, in that case, well, I needed, yeah, basically I wanted them all to have nice hex numbers. And I wanted to justify why the PTE size was so big. Because 16 bytes is equal to 128 bits and then my PPN would be equal to 128 minus the offset. So, 128 minus 16, which is whatever. So I'd need 112 bits for my PPN size. And then I have 16 left over for permissions and stuff like that, so it's actually justified. If I said that it supports 64 bit physical addresses and 16 or an 8 byte PTE size, then it'd be like, okay, that's too small, that's impossible. Which was a question before. All right, anything else we should do? If not, yeah. Locks and data races, all right, that's a good subject. Everyone's favorite. So, good lock question. That doesn't look like a lock. That doesn't look like a lock. Oh, that looks like a lock. All right, wanna do this one? Oops, here, I will give you some time to read it. And then we can see if we wanna do it or skip it. We wanna do it? All right, so code snippet, we have three threads then thread one locks mutex one and two, thread two locks mutex two and three, and thread three locks mutex three then one. So we only have three thread, three independent mutexes, and each thread executes a different function. So, first question says, identify and explain a deadlock condition that can occur in this program. Can this deadlock, sure, yeah, yeah, we have a circular weight, so we could have the case that thread one locks M1, I'll just write it shorthand, and then we execute thread two. It locks M2, then we execute thread three, and it locks M3. Now, in this case, no thread can proceed further. So thread one cannot proceed because it's trying to acquire mutex two, but thread two has mutex two, so it can't make any progress. Thread two is trying to acquire mutex three, but it can't get mutex three because thread three has it, so it can't make any progress. And then finally thread three, well, it's trying to get lock one. So thread one has lock one, it can't make any progress, no threads can make progress, therefore deadlock. Or if you wanna give this a name, this is a circular weight. All right, good, definitely have a deadlock, yep. No, yeah, if you didn't write it was a circular weight, you did not lose marks as long as you explained what the deadlock was. Generally, how I tell the TAs to grade is like, if they understood the concept, full points. They didn't, well, then use their judgment. So if you didn't have to say circular weight as long as I knew what you were getting at. All right, well, the next question says, propose a solution to avoid the deadlock and this code. Modify the code and describe your proposed solution. Briefly explains how it addresses the identified deadlock. All right, how would we fix this?  So you unlock whatever you gave up, so M1, wait, and then lock M1 again, and you do that for each of them. So you eliminate the whole hold and wait thing. So if I don't get both locks, I give up the first lock I got. What's another way to fix this that I can do in one line? Well, just swapping around two lines. A1c solution two, switch them both? Yeah, okay, if I only switch around thread three, then I also do not have a deadlock. Why don't I have a deadlock in that case? Yeah, well, they won't be fighting each other for a lock. I essentially eliminated the circular weight because I always acquire locks in the exact same order. So if I always acquire locks in the same order, I won't have the circular weight. The condition with the deadlock is lock three was held and tried to acquire lock one. So if I swap the order where I always get lock one first, I don't have a deadlock. No, just the order between all the mutexes. So I always acquire mutex one first, then always acquire mutex two second, and then always acquire mutex three third. And if one's missing, I don't have in that order. But in that case, if I just swapped around those two lines, this one, in this one I would acquire M1 then M2, in this one I would acquire M2 then M3, and then this one I would acquire M1 and then M3. So always in the same order. So one has the most precedents followed by two, and then followed by three. Yeah, all the threads, yeah. It has to be consistent for all the threads. Because otherwise, if it wasn't, then you could have a circular weight between the threads. Yeah. The thread is OK. Yeah. All right, here's a bonus question. If I only have thread one and thread two, is that a deadlock? Nope, M3 is M3. No, right? I don't have a hold and wait. The only lock they share is Mutex2. The other one's not shared, so whoever gets Mutex2 can get the other one with no contention. No one else is waiting on it. So be no case for a deadlock in that case. All right, cool, bonus question. Yeah? M3. If what? If M3 was M1? Yeah. Yes, and that would be a deadlock. Yeah. Yeah, if you swap the order, so if we just have thread one and thread two, and they're both ordered like that, essentially whoever gets lock one is guaranteed to get lock two. So we don't have a deadlock. But if we swap it around just like this, wow, that was really bad writing. Sorry. Well, thread one could get M1, thread two could get M2, and now they're waiting on each other.  Just swap in two lines. That was six points. Sweet. All right. Is that a fours? Yeah? All right. So here, let me start deleting stuff. So pretend you didn't see it. All right, you didn't see any of that. Still can't see it. OK, I should probably use something better. Oh, no, that's not. Yeah, I should have. This one I screwed up and I made it in such a way that I finished it, ran it through, printed it, and then did the solutions on it and had no good way of going back. So yeah. Yeah, so question, will the final exam have a lot of short answer like the midterm? No. So I think there's five short answers. 10 marks each? No. No, the short answer is I believe between three to five, if I remember. Yeah. Yeah, so there's going to be several topics. They'll say at the top of the page what it is exactly like this. Senate four is 15 points for all of it and then it has multiple questions throughout it. They usually don't carry over. There's one mega question that starts over fresh. So halfway through, it just starts over, but it's the same kind of concept. And other than that, it's like same thing. Tell me different things about it. Usually they try and be independent. But anything that's not, if you made a mistake before, you don't get penalized for it twice. All right, so wow, that looks terrible. All right, so you were given this code. So we have eight threads. We got a center four that we have no idea what it's initialized to. We have a run that initializes everything and then we have a call to initialize thread and we have this condition. So we want all cores to execute this only after initialize everything finishes and we only want thread zero to execute this. So initialize thread should run only after initialize everything happens and only one thread should call initialize everything. So we have a little bit of an ordering problem here. So it says, assume we have n threads. All set up to start executing the run function. Each thread receives a unique thread ID. In addition, that initialize some of four executes before any threads get created. So it's safe to initialize the center four. So then it says, using a single center four, some enforce the synchronization constraints specified in the comments. You may add code directly above and see your pseudocode and be sure to give the center four an initial value. Try to make a solution that supports any number of threads. Assume that thread zero always exists. For a maximum of seven points, you may use total threads and assume that it's the number of threads executing the run function. So for that, you could have multiple center fours as many as you want. So that was just another solution you could come up with but let's see if we can come up with a solution that just uses a single center four. So if we want only thread zero to execute this, well it should probably be in an if. So if thread zero, thread ID equals zero, then well we should probably just let it call, initialize everything. So how would we stop other threads from executing? Yeah, so that decrement, what is the function call for it? Do we remember what it's called? To decrement, wait, all right. Center fours get to wait on stuff. So if we're not the main thread and we shouldn't execute that initialize thread function, well in here we should probably just do a sem wait on whatever the center four. So if we want all these threads to wait and actually not execute, what does the initial value have to be? Well first, everyone remember what a center four is? Yeah, so center four is not just one zero, it's just any integer. So it's just a number, two operations that are atomic. I can post, which will increment it by one and I can wait, which will decrement it by one. If it's currently zero, it'll just sleep that thread until it can successfully decrement it. Think of something else maybe. All right, so if I want these threads to actually wait, what should the initial value be? Zero. All right, so if it just looks like this, well if threads one through seven start executing, well they'll be stuck here until eventually thread zero runs and it runs this. So how would it free all of the other threads? Yeah, increment it after running thread zero. So I could post and I could just post that sem. Do, do, do, that sem, whoops. Oh, I made a mess of things. All right, I will write it in this color sem, post. So now, if I only have one post, that only lets one thread run, right? Hmm, what else should I do? Yeah, I could post right here as well. So now if I have eight threads, well each one after it decrements it would increment it to let another thread run. So I could have as many threads as I would want to do this, yep. Yeah, so that posting seven times in thread zero was this answer. So that answer capped you minus two. So if you want to, yeah. If we want to use total threads, we could just increment, we could just post total threads minus one or even total threads doesn't really matter at that point and just have a wait. So both solutions are acceptable, one slightly more acceptable. So it wouldn't cause a thundering herd problem because seven things can execute, so you wake up seven things, that's what you want. You'll, with a mutex, the only reason we have a thundering herd problem is because with a mutex, we know we can only have one thing running. So why bother having eight if we can only execute one? Here, if we have seven, we can execute seven. Yep, yeah, if it's zero. Sorry? Yeah, okay, yeah. No, so we don't care if the other ones run in parallel and this, we can run in parallel, so we don't really care. So we want, after the initial thread runs, initialize everything, we could have the rest of them run in parallel if we want. So this will set off the chain, so that would change that zero to a one. And now every thread that waits, it would successfully go ahead and decrement it from a one to a zero. And then, well, it would also, once it gets by the weight, it would increase it back from a zero to a one and it would essentially wake them all up, which is what we want. Yeah, yeah, the weight is just to prevent any other thread other than thread zero from executing. So they all get stuck on that weight and then eventually when thread zero is done, one of them will pass the weight and then that will post, then cause another one to wake up, post cause another one to wake up, post cause another one to wake up, post, Jesus, sorry? Oh, this one? Yeah. Not relevant for us because I told you it wouldn't be, but it was like that P shared. So whether or not the center four is in shared memory. So if I set that to one and I forked that center four would be the same in both processes. I said I wouldn't do that because it's already confusing enough. All right, are we done with this question? So we did that, is there anything else? Consider the following solution without center fours. Oh, okay, so this is the example of a question that, you know, same idea, but doesn't carry on. So if you got the first one wrong, it doesn't matter. So here is a solution without center fours. So we check if we're thread zero, then we initialize everything. Otherwise, we just yield once. So assume that we have cooperative user threads, explain why or why not the solution is correct. Wow, that's worded terribly. So does this work if I have cooperative user threads, AKA your lab four? Yeah, you can assume that it's your lab four implementation. Yeah, so this, so assuming you have an implementation similar to lab, well, for you guys it's lab four. So if it's in FIFO order where you get thrown to the back, then if everything would essentially have its turn and then everyone would get skipped, no matter where thread zero was, it would eventually run. And then it would run, initialize everything before anything else, and then they would all continue past that. So that would work. All right, next part. Assume we have cooperative kernel threads running on multiple cores, does it work now? No, right? So even if they yield, well, if I actually had enough cores, it could all be running in parallel so that yield might not even do anything. So depending on the scheduler, you might have thread two or whatever, make it here before any other thread and whether or not yielded might not even make a difference. Because they're kernel threads, the kernel can go ahead schedule them in parallel. You don't get to tell the kernel what to do for the most part. So that makes sense. Yep. Yeah, if they're kernel threads and you have way more CPU cores, if you yield, it could just be like, okay, you're yielded, it's your turn immediately again. Go for it. Yeah, and then just continue. Yep. No, so join was blocking the thread, that was it. Yeah, so in lab four, if I had you implement more, you could have implemented thread sleep. So that could have blocked a thread until some other thread called wake up and unblocked it. You could have probably implemented that, it just would have taken some more time. Yep. So even if you have a single core, like cooperative threads might be good, if you want to switch, makes progress on a bunch of tasks at a different time. Like you want to be able to switch, make some progress, switch to something else, make some progress, switch to something else, make some progress. Sorry? Sure, banking example or a web server or anything like that. Yeah, but we could have done it with user threads if we wanted. Anything you do with kernel threads, you can do in user threads. You just won't get any benefits, but if they're user threads and they're doing IO or something, well, if one thread blocks and the whole process gets blocked, right? So that's the main drawback for that. So if one thread makes a read or a write system call that needs to physically read and write a file from, for example, your file system, that's slow. So that system called blocking, so you won't return from that system call until that operation's done. You've read something from the disk or wrote in something to the disk and in that case, your process is just blocked, right? It can't, it's in the middle of a system call. Yeah, if the kernel only knows about your one user thread that made that system call, well, it just knows that whole process is blocked. If you have user threads, the kernel doesn't know that that process has other threads that could execute. All it knows is that, hey, there's one thread I know about, it's doing a write system call. I will tell it when it's done. Okay, so we've got 10 minutes left. Any other pressing things or should we go to the next one? Condition variables. Condition variables, file systems. Wait, which one is this? This is the, okay, my screen died, cool. So page replacement. We shouldn't have to do a page replacement. Everyone knows page replacement or at least knows to look at it. All right, clocks are good. So threads question, oh, there's a bank question. Does it have deadlocks? Here's a center for question. Memory allocation, disks, virtual machines. Yeah, condition variables, I think it was just a short answer on this one. There, short answer. Briefly explain the purpose of condition variables and how they are used in conjunction with mutexes to synchronize threads in a multi-threaded program. You wanna do that one? So anyone wanna tell me what the purpose of condition variables are and why you need a mutex with them? Yeah, and why do I need a mutex with it?  All right, anyone that just doesn't read my line? That was a good one. All right, so it also needs a mutex. Well, because a condition variable is basically a queue. So it needs to be able to add itself safely to the queue without a data race. So that's one reason to use a mutex. The other is that, well, it needs to put this thread to sleep. It needs to give up the mutex so that another thread can go ahead and grab that mutex, hopefully update the condition variable without a data race. And then when you wake up, you go ahead and you try and lock it again. Okay, that screen's dead. All right, so just a short answer question, but for you, you might wanna know how condition variables are used slightly better? Yeah, know the function calls and know it's essentially a queue. I remember I did something with one. Long answer. Long answer, but like half a question, long answer. That's the mega question. And by mega questions like 25 instead of 20, maybe it's worth 30, I don't remember. Yep, there's one short answer off the top of my head. Processes, threads, virtual memory, file systems, set it for slash condition variables, locking, sorry? Page replacement, yes, of course. Yeah, page replacement. I think that's it. I remember you said that. Nope. Oh, I shouldn't have said that. Maybe, maybe but no. Yeah, it's more heavily weighted towards after the midterm, minus important things. So processes, well, everything involves a process. As long as I show you code, that's a process. Can't get away from that. And virtual memory is always fun. This, they're fun. This are okay. Nothing major though. This one had this. Briefly explain the concept of RAID 5. And hey, I guess I took inspiration for this one because this one only has five short answers and then goes right into questions. So yours kind of looks similar to that. Yep. Nope, okay. All right, anything else for the last five minutes? File system, speedrun, yeah? This exam is good. Realize that I wrote it so it won't be exactly the same as this. So anything that this doesn't quite test, you should be responsible for. So topics are the same, but obviously the questions aren't gonna be the same because, well, exams that are the same year or over a year don't really test anything. Test who got the last year's final. So you got a request for file systems real quick. No virtual machines. Nope. All right, file systems. All right, let's speedrun this. All right, for the following questions, assume your file system has a block size of 4096. Each point or two of block is four bytes. I-nodes are 128 bytes each. What is the minimum amount of space in bytes you need for a file system, like your lab, EXT4, to store 1,000 files? Assume that each file is 96 bytes in size. Include the size of the I-nodes in your calculation. You may skip the final calculation if you don't have a calculator. So how much space on the drive would a single one of these files occupy? That is 96 bytes. And you can see the answer anyways. So even if a file is smaller than an IO block, well, a regular file will still consume an IO block no matter what. So each of them would need a single block, which is 4,096, and each of them would also need an I-node. So add that, you need that many bytes per file. So times it by 1,000. If you don't have a calculator, leave it like that. You'd get that many bytes or a fair number of bytes. So next question. So the previous question, how many bytes are lost due to internal fragmentation? You may say zero bytes if that's the case. Yeah, 4,000 times 1,000. So for each file, while they get an IO block of 4,096, they're only 96 bytes. So we have 4,000 bytes lost due to internal fragmentation per file. Therefore, if we have 1,000 files, then we have 4,000,000 bytes lost due to internal fragmentation, which is most of that number. All right, so this is a question that I thought of when I was copying a bunch of small files in Windows, and it was super slow. And then I was like, oh yeah, this course. So why might copying a directory containing a single large file be faster than copying a directory with many small files? Even if the total size of the small files less than the size of the large file? Not quite, yeah. So this is copying a file to a new thing without any caches involved or anything. So like for instance, what's 4,000? It is like four megabytes or something like that. So let's assume like a four megabyte file versus that 1,096 byte files. So yeah. Yeah, well in this case, we're a single large file. There's just one single inode and it points to blocks. Those blocks are all going to be full except for essentially probably the last one. So it's essentially going to have zero internal fragmentation because it's a single large file. It's only gonna waste some space on the last block. And aside from that, it's just one inode. If it was a bunch of small files, it needs to copy an inode for each of those which in this case is bigger than the file itself. And to read the contents of each of those, well, it might actually have to access more blocks than that single large file because there's so much internal fragmentation. Reading a block is what the file system's doing and if it consumes more blocks, it's going to be slow. And in Windows, if you see once you get to a whole bunch of small files, the performance goes like that for the copying speed. That's because the copying speed only measures the contents being copied from the contents of the file. It doesn't include like the IO equivalent of Windows or anything like that. So it's doing a bunch of more disk accesses and it's not really copying anything. It has to read a bunch of blocks. All right, and we're over time. So with that, just remember, pulling for you, we're all in this together.