Section 1 of Little Pictorial Eyes of the Saints, Volume 5, The American Saints. This is a LibriVox recording. While LibriVox recordings are in the public domain. For more information or to volunteer, please visit LibriVox.org. Little Pictorial Eyes of the Saints, Volume 5, The American Saints by John Gilmary Shea. Lives of the American Saints placed in the proper for the United States at the special petition of the Third Plenary Council of Baltimore. Saint Philip of Jesus, martyr patron of the city of Mexico. Philip de la Casas was born in the city of Mexico, where his parents settled after setting out for the New World from Elascas in Spain. They were earnest in all their religious duties and brought up their family piously. Two sons entering the Augustinian order, one to die by the hands of the heathen. Philip at first showed little care for the pious teaching of his parents and the example of his brothers, but at last he too resolved forsake the world and entered the reformed Franciscan convent of Santa Barbara at Pueblo. He was not yet weaned from the world and its vanities and soon left the novitiate. Grieved at the inconstancy of his son, Alonzo de la Casas sent him to the Philippian islands with a large stock of goods and money to make purchases. In vain did Philip seek to satisfy his heart with pleasure. He could not but feel that God called him to a religious life. Gaining courage by prayer, he entered the Franciscan convent of Our Lady of the Angels at Manoa and persevered, taking his vows in 1594. His novitiate had produced a great spirit of poverty, obedience and prayer, and he sought by austerity to atone for the errors of his youth. As infomerian brother Philip of Jesus beheld Our Lord in the person of the sick and attended them with holy care, the richest cargo that he could have sent to Mexico would not have gratified his pious father as much as the tidings that Philip was a professed friar. Alonzo de la Casas obtained from the commissary of the Order directions that Philip should be sent to Mexico. He embarked on the St. Philip in July 1596 with other religious. Storms drove the vessel to the coast of Japan and it was wrecked while endeavoring to enter a port. Amid the storm Philip saw over Japan a white cross and the shape used in that country, which after a time became blood red and remained so for some time. It was an omen of his coming victory. The commander of the vessel sent our saint and two other religious to the emperor to solicit permission to continue their voyage, but they could not obtain an audience. He then proceeded to Mexico to a house of his order to seek the influence of the fathers there. But the pilot of the vessel by Eid al-Bos had excited the emperor's fears of the Christians and the heathen ruler resolved to exterminate the Catholic missionaries. In December officers seized a number of the Franciscan fathers, three Jesuits and several of their young pupils. St. Philip was one of those arrested while they were in the choir seeing the office. Philip bore with heroic patience the insults of the rabble who sailed the martyrs on their way to prison and heard with holy joy that sentence of death had been passed on them all. His left ear was cut off and he offered this first fruits of his blood to God for the salvation of that heathen land. The martyrs were led through the streets of several towns with inscriptions declaring the cause of their death. They at last reached Nangasaki where crosses had been erected on a high hill near the bay. When St. Philip was led to that on which he was to die, he knelt down and clasped it. Disclaiming O happy ship, O happy galleon for Philip, loss for my gain, loss no loss for me but the greatest of all gain. He was bound to the cross but the rest under him gave way so that he was strangled by the cords. While repeating the holy name of Jesus he was the first of the happy band to receive the death stroke, the lance being driven across his body to the right shoulder and then another to the left, a third stroke being given to assure his death. The Spanish and Japanese Christians who witnessed his triumph caught his blood in their hats and in cloths to preserve his relics. Miracles attested the power before God of these first martyrs of Japan. Pope Urban VIII granted permission to say an office en masse in their honor. In Pope Pius IX formally canonized them. The devotion of St. Philip of Jesus in his native city and throughout Mexico has always been very great. A church and a convent of capuchin nuns are dedicated to him. His feast was in Spanish times kept with great solemnity in New Mexico, Texas and California and a settlement in Arizona bore his name. St. Philip died at the age of 25. He is an example to encourage those who falter in the path of God's service. His prayers will aid those who are tempted and enable them to acquire strength to recover lost ground and go on with renewed courage in the narrow way of the cross. His feast is celebrated February 5th. End of Section 1. Section 2 of Little Pictorial Lives of the Saints, Volume 5. The American Saints. This is a LibriVox recording. All LibriVox recordings are in the public domain. For more information or to volunteer, please visit LibriVox.org. Little Pictorial Lives of the Saints, Volume 5. The American Saints by John Gilmary Shea. St. Toribius, Archbishop of Lima. Toribius Alphonsus Mogrobejo, whose feast The Church Honors on April the 27th was born on the 6th of November 1538 at Mallorca in the Kingdom of León in Spain. Brought up in a pious family where devotion was hereditary, his youth was a model to all who knew him. A tender devotion to the Blessed Virgin and the love of the poor marked this boy. He recited the rosary in the little office every day and fasted every Saturday in honor of the mother of God. As a schoolboy, he gave away his own food to relieve the poor. His life as a student at Valladolid and Salamanca showed no relaxation from his early spirit of prayer. All his leisure was given to devotion or to works of charity. His austerities were great and he frequently made long pilgrimages on foot. The fame of Toribius as a master of canon and civil law soon reached the years of King Philip II and made him judge at Granada. That monarch marked the exalted virtue and ability of Mogrobejo. About that time the Sea of Lima and Peru fell vacant and among those proposed Philip found no one who seemed better endowed than Arsene, with all the qualities that were required at that city, where much was to be done for religion. To Rome the name of the holy judge in the sovereign ponte confirmed his choice. Toribius in vain sought to avoid the honor and wrote a long treatise, which he forwarded to Rome, to show how irregular it was to appoint a layman to such a position. The pope in reply directed him to prepare to receive holy orders and be consecrated. King Philip was equally deaf to his appeals. Gileant last by direction of his confessor he prepared by a long retreat to receive minor orders in the subdeaconship and deaconship. Then he was ordained priest and consecrated. He arrived at Lima in 1587 and entered on his duties. All was soon edification and order in his episcopal city. A model of all virtue himself he confessed daily and prepared for mass by long meditation. The influences of the holy man was soon felt. Saint Toribius then began a visitation of his vast diocese which he traversed three times. His first visitation lasting seven years and his second four. He held provincial councils framing decrees of such wisdom that his regulations were adopted in many countries. Saint Toribius preached, catechized, and confirmed far and wide. He held diocese and synods and encouraged his bishops to do the same. Almost his entire revenues were bestowed on his creditors as he styled the poor. And he bore with intrepid patience the vexatious opposition raised to many of his reforms, maintaining the liberties of the church with apostolic courage. His charging was ill, his duties of priest and bishop. He was seized with a fatal illness during his third visitation and died on the 23rd of March in the year 1666 at Santa. Exclaiming as he received the sacred viaticum, I rejoiced in the things that were said to me, we shall go into the house of the Lord. His holy austere and devoted life had made the people regard him as a saint and a constant benefactor. They regarded him now as their patron in heaven, and miracles rewarded their faith. The proofs of his holy life and of the favors granted through his intercession induced Pope Innocent XI to beatify him, and he was canonized by Pope Benedict VIII in the year 1726. Saint Toribius was a model for all states, as a holy youth, as a pious and zealous layman, as a great and exemplary bishop. End of Section 2. Section 3 of Little Pictorial Lives of the Saints, Volume 5, The American Saints. This is a LibriVox recording. All LibriVox recordings are in the public domain. For more information or to volunteer, please visit LibriVox.org. Little Pictorial Lives of the Saints, Volume 5, The American Saints by John Gilmary Shea. Saint Francis Solano. The diocese of Cortitova in Spain was the birthplace of the saint, who won many thousands of souls to God. From his earliest years he was characterized by a modest behavior, prudent silence and edifying meekness. While still very young he was always able to affect a reconciliation between the most bitter enemies. Once when he came upon two Spaniards who were engaged in deadly strife, he threw himself between them, and kneeling down prayed with so much fervor that the furious combatants sheathed their daggers and became reconciled to one another. His education was entrusted to the Jesuit fathers, but his desire to follow the poor and humble Jesus in perfect poverty and humility induced him to enter the order of Saint Francis. Soon he excelled everyone in the house in humility, obedience, fervor and prayer and self-denial. Sometimes he would pass the entire night on his knees before the tabernacle. If he saw a religious zealous for God's honor and love he would say to him, Brother, let us see which of us can show Jesus more proofs of love, fervor and self-denial during this week. After his ordination he preached the word of God in simple, unadorned language, but with so much fervor and heartfelt emotion that those among his numerous audience who had been traveling on the broad road of vice abandoned it and entered upon the narrow path of a virtuous life. He was no less zealous indeed than a word, for when the pestilence was raging in Granada he was untiring and fearless in his service to the plague-stricken inhabitants, tending to sick and dying with such assiduous and, as it were, maternal care that the wondering people praised God for the visible protection he manifested toward his servant. In the year 1589 he sailed for South America to preach the gospel to the Indians in Peru. On the same vessel with him were six hundred negro slaves, while still at some distance from shore the ship struck a ledge of rocks and the danger of drowning was imminent. The captain hurried the officers and principal passengers into the only boat there was and tried to induce the missionary to accompany them. But he refused to do so in these terms. Sir, you have done your duty. Now I shall do mine. I stay here." He then consoled the remaining passengers, directing their thoughts to heaven. He knelt down with them, praying fervently, exhorting those who had been baptised, instructing those who were not, and comforting all. Meanwhile the vessel was sinking and the passengers trembled with fear, but not so the zealous missionary. He alone kept up his hope in God's mercy. Thus three dreadful days were passed until at last the captain came with the lifeboat and all were taken off in safety. The missionary did not confine his ministry to Lima. He visited the forests and deserts inhabited by the Indians who were cruel and bloodthirsty by nature and who hated the Spaniards because they had often times been cruelly treated by them. But God protected his fearless servant, to whom he had given the gifts of eloquence and power over wild beasts. Lions, tigers, and snakes obeyed him, and the birds perched on his shoulder singing with him the praises of God. By degrees he won the trust of the Indians, who marveled at his kindness. They listened to his instruction, allowed him to baptise them, and followed him as grateful children followed their father. In this way nine thousand Indians were converted, and everything was in the most promising condition when the missionary was recalled by an order from his superior to Lima, which at that time was like the godless city of Nineveh. Francis preached with great effect to the hardened sinners. He carried the mission everywhere in the public streets into the shameless theatres and gambling dens where, cross in hand, he frightened the evildoers by the might of his words, which echoed like the trumpet sounds of the last judgment. The result of his labours was that the whole city became converted.  In his leisure time he composed songsh to the Christ child and his blessed mother and sung them to the accompaniment of his violin so sweetly that his hearers were enraptured. His love of his neighbour was unbounded. He never thought evil of anyone and put a good construction on every action, even when persecuted, columnated, and held in suspicion by his religious brethren. The proverb, as our life is, so shall be our death, was fulfilled in Francis's case. In his last painful sickness he prayed thus, O Jesus, how do I deserve such grace? Thou art nailed to the cross, and I am served by my brethren. Thou art stripped of thy clothes, and I am well covered. Thou dost receive blows, and I only receive good things, O my God. His last words were, God, be praised, after uttering which, his soul departed his earth on July 14, 1610. His remains were honoured by a grand funeral, and he was declared blessed by Pope Clement X in 1675 and canonized by Benedict VIII in 1726. St. Francis' Feast is held July 24. End of Section 3 End of Little Pictorial Lives of the Saints, Volume 5 The American Saints by John Gilmary Shea


Yeah, then of course we have the choice between conventional and dry sanitation and I don't want to go into this too much because we deal with this topic in a different lecture and just one word about the torpedo sanitation concept. For a lot of eco houses people build their own dry toilets. What is okay if you are in a rural setting there is enough space and people are capable and willing of operating them. For most of the world population this is not an option. So whenever you plan for ecological sanitation you should consider a system that is operated professionally. So my suggestion is to have these container toilets that are operated with very very little water and that would be empty just like solid waste disposal collection and brought to a treatment site or being worked into the ground as a humus building material but very few people do have space enough to really deal with their excreta on their own land and it's better to have this in a well in professional hands than people emptying their excreta bins to the side of the ground what is not really a good idea.


This lecture is part of an online number theory course, and will be about Euclid's algorithm. So Euclid's algorithm tells you how to find the greatest common divisor of two numbers. So I'll start by quickly reviewing that. So we recall that the notation A with a long vertical line B means A divides B. In other words, B is equal to NA for N an integer. So, for example, 2 divides 10, A divides 0 for any A, and 0 divides A only if A is equal to 0. Some other examples are 6 divides N times N plus 1 times N plus 2 for any integer N, and if N is odd, then 8 divides N squared minus 1. So if you haven't seen either of these before, I guess they're exercises or something. So the greatest common divisor, well, as you notice, greatest common divisor takes rather long time to write out, so it's usually abbreviated as GCD. An old name for this is Highest Common Factor, so in some old book you'll occasionally see H, C, F, which I'm not going to write out. And the greatest common divisor, the greatest common divisor of two integers A and B, is the largest integer, N, with N divides both of them. So N divides A and N divides B. Actually, there's a slight modification to this. If A equals B equals 0, then the greatest common divisor of 0 and 0 is 0, either by definition or there is actually a slightly complicated reason for doing this, which I won't go into. Now mathematicians being lazy quite often omit GCD, so they just write A, B for the greatest common divisor of A and B. And you may have noticed this is kind of ambiguous because this notation is used to mean lots of other things, so it's also an ordered pair and about 23 other things. And how do you tell when it means the greatest common divisor? Well, there's no good way. You just have to figure it out from context. Anyway, so for example, the greatest common divisor of 6 and 10, for example, which will be written as 6, 10, is just 2 because that's the largest integer dividing both 6 and 10. So we now come to the following problem, which is calculate the greatest common divisor of A and B. So that means the greatest common divisor, not the ordered pair. Well, I'm going to give about four methods and let's start off with the stupid method, which is just check all n with less than or equal to n less than or equal to the absolute value of A because greatest common divisor must be between these and see if n divides A and n divides B. And you just pick the biggest one with those properties.  It does have some advantages. First of all, it's simple. It's easy to program. It obviously works because you just have to check a finite number of integers and pick the largest of them. In particular, it proves the greatest common divisor exists, which, okay, that's not terribly difficult, but it does want obvious big disadvantage. It's pretty slow because if A is quite large, then it's going to take ages to check all integers. Well, let's just check how slow. Well, the time taken is going to be, it's going to take roughly A steps, where each step is going to check to see whether some integer divides something else. Well, each step may take a fair amount of time, but we're just getting a rough estimate. So A is about 10 to the number of digits of A. So the time is going to be some constant to the number of digits of A. And this is the number of digits of A or the number of digits of B is roughly the length of the input to this algorithm. So when you're trying to assess how fast algorithms are, you usually try and figure out how long they take as a function of the input. So this algorithm takes exponential time because the time taken is an exponential function of the number of digits. And exponential time algorithms tend to be too slow to use in practice. So anyway, this gives us a target we've got to do better than. So we've now got to try and think of a better algorithm and we've got to beat exponential time. So let's try method two. We want to factor, we first factor A and B. So if I want to work out the highest, greatest common divisor of 24 and 60, for example, I do it like this. So I start by writing 24 is equal to 2 cubed times 3. It's factoring it into primes. We'll cover that later. And 60 is equal to 2 squared times 3 times 5. And now I can figure out the greatest common divisor as follows. I take the 2 cubed and the 2 squared and the greatest common divisor of those is obviously 2 squared. And then I take the 3 and the 3 and the greatest common divisor of these is 3 to the power of 1. And then I might take the, there's a sort of 5 to the 0 here and a 5 to the 1 here. And I take the greatest common divisor of these and this gives me 5 to the 0. So the greatest common divisor is 2 squared times 3, which is 12. And we can ask how fast is this? Well, that's actually a really tricky question because no one really knows how fast the fastest method of factoring is. This has been a subject of a lot of research. We can obviously factor in less than A steps. For instance, we only need to check devices up to the square root of A, but that's still sort of exponential in the length of A. And you can get factoring algorithms that are faster than exponential, but they're quite tricky. So let's just say it's faster than method 1, but still slow. At least it's slow, unless somebody thinks of a fast method for factoring. So it's actually a reasonably good method for small numbers A and B up to 100 or so if you're doing hand calculation. However, what happens if A and B are really large? For instance, maybe A and B both have a hundred digits. Can we find an algorithm that will do that in reasonably fast? Now, the answer is yes. We now come to Euclid's algorithm. So first of all, let's just recall division with remainder. This says if we've got two integers A and B and let's take A not equal 0 because if we try and divide by 0, we're going to run into problems. So we can write B is equal to Q times A plus R with naught less than equal to R is less than the absolute value of A. So here Q is the quotient and R is the remainder. Actually, Euclid stated division with remainder in a slightly different form. The problem was we have no problem writing down integers. You can write down an integer like 2, 3, 7, 1. But this is using the Indian notation for numbers which was only invented a few hundred years after Euclid. So you can also use it nicely for real numbers like 3.14159 and so on. And Euclid couldn't do that either. So what Euclid did to represent integers and real numbers was he represented either as the length of the line segment or sometimes as a ratio of the length of two line segments. And sometimes he uses the length of a line segment as a number and sometimes a ratio. And so there's not really an exact correspondence between Euclid's notation of numbers and hours, but most of the time this doesn't matter. So Euclid would state his division with remainder algorithm as follows. He would take a line segment and he would take another line segment and he would take several copies of the smaller line segment like this until they almost filled up the green line segment and the leftover bit at the end is going to be the remainder. So this line segment is A and this line segment is B and this remainder is R. So this was Euclid's geometric method of doing division with remainder and you notice he's not really doing... Well, he didn't really have a very clear concept of division. What he's really doing is repeated subtraction and looking at what's left over. It's not at all clear if Euclid had a concept of division of two real numbers. So now that we've got division with remainder, let's look at Euclid's algorithm and the easiest way to explain this is just to do an example. So let's find the greatest common divisor of 78 and 14 and what you do is you just repeatedly divide with remainder. So you say 78 is equal to 5 times 14 plus 8 and then you say 14 is equal to 1 times 8 plus 6 and then you say 8 is equal to 1 times 6 plus 2 and 6 is equal to 3 times 2 plus 0. So what's going on here is you see the remainder kind of gets shifted along like this and I can guess there as well. And when you get to a 0, we stop and this number here is then the greatest common divisor. So we can also write this out slightly more algebraically. So if you've got two numbers r0 and r1 and we want to find the greatest common divisor, what we're doing is we're just sending r0 equals q2r1 plus r2 and then we do r1 equals q3r2 plus r3 and r2 equals q4r3 plus r4 until we get to rn minus 1 equals qn plus 1 rn plus 0. And at that point, we stop and the greatest common divisor is this number here. Well, as I said, Euclid himself wouldn't have done that because he didn't have our algebraic notation. So instead, Euclid's version of this looks something like this. What you do is you take one line segment and we take a second line segment and then we subtract various copies of the second line segment from the first one and we have a little bit left over, which we can, let's call this the, it's my green pen gone, the green line segment and then you take the green line segment and you subtract a few copies of it from the orange line segment and you might get a pink line segment and then the pink line segment might exactly fill two copies of the green line segment and then the pink line segment is the greatest common divisor. So we should also check that this actually works. So we need to check several things. Does the algorithm, if any of you have ever done computer program, you have probably all come across the case where you write a program and it simply never stops because of some bug. So we need to check it stops. Well, yes, because the largest of our i, our i plus one is decreased each step. That means strictly decreased. So we're starting with positive integers and they're getting smaller and smaller and that can't go on forever. Does it stop with the right answer? Again, if you've done programming, you've all had the experience of a program stopping with the wrong answer.  And you notice that the greatest common divisor of a and b is the same as the greatest common divisor of b and r if a, b and r are related like this. So to each step, you're not changing the greatest common divisor and you eventually end up with rn and zero and the greatest common divisor of rn and zero is also rn. So it's easy to check that it does actually stop with the right answer. Then we should ask, how fast is it? Well, analysing this is quite tricky if you want to do it rigorously. In fact, this is a sort of classic example of an algorithm that people who study speed of algorithms study as a sort of warming up exercise. Well, let's just look at the worst case. Well, the worst case is when the numbers decrease as slowly as possible. So when you're writing a is equal to qb plus r, the worst case is it's reasonably plausible that it's going to be when q is equal to one. So an example of this, it might, if you're trying to find the greatest common divisor of 21 and 13, it might go 21, 13, 8, 5, 3, 2, 1, 1, 0. So each step you're only subtracting and not doing any, you're just subtracting one copy of each number from the previous one. Now you probably recognise these numbers there that just the Fibonacci numbers. I can't remember how to spell Fibonacci. So the Fibonacci numbers have a relation by fn equals fn minus one plus fn minus two. So each is the sum of the two previous ones. Well, how big are they? Well, you can see that fn is going to be at most two to the n. So the number of steps in the worst case is going to be at most about the log to base two of the absolute value of one of the numbers here. So it's some constant times the number of digits of A and B. This is a big improvement on the running time of the previous algorithms which instead of being sort of linear in the number of digits were exponential in the number of digits. So this is actually a really fast algorithm. Works fine even if A and B have, you know, you could do it by hand if A and B were several million, for example. Without too much trouble. Well, we can ask how fast is it if A and B are really large? Well, what do I mean by really large? Well, it might have thousands or even millions of digits. And we run into a problem here because the problem has a long division in it and long division is kind of slow and tedious. I'm not sure if long division is actually taught anymore in high school, but it was really tiresome to do by hand. Well, you say why is that a problem?  Well, long division even on a computer is kind of tricky to get right. There was a case some time ago when Intel lost several hundred million dollars because there was a small and rather subtle bug in its double precision real division algorithm on one of its chips. Long division is, let's just sort of illustrate, long division is actually really hard to implement correctly. And how slow is it? Well, how difficult is it to do long division of B over A if A and B of N digits? The usual algorithm taught takes about the number of steps is some sort of constant times the number of digits or squared. And if you run this in, if you insert this into Euclid's algorithm, this means Euclid's algorithm is now going to take the number of digits of the input cubed. You're starting to get rather big, especially if you've got thousands of digits. Well, you can improve this. First of all, there are faster ways of doing long division. You can reduce this to the number of digits to the one plus epsilon if you're really clever and use things like the fast Fourier transform, which you won't go into. That's not actually necessary because you can rearrange Euclid's algorithm slightly so that instead of this taking the number of digits cubed, you can arrange that you're really only using the number of digits squared. I'm not going to discuss how you do that because there's actually a rather easier way that I'm just about to describe. Incidentally, one of the changes that computers have made to number theory is, first, we can do examples with really huge numbers of digits. No one in their right mind would try and multiply 2,000 digit numbers by hand, but it's really easy on a computer. The second is it's actually opened up a new area of number theory where you try and find fast algorithms for really large numbers and try and find the most efficient possible algorithm. The naive method for doing long division in Euclid's algorithm uses the number of digits cubed. There's an easy way to speed this up as follows. This is going to be method four. It's about as fast as Euclid's algorithm, but avoids having to handle long division. This is very simple. So step zero says if A or B is zero, stop because the greatest common divisor is going to be the other one of them. And then step one is take out all factors of two from A and B. And you may have to keep track of them because if you take out a factor of two from A and B, remember that's going to give you a factor of two and the greatest common divisor. And step two, you just subtract the smaller from the larger. So if we've got two numbers A and B with A less than B, then we replace them with the numbers A and B minus A.  So that's really simple. In fact, if anything, it's even simpler than Euclid's algorithm because you're not doing division in any complicated way.  And you may be dividing by two, but dividing by two on a digital computer is utterly trivial because you just have to shift everything right by one step. So let's just see an example of this. First, I want to find the greatest common divisor of 84 and 66. So first of all, neither is zero, so they don't stop. Now I take out factors of two. So 84 goes down to 21 and 66 goes to 33. And now I should make a note that there's a common factor of two in both of these. So let's just make a note to keep track of the factor of two. And now these are both odd. I've taken out all factors of two. So I just subtract one from the other and I get 21 and 12. And now one of these is even. So I take out all factors of two and I get 21 and three. And now I subtract, so I get 18 and three. And now one of these is even, so I get 9 and 3. And now I subtract again, so I get 6 and 3, and now one of them is even. So I get 3 and 3. Now I subtract, so I get 3 and 0. and this point we stop and the greatest common divisor is not quite three because I've now got to you remember we had this factor of two to keep track of so the greatest common divisor is three times two. Now you notice that's taking more steps in Euclid's algorithm, however each step is very much faster because instead of doing a long division which would be horrible if the numbers had thousands of digits we're just doing a subtraction. So the number of operations needed, well how many steps do you need? Well each step you're sort of dividing by two so the number of steps is not going to be much more than number of digits it's going to be some constant times the number of digits and then each step you need to do a subtraction and doing a subtraction is going to take about the number of digits so we should also multiply by the number of digits. So the total number of steps is some constant times the number of digits or squared which is better than the naive implementation of Euclid's algorithm.  So if you're programming greatest common divisor on a digital computer you probably want to use some variation of method four if you're working for really big numbers and if you're using numbers that will fit in a single word of the computer then method three which is just the straightforward Euclid's algorithm is probably the best method. Okay next lecture we're going to give some applications of Euclid's algorithm in particular for solving linear diaphanetine equations.


Now, tenth problem, consider a well insulated horizontal rigid cylinder that is divided into two compartments by a piston that is free to move, but does not allow either gas to leak to the other side ok. So, initially one side of the piston contains 1 meter cube of nitrogen at 500 kilo Pascal and 80 degree centigrade while the other side has 1 meter cube. So, it is almost divided into half years like this ok. Here 1 meter cube of nitrogen, here 1 meter cube of helium, other side has 1 meter cube of helium. So, here pressure was pressure is here nitrogen side the pressure is 500 kilo Pascal and temperature is 80 degree centigrade and in the helium side it is 500 kilo Pascal and 25 degree centigrade ok. Now, thermal equilibrium is established in the cylinder as a result of heat transfer through the piston that means, this is conducting, conducting piston ok. Determine the final equilibrium temperature in the cylinder and entropy generation due to the process ok. So, here the piston is tight enough, but free to move, tight enough means leak proof that is the nitrogen cannot mix with helium or otherwise, but it is free to move. So, since it is free to move always mechanical equilibrium will be there and it is well insulated it is saying the entire is well insulated that means, there will be no heat transfer from either of the compartment or from the piston to the ambient. But since the piston is conducting there will be heat transfer between these two ok. So, that is the problem in hand. In this we have to find the entropy generation also, so solution let T f be the final temperature, equilibrium temperature ok. Let us find the masses of nitrogen and helium ok. So, mass of nitrogen is what? Nitrogen is 500 kilo Pascal into 1 meter cube divided by A 314 by 28 is the specific gas constant of the nitrogen for nitrogen right into the temperature is 80 degrees that is 273 plus 80 353 Kelvin. So, this is the mass 4.77 kg ok. Similarly, mass of the helium chamber will be equal to pressure is same because of the mechanical equilibrium correct the pressure the piston is free to move. If it is at a particular place then it means that pressure in the both side will be the same A 314 for helium for helium the molecular weight is 4 ok. So, molecular weight of helium equal to 4 kg per kilo mole ok. So, that into temperature is 25 degree centigrade, so 298. So, that will give the mass as 0.807 kg. Now, we can also calculate the CV, CV for nitrogen will be equal to A 314 by 28 that is the specific gas constant divided by 1.4 minus 1, 1.4 is the ratio specific heat 1.4 minus 1 which is equal to 742.3 joule per kg Kelvin. Similarly, CV for helium will be equal to A 314 by 4 divided by 1.66 minus 1. So, gamma for helium equal to 1.66 ok. So, now this will be equal to 3149.2 joule per kg Kelvin. So, these are the properties. So, now I can taking the rigid vessel as the system ok apply the first law what is that q minus w equal to delta u ok. Now, what is q entire rigid vessel is insulated. So, q is 0. Since rigid vessel volume will not change in this. So, individually the volume of nitrogen or volume of helium can change based upon the movement of the piston. But the rigid the entire vessel if it is taken as a system there is no delta v. So, this also is 0 because delta v equal to 0 rigid vessel. So, entire rigid vessel is the system now. So, that means delta u will be equal to 0 correct. So, now how will you calculate this delta u because we do not know the final condition ok. So, we will apply the equation here delta u equal to 0 equal to 4.77 into 742.3 into. So, let us assume that final temperature is T f we already done that initial temperature for the nitrogen is 353 ok. So, this is the mass of nitrogen this is C v of nitrogen and this is T nitrogen 1 initial temperature of nitrogen final temperature is this plus. So, this is actually delta u is written as delta u of nitrogen plus here 0.807 into 3149.2 into T f minus 298. So, this is basically delta u of helium. So, this is mass of helium this is C v of helium ok. So, now from this I can find T f which implies because delta u equal to 0. So, T f equal to 330 Kelvin ok. So, please see this initially 353 is the temperature of nitrogen helium is 25 degrees, but due to the heat transfer it has reached a common temperature now 330 ok. So, helium temperature has raised from 298 to 330 nitrogen temperature has decreased from 352 to 330 based upon whatever is the masses etcetera ok, final temperature is got. Now, total volume is the same that is V N2 1 plus V helium 1 will be equal to V N2 2 plus V helium 2 ok. That means, here if the piston moves to the right then the volume of nitrogen will increase, but the volume of helium will decrease, but total volume should remain the same that is what the volume conservation is in this. Any compartment problem where the piston is free to move this volume conservation has to be applied. So, now we apply this. So, how the volume can be calculated? We know P V equal to M R T. So, I write the volume in terms of M R T by P ok. Now, I know the left hand side volume 1 and volume 2 it is already given. So, this what this is given as 1 meter cube and this is also given as 1 meter cube. So, that is known. So, for the right hand side I do not know the pressure. The temperature is known because the final state temperature is 330 we have just now calculated, but I do not know where is the piston now. I do not know the pressure also. So, I cannot calculate this. So, I try to eliminate one of the variable ok. Write it in only the pressure terms. So, I will write this as 1 plus 1 ok the volume conservation 1 plus 1 meter cube equal to 2 equal to here V N 2 2 that is written as M N 2 R N 2 T final divided by P final ok plus M helium R helium T final divided by P final. So, now, I know this values I can directly get the P final implies P final will be equal to 510460.3 Newton per meter square or Pascal that is it. So, that is what is asked here. Final equipment temperature and pressure or the pressure also is asked we do this. Why we want pressure because you have to calculate the entropy change entropy generation basically. What is entropy generation? Entropy generation. So, entropy generation basically can be written as delta S system plus delta S surroundings. Entropy generation is delta S universe that is it. So, delta S system plus delta S surroundings. Now, what is delta S system delta S of N 2 plus delta S of helium that is delta S of system. What is delta S surroundings plus 0? Why there is no heat transfer here. See, please understand that the entire rigid vessel is insulated. So, there is no entropy transfer. So, we can say that the rigid vessel is isolated basically. It is not having any connection mechanically or thermally. So, there is no entropy change for the surroundings. So, if I calculate entropy change for the system which is the entropy change for nitrogen and that of helium that is enough for us. So, what I do here? I can apply first if I want to find the Cp value of nitrogen equal to 1.4 R nitrogen divided by 1.4 minus 1 which is equal to 1039.2 joule per kg Kelvin. Similarly, Cp helium can be got as 1.66 R helium divided by 0.66 which is equal to 5227.67 joule per kg Kelvin. So, now, what is delta S of nitrogen? Delta S of nitrogen equal to m N 2 into Cp ln T 2 by T 1. I will say T nitrogen 1.  Similarly, delta S of helium can be written as m He into Cp He ln Tf by T He 1 minus R helium ln Pf by P He 1. So, substituting these two I will get S generation S generated that is delta S universe equal to S gen equal to 32 joule per Kelvin. So, you have to understand that entropy generation is delta S system plus delta S surroundings. Okay. So, this is the problem which has basically why there is a entropy generation because of the irreversibility in the this isolated system basically. So, you can see that this isolated system there is no heat transfer, but due to some irreversibility see here clearly it is not given that the friction is the piston is frictionless it is free to move that is it. So, probably there is some friction in the system due to which there is a irreversibility that has caused the entropy generation. So, entropy generation is caused only due to irreversibility. This irreversibility basically can be internal irreversibility which is due to friction in this case what we have seen also it can be external irreversibility, but is if there is a heat transfer between system and surrounding if that occurs in a finite temperature difference then that will also cause this. Okay. So, in this case basically there is no heat transfer. So, the delta S surrounding is zero if there is a heat transfer then in the previous problem we have done know the delta S here delta S surrounding equal to Q surrounding by T surrounding we have written. If there is any heat transfer that can contribute to the change in the entropy of the surrounding. Since it is an isolated system in this case we cannot have any change in the entropy for the there is nothing entropy transfer due to heat transfer is not there plus there is no internal irreversibility in the surroundings also. So, this entropy change of universe will take care of both internal irreversibility and external irreversibility. Okay. This is about the problem 10. So, 11th problem carbon steel bolts density is 7833 kilogram per meter cube and specific heat is 0.465 kilo joule per kg Kelvin. 8 mm in diameter or annealed. So, annealing is a heat treatment process. And annealing is the heat treatment process. What they do here is they heat the balls to 900 degrees centigrade in a furnace in hot environment and allow them to cool slowly to 100 degrees centigrade in the ambient air which is at 35 degrees centigrade. So, once you do the structure the the atomic structure of this will change and you will get the required toughness etcetera. So, this is a metal processing or metal treatment process.  So, basically we are not caring about how it has reached 900. The cooling process is the annealing process. So, how it cools from 900 to 100 degrees in an air environment of 35 degrees. Okay. So, first one is rate of heat transfer from the balls to the air. Second is the rate of entropy generation due to the heat loss from the balls to the air. Okay. So, heating is not the main point here. The cooling is the main point here. Okay. So, solution. So, this is the entropy generation in solid, basically solid this mass of one ball, one steel ball. Okay. That will be what density into volume which is equal to 7 833 into 4 by 3 pi into radius square, radius cube that is 8 into 10 power minus 3 by 2 cube that is volume. Okay. So, now that will be 2.1 into 10 power minus 3 kg that is the mass of one ball. So, heat transfer to the air from one ball is what equal to m c delta t which is equal to 2.1 into 10 power minus 3 into c is 465 I have written in joule per kg Kelvin into 900 minus 100 that is what is the heat loss in air. Correct. So, that will be equal to 781.6 joules. So, rate of heat transfer. So, here you can see this is the amount of heat which is transferred basically, but I want the rate of heat transfer because I wish to anneal 2500 balls per hour. So, time is given now. So, rate of heat transfer for 2500 balls in 1 hour what is that that will be 781.6 into 2500 is the number of balls right 2500 divided by 1 hour is what 3600 seconds. So, this is in seconds. So, this is in total joules. So, joule per second so, it is in watts that is 542.5 watts that is the rate of heat transfer first part. So, if you want to anneal 2500 balls per hour then this much heat should be lost. So, that means, you have to design the environment with some convection etcetera to facilitate this much heat loss the rate of heat losses in watts.  Now, this is basically we have to write in rate at which. So, rate at which entropy is generated rate of the so, I can say this I put a overhead dot to represent that it is a rate at which it is done. So, not for the balls it is basically mass 2.1 into 10 power minus 3 into 2500 into 465 into ln of 100 Kelvin 100 degrees centigrade that is 373 divided by 900 is 1173 ok. So, this plus this is a rate at which so, 542.5 it will be ambient temperature is what 273 plus 35. So, now, here it is mass of one ball it is number of balls n this is c this is ln of t 2 by t 1 ok. Now, this is heat rejected see this is for surroundings this is heat received by the surroundings basically correct because ball is cooling the heat is rejected to the surrounding. So, the heat gained by the surrounding is q dot surrounding this is 542.5 watts divided by the temperature of the surrounding which is 35 degree centigrade so, 273 plus 35. So, this will totally give s gen as 0.985 watt per Kelvin which is the entropy gen rate of entropy generation ok due to the heat loss from the balls there. So, this is the a simple problem which demonstrate the entropy generation for the solids ok. Here we have to divide by 3,600 ok. So, here this divided by 3,600 we have rate no. So, rate at which this is the entropy change of the balls, but by dividing by 3,600 we will have the rate at which it is done ok. So, the rate at which the entropy changes in the balls plus the rate at which entropy changes in the surrounding that will be the entropy generation that is the entropy rate at which entropy changes for the universe that will be the rate at which the entropy is generated. This can be again positive or 0.