To Notes

IT 223 -- Feb 16, 2026

Review Exercises

  1. What is the regression fallacy?
    Answer: the regression fallacy occurs in a pre-test/post-test situation. Because there is usually a correlation r significantly less than 1 between the pre-test value (x = independent variable) and the post-test value (y = dependent variable), a one SDx increase in x results in, on the average, an r * SDy increase in y, which is smaller than expected for some observers. The fallacy is trying to attribute some lurking variable to the smaller than expected increase, rather than noting that this is normal behaviour for a regression model in a pre-test/post-test situation.
  2. What is the root mean squared error (RMSE)?
    Answer: root mean squared error = RMSE = √1 - r2 SDy
  3. What is a sample space?
    Answer: The sample space is the set of all possible outcomes for a probability experiment.
  4. Which greek letter is used to represent the sample space?
    Answer: big omega, which is Ω.
  5. What is an event?
    Answer: an event is a subspace of the sample space.
  6. What are the rules for probabilities?
    Answer: if P(E) is the probability of the event E,
    (a) 0 ≤ P(E)     (b) P(E) ≤ 1     (c) P(EC) = 1 - P(E)
    EC is the complement of E, which is also denoted by E'.
  7. What are the three methods for obtaining probabilities?
    Answer: (a) a priori (perhaps idealistic)      (b) empirical      (c) subjective.
  8. What is a random variable?
    Formal definition: a random variable is a function from the sample space to the set of real numbers.
    Informal definition: a random variable is the process of choosing a random number.
  9. What is a discrete random variable?
    Answer: a discrete random variable has only a finite number of outcomes.
  10. What is a Bernoulli random variable?
    Answer: a bernoulli random variable has only two possible outcomes 0 and 1 defined by this probablity table:
    Outcome Probability
           0       1 - p
           1          p

    p is the probability of success.
  11. What are some examples of Bernoulli random variables?
    Answer: number of heads from flipping a fair coin once, number of aces (ones) obtained from rolling a fair die once, shooting a free throw (1=shot name, 0=shot missed), choose a part from an assembly line (1=defective, 0=not defective).

Expected Value

The Multiplication Rule for Independent Events

The Addition Rule for Mutually Exclusive Events

The Standard Deviation of a Random Variable

Practice Problems

  1. Recall that the expected value for the Rainfall on a Tropical Island example is 1.1 inches. Here is the probability distribution:
       Rainfall       Probability  
    0 0.3
    1 0.4
    2 0.2
    3 0.1

    Compute the variance and standard deviation of this random variable.
    Ans: (0 - 1.1)2 0.3 + (1 - 1.1)2 0.4 + (2 - 1.1)2 0.2 + (3 - 1.1)2 0.1
    = 1.21 * 0.3 + 0.01 * 0.4 + 0.81 * 0.2 + 3.61 * 0.1 = 0.89
    The standard deviation is √0.89 = 0.943
  2. Compute the variance and standard deviation of a Bernoulli random variable.
    Ans: The expected value of a Bernoulli random variable is 0(1 - p) + 1p = p.

    Variance = (0 - p)2 (1-p) + (1 - p)2 p = p2(1-p) + (1 - 2p + p2)p
    = p2 - p3 + p - 2p2 + p3 = p - p2 = p(1 - p)
    The standard deviation is the square root of the variance = √p(1 - p)

  3. Use your result from Problem 2 to obtain the mean and standard deviation of the number of heads obtained in a single coin flip.
    Ans: E(x) = p = 0.5; σx = √p(1-p) = √0.5(1-0.5) = √0.25 = 0.5

Properties of Random Variables

  1. E(cx) = c E(x)
  2. E(x + y) = E(x) + E(y)
  3. E(x1 + ... + xn) = E(x1) + ... + E(xn)
  4. Var(x) = E(x2) - E(x)2
  5. Definition:   x and y are independent if E(xy) = E(x)E(y).
    If x and y are independent, Var(x + y) = Var(x) + Var(y)

Here are the derivations.

Practice Problem

  1. Compute the variance and SD of a Bernoulli random variable with the formula Var(x) = E(x2) - E(x)2.
         Var(x) = E(x2) - E(x)2 = (02 (1 - p) + ... + 12 p) - p2
                  = p - p2 = p(1 - p)
    This is the same result that we obtained earlier.

Sums of Random Variables

Practice Problems

  1. Compute the expected value and standard deviation of the random variable in Practice Problem 1 for 365 days.

    Ans: Recall that E(x) = 1.1 and σx = 0.943; E(S) = nE(x) = 365 × 1.1 = 401.5
    σS = σxn = 0.943√365 = 18.0

  2. Compute the expected value and standard deviation of a Bernoulli random variable (Practice Problem 2) for the sum of n trials.
    Answer: E(S) = nE(x) = np
    σS = σxn = √p(1-p)n = √np(1-p)
    p is unknown, so we approximate p with p^ = S / n:
    σS = σxn = √p(1-p^)n = √np^(1-p^)

Using R to Simulate Bernoulli Outcomes

  1. Use R to simulate the random outcomes from flipping a fair coin 10 times. Answer: the probability experiment is flipping a coin once; this experiment is repeated 10 times. A binomial random variable is the sum of a specified number of independent outcomes from a Bernoulli random variable. We will see why this type of random variable is called a binomial random variable later.
    // Here are the meanings of the R arguments:
    // n = number of times the experiment is repeated
    // size = number of Bernoulli outcomes in one experiment
    // prob = the probability of success for Bernoulli rv.
    rbinom(n=10, size=1, prob=0.5)
     [1] 1 0 0 1 1 1 1 0 0 1
    
  2. Use R to simulate 20 repetitions of flipping a coin 2 times.
    Answer: in this case, n = 20, size = 2, and prob = 0.5.
    > rbinom(n=20, size=2, prob=0.5)
    # or
    > rbinom(20, 2, 0.5)
     [1] 1 2 1 2 0 1 1 1 0 2 0 2 2 2 0 1 1 1 1 1
    
  3. Use R to simulate flipping a fair coin one million times. Repeat the experiment twice. Answer:
    > > rbinom(2, 1000000, 0.5) 
    [1] 500664 499815
    
  4. Elena Delle Donne is the best free throw shooter in WNBA history with a career average of 93.4%. Simulate 10 seasons of shooting 90 free throws per season with a success rate of 93.4%. Answer:
    > rbinom(10, 90, 0.934)
    [1] 79 82 84 87 86 81 85 86 82 87
    

Averages of Random Variables

The Law of Averages

The Central Limit Theorem