Why use random variables?

The foundations chapter defined outcomes, events, and probability measures. Suppose one outcome in a phonetics study is a complete vowel token. The stored record includes the speaker, word, waveform, vowel label, and measured duration, but the research question may concern only duration.

We need a principled way to move from the complete token to the property used in the analysis. A random variable provides that mapping.

Let \Omega contain the complete vowel token outcomes. Define a mapping D that returns the duration of each outcome in milliseconds:

D(\omega)\equiv\text{duration of vowel token }\omega.

For a three-outcome illustration, let \Omega\equiv\{\omega_1,\omega_2,\omega_3\}. The mapping is

outcome \omega word speaker D(\omega)
\omega_1 heed s01 112
\omega_2 hid s01 83
\omega_3 heed s02 126

The outcomes remain complete tokens. The mapping returns one numerical value from each token.

Values give us new events

Suppose we want the event that vowel duration exceeds 100 ms. Define the shorthand

\{D>100\} \equiv\{\omega\in\Omega:D(\omega)>100\}.

In this finite sample space, the event is \{\omega_1,\omega_3\}. It contains vowel token outcomes, not bare duration values.

A random variable maps outcomes to values. Probability statements about those values refer to the corresponding events in the original sample space.

One outcome can support several questions

Duration is not the only property of the token. Define another mapping H by

H(\omega)\equiv \begin{cases} 1 & \text{if the vowel is high},\\ 0 & \text{otherwise}. \end{cases}

The same outcome \omega_1 may satisfy D(\omega_1)=112 and H(\omega_1)=1. The two mappings do not compete. They encode different questions about the same represented token.

This separation is useful because the stored record is usually richer than any single analysis response. We can define one variable for duration, another for vowel height, and another for speaker identity without pretending that the record itself is a single number.

Working through the mapping in base R

Code
tokens <- data.frame(
  outcome = c("omega1", "omega2", "omega3"),
  word = c("heed", "hid", "heed"),
  speaker = c("s01", "s01", "s02"),
  duration = c(112, 83, 126)
)

tokens$outcome[tokens$duration > 100]

The result contains omega1 and omega3. The code returns outcome identifiers after selecting on the mapped duration values.

Retaining the outcomes as well as the extracted values

Extracting a property does not make the original outcome dispensable. If the table keeps only the values 112, 83, and 126, then speaker and word identity disappear. A later analysis can no longer ask whether durations repeat within speakers or differ across words.

A random variable does not require this deletion. It is a mapping defined on outcomes. Retaining the outcome identifier and other design identifiers keeps the extracted value connected to the observation process.

Check your understanding

  1. Let W(\omega) return the word produced in token \omega. Which outcomes in the table belong to the event W=\textit{heed}?
  2. Explain why D>100 describes a set of vowel tokens rather than a set containing only the numbers 112 and 126.
  3. Define a mapping that records whether the speaker is s01. What are its possible values?
  4. Which information is lost if duration values replace the complete outcomes rather than being attached to them?