Probability revision for PEPA - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Probability revision for PEPA

Description:

... with rates r1 (in the first room) and r2 (in the second room) are the first to ... rate r1 is first in room A)(prob alarm clock with rate r2 is first in room B) ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 27
Provided by: deptcomput
Category:

less

Transcript and Presenter's Notes

Title: Probability revision for PEPA


1
Probability revision for PEPA
Aim to fully understand a Multi-server
Multi-queue example in J. Hillstons thesis
Problems Didnt understand the PEPA of simpler
model (though the more complicated model is less
of a problem) Probability theory rather rusty
e.g. you say exponential, I say Poisson (JH
mixes them up).
But during preparation of this talk I sorted it
out ?
2
bibliography
  • 1 A compositional approach to Performance
    modelling J Hillston, PhD thesis.
  • 2 Introduction to stochastic processes Gregory
    Lawler
  • 3 Introduction to probability theory and
    statistical inference Harold Larson
  • 4 The nature of Synchronisation J Hillston,
    proc 2nd annual workshop on Process Algebras and
    Performance modelling, 1994

3
Probability revision
  • Discrete and continuous sample spaces
  • A Sample space (set of possible events or
    outcomes) is discrete if no finite-length
    interval on real line contains infinite no. of
    elements of S
  • E.g.
  • S1,2,3,..,n
  • S0,1,2,..
  • But
  • S1,1/2,1/4,1/8, (convergent sequence)
  • and
  • Sx a ? x ? b, a,b? R, altb (interval) are
    continuous

4
Example
  • Incoming/outcoming calls to an exchange.
  • Number of calls that have arrived during a period
    of time belongs to
  • S0,1,2, (discrete)
  • But the time taken between the rth call and the
    (r1)th call (say) belongs to an interval of R
  • (continuous)

A random variable X is said to be
discrete/continuous if its range is
discrete/continuous
5
Probability functions, distribution functions and
density functions
  • For discrete random variable X, probability
    function pX(x)P(Xx) for x in the range of X
  • E.g. if X is the number of calls arriving in
    first 10 mins to the exchange, then
  • pX(50) is
  • For continuous random variable, P(Xx) is
    equal to 0 for any x. (E.g. the probability that
    it takes exactly 0.2 seconds between the 9th and
    10th call is said to be zero).
  • Distribution function for X (discrete/continuou
    s),
  • FX(t)P(X? t) for any real t

If X is discrete,
FX(t)??x ? t pX(x)
6
  • Density function (probability density function)
  • of continuous random variable is
  • fX(t) d FX(t)/dt
  • P(Xt)dF(Xt)df/dt (tends to 0)
  • The range of X, RX t fX(t)gt0
  • Pdf is rate at which probability accumulated at
    value t.

Assume we always know the distribution function
for a given event.
7
Expected value, mean, variance
  • Expected value
  • If X is a discrete random variable with prob
    function pX(x) then

EX?x?RXx pX(x)
As long as sum converges, else doesnt exist
  • If X is a continuous random variable with prob
    density function fX(x) then

EX?x fX(x) dx
Expected value mean balance point of
probability/probablility density function
8
  • If X is a discrete random variable with prob
    function pX(x) then for any function G(X)
  • EG(X)?x?RX G(x) pX(x)
  • (sim for continuous)
  • Mean EX
  • Variance EX2-EX2

9
Some example distributions
  • Discrete
  • Binomial experiment with n (Bernoulli) trials and
    parameter p. (Two outcomes, success or failure, n
    independent trials). If qprob of failure (1-p).
    Xno. of successes in n trials

pX(k) ?nCk pk qn-k k 0,1,2, .., n
  • Geometric Again independent Bernoulli trials,
    X no trials necessary for first success

pX(k) ?p qk-1 k 0,1,2, .., n
10
  • Discrete contd.
  • Poisson used to measure number of events
    occurring within a time interval. Assume
  • (1) in sufficiently small Dt only 0 or 1 event
    can occur
  • (2) Prob of exactly one event occurring in
    interval Dt is equal to lDt (proportional to
    interval)
  • (3) Any nonoverlapping intervals of length Dt are
    independent Bernoulli trials

pX(k) gives the probability that there are k
events in interval of (fixed) length t. Poisson
dist. with parameter k given by
pX(k) ((lt)k/k!) e-lt, k0,1,2,
E.g. no calls to an exchange in given time
interval, or number of customers arriving at a
queue
11
  • Continuous distributions
  • Uniform sample space is an interval (a,b).
  • For any t, fX(t) 1/(b-a) and
  • FX(t) 0, for tlta,
  • (t-a)/(b-a) for a ? t ? b
  • 1 for tgtb

fX(t)
FX(t)
1
1/(b-a)
a
b
a
b
12
  • Continuous contd.
  • Exponential distribution
  • Related to Poisson distribution Suppose we
    have a Poisson process with parameter l. Then if
    T is elapsed time from beginning of observation
    until first event occurs, T has exponential
    distribution

For any t, fT(t) le-lt, tgt0 and
FT(t) 1- e-lt
Note P(T t)e-lt
FX(t)
fX(t)
1
l
t
t
13
So..
  • In a MSMQ for example, re. arrival of customers
    to queue
  • Number of customers arrived in given time
    interval Poisson distribution
  • Interarrival times exponentially distributed.

service exponential rate m
arrival Poisson rate l
Buffer (N)
Note that even though Poisson is discrete, time
is still continuous!
14
A useful result
  • If we have k simultaneous exponential
    distributions corresponding to the time for
    events e1,e2,..,en to occur, then their
    combination is an exponential dist. corresponding
    to time taken for any of the events to occur,
    ratesum of original rates.
  • E.g. suppose we have queue with at least k
    customers, and k servers, each serving at rate
    m, then the rate at which customers are served is
    km.

C1 C2
S1
S2
S3
Ck Ck1
Sk
Cn
15
How?
  • Server i has rate m so, if Ti is time taken for
    server i to serve, P(Ti? t)1-e-lt
  • And P(Ti gt t)1-(1-e-lt)e-lt
  • So probability that none of the servers has
    served a customer within time t is
  • P( (T1 gt t) (T2 gt t) (T3 gt t) (Tk gt
    t) )
  • P(T1 gt t). P(T2 gt t). P(Tk gt t)
  • (e-lt)k e-lkt
  • So probablility that a customer has been served
    within time t is 1- e-lkt
  • i.e. exponential distribution with rate lk

16
Alarm clocks
Suppose have n alarm clocks, time each goes off
has exponential dist with rate bi. if Titime
clock i goes off, P(Ti?t)1-e-bit
If TminT1Tn P(T ? t ) 1 P(T1 ? t). P(T2 ?
t)P(Tn ? t). 1-e-b1t.
e-b2te-bnt 1-e
-(b1b2bn) t So T has exp dist with rate
b1b2 .. bn
Can find the probability of a particular clock
going off first, Eg. P(TT1) b1/b1b2bn
Nb. This is a probability, given in terms of
individual rates, not a rate.
17
Proof
  • P(T1T) ?t0 P(T2gtt).P(T3gtt).P(Tngtt)dF1(T1t)
  • (remember, P(T1t)dF1(T1t)f1(t)dt all ? 0
  • F1,f1 are distribution function, density function
    of T1)
  • ?t0 e -(b2b1bn)t b1 e b1t dt
  • ?t0 b1e -(b1b2b1bn)t dt
  • b1/b1b2bn -e -(b1b2b1bn)t
    t0
  • b1/b1b2bn

Thanks to Ron Poet!
18
Attempt to express PEPA Operational semantics in
terms of alarm clocks (will need help..)
  • If P is component and Act(P) a, b, c
  • P

Like Server example, probability of doing an a
action (within time t) is exponentially
distributed with rate r1r2rk
Call ra r1 r2 rk apparent rate of action
of type a in P
From alarm clocks example Prob(action a results
in P ) r1/ra
19
Preparation the apparent rates of combinations
in terms of individual apparent rates
  • ra((b,r).P)

Act(P) is b here
  • ra(P Q) ra(P) ra(Q)

ra(P)
ra(Q)
20
  • ra(P/L)

21
If a ? L, P Q behaves as P Q
If a ? L ?
Scratch pad.. For transition with rate r, average
time 1/r smaller r ? longer average time Take
the min apparent rate, corresponds to max average
time (So if Q? Q slowest, holds up P?P)
Not very satisfying mathematically.
22
The nature of synchronisation
The reason for this is non-trivial, see 4 For
time being will just accept it. (It is not
possible to justify from first principles.) Justi
fication (from 4) rate of joint action
limited by rate of slowest participant. (The
underlying exponential functions are not
associative, but minimum is.)
If we accept this step, the rate R of a
synchronisation is easy to calculate
23
Operational Semantics of PEPA(easy ones first)
  • Prefix
  • Choice
  • Hiding
  • Constant

(a,r)
A ? E?
24
Op sems for cooperation
  • Cooperation
  • and
  • but, if a ? L,
  • Where R

25
Finding R
  • Let T denote the time taken for the first pair of
    actions to synchronise. Think of it as a set of
    alarm clocks in each room time of alarms in first
    room exp. with rate
  • r11, r12,..,r1n, in second with rates
  • r21, r22,,r2n, where
  • r11 r12 .. r1n ra(E) and
  • r21 r22 .. r2n ra(F)
  • The probability that the alarm clocks with
    rates r1 (in the first room) and r2 (in the
    second room) are the first to go off in their
    respective rooms is prob(alarm clock with rate r1
    is first in room A)(prob alarm clock with rate r2
    is first in room B)

Continued on next slide
26
Finding R contd.
  • Thinking of the particular synchronisations in
    the same way, the probability that a pair
    synchronise (think of each pair of clocks (one
    from each room) as a big alarm clock!) is
  • where R is the rate of that synchronisation.
  • Hence
  • and, since
  • result follows.

Write a Comment
User Comments (0)
About PowerShow.com