# Find the cumulative probability function given a probability density function

I am reading a very basic probability introduction. It's mostly a good text, but some small minutiae are often glazed over that someone with a more mathematical background might otherwise understand.

Given a probability mass function $f(w)$ that represents the temperatures you might encounter on a picnic: $$f(w)= \begin{cases} \frac{w-40}{625}, & \text{if } 40 \leq w \leq 65 ;\\ \frac{90-w}{625}, & \text{if } 65 \leq w \leq 90 ;\\ 0, & \text{otherwise} \end{cases}$$

the cumulative distribution function, $F$, is defined as:

$$F(w)=\int_{-\infty}^w f(u)dx$$ $$= \begin{cases} 0, &\text{if } w < 40 ;\\ \frac{w^2-80w+1600}{1250}, & \text{if } 40 \leq w \leq 65 ;\\ \frac{180w-w^2-6850}{1250}, & \text{if } 65 \leq w \leq 90 ;\\ 1, & \text{otherwise} \end{cases}$$

Questions:

1. What is the significance of capital $F$ for the cumulative distribution function as opposed to lower case $f$ for the probability mass function? Is that simply customary for defining a cumulative distribution function?
2. Why do we need a new function, $f(u)$, for the cumulative distribution function? Earlier in the text, it was demonstrated how to find the probability that the temperature would be $\leq55.2$ by:

$$\int_{40}^{55.2} f(w) dw = \int_{40}^{55.2} \frac{w-40}{625}dw$$ $$=\frac{w^2-80w}{1250}\Big|_{40}^{55.2} \$$ $$=\frac{55.2^2-80\times55.2-40^2+80\times40}{1250} \$$ $$=0.185 \text{ (rounded to 3 d.p.)} \$$ Is this not just a cumulative probability function from $-\infty$ to $55.2$? If so, then why is a new cumulative probability defined as above?

1. How did the author calculate the cumulative probability function? I understand how:

$$\int_{40}^{55.2} f(w) dw = \frac{w^2-80w}{1250}\Big|_{40}^{55.2}$$ but where does:

$$\frac{w^2-80w+1600}{1250}$$ come from?

Reference:

Tilman M. Davies. 2015. The Book of R: A First Course in Programming and Statistics (1st ed.). No Starch Press, San Francisco, CA, USA.

Edit:

I can arrive by hand at $$\int\frac{w-40}{625}dw = \frac{w^2-80w}{1250} + C$$ and $$\int\frac{90-w}{625}dw = \frac{180w-w^2}{1250} + K$$

Where does the $1600$ and the $6850$ in the numerators of the two functions below come from?

$$\frac{w^2-80w + 1600}{1250}\text{if }40\leq w \leq 65;$$ and $$\frac{180w-w^2-6850}{1250}\text{if }65 < w \leq 90;$$

I'm sorry that I am also asking for a quick explanation on some basic integral math.

• It will be helpful if you can distinguish the difference between a discrete random variable with probability mass function (pmf) and a continuous random variable with probability density function. Summing the pmf / integrating the pdf from $-\infty$ to $x$ will get you the cumulative distribution function (CDF) $F$. For Q2, from definition, it is obvious that $\Pr\{X < 40\} = 0$ (both your pdf and CDF result show this) so $\displaystyle \int_{-\infty}^{55.2} f(w)dw = \int_{-\infty}^{40} f(w)dw + \int_{40}^{55.2} f(w)dw = \int_{40}^{55.2} f(w)dw$ – BGM Mar 8 '18 at 6:35

1) You must be familiar with statistical concepts of "frequency" (denoted by $f$) and "cumulative frequncy" (denoted by $F$). The concepts of "probability density function" and "cumulative probability density function" are extensions of those statistical concepts to probability (percentage, proportion) concepts.

2) You are right, PDF is integrated to get CDF. The author did the same: $$\int \frac{w-40}{625}dw=\frac{(w-40)^2}{1250}+C=\frac{w^2-80w+1600}{1250}+C.$$

• Please see my edit. I am not sure where the $1600$ in the numerator of your anti-derivative comes from. I feel like I am messing up some very basic math here. – Dylan Russell Mar 8 '18 at 22:39
• Expanding $(w-40)^2=w^2-80w+1600$. That is $40^2=40\cdot 40=1600.$ – farruhota Mar 9 '18 at 2:04

Partial: I will only answer how they got $F(w)$ for $40 \leq w \leq 65$. $F(w)=\int_{40}^{w} f(u) du =\int_{40}^{w} \frac {u-40} {625}du =(\{u^{2}/2 -40u\}_{u=w} - \{u^{2} /2-40u\}_{u=40})/625$ =$\frac {w^{2}-80w-2(40^{2}/2-1600)} {1250}$=$\frac {w^{2}-80w+1600} {1250}$

1. This a naming convention. It is useful, however to denote the cdf and the pdf of the same random variable with the same letter -- yet the two notations have to be different as the functions are different.

2.

The cdf. exists always, the pdf does not exist necessarily. However it is easier to use the pdf.

1. $$\frac{w^2-80w+1600}{1250}$$

comes from $$\int_{40}^wf (x)dx=P (40 <X\leq w) =F (w)-F (40)$$

where $40 <w\leq 65$ and $X$ is the random variable about whose cdf and pdf we are talking.

• Please see my edit. I am not sure where the $1600$ in the numerator of your anti-derivative comes from. I feel like I am messing up some very basic math here. – Dylan Russell Mar 8 '18 at 22:40
• You have a definite integral. So you substitute the upper limit to the antiderivative and then the lower limit and then subtract the latter from the former. – zoli Mar 8 '18 at 23:02
• Yes, I understand how $\int\frac{w-40}{625} = \frac{w^2-80w}{1250} + C$ and then how to substitute in the limits to find the cumulative probability. For example, if I use the limits $65$ and $40$, I would get $0.5$, which makes sense if you graph the probability mass function as its symmetric and unipolar. What I don't understand is where the $1600$ comes from when the author later defines the case $40\leq w \leq 65$ in the CDF. – Dylan Russell Mar 9 '18 at 0:03
• $\left[\frac{x^2-80x}{1250}+C\right]_{40}^w=\left(\frac{w^2-80w}{1250}+C\right)-\left(\frac{40^2-80\times40}{1250}+C\right)=\frac{w^2-80w-1600+3200}{1250}=\frac{w^2-80w+1600}{1250}.$ – zoli Mar 9 '18 at 0:15
• Ah ok, so the other function would be: $$\left[\frac{180x-x^2}{1250}+C\right]_{65}^w=\left(\frac{180w-w^2}{1250}+C\right)-\left(\frac{180\times65-65^2}{1250}+C\right)=\frac{180w - w^2}{1250}-\frac{180\times 65 - 65^2}{1250} + C=\frac{180w-w^2-7475}{1250} + C$$ Which isn't $\frac{180w-w^2-6850}{1250}$? I'm really sorry I'm basically asking you to spell this out for me man, I'm just really struggling here. I swear I'm trying to work it on my own in between posts on paper. – Dylan Russell Mar 9 '18 at 3:18