2

I have sometimes seen the formulas such that $\operatorname{Var}(aX+b)=a^2\operatorname{Var} X$ and $EX^2=\sum_{x=0}^nx^2\binom{n}{x}p^x(1-p)^{n-x}$. But how do we define $aX+b$ and $X^2$ if, say $X\sim \operatorname{binomial}(n,p)$, is given? Or in general case.

2 Answers2

10

As an example, assume you toss a fair coin ten times and that $X$ is the number of heads. Then sometimes you will have 5 times head, sometimes 6 heads ... out of the 10 coin tosses.

The number of heads out of 10 coin tosses is thus random: you can not say in advance how many heads you will have, however you know 'something' about it: it must be somewhere between 0 and 10 heads, and for each outcome you can compute the probability that it occurs, nl the probability to observe e.g. 4 heads is $\binom{10}{4}0.5^4(1-0.5)^{10-4}$.

In this case, if you denote the number of heads that you get in ten coin tosses as $X$, then $X$ is a binomial variable of size 10 and with a success probability of $p=50\%$ so $X \sim Bin(n=10,p=0.5)$.

Now, let us analyse this further: if I toss ten coins, then I can have 4 heads in several ways : HHHHTTTTTT (Head=H, T= not head), but also TTTTTTHHHH, ...

So the random variable is a function that 'maps' the combinations of ten H/T onto a number, namely the number of H's among all 10. This is what is meant by $X: S\to \mathbb{R}$, the set $S$ is the set of all possible n-tuples (n=10) of H,T's and one such n-tupple is mapped onto a real number (hence $S \to \mathbb{R}$) by counting the number of H's among the 10.

So $X$ maps e.g. "HTTTTTTTTT" to $1$ or $X(HTTTTTTTTT)=1$, $X(HHHHHHHHHH)=10$, ...

Note that the outcome can be $1$ in several H,T n-tupples, HTTTTTTTTT, THTTTTTTTT, ... or in terms of functions, the inverse of $1$ under the function $X$ is a set of n-tupples: $X^{-1}(1)=\{HTTTTTTTTT,THTTTTTTTT, \dots TTTTTTTTTH \}$, and if you now look at the binomial densities, then the fact that $X^{-1}(1)$ is a set is excatly the reason for the factor $\binom{n}{x}$ in your formula.

So a random variable is a map that maps the outcome of a random experiment onto a real number.

What is now the random variable $5X$ ?

Well it is a random variable that is the number of heads (in 10 coins tosses) multiplied by 5. It is a random variable because you can not tell in advance what the outcome will be, you know the possible outcomes (0, 5, 10, ... 50) and for each outcome you can compute the probability.

The random variable $5X$ is a map (a function) from the set of the possible combinations of ten H/T onto a number, namely five times the number of H's among all 10.

  • @f coppens A nice clarification. please also in simple terms distinction between a ranfom variable and random function. –  Aug 30 '15 at 13:35
  • @subhash c. davar: I would like to do it but I must admit that I don't know a formal definition of random function, how is it defined , do you have a link or so ? –  Aug 30 '15 at 14:38
  • A random function would be a random variable defined on a probability space whose underlying elements are a set of functions. Certain kinds of random functions are called [stochastic processes](https://en.wikipedia.org/wiki/Stochastic_process#Definition). A generalization of those is called a [random field](https://en.wikipedia.org/wiki/Random_field). – whuber Aug 28 '16 at 16:43
  • @whuber: when you say ''A random function would be a random variable defined on a probability space whose underlying elements are a set of functions'', do you mean that the elements of the sample space $\Omega$ of the probability space $(\Omega, \mathcal{F}, \mathbb{P})$ are functions ? –  Aug 28 '16 at 17:27
  • Yes. The Wikipedia articles are pretty clear about that in the specific cases of stochastic processes and random fields. – whuber Aug 28 '16 at 19:39
  • @whuber: well in the link (stochastic process is a special kind of random function) you mentioned in your comment supra, it is not said that $\Omega$ should be a set of functions , or did I misunderstand that ? This link: https://en.wikipedia.org/wiki/Stochastic_process#Definition, it says an 'S-valued stochastic proces ...' but does it say that $\Omega$ is a set of functions ? –  Aug 28 '16 at 19:51
  • When you unravel the definitions, it becomes clearer. The set "$\{X_t\,|\,t\in T\}$," where each $X$ is an $S$-valued random variable on $\Omega$, means that for each $\omega\in\Omega$ and $t\in T$, $X_t(\omega)\in S$. By viewing $t$ as the variable, each $\omega\in\Omega$ is seen to designate a function $X^\omega: T\to S$ given by $X^\omega(t)=X_t(\omega)$. In other words, $X^\omega$ is a random function. – whuber Aug 28 '16 at 20:20
  • @whuber: and this shows that each $\omega \in\Omega$ is a function? I think that the definition in your link says that a stochastic process is a sequence of random variables. I doubt whether that implies that each $\omega$ must be a function –  Aug 29 '16 at 03:40
  • The notation "$X^\omega$" shows explicitly that $X$ *associates* a unique function $X^\omega$ to each $\omega\in\Omega$. That's exactly what we would expect a "random function" to be: a function-valued random variable. – whuber Aug 29 '16 at 13:20
  • @whuber: you are changing your version, in the comments above you say that the elements of $\Omega$ are functions; you say ''A random function would be a random variable defined on a probability space whose underlying elements are a set of functions'' (and you were very explicit on that, see your answer to my question), now it is changed to "*associates* a function with each $\omega$, and I even dare to doubt that there is a unique $X^\omega$ associated, with each $\omega$: you have $\#T$ functions $X_t$ from $\Omega \to S$ (# means cardinality) associated with each $\omega$ –  Aug 29 '16 at 13:57
  • We make exactly the same conflation of an abstract $\Omega$ with other sets all the time even in elementary statistics, because mathematically and conceptually it's of no consequence. – whuber Aug 29 '16 at 14:12
  • @whuber: but it is - accoring to the definition - incorrect to say that the elements of $\Omega$ must be functions. Note that it was you who referred to these definitions, why do you refer to them if they don't matter as long as ''it is of no consequence'' ? Normally it would be of ''no consequence'' if you prove that both are equivalent, which you did not do. –  Aug 29 '16 at 14:19
3

If $X$ is a random variable, that means that $X$ is a function from a sample space $S$ to the real numbers. If $g:\mathbb{R}\to\mathbb{R}$, we can define a new random variable $Y=g(X)$, so that if $s\in S$ and $X(s)=x$ then $Y(s)=g(x)$.

So as a concrete example, let $X$ be a random variable representing the number of heads that come up in two tosses, and let $Y=X^2$. Then we have

s    | X(s) | Y(s)
TT   |   0  |    0  
TH,HT|   1  |    1  
TT   |   2  |    4
crf
  • 479
  • 1
  • 7
  • 14