+ - 0:00:00
Notes for current slide
Notes for next slide

MATH 204 Introduction to Statistics

Lecture 8: Introduction to Random Variables

JMG

1

Goals for Lecture

  • Introduce basic concepts and terminology for random variables. Textbook section 3.4
2

Goals for Lecture

  • Introduce basic concepts and terminology for random variables. Textbook section 3.4

    • We begin our discussion on the imporant notion of random variable.
3

Goals for Lecture

  • Introduce basic concepts and terminology for random variables. Textbook section 3.4

    • We begin our discussion on the imporant notion of random variable.
  • In this lecture, we focus on getting an intuitive grasp on the notion of random variable. In our next lecture, we will be more precise in our discussion of the topic.

4

Introduction to Random Variables

  • It's often useful to model a process using what's called a random variable.
5

Introduction to Random Variables

  • It's often useful to model a process using what's called a random variable.

  • Suppose we toss a coin ten times and add up the number of heads that have appeared. Tossing a coin ten times is a random process, the total number of heads after ten tosses is a random variable.

6

Introduction to Random Variables

  • It's often useful to model a process using what's called a random variable.

  • Suppose we toss a coin ten times and add up the number of heads that have appeared. Tossing a coin ten times is a random process, the total number of heads after ten tosses is a random variable.

  • In general, a random variable assigns a numerical value to events from a random process.

7

Introduction to Random Variables

  • It's often useful to model a process using what's called a random variable.

  • Suppose we toss a coin ten times and add up the number of heads that have appeared. Tossing a coin ten times is a random process, the total number of heads after ten tosses is a random variable.

  • In general, a random variable assigns a numerical value to events from a random process.

  • We will see later that random variables have distributions associated with them, and we want to be able to describe the distributions of random variables.

8

Introduction to Random Variables

  • It's often useful to model a process using what's called a random variable.

  • Suppose we toss a coin ten times and add up the number of heads that have appeared. Tossing a coin ten times is a random process, the total number of heads after ten tosses is a random variable.

  • In general, a random variable assigns a numerical value to events from a random process.

  • We will see later that random variables have distributions associated with them, and we want to be able to describe the distributions of random variables.

  • The sample mean is an important example of a random variable and its distribution is an example of a sampling distribution.

9

Notation for Random Variables

  • We typically denote random variables by capital letters at the end of the alphabet such as X, Y, or Z.
10

Notation for Random Variables

  • We typically denote random variables by capital letters at the end of the alphabet such as X, Y, or Z.

  • For example, let X be the random variable that is the sum of the number of heads that we obtain after tossing a coin ten times. The possible values that X can take on are X=0, X=1, X=2, , X=10.

11

Notation for Random Variables

  • We typically denote random variables by capital letters at the end of the alphabet such as X, Y, or Z.

  • For example, let X be the random variable that is the sum of the number of heads that we obtain after tossing a coin ten times. The possible values that X can take on are X=0, X=1, X=2, , X=10.

  • Typical questions that we ask are ones such as, what is the probability that X=2, or what is the probability that X is less than 5. What do these questions mean in the context of our coin tossing example?

12

Notation for Random Variables

  • We typically denote random variables by capital letters at the end of the alphabet such as X, Y, or Z.

  • For example, let X be the random variable that is the sum of the number of heads that we obtain after tossing a coin ten times. The possible values that X can take on are X=0, X=1, X=2, , X=10.

  • Typical questions that we ask are ones such as, what is the probability that X=2, or what is the probability that X is less than 5. What do these questions mean in the context of our coin tossing example?

  • The distribution of X allows us to answer such questions.
13

A Look at Some Data

  • Let's look at six rounds of tossing a coin ten times. At each toss, we record 1 if we land heads and 0 if we land tails. Then we can add up the 1's to get the total number of heads after ten tosses. Our data might look as follows:
X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 total_heads
round_1 0 0 1 1 0 0 0 1 1 1 5
round_2 1 0 0 1 0 0 1 1 0 0 4
round_3 1 0 0 1 0 1 1 1 1 1 7
round_4 0 0 1 0 0 1 0 0 1 1 4
round_5 1 0 1 0 0 1 0 0 0 1 4
round_6 0 1 0 0 1 0 1 0 1 0 4
14

A Look at Some Data

  • Let's look at six rounds of tossing a coin ten times. At each toss, we record 1 if we land heads and 0 if we land tails. Then we can add up the 1's to get the total number of heads after ten tosses. Our data might look as follows:
X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 total_heads
round_1 0 0 1 1 0 0 0 1 1 1 5
round_2 1 0 0 1 0 0 1 1 0 0 4
round_3 1 0 0 1 0 1 1 1 1 1 7
round_4 0 0 1 0 0 1 0 0 1 1 4
round_5 1 0 1 0 0 1 0 0 0 1 4
round_6 0 1 0 0 1 0 1 0 1 0 4
  • Let's repeat this process many more times and create a barplot that shows the number of times each of the values 0, 1, ..., 10 occurs.
15

The Distribution of the Number of Heads

16

The Distribution of the Number of Heads

  • If we divide all of the counts by the total, we get the density. This provides an estimate for the probability value of each outcome.
17

Probabilities for Number of Heads

This plot shows the density instead of count for the previous barplot.

18

Probabilities for Number of Heads

This plot shows the density instead of count for the previous barplot.

  • From this plot, we can easily estimate probability values. For example, what is the probability of getting 4 heads out of ten tosses? It's about 0.2. What is the probability of getting less than three heads? It's about 0.04 + 0.01 + 0.0025 = 0.0525.
19

The Mean and Variance for Number of Heads

We can compute the mean and variance for the number of heads, in which case we get:

## [1] "The mean is 5.035400"
## [1] "The variance is 2.385024"
20

The Mean and Variance for Number of Heads

We can compute the mean and variance for the number of heads, in which case we get:

## [1] "The mean is 5.035400"
## [1] "The variance is 2.385024"
  • This tells us that the "average" number of heads out of ten tosses is about 5. How does this correspond with your real life experience or expectations?
21

The Mean and Variance for Number of Heads

We can compute the mean and variance for the number of heads, in which case we get:

## [1] "The mean is 5.035400"
## [1] "The variance is 2.385024"
  • This tells us that the "average" number of heads out of ten tosses is about 5. How does this correspond with your real life experience or expectations?

  • These values provide estimates for the expected value and variance of our random variable. These concepts will be defined and discussed in detail in the next lecture.

22

Summary

In this lecture, we introduced the basic notion of random variable.

23

Notes

24

Notes

25

Notes

26

Goals for Lecture

  • Introduce basic concepts and terminology for random variables. Textbook section 3.4
2
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
oTile View: Overview of Slides
sToggle scribble toolbox
Esc Back to slideshow