welcome back so this is one of our first lectures on probability in this series on probability and statistics and so I'm going to start off really really simple with just defining what is a probability giving some really simple examples with things like coin flips and dice roll and then I'm going to give you some idea of how probabilities can be used in much more complicated um uh tasks in the real world things like modeling the likelihood of of you know part failures or hurricanes or you know things like that okay so at the at the
very very simplest probabilities are how we calculate How likely some event is to happen so the probability of an event a now I'm going to Define what I mean so an event a could be if I flip uh two coins the event a could be that I get no heads so what's the probability of an event happening the probability I'm going to try to color code here if I can the probability of a happening is the number of ways that this event can occur number of uh number of ways a can happen can happen divided
by the total number of things that could happen in Period divided by the total number of things that can happen like total the total number of things that can happen so I'm going to give you some really simple examples with coin flips and dice roll um but very very soon we're going to start Computing the probabilities of pretty sophisticated uh things we're going to compute the probabilities of you know what's the probability I get a straight flush and poker what's the probability that if I have a triple redundancy system I could still have a failure
on a critical system what's the probability that um if I have a positive test or a symtom that I actually have the disease okay these are the kinds of things we actually want to compute the probabilities of and we'll get to those very quickly but let's start with some really simple examples okay so let's start with um coin FL that's super easy I have an actual coin right here this is a Washington state quarter it has Mount rer and a salmon on it and I can flip this quarter two times okay I got a tails
the first time and I got a heads the second time okay so this is a Fair coin I actually shaved this morning so you wouldn't second guess whether or not my coin is fair so let's just set up a problem okay so the example is is I flip a coin twice I flip a coin twice now two questions I could very easily ask are what is the probability that I get um what's the probability I have at least one heads so um let's say that my event a is at least one of these coin flips
turns up heads and two I could say what's the probability so another event B could be what's the probability that there are no heads at all probability of no heads at all period out of the two coin flips so the way this is super easy to compute and I think you know any of us uh school kids right could compute this pretty easily but I'm going to formally do it so that we see that it really is a just about fancy counting okay and then we'll do a more sophisticated example and then we'll zoom out
so the first thing I'm going to do is I'm going to compute this this denominator here what is the total set of things that could happen period so if I flip a coin twice the things that could happen I could get um maybe I'll do this in uh in Orange I could get um heads and then heads I could get heads and then Tails I could get tails and then heads or I could get tails and then Tails this is the set of all things that could happen and we're going to just give this set
a name we're going to call it Omega um for right now you don't have to worry about set theory but very soon we're going to need need to start defining what is a set and some set theory to do more sophisticated probability but for now let's just say this is kind of a collection of all of the things that could happen as Omega there's four things that could happen so this denominator is four now a being at least one heads what are the set of coin flips where at least one of the coins was heads
so now a is the set heads Heads one of those is a head heads tails and Tails heads but not Tails Tails neither of those are heads so it doesn't satisfy event a occurring and so the probability of a is the number of ways a can happen there's three ways a can happen divided by the total number of things that can happen so three4 of the events have at least one heads or 75 percent okay so that's really really simple and I'm just kind of codifying what you already know about basic probability and one of
the things I love about probability is that you know all of our favorite games darts and back gam and poker you know uh dice DND all of them you know they have some element of randomness of of of probability and you can actually calculate the probabilities and get better at winning those games so that's kind of fun okay uh what's the probability that there are no heads well so this set B there's only one element in the set and that's if I flip two tails that's the only way I can have you know I don't
get at least one head is if both of the coins are tails and that means there's only one way that B can happen so the probability of B is one in four or 25% okay really easy to compute these but for example what if I flip a th000 coins what's the probability that I get 300 heads that would be a huge pain to count all of the possible ways I could get a th coins flipped and then you know add those all up so we're going to very very quickly come up with formulas and models
and better ways clever ways of counting these probabilities that's all probability is at the end of the day is just clever ways of counting how many ways that thing can happen out of the total number of things that can happen this is actually you know also how we Define entropy in statistical mechanics it's how we think about you know the theory of gases and gas Dynamics it's actually a very very big idea I'm just showing you some baby examples right now okay to get kind of make us feel comfortable good um maybe I'll do one
more example and then we'll we'll zoom out so second example is pretty easy so uh my second example is let's say I roll two dice okay I roll uh I roll two dice now depending on who my audience is I have to specify that this is a six cited dice with equal probabilities okay again I'm making assumptions here and you need to be defining those assumptions if you want to be really careful this was a Fair coin and each of these flips was independent meaning the second flip had nothing to do with the first flip
this is a fair six-sided Dice and each role is independent meaning the two dice don't affect each other um now that isn't always the case but it's it's the easiest set of assumptions so some of my questions I can ask would be things like uh what is the probability that at least one of these dice is a five the probability um at least one die is a five okay I'm like running out of space here but what's the probability that at least one die is a five the there's a lot of ways of solving this
the you know kind of most simple foolproof way and it's not the best way but the simplest way would be you know just list all of the possible combinations what is how many possible ways can I roll two dice well the set of all dice rolls I could get a one on the first eye and a one on the second one and two uh a one on the first eye and a three on the second a one on the first ey four on the second and so on and so forth dot dot dot dot dot
I could get a you know um a five on the first eye and a two on the second a five on the first eye and a three on the second dot dot dot dot dot and eventually if I enumerate all of them you know the last one would be a six on the first eye and a six on the second and it's pretty easy to compute just with uh kind of basic arithmetic that there are 36 total things that can happen if I roll two dice the first one there's six possible dice rolls and the
second dice there's six other unique dice roles for that Dice and so there's 6 * 6 or 36 possible things that could happen so now I want to count how many things can happen so that I get at least one dice is a five and I'm just going to go through it even though it's a little boring and you know how to do this just to remind you that I'm just going to take out of all the things that can happen all of the cases that satisfy this condition of at least one of the die
being a five okay so if the first die is a one the second die has to be a five if the first die is a two the second die has to be a five 3 five four five here's where it gets interesting if the first die is a five the second die can be anything 51 52 53 54 5 five five six and then again if the first die is a six the second die has to be a five for at least one of them to be a five and if I count this one two
three four five six seven eight nine 10 11 the probability of a occurring is 11 out of 36 so just under one and three chances of getting at least one die being a five so that's pretty easy um now again if I wanted to compute the probability if I rolled you know 15 die what's the probability of at least three of them being five that would be very hard to compute using this counting method the counting method is like it's like count on your fingers you don't actually want to do it but you can always
fall back on it as a thought experiment that's how you you can always count that way another way to do this would be I could draw a picture I could say well you know I have six possibilities for the first die and then for each of those I have six more possible outcomes so each of these if I drew it correctly would have you know six more and I could count that way that's another way to do it um maybe a slightly better way to do it would be to say you know to actually try
to reason through the ways these could happen I could say the probability of a is equal to the probability that the D one equals a five plus the probability die one doesn't equal five times the probability that d 2 equals 5 so either die one is five and if the first die is not a five die two has to be a five and I can compute this pretty easily the probability that the first die is a five is one and six the probability that the first eye is not a five is five and six there's
five ways that it cannot be a not be a five times the probability that the second ey is a five that's one and six and if I add these up I get 6 over 36 plus 5 over 36 is 11 over 36 this is a slightly better way of calculating this without listing all of the possibilities um you know add ad nause good okay so really really simple let's zoom out probability is one of the most important ways we model the real world we model weather probabilistically we model Health outcomes probabilistically we understand the likelihood
of having cancer given symptom X as a probability um you know we build probabilistic models of part failures and Manufacturing outcomes and safety outcomes you know what is the probability that my self-driving car is going to hit a pedestrian what are the probabilities that some critical component is going to fail you know uh while I'm driving or in midair or you know etc etc etc those are probabilities that we're Computing and we want to model those at the end of the day you calculate how many ways that thing can happen divided by how many total
things can happen that's you know that that's the simplest way to think about probability but again zooming out I made some big assumptions here in these cases the probability of a head or a tail those are equal probabilities the probability of you know all of the dice roles it's a fair dice so one is as likely as two is as likely as three and so on and so forth so we'll get into cases where um there are you know not these kind of uniform probabilities of things Happ happening we'll also get into cases where the
probability of sequential events is not independent where future things will depend on past things that's interesting too um there's this interesting idea that this coin is random we haven't really talked about what we mean by random um random is essentially this idea that the outcome of this coin flip is not deterministic or is very hard to model deterministically meaning we have to build a probability model for the outcome of this coin flip it's a little circular but if you think about it flipping this coin actually is deterministic it's a physical coin it has mass it's
not you know quantum mechanical when I flip this coin there's wind resistance there's Mass there's inertia it's acting under the effect of gravity it is a predictable deterministic system there is you a formula essentially for the physics of this coin and you could simulate coin flips what we mean by random is that the outcome of this coin flip is too hard for me to predict with the information I have so for me it might as well be random it might as well be a 5050 chance now that's interesting in the machine learning era I actually
bet you could take a video of me flipping a coin and if you had enough information you could probably predict what the outcome is going to be better than coin flip better than 50/50 odds from the information of that coin rising to its peak I bet by the time you see it go up to its peak you could call it in the air heads or tails with a machine learning algorithm that might be a cool project to try to build um actually build a classifier to see if you can tell you know what the coin
flip is going to be in the air just from watching it flip okay maybe you could maybe you couldn't I don't know I can't and so for me it's a random event it's a there's a probability associated with it and that's how most of the world is you know weather is deterministic there's physics that drives the climate that drives the weather that drives clouds and storms and tornadoes and hurricanes but with the information we have with the uncertainty in our measurements and the uncertainty uh in our information at some point in the future all we
can say are probabilistic estimates and probabilistic forecast the better we measure and the better we model those physical systems the tighter those probabilistic estimates become and eventually they might become deterministic we might be certain that this is going to be a heads just from observing its its path in the air but with increased uncertainty things look more and more random now some things truly are random the decay of a radioactive element that's actually random um that is a stochastic process it's kind of a whatever quantum mechanical process that is truly random so radioactive decay um
is an actual uh uh random process but a lot of the things that we pretend are random are actually deterministic they're just too complicated for us to actually understand and model and so we model them with probabilities instead it's a very very useful way to model things like turbulence uh if I think about the molecules of gas in this room I can't model every single atom and I don't want to I model the average value of their velocities and I call it a temperature that's a a a probabilistic or a statistical way of quantifying information
um I guess parting thought here very very important we're going to get to this soon probability is all about modeling what can happen and Counting what can happen statistics is almost the inverse problem let's say I flip a coin 10 times and I get 10 heads in a row what are the chances that that coin is fair that's a statistics problem so I have a model of what I think the coin is behaving like but then I actually collect data and it might disagree with my model what are the chances that that is truly just
from the randomness the natural randomness of the system and what are the chances that my coin my model of the coin are wrong so that's what statistics is all about is hypothesis testing testing your probability model collecting data and making hypotheses uh about that or inferring things if I if I measure certain genes or certain um Health traits can I infer what is the likelihood of you know some underlying uh causal effect um you know some some underlying disease that's causing those symptoms that's causing those test scores so those are all things that we're going
to talk about soon in probability and statistics we're going to start with real simple examples very quickly we're going to learn how to calculate much more sophisticated things like poker hands probability of part failures how many parts you need to inspect to be 99% sure of a certain quality or a certain reliability things like that tons tons more coming this is one of the most powerful useful uh ways of modeling the world we're going to question our assumptions we're going to try lots of things we're going to build lots of probability models and soon we're
actually going to start collecting data and running experiments and doing statistics against these probabilistic models okay thank you