Hi again. Tell me about my talk yesterday. I'm Gershon Bazerman. I'm at S&P Capital IQ. This is on the advanced track and in a sense it is because I think but in another sense, right, this is another sort of soft talk in that there's no code, but there's real ideas in it. As in it's gonna be a talk about the philosophy of math and its applications to programming and when I say the philosophy of math I don't mean, you know, my personal philosophy of math. I mean, you know, people from the field who talk about it and write books about it and so on and some ideas from there that I think can translate in useful ways and So the inspiration for why I thought this would be interesting talk to give came from two things. The first is this quote from a Colin Mclarty article, which is a wonderful article that I keep going back to on the history of topos theory and It on one of my read-throughs this struck me. He has this line It is natural to attend to the most set-like aspects of topoi to imagine them as derived from set theory and to do this even without thinking about it This is how common sense works. Students afflicted with this misunderstanding have trouble escaping the idea that the objects are quote really structured sets and the arrows are quote really structures of preserving functions So they keep looking for the truce quote behind the category axioms Instead of learning to use the axioms themselves They have trouble learning these definitions not because these are complex definitions But because they don't believe what the definition say and they keep saying no What does it really mean and it really means a set and it really means, you know set theoretic arrow and So I read this quote from Mclarty and this sort of context of teaching students some very abstract math and Simultaneously, I was encountering these are paraphrases And these are from people every day on the internet Right, um, you know, oh monad is just another name for effects. Why didn't you tell me this? That's what it really is It's not these axioms. Oh a monad is just a name for sequencing. What no, no, it's not that Oh a monad is just a way to handle errors. Why didn't you tell me that and so on and so forth? And I said so so Mclarty's addressing something that we run into a lot Which is you know the problem of people Insisting that they need to know what something really is and they don't believe you when you tell them And they tell you that it's hard and it's not that it's hard It's that they just don't believe you because it can't be that because that's not a real thing and and so this is a problem about abstraction and That we find it it's hard to teach abstraction, right? And so the question I wanted to ask is why is it so hard to teach abstraction and is it harder for us in programming to teach abstraction and Then elsewhere and I think it's in programming We tell people abstraction is unnatural in a certain way that we don't necessarily in other disciplines and so the the idea of this talk is you know, we import a lot of mathematical ideas and Think of ourselves sometimes as engaging in mathematical practice other people would disagree But we haven't imported a lot of metamathematical ideas in the sense of ideas from the philosophy of math from people who sort of study how people think about and teach math and and and so that leads to a mismatch and Right, you can't learn abstraction the same way you learn addition. You don't learn abstraction by rote Right, I can go through an elementary school and add a whole bunch of numbers on a worksheet and take a test and now I've learned something about addition Maybe not its meaning but the act of it I can't go through and just abstract a bunch of things on a worksheet and you know I now have learned how to think abstractly There's a sort of different thing involved when we talk about teaching abstraction. It's not like teaching other things in that sense. It's a way of infusing a way of thinking not not not an act of thinking um and It's a mode of thought so the atomist fallacy Right, which is something that sort of philosophers will talk about in some sense and not even will say it's a fallacy I is when you want to understand a thing you understand the things It's made of and those things are in turn made of smaller things and those things are made of even yet smaller things And once you have taken things down to the very smallest things then you've understood everything about the big thing right and so These people are really understanding this printer, right? They're gonna know what PC mode letter means, right? They're understanding the heck out of that printer, right? That's so loud. There's obviously a missing piece and The philosophical response and there's been a lot of interesting discussions on this. It's got a little small is Generally sort of falls under the realm of some version of structuralism That objects don't exist nearly as a constituent elements, but it's the arrangements that matter more than what the things are made of inside of them and There's a lot of examples we can give from the physical world So the quantum world in the classical world But in a sense the transition is a statistical one and when you talk about the classical world You don't understand it in terms of you know these sort of you know Hilbert state spaces and so forth you can pass into a different thing and the structure of the quantum interactions is what's important not the individual ones similarly in Computer ships the movement of electrons and assembler language to move between them is you have a structure imposed by chef engineers When we think about assembler right and sort of close to the metal as we would call it That's very different than the actual metal of the electrons and that the electrons sometimes don't even stay exactly on the paths But hop around you know sort of nearby them and you don't think about that you and and then that's a sort of That's a structural phenomenon right in a sense The objects of a theory in general which are just names in the model of a theory which are structured by equation laws and that that's a much more mathematical approach and Then up in turn between assembler and higher level languages you have the same things occurring and and one can give many other examples so one element of how people talk about Structurism and so on is There's a sort of tedious discussion of what things really are and you know I don't want to call that a matter of taste, but it's a matter where it's hard to convince people You're not sure practically what the effect would be if we could agree what they really were so but there's a weak structuralist program Which is whatever your take is on you know where the reality of things comes from? certainly as a practical matter If you you need to conceive of certain practices is operating with structures or objects and not with atoms And that's how people learn these practices and that's how people use them So in a sense you pass from sort of you know these deeper philosophical questions into almost the sociology of knowledge is sort of the program This goes under and that overlaps with some philosophy of math And so and then and in a sense what I'm saying is this is not a philosophical claim although philosophers will write about it It's just it's a true historical claim about what's happened in 20th century mathematics that this is how people operate and And All right up who here is familiar with axiomatic systems a la Euclid All right, I'm about Okay, so I'm not sure I realized I added these slides because I figured it's I It's a good way to start things and I don't want to bore the people that know it But I it might as well just very briefly right here were Euclid's postulates axioms after King prior, but we're gonna call these axioms sort of and you know And so this is how we gave geometry and it's arguably the world's first formal mathematical system and first axiomatic system and he says And and there's something interesting here He doesn't say it is possible to draw a straight line from a point to any point his axiom is the act of drawing the line He says if the postulate is to draw line. I postulate drawing a line I postulate to produce a finite straight line continuously in a straight line, right? So if you which is you know in our modern language if I have two points I claim I can draw a line if I have a line I claim I can extend it You know vine in a point that I can make a circle blah blah blah on and then the fifth one which is sort of interesting And I'll touch on briefly um now Who's written interestingly about this by the way is Rodin who's got a book axiomatic method in category three But this is just sort of axiomatic methodist things like this You have a bunch of these what we'll call them axioms or postulates And then you have everything else that you know in the system is derived from these and your logical laws and combining them And all your constructions are built out of these in some sense now this underwent a Rather drastic change in the 20th century Where and I think I'll come back to that change but by the time you hit on 1950 You have the burbaki group right which is the the anonymous collective of great mathematicians who who tried to write as one And they vote an article they didn't just write books and this article is called the architecture of mathematics 1950 It's a beautiful article and they describe what they conceive of has become the modern axiomatic method That you separate out the principal mainstreams of the arguments then you take each of these mainstreams of the arguments separately and formulate them in abstract form and look at their consequences and Returning to the theory under consideration you look at these component elements which had been separated out and you look at out these components interact and then And so there's nothing new in this going to and throw between analysis and synthesis between separating out sort of and forgetting everything else but certain elements and only looking at those and then taking it back into the world where you had sort of these objects with more structure but in the way it's applied and another character Marquis the JP Marquis is written about Abstraction and then there's a the axiomatic method He pointed out is only an element of abstraction and the abstract method and there's a difference is You don't is you take the abstractions as separate from the object Euler really believed that he was axiomizing the geometry which I'll get you right and When you hit the abstract method what you start with is you start with things that are apparently dissimilar But it turns out they have something in common so you need a range of variation and you have to identify invariant properties over this whole different collection of things and The example that's often given is that of rings where you notice that many different things form rings and I'll get to that in a later slide The thoughts and the slides don't quite match up because everything connects here Then you ignore particular elements of the properties of each of these different things Systematically so in such a way that you see what they have in common But not what they have differently and you forget those and you say I'm not gonna look at that I'm not gonna think about all these things that are different I'm only gonna look at about what they have in common and then I'm gonna say and now I'm gonna have an identity criteria And that's gonna say all the things that are by only these things they've in common indistinguishable I'm now gonna identify and in doing so I've now created an entirely new class of objects that did not exist before Right, which are the objects that are built out of the commonalities, but not the differences and which are indistinguishable under these commonalities And and and that's his summary from our case of sort of what the abstract method has been in 20th century mathematics It is a relatively new phenomenon different from axiomatics And so here we come to what I wanted to preview is Euclid right people thought that this axiomatized the geometry and so people who know about non-euclidean geometries. Yes now Right, so the parallel posture. Yeah, this is good and very math the audience The parallel posture can be re-read as saying within a two-dimensional plane Give him a line and a point not in the line There is one unique line which will never intersect the other line right that that's a parallel posture And of course it was discovered rather shockingly that You could also modify it to say that there are infinitely many lines that never intersect this line and then you get a hyperbolic geometry the lines sort of curve away and That there are no such lines and you have an elliptic geometry and That all of the other axioms held and This is a discovery that you know you thought you would axiomatize something But it turned out that you had axiomatized a class of things and you didn't realize this and the argument that I'm gonna make is Just as a thought experiment you can imagine a counter-history where people had invented You know Euclidean hyperbolic and elliptic geometries Sort of independently and then realized later they coincided if you know modulo is one axiom and and then that would be an example of the abstract method right would be to later after the fact Recognize these commonalities and derive a theory that was invariant over these differences and Right so so these things I think we I don't need to make the directions to programming directly I hope I hope people are sort of feeling them in their gut already that what I'm talking about is very relevant and but Here's a very simple example take a collection of functions and identify the invariant code between them Systematically forget those elements of the code that are different pull out a new function pass in those bits that are different And I believe that we've taught the eclipse IDE among others to do this right now I can apply the abstract function refactor, right and And then this is an example of the abstract method and then of course when eclipse does it Doesn't tend to produce beautiful structures such as rings, but but you can recognize the I hope you can recognize it That this is that this is in fact a sense of deep commonality In what's going on here, and and that's something that these notions are very fundamental So let's return to a couple more quotes. I love from this provacchi article where he talks about The most striking feature of the they're talking about the abstract But they in a sense they mean the ab axiomatic in the sense They mean what I'm calling the abstract method the striking feature is you get a considerable economy of thought These structures are tools and as soon as you recognize among the elements the common structure Relations which satisfy the axioms of a known type you have at your disposal immediately the entire arsenal of general theorems Which belong to the structures of that type, right? This should sound very familiar to some people right and you know any of the talks on scholar's debt or whatever that You know we'll make a very parallel point right and then and then this is a point that you know that was well-known in 1950 and then as my point and And this is the point that I think is less well-known and I've only started to recognize more recently But it's equally important each structure carries with it its own language Frated with special intuitive references derived from the theories from which the axiomatic analysis derived described above has derived the structure and Now you get something very different which is that you can get these Transportation's between different things and you can take intuitions from one place to a very different place And so so the purpose of this is not only the economy of knowledge, but that it creates unexpected connections and So now I'm gonna Talk about the unity of mathematics as many people have called it that in a sense many people who much better at math than me And you know very serious people have have pointed out that about one element of how one can think about math is as as the science of discovering Surprising and outrageous coincidences right and You know things that not should not be related that are and the development of a structure of sort of puns almost Right in a systematic way And the example given by the burr-up Bakke article is that you know people did not come connect Complex numbers to the Euclidean plane at first and when they did all of a sudden You know these you know and now of course we're all taught to do it So it's hard to imagine that people were thinking of complex numbers purely formally and they said wait I can look at these as points on a grid and now I can think about functions on this grid And now I understand the complex numbers in a whole new way And that was a moment in mathematics where people had to make that discovery and that's a very good example of the abstract method sort of leading to something that we now Can't I can't even imagine what it would be like to not see that because that's how I was taught these numbers in the first place More complex examples of the duality of combinatorial and categorical accounts of homotopy spaces Which I won't get into but it turns out that one way to represent homotopy spaces is through sort of a yonade embedding And it's very beautiful and the other approach is to crank out these enormous combinatorial sequences And these are the only what two ways to understand it And they are in the deep extremes of abstraction here and on the other hand you would consider, you know very gritty combinatorics and So combinatorics arises in places where you don't expect it or alternately categories do and and often they're the same and so that's very interesting And here I was gonna mention the rings, you know You can look at the reals the geometrical and numerical notions of rings vector notions of rings algebraic notions of rings and formulas rings Logical things that's ringing and I'm scratching the surface And of course you get you know triply derived concepts and schemes of rings and I you know it goes on So it turns out these enormously general concepts much more than were anticipated even when they were generalized in the first place You know calculus right that the fund that they they spend basically a semester to convince you that the slope of the line in the Area underneath it have have a spectacular coincidence that you know, of course There's a deep theory as to why but but it doesn't seem evident to you until you've taken a calc course necessarily why you should think of these things as intuitively In a deep relationship. So math is all about these coincidences. I won't go through the law. I listed a lot more fun ones The monstrous moonshine. I don't have time to talk about that Blossards on will calculus. Anyway, sorry just things to Google later. Let's move on So I don't know if I time for this I thought I talked about one example that surprised me and I don't have time to do this right So people are no how many people know what sort of a localization or completion is in a mathematical sense all right, I I'm gonna tell the story in a lying way because otherwise I'll never get away with it in this span of time And there's actually a couple different notions of localization that don't coincide going on here But start with the naturals, right? Now the naturals, of course you they're not complete with regards to subtraction because what's you know, two minus five it right You can't do that. So addition doesn't dollars have an inverse. How do you make addition have an inverse? well, the classical way you do this is I'm gonna have two numbers and Two naturals instead of one natural. I'm gonna have a pair of them that I walk around with and if I want to subtract what and Positive numbers are the ones that are like something comma zero and negative ones are zero comma something And then you can work out if you want to subtract these pairs that you can represent the subtraction as you know In all is a sound way by just having sort of the pairs of one minus the other and So you've added a whole bunch of points to your space in a sense because you know where you just had one number before Now you have two so you've got a lot more points in your space But then you quotient those points down again by saying I identify all pairs as the same Where the difference between them is the same right? Although you can't exactly say the difference between them because you don't yet have subtraction So you do a slightly different formula that gets you there and stays in the positive world But it that's an example of a sort of notion of a localization or completion is we've gone from something that doesn't have some Traction to a structure built on it through two steps adding a bunch of points and then identifying a bunch of points To a structure that does have subtraction you do exactly the same procedure with regards to division and you go from the Sorry, we go from the integers to the rational numbers and in the rational numbers We actually represent them as a pair right because it's a fraction So we've learned that one and that's very easy you just say well what is you know two divided by five well It's two five the pair and what do we do again? We identify classes of them in this case the classes where you know You know four ten is the same thing and it's the exact same So you can see the procedure of going of completing with regards to addition and completing with regards to division Is the same procedure? You get the rationals you complete the rationals with regards to Cauchy sequences which It and it's very much the same thing you just declare that all these things have limit points And then you identify the ones where the limit points are the same under some invariant and now you get the reels You complete the reels with regards to roots almost the same procedure again and you get the complex numbers and So this to me is sort of a second level abstraction is that you have one procedure and you can go from the things that the counting numbers You know up up to the field of the complex and you just by iterating it And this is a notion of an abstraction of of a procedure and you can see how you apply the same thing over and over and this This appears in pipe theory in a very surprising way There's a famous line line strength you're a paper So, you know everyone that remembers any of the stuff we do in Haskell where you do sort of like this math with the signatures of polynomial Functors and then you get that hilarious result that if we pretend that this polynomial functor like for list which is recursive if we pretend that we can do all the operations of complex numbers on it right you can solve the fixed-point equation for a list and and get what it should be and line strength for your a gave a Article that explains in category theory why it's always the case that if you just have a semi group And you pass through all this other stuff you can do all the complex operations and your result is a semi group Then there always exists a quote Honest proof of the same thing that doesn't pass through this and In a sense is a surprising result, but if you look at what I presented in the prior page it's not Because the entire purpose of every single construction taking us from right the in the history of mathematics Taking us from the counting numbers to the complex numbers was precisely so that you get such a result with regards to numbers Right precisely to make everything work out And so in a sense it's very shocking in a sense. We're digging up what has been buried for us when we discover that we can do This with types as well That that was why this apparatus was built and then that's an element of the unity of mathematics is that It turns out that you there's a lot of structures here that you have to know what you're looking for and know that They were put there to begin with And then and then now I'm going to talk about on the other side the prism of mathematics Which is the second part of that burbaki quote the elements in which you know every field has its own every way of looking at things Even if it's the same thing carries in its own intuitive landscape that that we navigate So if you look at the same system categorically you can think about diagram chases commuting paths Maybe you'll make this certainly you'll need a If you think of the same space homotopically or the same object and you can take any mathematical object and look at it in different ways you're going to be looking at sort of ways to glue them and to Maybe split them and I won't explain what all this means. Sorry. I don't have time In topological point set thinking where you have a lot in computer science This is what we're actually we're talking about last night some of the pub right is it's all gonna be about semi-decision procedures and things that you certainly know But maybe don't know right so they're open or closed in a topological sense in one way or another and An example of this that comes up in practical programming is the notion of something like a bloom filter a set where you can certainly know If something is a member, but you maybe know that it's not a member But maybe you'll actually think it's a member when it's not and then you get a great deal of data compression And we use these algorithms all the time and we also have semi-decidable questions like halting. I certainly know What well rather if it halts I certainly know it's halted and there's certain things that I certainly know won't halt But then there's things that you know are semi-decidable. I'm not I'm doing a bad job But you can there's a topological translation of that stuff So you don't have to think of it topologically but if you like your topological intuitions then you can translate them and then you can look at it logically in a Whole different theory. It's the same object. You have a whole new set of intuitions to bring to bear on it Harmonic analysis computational thinking commentatorial thinking which I'm not very good at but I all those marvel at their proofs And then the people that can think in terms of those series So gosh Now I'm gonna take a big jump in the sense of things that interest me that loosely fit together in this talk and I think are things we can draw from I Was reading a bill of air as some people know him a fan of his work in a more an order 1992 article categories of space and quantity And he said something that completely baffled me He taught he was talking about Aristotle's program of using clear Philosophical and clarity direct in us and unity to the investigation and study of science and all of a sudden he talks about Hepatites 1887 struggle for the proper role of theory in the practice of long-distance telephone line construction. I said I Was not aware of this So I went to I found the happy side article and started reading about this gentleman he really is I as interesting a figure as a as an Edison or a Tesla or the other people people like to talk I would urge people to read about happy size by fascinating bad In fact, did you know that Maxwell's equations are the Maxwell have a side equations? Maxwell gave us depending on who you believe between eight and twenty equations and they used a court nonce Have a side translated that into the four vector equations. We know one love today And he's entirely self-taught although his uncle was a Wheatstone of the Wheatstone bridge, so he had some help But he came from a very working-class background he worked on the Anglo-Danish telegraph cable and You know and he worked on it and and then He invented things such as the coaxial cable the theory of transmission lines anytime you see a Loop in a wire and and like an antenna that come have a side sort of pioneered why you would want to put those things there And that's what leads to Laverre's remark in fact There's also the operational calculus Which is that sort of the notion of differential operators and which the mathematicians hated by the way because he have a side Just said what if we treated these things like this and people said look but they're not he said yes but look what we could do and he never proved it and But he used it to great effect And so Norbert Wiener who's a fan of heavy-sides had said the brilliant work is purely heuristic Devoid of even the pretense to mathematical rigor its operators apply to electric voltages and currents Which may be discontinuous and see certainly need not be analytic But he did it and it worked and later on the math caught up with him So that that's one element to the role of theory and practice in math All right is when you want to say you want to be mathematical that doesn't mean that you have to respect only the Mathematics that exists sometimes you just want to make the thing transmit on the line faster Right, and and then you have to invent math to do it and that's okay so your mathematical doesn't mean you're sitting at the feet of the ancients and I won't go into operational calculus more But the dispute in particular that Laverre referred to is priest who was another important person in telegraphy at the time and Telephony and others they considered on induction the worst thing right because You know if you want an electrical signal to transmit then you have to eliminate all this magnetic interference So any inductance is the worst thing because clearly you know we want that signal math the interference and have a side said well, you know you've studied some things and You know in a practical world, but I'm just looking at the equations very seriously And it seems that if we add uniform inductance Then that'll actually reduce a distortion because it'll sort of have the signal boosting against itself and people said this is insane we've been fighting inductance for years and you want to embrace it, you know and he vote these articles for journal called the electrician and Actually a priest had the editor of the electrician fired And the new editor refused to print it heavy-sides articles and have a side was similarly discredited to priests There's a very heated argument over inductance I Don't really have time to get into this I want to get to the conclusion But I it's an interesting digression that I think is relevant to us in a way because you know one can make the Analogy right between you know you use a man who's who's interested in very practical things, you know transmission of Telephone signals over long distances and he has to reach into theory and when he does so the mathematicians don't necessarily like everything He's doing because he has to sort of find new ground there and the practitioners don't like everything. He's doing But but he persists and and then a lot of his ideas in the end ended up changing the world So this is a when one talks about abstraction and the unity of math and so forth like this is sort of There's these figures that I think are just an interesting inspiring historical lessons. I don't know what else to take away from it and He has this quote that is the one that lavera picked up on on his article on inductance where he says that We shall never know the most general theory of anything in nature But we may at least take the general theory in so far it is known and work with that finding special cases Whether a limited theory will not be sufficient and keeping within bounds accordingly and Lavera translate that in his article Right, this is the quote that I now found that let's me understand Lavera's quote, right that We don't have the final answers in any of these theories But we always have to reach for the best theory we have even if that means reaching a bit beyond our comfort zone and and thinking of things in a bit more complicated way than we would necessarily want to if we want to really sort of do the best we can and Here we go. Um, a lot of put this is a assemblage of quotes. I like as much as anything else Rhoda and in discreet thoughts points out that he sees there is two sorts of mathematicians the problem solver Who wants to solve one problem at a time? He wants to solve the problems that no one else thinks can be solved and once he's solved it He doesn't care how he solved it Right, it's done on to the next one and then there are other people who are the theorizers You don't really care about problems They want a theory that sheds light on phenomena They don't look success does not line solving problems, but in trivializing them The moment of glory comes with the discovery of a new theory that does not solve any of the old problems But renders them irrelevant and perhaps introduces a bunch of new problems, which you have to mention Road is not taking sides here Again, this should be very familiar to many of us in many discussions over how we write software libraries and think about our programs and so This sort of is the last section of the talk is There are a lot of it right there was a rather stupid argument is programming mathematics that took place Back and forth at some conferences I don't know if that's an interesting argument an interesting question is How are programmers like mathematicians and how are mathematicians like programmers and this is like a social phenomena This isn't but but you could if you recognize the same social phenomena in many ways You have to say the object of study has to in some sense be similar enough to engender the same sort of personal responses So here's some Disparaging ways in which mathematicians are like programmers Right, they're gonna argue over you know the generality of their approach They're gonna have mutual theories that all say the same thing But one is clearly correct and the other is clearly wrong and you look at the history of math.  They will talk about fundamental and debuggable flaws in their proofs. They will refactor their proofs, which is much better They will accrue and play it pay down technical debt in their theories And then they will as well argue endlessly about syntax and they will write articles that are mutually Unintelligible to one another that are saying the same thing, right? So so in good and bad ways both there are a lot of elements that should be familiar to us as programmers in mathematical practice Programmer is also a lot like mathematicians we see the abstract method pervasively maybe in sometimes boring ways Maybe in more complex ways I Like mathematicians if you ask two programmers what programming is about you'll get four answers, right? So no one can really tell you You can take the same problem that's already been solved and You know talk about different ways to solve it for years and years and years and find that in lightning You can place emphasis on elegance in the economy of results just as mathematicians often do and You can very often accidentally rediscover known results, which I think is the hallmark of mathematics that No in a good way, right that that you understand things once you accidentally rediscover them and and we see this in programming as much as math So so here's my punchline in so far as I have one I believe we should teach programming from what I had introduced as a weak structural standpoint Which is to accord programming concepts the same status as mathematical concepts tell people their abstractions from the start Tell people that programming is abstractions in the sense. I've been describing and that's okay And and this is what I mean is I believe that in some sense, right? We have a notion of our machine sort of in some steampunk sense that you know Whether or not they're actually you know their chips and so on now like it's a machine and I don't know Maybe you put in the quarter and turn the handle and the steam comes out of it and the gears turn and and you were directing this Physical object and therefore it must be concrete and these abstractions cannot be the close to the metal that people speak of Right and but that's not really the case. It's just not and you know whenever and and and People have a hard time learning if they can't let go of that So right we need to sort of just encourage from the start that you know nobody very few people will claim that mathematics is Really, you know counting the rocks is an element of it But they know that it's more than that and they're taught that from a young age So why can't we let them know that programming is just the same and and whether or not they deeply believe it They should at least believe it for the sake of learning new things for the time being just contingently believe it And that there's an element of invention right we don't discover it in a sense you discover in a sense you create and there's We're making up the rules of the game as we go That's the mystery of the abstract method and now that's something that's lovely in programming in math in both ways is We invent the rules, but we don't know how to play the game, right? We get to send and and a lot of Discoveries are about discovering what you put in there that you didn't realize you had put in there and So, you know, it's the art of making things up with some consistent Consistency in how you make things up, but also, you know, not a consistency in what we mean by that term consistency Right. It's Calvin ball or it's building robot friends and talking to them And I don't think we teach people about programming in that sense And so I think improving the discipline of programming means encouraging mathematical thinking but simultaneously encouraging mathematical thinking means de-mystifying mathematics and encourage it right and and functional programming is a place where the two can meet and I guess I'll end there. Thanks for your time


We're going to do an example and make our own probability distribution or table from scratch a Supplier of aircraft parts has 12 altimeters that are correctly calibrated and two that are not Three altimeters are randomly selected without replacement without replacement Let X represent the number that aren't correctly calibrated create a probability distribution table So just from reading this question I was able to pick up on a few things and the first thing is that if I have 12 Altimeters that are correctly calibrated and to that or not means I have 14 Altimeters total so that's how many we had to pick from in our first trial 14 Next I am selecting three without replacement Which means that as I go to collect my three and select them, I will have one less every single time So these trials are dependent on each other Well first and foremost if you are considering Altimeters that aren't correctly calibrated and you have two that are not It is impossible for you to get three altimeters that aren't correctly calibrated So the probability that three altimeters are not correctly calibrated would be zero. It's not possible There's only two Altimeters that are not correctly calibrated Next the probability you get zero altimeters that are not correctly calibrated so For probability That X equals zero so you get zero altimeters Not correctly calibrated would be the probability that you would Get an altimeter that's calculated in the first trial probability you get an altimeter in the second Trial that's correctly calibrated and also the probability you get a correctly calibrated altimeter in the third trial So in the first trial the out of 14 altimeters How many would be correctly calibrated what are the favorable outcomes there would be 12 Second trial since you've already picked one that was correctly calibrated in the first trial You now have 13 altimeters to pick from and there are 11 that are correctly calibrated Third trial you now only have 12 altimeters to correctly that are correctly calibrated and you actually only have 10 That are correctly calibrated. That's 12 altimeters total 10 of them are correctly calibrated. So multiply 12 times 11 times 10 14 times 13 times 12 and I believe you'll get 1320 over 2184 You can write this as a decimal to For decimal places you get point six zero four four So the probability you get zero Altimeters not correctly calibrated is point six zero four four Alright, let's do the probability you get one One altimeter correctly calibrated not correctly calibrated So that means You want one altimeter that's not calibrated not correctly calibrated In the other two trials you do want the altimeters correctly calibrated So we have 14 altimeters total how many are not calibrated that would be two All right now, let's do the probability That in our second trial that we get a altimeter that is correctly calibrated out of 13 altimeters there would be 12 All 12 are still correctly calibrated because in my first trial I pulled out one that was not correctly calibrated Third trial out of my 12 total left 11 are correctly calibrated So two times 12 times 11 14 times 13 times 12. Excuse me 264 out of 2184 This is not the answer there Because how many ways are there for you to get one altimeter not correctly calibrated in three trials? Well The first one drawn Could be not calibrated The rest could be calibrated the second one drawn could be not correctly calibrated or Even the third one drawn could be not calibrated So there's three different ways total so take this probability 264 out of 2184 and multiply it by three So multiply it by three When you do that You will get point three six two six. I'm rounding everything to four decimal places We're applicable So we got point three six two six Next let's find the probability we get two altimeters that are not correctly calibrated or just not calibrated at all So probability that the altimeter on the first trial is not calibrated Probability that the altimeter we pick on the second trial is not calibrated And on the third trial probability that the altimeter we pick is calibrated So first trial out of my 14 altimeters how many are not calibrated that would be two Second trial out of the 13 remaining altimeters how many are not calibrated That would be one because I picked one out in the first trial And then third trial out of 12 altimeters how many are calibrated? All 12 are still in the mix So this is going to give me two times one times 12 which is 24 And then 14 times 13 times 12 That's just 2184 This is just one of a few ways that you can get two altimeters that are not calibrated So You could get two altimeters right off the bat that are not calibrated and the third one's calibrated Your not calibrated altimeters might be the first center of the third pool Or They might even be the last pool the last two pooled So there's three different ways you could obtain two altimeters that are not calibrated So take your answer three times 24 over 2184 Multiply together The answer that you get is actually 0.033 And if it makes you feel better you can add the zero at the end so everything's the four decimal places So we just created a probability distribution Let's now find the expected value or the mean of a probability distribution you could use technology But rather than having to pull up the technology that we could use Or pulling out my calculator. I can actually find the expected value or the mean Just by looking at my table Because of the formula for expected value or mean of a probability distribution I literally just multiply each Possible value by its probability so multiply across the rows of your probability distribution I got zero One times point three six two six is point three six two six On two times point zero three three Is going to be Point zero six six Three times zero zero So what i'm going to do here is I'm going to add this last column All of my products from multiplying the rows together. I'm going to add these results. So my expected value represented by the notation given here Or my mean they mean the same thing Be zero plus point three six two six plus point zero six six plus zero Which gives me an expected value of Point four two eight six Make sure you round to the appropriate number of decimal places Based on what the question states So once again the expected value or mean as point four two Eight six