Probabilistic Models and Their Verification David N. Jansen - - PowerPoint PPT Presentation

probabilistic models and their verification
SMART_READER_LITE
LIVE PREVIEW

Probabilistic Models and Their Verification David N. Jansen - - PowerPoint PPT Presentation

Preliminaries Discrete-Time Markov Chains Recapitulation Probabilistic Models and Their Verification David N. Jansen Informatics for Technical Applications Radboud University Nijmegen September 18, 2007 Preliminaries Discrete-Time Markov


slide-1
SLIDE 1

Preliminaries Discrete-Time Markov Chains Recapitulation

Probabilistic Models and Their Verification

David N. Jansen Informatics for Technical Applications Radboud University Nijmegen September 18, 2007

slide-2
SLIDE 2

Preliminaries Discrete-Time Markov Chains Recapitulation

Overview

1

Preliminary Definitions σ-Algebra Measure Space Probability Space

2

Discrete-Time Markov Chains Definition Logic Model Checking

3

Recapitulation

slide-3
SLIDE 3

Preliminaries Discrete-Time Markov Chains Recapitulation

Notation

P (A) probability that A happens P (A, B) probability that both A and B happen P (A|B) probability that A happens under the condition that B has happened

slide-4
SLIDE 4

Preliminaries Discrete-Time Markov Chains Recapitulation

Notation

P (A) probability that A happens P (A, B) probability that both A and B happen P (A|B) probability that A happens under the condition that B has happened Conditional Probability P (A|B) = P (A, B) P (B)

slide-5
SLIDE 5

Preliminaries Discrete-Time Markov Chains Recapitulation σ-Algebra

σ-Algebra

Let Ω be a set, the sample space. We assign probabilities to subsets of Ω in a systematic way. Definition A σ-algebra A is a set of subsets: Ω ∈ A A ∈ A → Ω \ A ∈ A Ai ∈ A for all i = 1, 2, . . . →

  • i=1

Ai ∈ A Definition A measurable space is a pair (Ω, A) where A is a σ-algebra over Ω.

slide-6
SLIDE 6

Preliminaries Discrete-Time Markov Chains Recapitulation σ-Algebra

Example: Borel-σ-algebra

Ω = R B = the smallest σ-algebra that contains all intervals [r, s) for r, s ∈ R The standard σ-algebra for the real numbers ´ Emile Borel, French mathematician, 1871–1956, wrote Le Hasard

slide-7
SLIDE 7

Preliminaries Discrete-Time Markov Chains Recapitulation Measure Space

Measure Space

Definition A measure is a function µ : A → [0, ∞] with the properties: µ(∅) = 0 σ-additivity: If Ai ∈ A for all i = 1, 2, . . . are pairwise disjoint sets, then µ ∞

  • i=1

Ai

  • =

  • i=1

µ(Ai) Definition A measure space is a triple (Ω, A, µ) where A is a σ-algebra over Ω and µ : A → [0, ∞] is a measure.

slide-8
SLIDE 8

Preliminaries Discrete-Time Markov Chains Recapitulation Probability Space

Probability Space

Definition A probability measure is a measure µ with µ(Ω) = 1 A probability measure is often written P or P. Definition A probability space is a measure space (Ω, A, P) where P is a probability measure.

slide-9
SLIDE 9

Preliminaries Discrete-Time Markov Chains Recapitulation

Overview

1

Preliminary Definitions σ-Algebra Measure Space Probability Space

2

Discrete-Time Markov Chains Definition Logic Model Checking

3

Recapitulation

slide-10
SLIDE 10

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

Markov Chains

A model of the behaviour of a system with discrete states. Behaviour := development over time, including the probabilities to move from one state to another. Two variants: discrete time or continuous time Special cases of more general stochastic processes.

slide-11
SLIDE 11

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

Discrete Time Markov Chain

Definition A discrete-time Markov chain consists of a set of states S. Often, S = {1, 2, . . . , n}. a transition probability matrix P : S × S → [0, 1] satisfying, for all s ∈ S, 1 =

  • s′∈S

P

  • s, s′

Sometimes, an initial probability distribution π0 : S → [0, 1] satisfying 1 =

  • s′∈S

π0(s′)

slide-12
SLIDE 12

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

Drawing a DTMC

Draw states as (numbered) circles Draw an arrow from i to j is P (i, j) > 0 Similar to a labelled transition system Example, to be drawn on the board: P =     0.2 0.3 0.5 1 1 1    

slide-13
SLIDE 13

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

The Behaviour of a DTMC

The system starts in one of the initial states, chosen based on π0 When the system leaves state i, the next state is j with probability P (i, j).

slide-14
SLIDE 14

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

The Probability Space of a DTMC

Definition A run is a sequence (s0, s1, . . .). . . . meaning: begin in s0 and proceed from si to si+1. Definition A cylinder set C(s1, s2, . . . , sn) (for n ≥ 0) is the set of runs: {(r1, r2, . . .) | ∀i ≤ n : ri = si} The cylinder sets generate a σ-algebra. Cylinder set C(s1, s2, . . . , sn) has probability: π0(s1)P (s1, s2) P (s2, s3) · · · P (sn−1, sn)

slide-15
SLIDE 15

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

DTMC Example: Gambler’s ruin

A gambler plays a game repeatedly Each time, he either wins e 1 with probability p

  • r he loses e 1 with probability 1 − p.

Plays until he is bankrupt

slide-16
SLIDE 16

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

DTMC Example: Gambler’s ruin

A gambler plays a game repeatedly Each time, he either wins e 1 with probability p

  • r he loses e 1 with probability 1 − p.

Plays until he is bankrupt or until he is millionaire. Draw the Markov chain on the board!

slide-17
SLIDE 17

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

Standard Properties of Discrete-Time Markov Chains

Definition A DTMC is irreducible if every state is reachable from every other state. Definition A state s of a DTMC is periodic with period k if any return to state s occurs in some multiple of k steps. A DTMC is aperiodic if all its states have period 1. If an aperiodic DTMC is finite, it is also called ergodic.

slide-18
SLIDE 18

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

Analysis of a Markov Chain

Interesting measures: Transient state distribution: What is the probability to be in state i at time t?

slide-19
SLIDE 19

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

Analysis of a Markov Chain

Interesting measures: Transient state distribution: What is the probability to be in state i at time t? Steady-state distribution: What is the probability to be in state i in equilibrium / after a long time (t → ∞)?

slide-20
SLIDE 20

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

Analysis of a Markov Chain

Interesting measures: Transient state distribution: What is the probability to be in state i at time t? pi(t) and π(t) = (p1(t), p2(t), . . .) Steady-state distribution: What is the probability to be in state i in equilibrium / after a long time (t → ∞)? pi and π = (p1, p2, . . .)

slide-21
SLIDE 21

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

DTMC: Transient State Distribution

Given: Initial distribution π(0) and P = P (1) Requested: Transient probabilities π(t), for t ∈ N

slide-22
SLIDE 22

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

DTMC: Transient State Distribution

Given: Initial distribution π(0) and P = P (1) Requested: Transient probabilities π(t), for t ∈ N π(t) = π(0) · P (t) = π(0) · Pt

slide-23
SLIDE 23

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

DTMC: Steady State Distribution

Given: Initial distribution π(0) and P = P (1) Requested: Steady-state probabilities π

slide-24
SLIDE 24

Preliminaries Discrete-Time Markov Chains Recapitulation Definition

DTMC: Steady State Distribution

Given: Initial distribution π(0) and P = P (1) Requested: Steady-state probabilities π Theorem If a DTMC is irreducible and ergodic, it has a steady-state distribution, which does not depend on the initial distribution. The steady-state distribution is the solution of the equation system: π = π · P

  • s∈S

ps = 1

slide-25
SLIDE 25

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Labelled Markov Chain

Definition A labelled DTMC (S, P, L) consists of a set of states S a transition probability matrix P a labelling L : S → 2AP where AP are the atomic propositions

slide-26
SLIDE 26

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Probabilistic Computation Tree Logic

Syntax Name Semantics a atomic proposition a ∈ L(s) ¬ϕ negation s | = ϕ ϕ ∧ ψ conjunction both s | = ϕ and s | = ψ P≥p (X ϕ) next

  • s′|

P (s → s′) ≥ p P≥p

  • ϕ U≤k ψ
  • bounded until

see picture P≥p (ϕ U ψ) unbounded until see picture

slide-27
SLIDE 27

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Example formulas

¬red P≥0.3

  • red ∧ green U≤k blue
slide-28
SLIDE 28

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Example formulas

¬red P≥0.3

  • red ∧ green U≤k blue
  • P≥1 (true U red)
slide-29
SLIDE 29

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Example formulas

¬red P≥0.3

  • red ∧ green U≤k blue
  • P≥1 (true U red)

P≥0.5 (X green) ∧ red

slide-30
SLIDE 30

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Example formulas

¬red P≥0.3

  • red ∧ green U≤k blue
  • P≥1 (true U red)

P≥0.5 (X green) ∧ red P≥0.6

  • P≥0.3 (true U blue) U≤10 blue
slide-31
SLIDE 31

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Mouse Catching

✑ ✑ ✑ ✑ ✑ ❛❛❛❛❛❛❛ ❛

mouse kitchen

  • ut

cellar A mouse walks through the house at random. It cannot climb where there are no stairs. Let’s think about the probability that the mouse gets out. What happens if we place a mouse trap in the kitchen?

slide-32
SLIDE 32

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Mouse Catching: Example Formulas

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Is the probability that the mouse gets out within 5 steps ≥ 0.2? P≥0.2

  • true U≤5 out
slide-33
SLIDE 33

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Mouse Catching: Example Formulas

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Is the probability that the mouse gets out within 5 steps ≥ 0.2? P≥0.2

  • true U≤5 out
  • Is the probability that the mouse gets out

within 5 steps while there is a mouse trap in the kitchen ≥ 0.2? P≥0.2

  • ¬kitchen U≤5 out
slide-34
SLIDE 34

Preliminaries Discrete-Time Markov Chains Recapitulation Logic

Mouse Catching: Example Formulas

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Is the probability that the mouse gets out within 5 steps ≥ 0.2? P≥0.2

  • true U≤5 out
  • Is the probability that the mouse gets out

within 5 steps while there is a mouse trap in the kitchen ≥ 0.2? P≥0.2

  • ¬kitchen U≤5 out
  • Is the probability that the mouse gets out at

all ≥ 0.2? P≥0.2 (true U out)

slide-35
SLIDE 35

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

General Principle of Model Checking

Input: model (e. g., DTMC) and desired property (e. g., PCTL formula) Output: “Yes” or “No” (or a probability)

slide-36
SLIDE 36

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

PCTL Model Checking

Recursion over subformulas! For formula ϕ, we need an algorithm like:

Given: satisfaction sets of subformulas of ϕ Requested: satisfaction set of ϕ

slide-37
SLIDE 37

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

PCTL Model Checking: Example of Recursion

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Let’s look at the formula: P≥0.2

  • ¬kitchen U≤5 out
slide-38
SLIDE 38

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

PCTL Model Checking: Example of Recursion

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Let’s look at the formula: P≥0.2

  • ¬kitchen U≤5 out
  • 1 Calculate Sat (kitchen)
slide-39
SLIDE 39

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

PCTL Model Checking: Example of Recursion

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Let’s look at the formula: P≥0.2

  • ¬kitchen U≤5 out
  • 1 Calculate Sat (kitchen)

2 Calculate Sat (¬kitchen) using 1

slide-40
SLIDE 40

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

PCTL Model Checking: Example of Recursion

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Let’s look at the formula: P≥0.2

  • ¬kitchen U≤5 out
  • 1 Calculate Sat (kitchen)

2 Calculate Sat (¬kitchen) using 1 3 Calculate Sat (out)

slide-41
SLIDE 41

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

PCTL Model Checking: Example of Recursion

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Let’s look at the formula: P≥0.2

  • ¬kitchen U≤5 out
  • 1 Calculate Sat (kitchen)

2 Calculate Sat (¬kitchen) using 1 3 Calculate Sat (out) 4 Calculate the probabilities of

¬kitchen U≤5 out using 2 and 3

slide-42
SLIDE 42

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

PCTL Model Checking: Example of Recursion

✑ ✑ ✑ ❛❛❛❛ ❛

mouse kitchen

  • ut

cellar

Let’s look at the formula: P≥0.2

  • ¬kitchen U≤5 out
  • 1 Calculate Sat (kitchen)

2 Calculate Sat (¬kitchen) using 1 3 Calculate Sat (out) 4 Calculate the probabilities of

¬kitchen U≤5 out using 2 and 3

5 Calculate

Sat

  • P≥0.2
  • ¬kitchen U≤5 out
  • using 4
slide-43
SLIDE 43

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Checking Simple Operators

Atomic proposition: Sat (a) = {s ∈ S | a ∈ L(s)} Negation: Sat (¬ϕ) = S \ Sat (ϕ) Conjunction: Sat (ϕ ∧ ψ) = Sat (ϕ) ∩ Sat (ψ)

slide-44
SLIDE 44

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Next Operator

For all s ∈ S, let iϕ(s) :=

  • 1

if s ∈ Sat (ϕ)

  • therwise

P (X ϕ) = P · iϕ Sat (P≥p (X ϕ)) = {s | P (X ϕ)i ≥ p}

slide-45
SLIDE 45

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Bounded Until Operator

Sat

  • P≥p
  • ϕ U≤k ψ
  • =
  • s | P
  • ϕ U≤k ψ
  • s ≥ p
  • To calculate P
  • ϕ U≤k ψ
  • :

Make all states in Sat (ψ) absorbing because they satisfy the formula trivially Make all states ∈ Sat (ϕ) ∪ Sat (ψ) absorbing because they falsify the formula trivially Let ˜ P be the resulting matrix P

  • ϕ U≤k ψ
  • = ˜

Pk · iψ

slide-46
SLIDE 46

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Bounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2

  • true U≤5 out
slide-47
SLIDE 47

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Bounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2

  • true U≤5 out
  • P =

           

1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 3

1 1 1            

slide-48
SLIDE 48

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Bounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2

  • true U≤5 out
  • ˜

P =            

1 2 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 3

1 1 1            

slide-49
SLIDE 49

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Bounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2

  • true U≤5 out
  • ˜

P5 · iout = = (0.18, 0.27, 0.14, 0.17, 0.47, 1, 0, 0)

slide-50
SLIDE 50

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Bounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2

  • true U≤5 out
  • ˜

P5 · iout = = (0.18, 0.27, 0.14, 0.17, 0.47, 1, 0, 0) Sat

  • P≥0.2
  • true U≤5 out
  • = {2, 5, 6}
slide-51
SLIDE 51

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Unbounded Until Operator

Sat (P≥p (ϕ U ψ)) = {s | P (ϕ U ψ)s ≥ p} P (ϕ U ψ) satisfies the equation system: P (ϕ U ψ)s =        1 if s ∈ Sat (ψ) if s ∈ Sat (ϕ) ∪ Sat (ψ)

  • s′∈S

P (s, s′) P (ϕ U ψ)s′

  • therwise

Equation system is ambiguous if ϕ ∧ ¬ψ-traps (BSCCs) exist Can be repaired by:

Take the minimal solution; or Change the equation system: P (ϕ U ψ)s = 0 also if s is in such a trap

slide-52
SLIDE 52

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Unbounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2 (¬kitchen U out)

slide-53
SLIDE 53

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Unbounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2 (¬kitchen U out) x1 = 1

2x2 + 1 2x3

x2 = 0 x3 = 1

2x1 + 1 2x4

x4 = 1

3x3 + 1 3x5 + 1 3x8

x5 = 1

3x2 + 1 3x4 + 1 3x6

x6 = 1 x7 = x8 x8 = x7

slide-54
SLIDE 54

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Unbounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2 (¬kitchen U out) x1 = 1

2x2 + 1 2x3

x2 = 0 x3 = 1

2x1 + 1 2x4

x4 = 1

3x3 + 1 3x5 + 1 3x8

x5 = 1

3x2 + 1 3x4 + 1 3x6

x6 = 1 x7 = 0 x8 = 0

slide-55
SLIDE 55

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Unbounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2 (¬kitchen U out) (x1, . . . , x8) = 1

18, 0, 1 9, 1 6, 7 18, 1, 0, 0

slide-56
SLIDE 56

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Mouse Catching: Unbounded Until Example

✑ ✑ ✑ ❛❛❛❛ ❛

1 2 3 4 5 6 7 8 P≥0.2 (¬kitchen U out) (x1, . . . , x8) = 1

18, 0, 1 9, 1 6, 7 18, 1, 0, 0

  • Sat (P≥0.2 (¬kitchen U out)) = {5, 6}
slide-57
SLIDE 57

Preliminaries Discrete-Time Markov Chains Recapitulation Model Checking

Steady-state Operator?

Steady-state probabilities are undefined for non-aperiodic DTMCs It is, however, possible to define a long-run operator (seldom used)

slide-58
SLIDE 58

Preliminaries Discrete-Time Markov Chains Recapitulation

Recapitulation

A Markov chain describes the (probabilistic) behaviour of a discrete-state system. Transient state and steady state analysis calculate state probabilities. Probabilistic CTL expresses properties of discrete-time Markov chains. There are model checking algorithms for PCTL (using transient state analysis).

slide-59
SLIDE 59

Preliminaries Discrete-Time Markov Chains Recapitulation

Coming Soon

1 Continuous-Time Markov Chains 2 Markov Decision Processes 3 Further Extensions: MRM, HMM, . . . 4 Tool: MRMC