How to draw a distribution of the function?

259 Views Asked by At

I have $f(x)= \frac{1}{2}$ and $x\in[0,2]$.

How i can draw a distribution for it ?

1

There are 1 best solutions below

0
On

A density is just like any other function. To plot it, simply draw $f(x) = \frac{1}{2}$ on the given interval $[0,2]$. This would be a zero slope line at $\frac{1}{2}$ on the vertical axis from $0$ to $2$ on the horizontal axis (including $0$ and $2$, obviously). Note that the vertical axis is the probability for a given element in the domain of the random variable whose density function we are considering. This is the density of a uniform random variable on $[0,2]$.