Continuous Random Variables Daniel A. Menascé, Ph.D. Department of Computer Science George Mason University 1 © 2001 D. A. Menascé. All Rights Reserved.

Relevant Functions • Probability density function (pdf) of r.v. X: f X (x ) b

P[a ≤ X ≤ b] = ∫ f X ( x)dx a

• Cumulative distribution function (CDF):

F X ( x) = P[ X ≤ x] • Tail of the distribution (reliability function):

R X ( x) = P[ X > x] = 1 − FX ( x) 2 © 2001 D. A. Menascé. All Rights Reserved.

1

Moments +∞

• k-th moment: E[ X k ] = ∫− ∞ x k f X ( x)dx • Expected value (mean): first moment µ = E[ X ] = ∫

+∞

−∞

xf X ( x) dx

• k-th central moment: E[( X − µ )k ] = ∫

+∞

−∞

( x − µ ) k f X (x )dx

• Variance: second central moment σ 2 = E [( X − µ )2 ] = ∫

+∞

−∞

( x − µ )2 f X ( x )dx

3 © 2001 D. A. Menascé. All Rights Reserved.

The Uniform Distribution • pdf:

 1 a ≤ x≤ b f X ( x) =  b − a  0 otherwise

• Mean:

µ=

a +b 2

• Variance: σ 2 = (b − a )

2

12

4 © 2001 D. A. Menascé. All Rights Reserved.

2

The Uniform Distribution 1

U(0,1)

0

0.2

0.5

1

P[0.2τ ] ~ P[ t ≤ t + τ ] − P[ ~ t ≤τ ] = ~ P[ t > τ ] 1 − e− λ.(t +τ ) − (1 − e −λ.τ ) = 1 − (1 − e −λ .τ ) = 1 − e −λ .t 19 © 2001 D. A. Menascé. All Rights Reserved.

Exponential Distribution 1.0

0.9

0.8

In Excel: FX(x) = EXPONDIST(x,λ,TRUE) fX(x) = EXPONDIST(x,λ,FALSE)

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0.0 0

2

4

6 pdf

8

10

12

CDF

20 © 2001 D. A. Menascé. All Rights Reserved.

10

Pareto Distribution • A case of a heavy-tailed distribution. • The probability of large values is not negligible. a

f X (x ) =

a>0 ,

1 +a

x

1 a x a >1

FX ( x) = 1 −

• Mean:

a a −1

a>0 ,

a (a −1) ( a − 2)

• Variance:

x ≥1 x ≥1

a>2

2

21 © 2001 D. A. Menascé. All Rights Reserved.

Tail of the Pareto and Exponential Distributions Ln x 0 0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

4.5

5.0

-10

-20

-30

-40

-50

Ln P[X>x] -60

Tail Pareto

Tail Exponential

22 © 2001 D. A. Menascé. All Rights Reserved.

11

Generation of Random Variables 1.0

• randomly generate a number u = U(01,) • x = F-1 (u) where F is the CDF

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0.0 -10 -9

-8

-7

-6

-5

-4 -3.5 -3 -2.5

-2 -1.5

-1 -0.5 0

0.5

1

1.5

2

2.5

3

3.5

4

5

6

7

8

9

10

23 © 2001 D. A. Menascé. All Rights Reserved.

12