19
CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected] http://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474 CSE474: Simulation and Modeling Chapter 4 Review of Basic Probability and Statistics Mushfiqur Rouf [email protected]

CSE 474 Simulation Modeling | MUSHFIQUR ROUF CSE474:

Embed Size (px)

DESCRIPTION

CSE 474 Simulation Modeling | MUSHFIQUR ROUF Experiment –A process whose outcome is not known with certainty –Throwing a die Sample Space, S –Set of all outcomes –{1, 2, 3, 4, 5, 6} Sample Point –Each outcome in a sample space

Citation preview

Page 1: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

CSE474: Simulation and ModelingChapter 4

Review of Basic Probability and

StatisticsMushfiqur [email protected]

Page 2: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Why• How to model a probabilistic system• Validate a simulation model• Choose an input probability distributions• Generate random samples from these

distributions• Perform statistical Analyses of the simulation

output data

Page 3: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Experiment• Experiment

– A process whose outcome is not known with certainty

– Throwing a die• Sample Space, S

– Set of all outcomes – {1, 2, 3, 4, 5, 6}

• Sample Point– Each outcome in a sample space

Page 4: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Random Variable• A function that assigns a real number to each

point in sample space S.– If X = “number of heads” in an experiment of

rolling a pair of dice.– Then X assigns 5 to {4, 1}, {3, 2}, {2, 3}, {1, 4}

• Discrete: if it can take countable number of different values

• Continuous: it can take any value

Page 5: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Probability Distribution Function

• Or, cumulative distribution function• F(x) of random Variable X

– X: random variable name– x: value taken

• F(x) = P(X<=x) for –∞ < x < ∞• Properties

– 0 <= F(x) <= 1– F(x) is nondecreasing– and1)(lim

xF

x0)(lim

xF

x

Page 6: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Probability Distribution Function

• X can take values – x1, x2, …, xn,

• Probability mass function “probability that x equals to xi”

p(xi) = P(X = xi)

1)(1

iixp

bxai

i

xpIX

baI

)()P(],,[ If

xx

ii

xpx )()F(

Page 7: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Probability Distribution Function

1/61/31/2

0 1 2 3 4 x

p(x)

0 1 2 3 4 x

1

1/61/31/2

F(x)1

Page 8: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Continuous Random Variable

• X is a continuous random variable if probability density function

f(x) is nonnegative

B

dxxfBXP )()(

1)(

dxxf

Page 9: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Continuous Random Variable

• f(x) is not the probability that X=x

• X is more likely to fall in an interval I

0)(]),[()( x

xdyyfxxXPxXP

)()()()( aFbFdyyfIXPb

a

Page 10: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Continuous Random Variable

• Distribution function F(x)– Area under the curve f(x)

xdyyfxXPxF )(]),(()(

f(x)

x

F(x) = P(X [-, x]) f(x)

b

P(X [a, b])

= F(b) – F(a)

a x

Page 11: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Uniform Random Variable

01

)(xf0 <= x <= 1

otherwise

1 x0

1f(x)

1 x0

1F(x)U[0,1]

Page 12: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Joint Probability Mass Function

• p(x, y) = P(X = x, Y = y)• X and Y are

independent if p(x, y) = px(x) py(y)

xY

yX

p(x,y)yp

p(x,y)xp

all

all

)(

)(

027),(xy

yxp

Calculate if X and Y are independent

For x = 1, 2 and y = 2, 3, 4

otherwise

Page 13: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Jointly Continuous• Joint probability density function

• X and Y are independent if

B A

dydxyxfBYAXP ),(),(

)()(),( yfxfyxf YX

dxyxfxf

dyyxfxf

Y

X

),()(

),()(

Page 14: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Mean or Expected Value

n

iii

n

iii XEcXcE

11

• E(cX)=cE(X)

dxxxf

xpx

i

i

X

jjXj

i1

Page 15: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Median• Smallest value of x such that FXi (x) >= 0.5

median

F(median) = 0.5

area = 0.5

Page 16: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Variance 2222 ][)Var( iiiiii XEXEX

μ μ

σ2 largeσ2 small

Calculate Mean and Variance of U[0,1]

Page 17: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Standard Deviation• σi = √(σi

2)• Useful with Normal distribution

Page 18: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Covariance• Dependence between two random variables

• Cij = 0 means Xi and Xj are uncorrelated• Cij > 0 means Xi and Xj are positively correlated• Cij < 0 means Xi and Xj are negatively correlated

jijijii

ij

ji

XXEXjXE

C

XXCov

,

Page 19: CSE 474 Simulation Modeling | MUSHFIQUR ROUF   CSE474:

CSE 474 Simulation Modeling | MUSHFIQUR ROUF [email protected]://groups.google.com/group/cse474spring07/ http://faculty.bu.ac.bd/~rouf/cse474

Correlation

)Var()Var(),Cov(

,Cor

22

ji

ji

ji

ijij

ji

XXXX

C

XX

• Covariance is not dimensionless, – makes interpretation troublesome