System Modeling and Simulation Carey Williamson Department of - - PowerPoint PPT Presentation

system modeling and simulation
SMART_READER_LITE
LIVE PREVIEW

System Modeling and Simulation Carey Williamson Department of - - PowerPoint PPT Presentation

CPSC 531: System Modeling and Simulation Carey Williamson Department of Computer Science University of Calgary Fall 2017 Outline Probability and random variables Random experiment and random variable Probability mass/density


slide-1
SLIDE 1

CPSC 531: System Modeling and Simulation

Carey Williamson Department of Computer Science University of Calgary Fall 2017

slide-2
SLIDE 2
  • Probability and random variables

—Random experiment and random variable —Probability mass/density functions —Expectation, variance, covariance, correlation

  • Probability distributions

—Discrete probability distributions —Continuous probability distributions —Empirical probability distributions

Outline

2

slide-3
SLIDE 3
  • Random Experiment

3

slide-4
SLIDE 4
  • Probability of Events

4

slide-5
SLIDE 5
  • Joint Probability

5

slide-6
SLIDE 6
  • Independent Events

6

slide-7
SLIDE 7
  • Mutually Exclusive Events

7

slide-8
SLIDE 8
  • Union Probability

8

slide-9
SLIDE 9
  • Conditional Probability

9

slide-10
SLIDE 10
  • Discrete

—Random variables whose set of possible values can be

written as a finite or infinite sequence

—Example: number of requests sent to a web server

  • Continuous

—Random variables that take a continuum of possible values —Example: time between requests sent to a web server

Types of Random Variables

10

slide-11
SLIDE 11
  • Probability Density Function (PDF)

) ( ) ( x F dx d x f 

11

slide-12
SLIDE 12
  • Cumulative Distribution Function (CDF)

12

slide-13
SLIDE 13
  • Expectation of a Random Variable

        

 

   

X dx x xf X x p x X E

n i i i

continuous ) ( discrete ) ( ] [

1

13

slide-14
SLIDE 14
  • Properties of Expectation

14

slide-15
SLIDE 15
  • Multiplying means to get the mean of a product
  • Example: tossing three coins

—X: number of heads —Y: number of tails —E[X] = E[Y] = 3/2  E[X]E[Y] = 9/4 —E[XY] = 3/2

 E[XY] ≠ E[X]E[Y]

  • Dividing means to get the mean of a ratio

Misuses of Expectations

] [ ] [ Y E X E Y X E        ] [ ] [ ] [ Y E X E XY E 

15

slide-16
SLIDE 16
  • Variance of a Random Variable

16

slide-17
SLIDE 17
  • Variance: The expected value of the square of distance

between a random variable and its mean where, μ= E[X]

  • Equivalently:

σ2 = E[X2] – (E[X])2

Variance of a Random Variable

            

 

   

X dx x f x X x p x X E X V

n i i i

continuous ) ( ) ( discrete ) ( ) ( ] ) [( ] [

2 1 2 2 2

   

17

slide-18
SLIDE 18
  • Properties of Variance

18

slide-19
SLIDE 19
  • Coefficient of Variation

3 1 2 / 3 4 / 3 CV  

19

slide-20
SLIDE 20
  • Covariance

20

slide-21
SLIDE 21
  • Covariance

x y xy p(x) 3 1/8 1 2 2 3/8 2 1 2 3/8 3 1/8 xy p(xy) 2/8 2 6/8

21

slide-22
SLIDE 22
  • Correlation
  • 1

+1 No correlation Positive linear correlation Negative linear correlation

22

slide-23
SLIDE 23
  • Autocorrelation
  • 1

+1 No correlation Positive linear correlation Negative linear correlation

23

slide-24
SLIDE 24
  • Correlation (if desired) can be induced by sharing or re-using

random numbers between two (or more) random variables

  • Example: height and weight of medical patients
  • Example: a coin that remembers some of its recent history

Demo: Correlation and Autocorrelation

  • 1

+1 No correlation Positive linear correlation Negative linear correlation

24

slide-25
SLIDE 25
  • Geometric Distribution

25

slide-26
SLIDE 26

Example: Geometric Distribution

Geometric distribution PMF Geometric distribution CDF

slide-27
SLIDE 27
  • Uniform Distribution

CDF PDF

27

slide-28
SLIDE 28
  • Uniform Distribution Properties

28

slide-29
SLIDE 29
  • Exponential Distribution

29

slide-30
SLIDE 30

Example: Exponential Distribution

Exponential distribution PDF Exponential distribution CDF

slide-31
SLIDE 31
  • Scenario: Walmart has a giant bin of lightbulbs on sale. You

buy one and bring it home for testing and observation.

  • Assume: All light bulbs last exactly 100 hours.
  • Observation: Your light bulb has worked for 70 hours.
  • Question: How much longer is it expected to last?
  • Answer:

Light Bulb Testing (1 of 5)

31

30 hours

slide-32
SLIDE 32
  • Scenario: Walmart has a giant bin of lightbulbs on sale. You

buy one and bring it home for testing and observation.

  • Assume: Half of the light bulbs last exactly 50 hours, while the
  • ther half last exactly 150 hours. The mean is 100 hours.
  • Observation: Your light bulb has worked for 70 hours.
  • Question: How much longer is it expected to last?
  • Answer:

Light Bulb Testing (2 of 5)

32

80 hours

slide-33
SLIDE 33
  • Scenario: Walmart has a giant bin of lightbulbs on sale. You

buy one and bring it home for testing and observation.

  • Assume: Half of the light bulbs last exactly 50 hours, while the
  • ther half last exactly 150 hours. The mean is 100 hours.
  • Observation: Your light bulb has worked for 40 hours.
  • Question: How much longer is it expected to last?
  • Answer:

Light Bulb Testing (3 of 5)

33

60 hours

slide-34
SLIDE 34
  • Scenario: Walmart has a giant bin of lightbulbs on sale. You

buy one and bring it home for testing and observation.

  • Assume: Light bulbs have a working duration that is uniformly

distributed (continuous) between 50 hours and 150 hours. The mean is 100 hours.

  • Observation: Your light bulb has worked for 70 hours.
  • Question: How much longer is it expected to last?
  • Answer:

Light Bulb Testing (4 of 5)

34

40 hours

slide-35
SLIDE 35
  • Scenario: Walmart has a giant bin of lightbulbs on sale. You

buy one and bring it home for testing and observation.

  • Assume: Light bulbs have a working duration that is

exponentially distributed with a mean of 100 hours.

  • Observation: Your light bulb has worked for 70 hours.
  • Question: How much longer is it expected to last?
  • Answer:

Light Bulb Testing (5 of 5)

35

100 hours

slide-36
SLIDE 36
  • Memoryless Property

36

slide-37
SLIDE 37

Example: Exponential Distribution

  • 37