219323 Probability and Statistics for Software and Knowledge - - PowerPoint PPT Presentation

219323 probability and statistics for software and
SMART_READER_LITE
LIVE PREVIEW

219323 Probability and Statistics for Software and Knowledge - - PowerPoint PPT Presentation

219323 Probability and Statistics for Software and Knowledge Engineers Lecture 3: Random Variables II Monchai Sopitkamon, Ph.D. Outline Discrete Random Variables (2.1) Continuous Random Variables (2.2) Expectation of a Random


slide-1
SLIDE 1

219323 Probability and Statistics for Software and Knowledge Engineers

Lecture 3: Random Variables II

Monchai Sopitkamon, Ph.D.

slide-2
SLIDE 2

Outline

Discrete Random Variables (2.1) Continuous Random Variables (2.2) Expectation of a Random Variable

(2.3)

The Variance of a Random Variable

(2.4)

Jointly Distributed Random Variables

(2.5)

Functions and Combinations of

Random Variables (2.6)

slide-3
SLIDE 3

The Variance of a Random Variable (2.4)

Definition and Interpretation (2.4.1) Examples of Variance Calculations

(2.4.2)

Chebyshev’s Inequality (2.4.3) Quantiles of Random Variables

(2.4.4)

slide-4
SLIDE 4

The Variance of a Random Variable: Definition and Interpretation I (2.4.1)

Measures the spread or variability in the

values of the RV, or the deviation of the RV around its expected (mean) value.

Var(X) = σ2 = E((X - E(X))2) = E(X2) - (E(X))2

Variance must be positive The greater the variance value, the more

spread of the distribution from its mean

Standard deviation (σ) = SD has the same unit as the RV, while

Var(X) has the square of the unit

σ 2

slide-5
SLIDE 5

The Variance of a Random Variable: Definition and Interpretation II (2.4.1)

Two distributions with different mean values, but identical variances Two distributions with identical mean values, but different variances

slide-6
SLIDE 6

The Variance of a Random Variable: Examples of Variance Calculations I (2.4.2)

Do examples 1 pg.103 and 14

pg.104

slide-7
SLIDE 7

The Variance of a Random Variable: Examples of Variance Calculations II (2.4.2)

  • Ex. The quiz scores for a particular student are

given below: 22, 25, 20, 18, 12, 20, 24, 20, 20, 25, 24, 25, 18 Find the variance and standard deviation.

21 μ =

( ) ( ) ( )2

2 2 1 1 2 2

( ) ...

n n

V X p x p x p x μ μ μ = − + − + + − ( ) V X σ = Value 12 18 20 22 24 25 Frequency 1 2 4 1 2 3 Probability .08 .15 .31 .08 .15 .23

slide-8
SLIDE 8

The Variance of a Random Variable: Examples of Variance Calculations III (2.4.2)

( ) ( ) ( ) ( ) ( ) ( )

2 2 2 2 2 2

( ) .08 12 21 .15 18 21 .31 20 21 .08 22 21 .15 24 21 .23 25 21 V X = − + − + − + − + − + − ( ) 13.25 V X = ( ) V X σ = 13.25 3.64 = ≈

slide-9
SLIDE 9

The Variance of a Random Variable: Chebyshev’s Inequality I (2.4.3)

Provides bounds on the prob. that a RV

can take values greater than so many SD away from its expected value.

If a RV has a mean μ and a variance σ2,

then for c ≥ 1

Refer to next slide for c = 2 and c = 3 Do example 14 pg.108

P(μ − cσ ≤ X ≤ μ + cσ) ≥1− 1 c 2

slide-10
SLIDE 10

The Variance of a Random Variable: Chebyshev’s Inequality II (2.4.3)

Illustration of Chebyshev’s inequality

slide-11
SLIDE 11

The Variance of a Random Variable: Quantiles of Random Variables I (2.4.4)

The pth quantile of a RV X with a cdf F(x) is the

value of x for which

F(x) = p p x 100th percentile

There is a prob. of p that the RV takes a value <

the pth quantile

Spread of distribution can also be obtained by

computing its quartiles.

The upper quartile = 75th percentile The lower quartile = 25th percentile The interquartile range = distance between the

lower and upper quartiles.

Do example 14 pg. 110

slide-12
SLIDE 12

The Variance of a Random Variable: Quantiles of Random Variables II (2.4.4)

Illustration of 70th percentile Illustration of quartiles and median

slide-13
SLIDE 13

The Variance of a Random Variable: Quantiles of Random Variables III (2.4.4)

Interquartile range Interquartile range for metal cylinder diameters

slide-14
SLIDE 14

Outline

The Variance of a Random Variable

(2.4)

Jointly Distributed Random Variables

(2.5)

Functions and Combinations of

Random Variables (2.6)

slide-15
SLIDE 15

Jointly Distributed Random Variables (2.5)

Joint Probability Distributions (2.5.1) Marginal Probability Distributions

(2.5.2)

Independence and Covariance

(2.5.4)

slide-16
SLIDE 16

Jointly Distributed Random Variables: Joint Probability Distributions I (2.5.1)

Consider two RVs X and Y and their

joint prob distribution.

The joint prob distribution of two RVs

X and Y is a set of prob values P(X = xi, Y = yj) = pij for discrete RVs, or

A joint pdf f(x, y) for continuous RVs. The joint pmf must satisfy While the joint pdf must satisfy

1 =

∑∑

i j ij

p

1 ) , ( =

∫∫statespace

dxdy y x f

slide-17
SLIDE 17

Jointly Distributed Random Variables: Joint Probability Distributions II (2.5.1)

The prob that a ≤ X ≤ b and c ≤ Y ≤ d

is obtained from the joint pdf as

The joint cdf F(x, y) = P(X ≤ x, Y ≤ y) See example 19 pg. 114

∫ ∫

= = b a x d c y

dydx y x f ) , (

∫ ∫ ∑ ∑

−∞ = −∞ = ≤ ≤

= =

x w y z x x i y y j ij

dzdw z w f y x F p y x F

i j

) , ( ) , ( ) , (

: :

For discrete RVs For continuous RVs

slide-18
SLIDE 18

Jointly Distributed Random Variables: Joint Probability Distributions III (2.5.1)

Ex 19: Joint probability mass function for air conditioner maintenance example

00 . 1 07 . 08 . 12 . = + + + =

∑∑

K

i j ij

p

slide-19
SLIDE 19

Jointly Distributed Random Variables: Joint Probability Distributions IV (2.5.1)

Joint cumulative distribution function for air conditioner maintenance example

∑∑

= =

= ≤ ≤ =

x i y j ij

p y Y x X P y x F

1 1

) , ( ) , (

F(2, 2) = p11+p12+p21+p22

slide-20
SLIDE 20

Jointly Distributed Random Variables: Marginal Probability Distributions I (2.5.2)

For two discrete RVs X and Y, the

prob values of the marginal distribution of X are:

For two continuous RVs, the prob

density functions of the marginal distribution of X is:

= = =

+ j ij i i

p p x X P ) (

∞ ∞ −

= dy y x f x f X ) , ( ) (

slide-21
SLIDE 21

Jointly Distributed Random Variables: Marginal Probability Distributions II (2.5.2)

21 . 01 . 08 . 12 . ) 1 (

3 1 1

= + + = = =

= j j

p X P

=

= =

4 1

) ( ) (

i

i X iP X E

= (1x0.21)+… …+(4x0.25) = 2.59

P(X = i) P(Y = j)

slide-22
SLIDE 22

Jointly Distributed Random Variables: Marginal Probability Distributions III (2.5.2)

Marginal probability mass function of service time

=

= =

4 1 2 2

) ( ) (

i

i X P i X E

= (1x0.21)+… …+(16x0.25) = 7.87

Var(X) = E(X2) – (E(X))2 = 7.87 – 2.59^2 = 1.162 SD (σ) = √1.162 = 1.08

=

= =

4 1

) ( ) (

i

i X iP X E

= (1x0.21)+… …+(4x0.25) = 2.59

slide-23
SLIDE 23

Jointly Distributed Random Variables: Marginal Probability Distributions IV (2.5.2)

Marginal probability mass function of number of air conditioner units

Y

slide-24
SLIDE 24

Jointly Distributed Random Variables: Independence and Covariance I (2.5.4)

Two RVs X and Y are independent if the

value taken by one RV is “unrelated” to the value taken by the other RV.

Two RVs are independent if their joint

pmf or pdf is the product of their two marginal distributions.

If the RVs are discrete, then they are

independent if

pij = pi+p+j for all values of xi and yj

If the RVs are continuous, then they are

independent if

f(x, y) = fX(x)fY(y) for all values of x and y

slide-25
SLIDE 25

Jointly Distributed Random Variables: Independence and Covariance II (2.5.4)

See independent example on pg. 122 The covariance of two RVs X and Y

Cov(X, Y) = E[(X – E(X))(Y – E(Y))] = E(XY) – E(X)E(Y)

The covariance can be any positive or

negative number, and

Independent RVs have a covariance = 0 The correlation between two RVs X and Y The correlation takes values between -1

and 1, and ind. RVs have a correlation = 0

See examples on pg. 124, 125

) ( ) ( ) , ( ) , ( Y Var X Var Y X Cov Y X Corr =

slide-26
SLIDE 26

Outline

The Variance of a Random Variable

(2.4)

Jointly Distributed Random Variables

(2.5)

Functions and Combinations of

Random Variables (2.6)

slide-27
SLIDE 27

Functions and Combinations

  • f Random Variables (2.6)

Linear Functions of a Random

Variable (2.6.1)

Linear Combinations of a Random

Variables (2.6.2)

Nonlinear Functions of a Random

Variable (2.6.3)

slide-28
SLIDE 28

Functions and Combinations of Random Variables: Linear Functions of a Random Variable (2.6.1)

If X is a RV and Y = aX + b for some

numbers a and b ∈ R, then

E(Y) = aE(X) + b and Var(Y) = a2Var(X)

slide-29
SLIDE 29

Functions and Combinations of Random Variables: Linear Combinations of a Random Variables I (2.6.2)

Sums of RVs

– If X1 and X2 are two RVs, then

E(X1 + X2) = E(X1) + E(X2)

and Var(X1 + X2) = Var(X1) + 2Cov(X1, X2) – If X1 and X2 are independent two RVs so that Cov(X1, X2) = 0, then Var(X1 + X2) = Var(X1) + Var(X2)

slide-30
SLIDE 30

Functions and Combinations of Random Variables: Linear Combinations of a Random Variables II (2.6.2)

Linear Combination of RVs

– If X1, …, Xn is a sequence of RVs and a1, …, an and b are constants, then

E(a1X1 + … + anXn + b) = a1E(X1) + … + anE(Xn) + b

– If the RVs are independent, then

Var( a1X1 + … + anXn + b) = a1

2Var(X1) + … +

an

2Var(Xn)

slide-31
SLIDE 31

Functions and Combinations of Random Variables: Linear Combinations of a Random Variables III (2.6.2)

Averaging Independent RVs

– Suppose that X1, … Xn is a sequence of

  • ind. RVs each with an expectation μ

and a variance σ2, and with an average

Then and

n X X X

n

+ + = L

1

μ = ) (X E n X Var

2

) ( σ =