comp 170 l2 l17: random variables and expectation page 1

45
COMP 170 L2 L17: Random Variables and Expectation Page 1

Upload: leona-banks

Post on 03-Jan-2016

224 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

L17: Random Variables and ExpectationPage 1

Page 2: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Outline

Random Variables

The concept

Bernoulli/Binomial random variables

Expectation of Random Variables

The concept

Properties

Expectation and counting

Geometric distribution

Page 2

Page 3: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Functions on Sample Space

Probability starts with a process (test, experiment) whose outcome is

uncertain

Sample space: the set of all possible outcomes

Sometimes, we want to define functions on the sample space

Example

Process: flip a coin n times

Sample space: set of sequences of n elements, each being H or T

Example: n=5, Function: “Number of heads”

Page 3

Page 4: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Random Variables

Probability starts with a process whose outcome is uncertain

Sample space: the set of all possible outcomes

Sometimes, we want to define functions on the sample space

Outcome of the process is uncertain

Function defined on the outcome is also uncertain

So, called random variable

A random variable is a function defined on the sample space

Example: “Number of heads” in n coin flips is a random variables

Page 4

Page 5: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Example 2Page 5

Page 6: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Outline

Random Variables

The concept

Bernoulli/Binomial random variables

Expectation of Random Variables

The concept

Properties

Expectation and counting

Geometric distribution

Page 6

Page 7: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 7

Page 8: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 8

Page 9: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 9

Page 10: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 10

Page 11: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 11

Page 12: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Binomial Random Variable

n Bernoulli trials, each with probability of success at each trial being p

X: number of successes,

X: called Binomial random variable

P: Binomial probability distribution

Do the numbers sum to 1?

Page 12

Page 13: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 13

Page 14: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Outline

Random Variables

The concept

Bernoulli/Binomial random variables

Expectation of Random Variables

The concept

Properties

Expectation and counting

Geometric distribution

Page 14

Page 15: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Expectation of Random VariablesPage 15

Page 16: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Expectation ExamplePage 16

Page 17: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Expectation and Average

Expectation ~= Average over many runs of process

Page 17

Expect the average

Page 18: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Page 19: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Outline

Random Variables

The concept

Bernoulli/Binomial random variables

Expectation of Random Variables

The concept

Properties Proof of linearity

Use of linearity

Expectation and counting

Geometric distribution

Page 19

Page 20: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Expectation from Sample spacePage 20

Get the same result from sample space

Page 21: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Expectation from Sample spacePage 21

Page 22: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 22

Page 23: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 23

Page 24: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 24

Page 25: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 25

Page 26: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 26

Page 27: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Outline

Random Variables

The concept

Bernoulli/Binomial random variables

Expectation of Random Variables

The concept

Properties Proof of linearity

Use of linearity

Expectation and counting

Geometric distribution

Page 27

Page 28: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 28

Page 29: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 29

Page 30: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 30

Page 31: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 31

Page 32: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 32

Page 33: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Outline

Random Variables

The concept

Bernoulli/Binomial random variables

Expectation of Random Variables

The concept

Properties

Expectation and counting

Geometric distribution

Page 33

Page 34: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 34

Page 35: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 35

Page 36: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 36

Page 37: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 37

Page 38: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Outline

Random Variables

The concept

Bernoulli/Binomial random variables

Expectation of Random Variables

The concept

Properties

Expectation and counting

Geometric distribution

Page 38

Page 39: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Repeating Bernoulli Trials Until SuccessPage 39

Page 40: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Number of Trials until First SuccessPage 40

Page 41: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Let x = 1-p

Consider only 0 < p < 1

Then, 0 < x <1

Let n goes to infinity, LHS becomes

Page 41

Page 42: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Number of Trial until First SuccessPage 42

Page 43: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 43

Page 44: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2Page 44

Page 45: COMP 170 L2 L17: Random Variables and Expectation Page 1

COMP 170 L2

Recap: 06-05-2010

Probability starts with a process whose outcome is uncertain

Sample space: the set of all possible outcomes

A random variable is a function defined on the sample space

Uncertain because outcome of process is

Bernoulli RV:

Outcome of Bernoulli Trail (success of failure)

Binomial RV

# of successes in n independent Bernoulli trials