introduction to random variables

25
Hadley Wickham Stat310 Random variables

Upload: hadley-wickham

Post on 05-Dec-2014

2.907 views

Category:

Education


5 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Introduction to random variables

Hadley Wickham

Stat310Random variables

Page 2: Introduction to random variables

1. Feedback

2. Recap

3. Introduction to random variables

4. Expectation

Page 3: Introduction to random variables

Feedback

Page 4: Introduction to random variables

Reading through text

Did homework early

Did homework

Taking good notes

Attending class

0 4 8 12 16 20

Page 5: Introduction to random variables

Reading through text

Did homework early

Did homework

Taking good notes

Attending class

0 4 8 12 16 20

Start homework earlier

More work outside of class

Read book

Page 6: Introduction to random variables

Recaps

Powerpoints

Website

Clear presentation/explanations

Interactivity & Feedback

Examples

0 5 10 15 20 25

Page 7: Introduction to random variables

Recaps

Powerpoints

Website

Clear presentation/explanations

Interactivity & Feedback

Examples

0 5 10 15 20 25

T shirts

Accent

Page 8: Introduction to random variables

Improvements

Board skills: mistakes, more details & structure, straight lines

Pace: 5 good, 5 too fast, 2 too slow

Office hours. Homework answers online.

Connection to text/more practice.

Class mailing list / forums?

Page 9: Introduction to random variables

Notation

!

i!{1,...,k}

xi

k!

i=1

xi

!xi

Page 10: Introduction to random variables

Recap

What is the law of total probability?

What is the multiplication rule?

What is Bayes rule?

Page 11: Introduction to random variables

Recap

A, B and C are independent events.

What is P(A ∪ B ∪ C)?

Page 12: Introduction to random variables

Random variables

Page 13: Introduction to random variables

Why?

Probability is a set function. Kind of tricky to deal with. Easier to deal with functions of numbers.

Want to ignore details of problem (e.g. specific events) and focus on essence.

Real world ➙ mathematical world

Page 14: Introduction to random variables

Definition

A random variable is a function from the sample space to the real line

Usually given a capital letter like X, Y or Z

The space (or support) of a random variable is the range of the function (analogous to the sample space)

(Usually just call the result a random variable)

Page 15: Introduction to random variables

Discrete vs. continuous

Space of X is countable = can be mapped to integers = discrete

Space of X is uncountable = can be mapped to real numbers = continuous

(We’ll focus on discrete to start with)

Page 16: Introduction to random variables

Example

Select a family at random and observe their children. What is the sample space?

What random variables could we create from this experiment?

Page 17: Introduction to random variables

Example

Pick someone at random out of this class. Measure their height.

What random variables could we create from this experiment?

Page 18: Introduction to random variables

Random variables

For a countable sample space, usually a count. (But many things we could count)

For a uncountable sample space, usually just the value. (Typically fewer logical possibilities)

Page 19: Introduction to random variables

Random event Random variable

Anything Numbers

ProbabilityProbability mass

function

Page 20: Introduction to random variables

Discrete pmf

f(x) > 0 !x " S

!

x!S

f(x) = 1

P (X ! A) =!

x!A

f(x)

Page 21: Introduction to random variables

Example

• If X=1, f(x) = 0.9

• If X=2,3,4,5 or 6, f(x) = c/x

• (How to write and read more mathematically)

• Is this function is a pmf? What is c?

Page 22: Introduction to random variables

Why?

Once we have random variable + pmf, we don’t need any more information about the original experiment.

Means we can apply the same tools to completely different types of experiments.

Page 23: Introduction to random variables

Example

Draw two cards (with replacement) out of a shuffled pack. Let X be the number of hearts and clubs. What is the pmf of X?

Pick two people at random. Let Y be the number of males. What is the pmf of Y?

How are these pmfs related?

Page 24: Introduction to random variables

Expectation

E[u(X)] =!

x!S

u(x)f(x)

Summarises a function of a random number with a single number

Page 25: Introduction to random variables

Properties

E[c] = c

E[cu(X)] = cE[u(X)]E[au1(X) + bu2(X)] = aE[u1(X)] + bE[u2(X)]

What are c and u?

All conditions together imply E is a linear operator