Random variable
Definition Given an experiment with the sample space S, a random variable (r.v.) is a function from the sample space S to real numbles.
It gives a numerical summary of some aspect of the result.
Example Consider an experiment where we toss a fair coin twice. The sample space consists of 4 possible outcomes S = {HH, HT, TH, TT}. (H - Head, T - Tail) Here are some random variables on this sample space:
Let X be the number of Heads. Thus we have X(HH)=2, X(HT)=X(TH)=1, X(TT)=0
Let Y be the number of Tails. Thus Y=2-X. Y(HH)=0, Y(HT)=Y(TH)=1, Y(TT)=2
Let I be 1 if the first toss lands Head and be 0 otherwise. I(HH)=I(HT)=1, I(TH)=I(TT)=0
It shows that a random variable X assigns a numerical value X(s) to each possible outcome s of the experiment.