Skip to content

Mid

Random Variable

  • The result of experiments (random events)

Markov's Inequality

  • for X0 and a>0
P(Xa)E[X]a

Proof

Define a lower bound r.v. Y. That is

Y={aif Xa0if 0<X<a

thus,

YX

then,

E[X]E[Y]=aP(Xa)P(Xa)E[X]a

Chebyshev's Inequality

  • for X is r.v. having mean μ and variance σ2, then for k>0,
P(|Xμ|kσ)1k2

Proof

P(|Xμ|kσ)=P((Xμ)2k2σ2)

and by Markov's inequality, we now have,

P(|Xμ|kσ)=P((Xμ)2k2σ2)E[(Xμ)2]k2σ2=1k2

Law of Large Number

Weak Law of Large Number

Let X¯=1nXi, and Xi are i.i.d., and for any ϵ>0

P(|X¯μ|ϵ)0,when n

Proof

First of all,

E[X¯]=μVar(X¯)=1n2iVar(Xi)=σ2n
  • since i.i.d., Cov(Xi,Xj)=0

then by Chebyshev's inequality,

P(|X¯μ|kσn)1k2P(|X¯μ|ϵ)σ2nϵ2

Central Limit Theorem

  • The sum of samples is also an normal distribution when n.
  • The sample mean is normal distributed.

Let X1,X2, be a sequence of i.i.d. random variables with mean μ and variance σ2. Then,

limnP(Xinμσn<x)=Φ(x)

in which Φ(x) is cdf of standard normal distribution.

Monte Carlo Approach

θ=01g(x)dx=E[g(U)]=limnng(Ui)n

Acceptance-Rejection Method

  • required
f(y)cg(y)1

To solve c, find the maximum of f(y)g(y). Then find y such that

y=argmaxyf(y)g(y)cf(y)g(y)

Normally, we hope c as small as possible (to make the rejection rate lower). Thus we could let

c=f(y)g(y)
Standard Normal R.V. Example
  • absolute value of Z
f(x)=22πex2/20<x<

and let say Y be exponential random variable with λ=1

g(x)=ex

then,

ddxf(x)g(x)=0(x+1)exp(x22+x)=0

thus

c=f(1)g(1)=2eπ

MM1 queue

First of all, with the entering rate λ and exiting rate μ, we have the server utilization ρ

ρ=λμ

and the server would be stable iff λ<μ so that the ρ<1

graph LR
s0((0))
s1((1))
s2((2))
sn-1((n-1))
sn((n))
sn+1((n+1))
s0 --"&lambda;"--> s1
s1 --"&lambda;"--> s2
s1 --"&mu;"--> s0
s2 --"&mu;"--> s1

sn-1 --"&lambda;"--> sn
sn --"&lambda;"--> sn+1
sn --"&mu;"--> sn-1
sn+1 --"&mu;"--> sn

The states transition graph have to follow the rule that the outgoing probability must be equal to ingoing probability. Thus it yields the following equations

{λp0=μp1(λ+μ)pn=λpn1+μpn+1

in which n, and then we can get p2 as

(λ+μ)p1=λp0+μp2λp1=μp2

Recursively, we would have

pn=ρpn1

and since we known that ipi=1,

ipi=p0iρi=p011ρ=1p0=1ρpn=(1ρ)ρn

and thus we know that the stable state probability of number of customers n waiting in queue is a geometric random variable with failure times n.

Number of Customers in System

E[N]=nnpn=(1ρ)nρn=(1ρ)i=0j=iρj=(1ρ)ρ(1ρ)2=ρ1ρ

Average Departure Rate

E[ND]=μρ=λ

Waiting Time

  • overall time spent in system W
E[W]=E[N]E[ND]=E[N]λ=E[N]/μρ=1μ(1ρ)
  • time wait in queue Wq
E[Wq]=E[W]1μ=1μ(1ρ)(1ρ)μ(1ρ)=ρμ(1ρ)

Sample Stats.

Sample Mean

  • denotation
    • θ – popluation mean
    • σ2 – population variance
    • X¯ – sample mean
θ=E[Xi]σ2=Var(Xi)X¯i=1nXinE[X¯]=E[i=1nXin]=1nE[i=1nXi]=1nnθ=θ
E[(X¯θ)2]=Var(X¯)=Var(i=1nXin)=1n2Var(i=1nXi)=1n2nσ2=σ2n

Binomial and Negative Binomial

Binomial Distribution

  • distribution of number of success r given number of trails n
P(X=r)=(nr)pr(1p)nr

Negative Binomial Distribution

  • distribution of number of trails n given number of success r
    • namely, distribution of number of failures k given number of success r
P(X=n)=(n1r1)pr(1p)nr

Geometric Distribution

  • number of trails n until success
P(X=n)=p(1p)n1

Generation Method

  • CMF
F(i)=n=1ipqn1=p1qi11q=1qi1

let

U=G(i)=1F(i)=qi1

thus

i1=logqUG1(U)=logqU+1

Poisson Distribution

  • Pois(λ)
  • Considering events occur with rate r, with time interval t, there would be average number of events rt per interval.
    • say that λ=rt, expected rate of occurrences
    • Split the time interval t in to N pieces and make the sub-interval t very small(i.e. N very large).
    • t=t/N where Nthen rt1
    • if rt1, it approximates to do one Bernoulli trails in each time interval t.
    • Pois(λ)B(n=N,p=rt=λ/N)B(n,p0)
  • EXPois[X]=λ=np=rt
  • XPois(λ), indicates X is the number of events occurs in unit time interval (and the event rate is λ).
P{X=i}=(ni)pi(1p)ni=(\cancelni)λi\cancelni(1p)ni=λii!(1p)ni=λii!(ep)n=λii!eλ

hint

limx0ex=e0(1+x1!+x22!)1+x

Generation Method

  1. Generate several exponential random variable EiExp(λ)
  2. until E1+E2++Ei1>E1+E2++Ei1

Exponential Distribution

  • time between events in Poisson process
  • continuous analogue of the geometric distribution.

  • CDF

    • take YPois(λ)
    • split unit time interval to 1/N, where N is large
    • then p=λ/N
P(Xk)=(1p)kN=ekNp=eλkF(x)=1P(Xx)=1eλx
  • PDF
f(x)=F(x)=eλx

Generation Method

Since,

F(x)=1eλxF1(U)=ln(1U)λ

identically,

F1(U)=F1(1U)=1λlnU