If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Statistics and probability

### Course: Statistics and probability>Unit 9

Lesson 2: Continuous random variables

# Probability density functions

Probability density functions for continuous random variables. Created by Sal Khan.

## Want to join the conversation?

• I don't completely understand why the area under a graph represents probability of something happening. Extending from discrete variables, their probability was not the area under the graph but rather just the corresponding value on the y-axis, why should it be any different here? I can intuitively see why any 1 value would have the probability of 0, but even then, where does the area under the graph come in?
• Here's another trick to visualizing this: Suppose you use rain fall measurement as a tool for getting unfair dice rolls. So let's map the inches of rain to every side on a 4-sided dice. Between 0.0 and 0.5 inches gives a "0" dice roll, between 0.5 and 1.0 inches gives "1", 1.0 to 1.5 gives "2", 1.5 to 2.0 gives "3" and finally anything more than 2.0 gives "4". Now if you rewrite that as a bar chart then every bar's length takes on the area under the PDF for the range you mapped to that bar's number. The bar chart is a little bit like a step-wise approximation of the graph where each step is given a dimension of 1 along the x-axis. So selecting one bar would be equivalent to selecting the area under that step.
• At Sal says that the two statements P(|Y-2|<.1) and P(1.9<Y<2.1) are the same. Why?
• |Y-2|<.1 is the same as 1.9<Y<2.1 because :
solving "|Y-2|<.1" for "(Y-2) >= 0" gives "Y-2<.1" wich gives "Y < 2.1"
solving "|Y-2|<.1" for " (Y-2) < 0" gives "-Y+2<.1" wich gives "-Y<-1.9" wich gives "Y > 1.9"
Search for lecture about absolute value for more explanation.
• I have a hard time wrapping my head around infinity (probably not the first one.)
I get the concept of continuity and that the probability on a specific point is zero. I am just curious... if the area under the curve is 1 but the curve goes on to +Inf (or in case of a normal distribution even to -Inf and +Inf) then it feels like you could add a little area to the right whenever you want to - so going on forever even with smaller and smaller probability that gets added to the area. So how can something be fixed to 1 when the area itself is not really fixed.
I guess its the same paradox like the finger of a spinning wheel that has 0 probabilty to stop at any particular point but eventually does stop somewhere....
• In answer to your question about how the total area can be fixed to 1 even though the curve may continue to infinity: try thinking of it this way: start with 0.5 and keep adding half and half again: that is, 0.5+0.25+0.125+0.0625 +.... (keep going forever). However far you go will not get an infinite number, you will get a number that keeps approaching but not quite reaching 1; that is, 'tending to' 1. (You may prefer to think of this as 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + ..... + 1/n where n tends to infinity.) So, contrary to our intuitive first impression, it is actually possible to add increasingly small amounts infinitely and yet never be in 'danger' of exceeding a certain finite total. In this case it's because you are only ever adding on half of what you would actually need to reach 1 - like being 1m away from a wall and walking half a metre, then a quarter of a metre, etc...... - but I'm sure there are other cases!
• Isn't the part you mentioned from that use calculus to find out the probability as 1.9<Y<2.1 should be CDF(cumulative distribution function) instead of PDF?or the PDF includs CDF??
please answer me the question so i can find out whether i got wrong！thx
• A CDF function, such as F(x), is the integral of the PDF f(x) up to x. That is, the probability of getting a value x or smaller P(Y <= x) = F(x). So if you want to find the probability of rain between 1.9 < Y < 2.1 you can use F(2.1) - F(1.9), which is equal to integrating f(x) from x = 1.9 to 2.1.

• This might be stupid, but instead of asking for precisely P(Y = 2), couldn't we ask for the limit as Y approaches 2?
• The question of "limit as Y approaches 2" is not at all stupid: It is exactly the point! You just have to be careful with placement of the word "precisely": The limit of Prob(Y= precisely 2) = limit of Prob(Y= 2 +/- a bit) as "a bit" approaches zero,... which = 0 . On the other hand... limit Prob(Y = 2 +/- a bit) =1 as "a bit" approaches "whatever" (ie. as "a bit" approaches infinity).
• Is there any continuation to this with multidimensional density functions??? more continuos density functions or expected values from continuos density functions???? beacuse i could not find any video.
• Nice question! Yes, there are joint probability density functions of more than one variable! If X_1, X_2, ... , X_n are continuous random variables, then their joint density function is denoted by f(x_1, x_2, ... , x_n).

The joint cumulative distribution function of X_1, X_2, ... , X_n is given by
F(x_1, x_2, ... , x_n) = P(X_1 <= x_1 and X_2 <= x_2 and ... and X_n <= x_n)
= integral -infinity to x_1 integral -infinity to x_2 ... integral -infinity to x_n of f(y_1, y_2, ... , y_n) dy_n ... dy_2 dy_1.

The joint probability density function, f(x_1, x_2, ... , x_n), can be obtained from the joint cumulative distribution function by the formula

f(x_1, x_2, ... , x_n) = n-fold mixed partial derivative of F(x_1, x_2, ... , x_n) with respect to x_1, x_2, ... , x_n.

If A is a subset of R^n (i.e. n-dimensional space), then the probability that (X_1, X_2, ... , X_n) is in A is given by

P((X_1, X_2, ... , X_n) is in A) =
n-fold integral over (X_1, X_2, ... , X_n) in A of f(x_1, x_2, ... , x_n) dV,

where dV is the n-dimensional infinitesimal volume element.

For a function g of these n random variables, the expectation of g is given by
E(g(X_1, X_2, ... , X_n)) = integral -infinity to infinity integral -infinity to infinity ... integral -infinity to infinity of f(x_1, x_2, ... , x_n) g(x_1, x_2, ... , x_n) dx_n ... dx_2 dx_1.

Have a blessed, wonderful day!
• I don't understand how you are supposed to draw a continuous probability graph properly, as it is just a probability of 0 along the whole graph.
• When we plot a continuous distribution, we are actually plotting the density. The probability for the continuous distribution is defined as the integral of the density function over some range (adding up the area below the curve)

The integral at a point is zero, but the density is non-zero.
• The probability of 2 inches of rain can't be zero, can it? I get that we can't be certain but probabilit y of 0 would imply that we never ever get 2 inches of rain but we couldn't be sure of that. I would really like to get this point cleared.
• The probability of exactly two inches of rain is zero. But we can think about the probability of getting between 1.9 and 2.1 inches of rain and the probability of getting between 1.99 and 2.01 inches of rain and so on, because all of those probabilities with actual intervals will be non-zero. So if you consider the ratio of those probabilities to the length of the intervals and take the limit of that ratio as the intervals become very very small, you will get, in some sense, the relative likelihood that you will get "around" two inches of rain, which is what the continuous density function is trying to measure.
• Does sal explain the area under the curve and explain the fact that its equal to 1 in any of his videos?
• Yes in this video at