Realizations of random variable Can some of you help me with following exercise?

Provide a procedure to generate realizations of a random variable with
  CDF (cumulative distribution function) $Fx(x)$ given by:
$Fx(x)=(x+1)/4$ if   $-1<x<0$
$Fx(x)=(x+3)/4$ if $0<=x<1$

What is the meaning of generate realizations of random variable?
Thank all!
 A: I think what is meant is: produce (pseudo-) random numbers.
Note that for a distribution function $F$ and its inverse $F^{-1}$ and a uniform random variable $U$ it holds that
$ F^{-1}(U) $ has distribution $F$. You an google random number generation and find this procedure.
In you case:


*

*find the inverse of $F$

*Generate uniform random variables

*Apply $F^{-1}$


Then you are done. Which programming language do you use?
Edit: As remarked by Macro there is an atom at $0$ with probabilty $\frac12$. I think we can still use the inverse in the following way:


*

*find the inverse for $x \in [-1,0)$ and $x \in (0,1]$

*Generate a uniform $U$

*Call the generated rv $X$
3.a) If $U \in [0,\frac14]$ then apply $F^{-1}$ as definded on the left of $0$ and set $X = F^{-1}(U)$
3.b) If $U \in (\frac14,\frac34)$ then set $X = 0$
3.c) If $U \in [\frac34,1]$  then apply $F^{-1}$ as definded on the right of $0$ and set $X = F^{-1}(U)$.
This should take care for the atom. Note that I did not care about open or closed intervals in the definition above as the probability for the uniform to reach the the point at the interval end is zero.
