# What is the difference between a CDF vs a PDF?

**What is the difference between a CDF vs a PDF?**

The y-axis. For a CDF it is the probability from minus infinity up to the respective value of the random variable.

For a pdf, it is the “density”, the derivative, the tangent(trigonometry) of the CDF on the respective point in the CDF.

A discrete function has no derivatives. Infinite straight lines can be drawn. That is the reason edges of functions have no derivatives. But don’t worry mathematics has a solution for you.

The y-axis is a probability mass function is just that straight probability. It is the difference(a recurrence relation, the change) in the CDF.

If a random variable has a probability of x that also means at that exact point the CDF also increases by x.

Since this is posted in Statistics discipline ( pdf and CDF have other meanings too):

#### 1) pdf ( probability density function)

This basically is a probability law for a continuous random variable say X ( for discrete, it is probability mass function).

The probability law defines the chances of the random variable taking a particular value say x, i.e. P (X=x).

However, this definition is not valid for continuous random variables because the probability at a given point is zero.

An alternate to this is: pdf= P (x-e<X<=x)/e as e tends to zero.

#### 2) CDF ( Cumulative Distribution Function)

As the name cumulative suggests, this is simply the probability up to a particular value of the random variable, say x. Generally denoted by F, F= P (X<=x) for any value of x in the X space. It is defined for both discrete and continuous random variables.

For detailed descriptions, refer to any book on fundamental statistics.

## What is the difference between a CDF vs a PDF?

CDF stands for the cumulative distribution function. It takes as input any real number and returns as output a number from 0 up to 1. It is defined as cdfX(a)=FX(a)=P(X≤a).

PDF stands for probability density function. It is a bit trickier to define. When X is a continuous random variable, then pdfX(a)=fX(x)=[\cdfX(a)]′=dcdfX(a)/da. When X is a discrete random variable, then pdfX(a)=(P)(X=a).

So a CDF is a function whose output is a probability. The PDF is a function whose output is a nonnegative number. The PDF itself is not a probability (unlike the CDF), but it can be used to calculate probabilities.

When X is a continuous random variable, then we use integration to calculate probabilities using the PDF: P(X∈A)=∫an∈AfX(a) dx. When X is a discrete random variable, then we use summation to calculate probabilities using the PDF: P(X∈A)=∑an∈AfX(a).

### Conclusion:

A function ‘F(x)’ is said to be a CDF if it follows the following properties

- F(x) is non decreasing (i.e.dF(X)dx≥0)
- F(-∞)=0
- F(+∞)=1
- F(x) is always right continuous.

Basically CDF gives P(X≤ x), where X is a continuous random variable, i.e. it is the area under the curve of the distribution function below point x.

On the other hand PDF(probability distribution function) of a continuous random variable is a function ‘f(x)’ such that

- f(x)>0, for all x belonging to the sample space Ω.
- ∫Ωf(x)dx =1

PDF of a continuous random variable gives the value P(X=x) and area at a point (say x) is 0.

we can obtain the CDF

F(t) = ∫taf(x)dx

when xϵ(a,b)

suppose, a continuous random variable X follows Normal Distribution.

Hence, X~N( μ,σ2 );x∈R

The PDF of X is

ϕ(x)=(1/(σ∗2π−−√))∗e((−1/2)((x−µ)/σ)2)) , whenx∈R

and the CDF of X is

Φ(x)=∫x−∞(1/(σ∗2π−−√))∗e((−1/2)((x−µ)/σ)2))dx

for further details: Outline of statistics – Wikipedia

What is a good average number of keystrokes per hour