I am studying distribution functions of random variables. The text I'm reading has the next example: Suppose we toss a fair coin, and if it comes up $H$, then $X = 1,$ and if it comes up $T,$ then $X$ is determined by spinning a pointer and noting its final position on a scale from 0 to 2, that is, $X$ is then uniformly distributed over the interval [0,2].
Then proceeds to compute the distribution function utilizing Law of Total Probability. I don't have any problem understanding the way in an intuitively fashion because conditioning under the result of head or tail we can utilizing 'geometric probability'. My question is: Why $X$ defined in such manner is a random variable?
I am testing some ways to define $X$ as a function by parts, but I have trouble when I am utilizing the definition of inverse mapping of Borel sets or $\{X\leq x\}$ because I think is necesary utilize some random variable $Y$ with uniform distribution over $[0,2]$, but I cannot see how to define $X$ in terms of $Y.$ What is the proper way to define $X$ as function in such manner it be the random variable of the experiment?
Any kind of help is thanked in advanced.