These are draft notes extracted from subtitles. Feel free to improve them. Contributions are most welcome. Thank you!
Please check the wiki guide for some tips on wiki editing.
So today I want to talk about a little bit more of probability distributionsand specifically talk about what ??? continuous distribution isbecause there is some ??? that you should be aware of ??? look forward in this class.So here's a new prop. It's a ??? gun.They actually shoot like this and we have a lot of those at Udacityand I want to know doing experiment in which I shoot it projectile and some way hits the ground.
And the answer is zero, nothing else butzero. Because any specific value over hereis just really, really unlikely – so unlikelywe can give it a probability.
This is a more common example; it’s called thewheel of fortune. We’re twisting an object likea bottle, or like a pen and then it arrives at aspecific angle. We all know that angles gobetween zero and 360 degree. So let’s take aspecific angle. What is the probability that ourobject has the very precise angle 180 degrees?
And the answer is zero. It’s zero for any othernumber. 179.99, 179.98 and so on, eachangle has probability zero. That’s becausegetting that exact angle right with exact theright decibels, you just won’t be able to get there.
So now here is the conundrum. Does this meanthat the object stops nowhere, yes or no?Say, yes, if you believe it stops nowhere.
And of course it stops. So, no, is the right answer. But the bizarre thing is, it’s goingto have an angle, like this one over here,this might be 101.374819 and so on. And this number truly has probability zero. So whatever the outcome is, that specificoutcome will be unlikely, so unlikely as probability zero. And this is one of the bizarre things about probability when you go to continue spaces. In continuous distributions, every outcome has probability zero. And that might sound entirely counter intuitive and it is, but it is important to understand.
So let’s now redefine how to treat continuousdistributions, here is our circle again andhere is the bottle that we are spinning.Let’s call the outcome X, that’s the final angle at which the bottle arrives. Tell me what’s the probability that X is between zero and 180 degrees? Put your answer here.
And you guys correctly, it’s half. There is a50% chance of being between zero and 180and the 50% chance of between 180 and 360.
How about the interval 260 degree all theway to 290 degrees, what’s the probability?
That’s actually one twelfth: 0.0833 and so on.
Okay, let’s make this interval really, really small.Let’s say we go from 179 degrees to 180degrees. So, it’s specific up to a single degreebut is still an ever so slight range in thespectrum over here. What’s the probability?
It’s 0.002777 which is the same as 1 over360. So, obviously, the probability for anyinterval, defined by A and B, is the size ofthe interval divided by 360. And, if yougot those right, you understand all this.
So, I’m now going to teach you a concept thatis very deep, called the density of a probability.And it’s kind of like a probability for continuousspaces but not exactly. It’s just a good motivatorto think of a density as a – of a probability forcontinuous spaces. Let’s take the bottleexample. We know that the outcome of turningthe bottle lies between 0 and 360 degrees.So, given what we learnt, you want to assign0 to anything outside that range but insidethis range, we’d love to give a value and say,look, there is a function here that rendersevery outcome in this interval equally likely.So, you’re going to construct this function forSo, you’re going to construct this function for cnumber one, each outcome in the range of 0to 360 has an equal value, and, constraintnumber two, the area under this function sumsup or integrates to 1 which means this areaover here is just 1. So, tell me what is thisfunction for X’s that are between 0 and 360degrees. There is a single numerical valuethat goes in here and you have to guess it.
And, the answer is, again, 0.002777 and so on,which is the same as 1 over 360. And, the wayto see this is that the width of this interval overhere is 360. We didn’t know the height whichis what I asked you to guess. But, if we multiply360 by 1 over 360 then the area of this rectangleover here becomes 1. So, let’s do this again.
Suppose, you look at the date and time you wereborn, and then specifically look not at the date, not even the time, but just the seconds of thetime. So, it could be that we were born exactlyas the minute began, in which case, it was zero; or exactly at second 59.282, I don’t know.Let’s assume it’s completely uniform. Thereis no preference to be born early in theminute or late in the minute. I’m going toask you two questions now. For any suchthing, X, where X is the seconds of the timestamp, what’s the probability of that specific X? And, what’s the density of that specific X?It might mean that these are actually different questions.
And, the correct answer here is 0. Any specificcontinuous thing, 0. For uniform distribution,we find that the interval we’re talking aboutskates between 0 and 60 so the correctanswer is 1 over 60 and that is 0.01666.
So, here’s a new quiz and in this quiz you’llbe looking into densities that are non-uniform.In particular, I’m looking at the time of daywhen people are born. And, let’s assumefor this exercise that it’s twice as likely tobe born before noon than in the afternoonor the evening. So, if you look at the timeof day and the density for the time of day,I wonder if the shape is like this. This iszero and this is midnight, right at 24.Perhaps like this or more like that? Pickthe one that you think is most plausible.
This is the one I would pick and the reason,if it’s twice as likely to be born before noon,it means the density in the morning, beforenoon, should be twice as high as the densityin the afternoon. And that’s best depicted bythis diagram over here. This one would beuniform so ignoring the fact that it’s twiceas likely. And, this is even worse; itemphasizes the afternoon over the morning.
And, now, comes the hard part. I want you tocalculate the actual density. We know that thedensity for the birth time to be before noon istwice as large as the density for being bornafter noon. So, here is my density function,time of day X, Nf of X and you’ve alreadyidentified the shape. And, there’s now twoparameters, A and B. I want you to figure outfor me what A is and what B is, assuming thatthe basic unit here is in hours. Put differently,there is 24 hours horizontally in this interval. As a hint, make sure that thearea underneath sums up to 1.
And, here’s how I calculate it. These spheresover here are all of the same volume. Sincethey have to add up to 1, each of those hasexactly a third. Now, let’s start with the rightone. If this is a third in terms of area and wehave to cover 12 hours, then B equals to Athird times 12 which is 0.0277. The one onthe left is exactly twice the size, 0.0555which is two-thirds times 12, it’s 1/18th.
if we multiply A by 12 because the densityover here applies to 12 hours, plus B by times12, tell me what the resulting number is.
And, I hope you got this right as, of course,1 because the surface area has to add up to 1.This was to cross-check over here, whereby1/18th times 12 is two-thirds and 1/36 times12 is one-third, and two-thirds plus one-thirdsequals 1. So, this was an example of a non-uniformdensity that you were able to compute. As youcan tell, each specific birth time has exactly aprobability of zero and this is just a density.
Here’s another quiz. You’re dropping a packageout of an aircraft, and the package goes downand we happen to know it takes between 3 and3.5 minutes to reach the ground. And, let’s say,in between the probability density is uniform.Asking the same question again. There’s somethingto be learnt here. Here is 3. Here is 3.5. Obviously,the density outside is zero, is uniform, and there’sa value here A. And, I want you to tell me what is A.
And in my calculation A is 2. And, the reasonis the normalizer over here is a half, fromthree to three and a half. To multiply a halfwith 2 gives us the area of 1 which is whatwe want to have for density. Now, what’sinteresting here? A is larger than 1. Probabilitiesare never larger than 1. They are bound to theabove by 1. But, densities can be larger than 1.In fact, if this package were to arrive between3 minutes and 3 minutes and 1 second, thenthis would be 60 because there are 60seconds in a minute. So, it is possible thatdensities become larger than 1; that’s a bitconfusing if you think it was probability. But, you should know that this is the case.
Let me ask another trick question and that’ssomewhat academic. For function f to qualifyas an entity which of the conditions have tobe fulfilled: has to be positive, non-negative,continuous, and smaller or equal to 1? Checkany or all that apply including the ‘none ofabove’ if you believe none of those apply.
And, this is a really tricky question. So,clearly, densities don’t have to be positiveeverywhere. It suffices to be non-negativeand I gave you examples where outside ofcertain interval density was zero. Zero is notpositive. Zero is just non-negative. Now,densities don’t have to be continuous. I gaveyou an example of a density like this. And,over here where the density jumped, you hada point of discontinuity. So, continuous isnot correct. And, if you got this wrong,no big deal. The word continuous might noteven mean much to you. But, it’s one of thesethings to know about densities. Now, smalleror equal to 1, that’s a really tricky one. And, Iwould submit that’s not correct and here’s why.Suppose you have a density that assignsuniform probability only to values between 0and 0.1, then the height of this density couldbe 10; it’s 1 over 0.1. And, as a result, it’spossible that densities can exceed 1. Andthat is a key point that makes them differentfrom probabilities. Probabilities are alwayssmaller than or equal to 1. Densities can be larger than 1.
So you just learned about the concept of aprobability density and that’s very cool.You now know what a uniform density is, you’veencountered a new type of density that have astep in the middle and later in this class wewill see densities that are very funny likethis one over here called the Gaussian.We get back to this after we talked about largenumbers and something funky called thecentral limit theorem or CLT.