DATA 352/551: Modeling and Simulation
Consider a random experiment like tossing a fair coin. This is a random experiment because the outcome is unknown. The sample space is the set, or collection, of all possible outcomes.
A random variable (denoted, say, \(X\)) is a variable whose value depends on the unknown outcome. More formally, a random variable is a functional mapping from the outcome to the real line.
For one coin toss, the sample space is \(\{H, T\}\). The outcome is unknown before the experiment, while the sample space lists every outcome that could occur.
Suppose you toss a fair coin three times. Let \(X\) be the number of heads you get. What is the sample space? What is the range, or possible values, of $X?
Let \(Y\) be the number of tosses until you get the first head. What is the sample space? What is the range of \(Y\)?
Unless otherwise specified, we will use “sample space” to refer to the range of a random variable.
Discrete random variables: A random variable is called discrete if the sample space is finite, such as \(X\) above, or countably infinite, such as \(Y\) above.
Counterexample: the weight of a randomly selected person and the waiting time until the next bus. These are examples of continuous random variables.
To fully define a random variable, we need to specify its distribution. In the discrete case, this is done by assigning a probability to each outcome in the sample space.
The function \(P(x)\), for \(x = 1, \ldots, 6\), is called the probability mass function for the discrete random variable \(X\).
A valid probability mass function must satisfy these basic conditions:
The random variable \(X\) has a sample space \(\{1, 2, 3, 4, 5, 6\}\). Because the die is fair, each outcome has probability \(1/6\). Thus \(P(x) = 1/6\) for \(x = 1, \ldots, 6\).
We simulate the process of rolling one fair die to verify the probabilities, using random.org/dice. What can we expect from the result?
Simulation often requires repeating an experiment a large number of times. The result is more trustworthy and can better estimate the truth because the summary of the data, called a “statistic,” has less variation.
Simulation has limitations when the sample space is very large or when an outcome in the sample space has a very low chance of occurring.
Let \(X\) be the number of heads in two coin tosses. The coins are assumed to be fair.
Goal: Estimate \(P(X = 0)\) in the previous example, where \(X\) is the number of heads in two coin tosses.
Try the “American voting coin” on random.org/coins: Bush versus Kerry. Let \(X\) be the number of “Bush” outcomes in 5 flips. What is the range of \(X\)? Use the four steps to describe how to estimate \(P(X \le 2)\).
Interpretation: The coin is likely biased. The probability of each side, Bush or Kerry, can represent the percentage of people who would vote for the candidate in a certain population. Suppose you ask five randomly selected people from that population. What is the chance that two or fewer of them would vote for Bush?
(Example 1.3 from Introduction to Probability) Simulation is especially useful when probabilities are hard to calculate mathematically.
Suppose we roll a pair of fair dice. A gambler bets that, in 10 rolls, a pair of sixes will appear. What is the chance of winning? Use the four steps to describe how to estimate the chance of winning.
(Optional) the exact probability is \(1 - (35/36)^{10} \approx 0.245\).
(Example 1.4 from Introduction to Probability) You play a game with me as follows. A fair coin is tossed. If a head appears, I give you a dollar. If a tail appears, you give me a dollar.