they are sometimes used when a problem can be only (or more successfully)
described by statistical models rather than by closed equations. Examples
are inhomogeneous samples, samples with irregular shapes, or excitation of
ﬂuorescent radiation by electrons.
The key components of Monte Carlo computations are a random num-
ber generator, functions (probability density functions, PDF) that relate the
generated random numbers to observable (countable) events, and counters
for these events. A simple example is the selection of a random penetra-
tion event for a photon in absorbing material, i.e., the position (depth) of
interaction. Simplest, a small discrete set of random numbers,
R
, could be
obtained by casting dice, where each numbered face shows with equal prob-
ability:
R
=
{
1
,
2
,
3
,
4
,
5
,
6
}
,
P
(
R
) = 1
/
6. Then the thickness of the specimen
(assume infinite thickness) is subdivided into a corresponding number,
m
, of
regions (
m
= 6 in this case) in such a way that in each of them the same
number of photons (
N
0
/m
) is absorbed (this is the important point: each
randomly generated number,
R
, must correspond to a set of equally proba-
ble events, in this case to an equal number of absorbed photons). From the
absorption law
N/N
0
= exp (
−
µD
) follows for the
i
th region from
D
i
−
1
to
D
i
:
N
i
−
1
−
N
i
N
0
=
N
0
/m
N
0
=
1
m
= exp (
−
D
i
−
1
µ
)
−
exp (
−
D
i
µ
)
exp (
−
D
1
µ
) = 1
−
1
m
,
· · ·
,
exp (
−
D
i
µ
) = 1
−
i
m
,
· · ·
and
D
i
=
−
1
µ
log
1
−
i
m
with
i
= 0
,
1
,
2
, . . . , m
and
D
0
= 0
.
(5.120)
For
µ
= 1 one obtains
D
0
= 0,
D
1
≈
0
.
18 cm,
D
2
≈
0
.
40 cm,
D
3
≈
0
.
69 cm,
D
4
≈
1
.
09 cm,
D
5
≈
1
.
79 cm, and
D
6
=
∞
; reading four eyes on the dice would
then be interpreted as the absorption of a photon somewhere within interval
4 (0.69–1.09 cm). In practice, this is perhaps not suﬃciently accurate, and a
continuous relationship with infinitely small intervals is preferred. This is eas-
ily achieved by replacing the discrete term
i/m
in the equation for
D
i
above
by a continuous, equally distributed random number,
R
, which is also normal-
ized to 1 and defined within the interval (0
,
1). Note that a sequence of such
random numbers
{
R
i
}
is equivalent to the sequence
{
1
−
R
i
}
, and therefore
D
(
R
) =
−
1
µ
log (
R
) =
−
Λ log (
R
)
(5.121)
Λ is the mean free path length. Given the starting point of a photon, this
defines the distance to travel to the point of the expected interaction.