Exercises: Stochastic Processes
Exercises: Stochastic Processes
HT09
can be obtained from rectangularly distributed random numbers by (a) the transformation
method, and (b) the accept/reject method.
Solutions
2. Consider the probability distribution for the χ2 -distribution with n degrees of freedom:
(
xn/2−1 e−x/2 /[2n/2 Γ(n/2)] if x ≥ 0
p(x) =
0 otherwise
R
where Γ(x) = 0∞ e−t tx−1 dt is the gamma function. What is the characteristic function?
What are the first two cumulants? What are the first two moments of p(x)?
Solution: Taking the Fourier-transform of p(x) gives:
Z Z
∞ 1 ∞
φ(k) = eikx p(x)dx = n/2
ex(ik−1/2) xn/2−1 dx.
−∞ 2 Γ(n/2) 0
where we in the last step used the definition of the gamma function. In order to determine
the cumulants we expand:
n
ln φ(k) = ln[(1 − 2ik)−n/2 ] = − ln(1 − 2ik) = n(ik) + n(ik)2 + O(k3 )
2
from which we identify
hXic = n hX 2 ic = 2n
Using the relation between cumulants and moments: hXic = hXi and hX 2 ic = hX 2 i−hXi2
we obtain the moments:
hXi = n hX 2 i = n(n + 2)
3. Consider the (discrete) Poisson distribution:
λn
pn = e−λ n = 0, 1, 2, 3, .. (λ > 0)
n!
P∞
Show that this distribution is normalized: n=0 pn = 1. What is the first moments µ?
What is the variance σ 2 ?
P∞
Solution: From the fact that the Taylor-series of eλ is n
n=0 λ /n! it follows immediately
P
that ∞ n=0 pn = 1. The first moment µ is:
∞
X ∞
X ∞
X λn X∞
λn−1
µ= npn = npn = e−λ = e−λ λ =λ
n=0 n=1 n=1
(n − 1)! n=1
(n − 1)!
| {z }
eλ
4. First-passage time problems can be solved by introducing an absorbing boundary into the
equations of motion. Alternatively, renewal theory relates the first passage time density
f (t) (from x = x0 to the absorbing point x = c) to the probability distribution, P (x, t|x0 ),
in the absence of the boundary, according to:
P̂ (c, s|x0 )
fˆ(s) =
P̂ (c, s|c)
R
where a “hat” denotes the Laplace-transform: Â(s) = 0∞ e−st A(t). Show by explicit calcu-
lation that the result above agrees with the result in the lecture notes for a one-dimensional
random walker satisfying the diffusion equation: ∂P (x, t|x0 )/∂t = D∂ 2 P (x, t|x0 )/∂x2 .
Solution: The solution to the 1d diffusion equation with initial condition P (x, t = 0|x0 ) =
δ(x − x0 ) is: !
1 (x − x0 )2
P (x, t|x0 ) = exp −
(4πDt)1/2 4Dt
Taking the Laplace-transform gives:
q
1
P̂ (x, s|x0 ) = p exp −|x − x0 | s/D
2 s/D
We hence get:
q
P̂ (c, s|x0 )
fˆ(s) = = exp −|c − x0 | s/D
P̂ (c, s|c)
so that by inverse Laplace-transform we have:
!
|c − x0 | (c − x0 )2
f (t) = √ exp − .
4πDt3 4Dt
can be obtained from rectangularly distributed random numbers by (a) the transformation
method, and (b) the accept/reject method.
Solution: (a) The cumulative distribution is
Z x
4 dx′ 4
C(x) = 2
= tan−1 (x)
π 0 1 + (x )
′ π
so that by introducing a uniform random number R ∈ [0, 1] and setting C(X) = R we get
X = tan(πR/4).
(b) The simplest overestimating function is f0 (x) = 4/π. Thus,
f0 (x)
p0 (x) = R 1 = 1, if 0 < x < 1
0 f0 (x)
and 0 otherwise. So, we first generate a random number Xtrial from the p0 (x) (uniform)
distribution. We then draw a new uniform random number R and accept Xtrial with
probability p(Xtrial )/f0 (Xtrial ) = 1+X1 2 , i.e., if
trial
1
R< 2 .
1 + Xtrial
The efficiency of this method is larger than 50% (π/4 to be precise).