Post · 2 min read· pp. 152–153

3.1.1 Random Variables


In general, to analyze random experiments, we usually focus on some numerical aspects of the experiment. For example, in a soccer game we may be interested in the number of goals, shots, shots on goal, corners kicks, fouls, etc. If we consider an entire soccer match as a random experiment, then each of these numerical results gives some information about the outcome of the random experiment. These are examples of random variables. In a nutshell, a random variable is a real-valued variable whose value is determined by an underlying random experiment.

Let's look at an example.


Example

I toss a coin five times. This is a random experiment and the sample space can be written as

S={TTTTT,TTTTH,...,HHHHH}.S=\{TTTTT,TTTTH,... , HHHHH\}.
Note that here the sample space SS has $2^5=32$ elements. Suppose that in this experiment, we are interested in the number of heads. We can define a random variable XX whose value is the number of observed heads. The value of XX will be one of $0, 1,2,3,4$ or $5$ depending on the outcome of the random experiment.


In essence, a random variable is a real-valued function that assigns a numerical value to each possible outcome of the random experiment. For example, the random variable XX defined above assigns the value $0$ to the outcome TTTTTTTTTT, the value $2$ to the outcome THTHTTHTHT, and so on. Hence, the random variable XX is a function from the sample space SS={TTTTT\{TTTTT,TTTTHTTTTH, ⋯\cdots ,HHHHH}HHHHH\} to the real numbers (for this particular random variable, the values are always integers between $0$ and $5$).

Random Variables: A random variable XX is a function from the sample space to the real numbers.

X:S→RX:S\rightarrow \mathbb{R}

We usually show random variables by capital letters such as XX, YY, and ZZ. Since a random variable is a function, we can talk about its range. The range of a random variable XX, shown by Range(X)(X) or RXR_X, is the set of possible values for XX. In the above example, Range(X)=RX={0,1,2,3,4,5}(X)=R_X=\{0,1,2,3,4,5\}.

The range of a random variable XX, shown by Range(X)(X) or RXR_X, is the set of possible values of XX.


Example

Find the range for each of the following random variables.

  1. I toss a coin $100$ times. Let XX be the number of heads I observe.
  2. I toss a coin until the first heads appears. Let YY be the total number of coin tosses.
  3. The random variable TT is defined as the time (in hours) from now until the next earthquake occurs in a certain city.
  • Solution
      1. The random variable XX can take any integer from $0$ to $100$, so RX={0,1,2,...,100}R_X=\{0,1,2,...,100\}.
      2. The random variable YY can take any positive integer, so RY={1,2,3,...}=NR_Y=\{1,2,3,...\}=\mathbb{N}.
      3. The random variable TT can in theory get any nonnegative real number, so RT=[0,∞)R_T=[0,\infty).