Changing Random Variables Tijms Understanding Probability
Changing Random Variables Tijms Understanding Probability
Understanding Probability
Chance Rules in Everyday Life
Secom.I Edition
HENK TIJMS
VrUe Uni\•ersily
~CAMBRIDGE
~~UNIVERSITY PRESS
CAllHIDOB UNIVHllTY PHii
CamtJridae. New York. Melboume, Mldrid. Olpe 1lJwn, S........ Slo Pllllo
C.mbliclae Uniwlllity Pnm
The SdiabarP Builcliaa. Cllllbridp C82 IRU, Ult
Publilbed in lhe Uaited Stlltll of Arwica by c.mbridp Unhenity Pnm. New YOltc
www.cllllbridaurl
lnfonmliua ua dlil tide: www~21701723
CH.11jmD17
ISBN 978-0-521-70172-3 ~
Preface page ix
Introduction
v
vi Ct1111<'111.T
p(x, y) = P(X = x, Y = y)
is called the joint probability mass function of X and Y. As noted before, P(X =
x, Y = y) is the probability assigned by P to the intersection of the two sets
313
314 Jt1int(v di:rtributed random variables
x\.v 2 3 4 s 6 7 8 9 10 II 12 Px(.r)
2 2
I I
J6 J6 iI 2
J6
2
2
J6 J6
2
0 0 0 0 () II
J6
9
2 0 0 :ii J6
2
:ii J6 i 0 0 0 0 J6
3 0 0 0 () I
J6 Iii i 2
J6 0 () () . 7
J6
~
4 0 0 0 0 0 0 2 2 () 0 !I
J6 J6 J6
s 0 0 () () () 0 0 0 I
J6
l.
36
() .l
J6
I
6 0 0 0 0 0 0 0 0 0 0 :ii ~
l
py(J•) I
J6
2
J6 J6
4
J6
!I
J6
ft
J6 i 4
J6
l
:ii
2
J6
I
:ii sum= I
A = ("' : X(ld) =.rt and B = (w: f(ld) = yl, with"' repmlellting an element
of the sample space. The joint probability 1111155 function uniquely determines
the probability dildributiOlll Px(x) = l'(X = .r) and py(.l') = I'( Y = y) by
px(x) =L, l'(X =x. Y =.v>. pr(Y) =Lx P<X =x. Y =.v).
These dilllributiOlll are called the marginal distributltms of X and Y.
Eample II.I Two fair dice are rolled. Let the random variable X represent
the smallest of the outcome1 of the two rolls. and let Y repraent the sum of
the outcomes of the two rolls. What is the joint probability mass function of X
and f?
Solution. The random variables X and Y are defined on the same sample
space. The sample space is the set of all 36 pain (I, j) for i. j = I •... , 6,
where i and j are the outcomes of the first and second dice. A probabil-
ity of ~ is usigned to each element of the sample space. In Table 11. I,
we give the joint probability 1111155 function p(x. y) = l'(X = x, Y = y).
For example, l'(X =2. Y = S) is the probability of the intersection of
thesetsA=~n~n~~~n~~~n~n~n~~and
B = {(I, 4), (4, I), (2, 3), (3, 2)). The set ((2, 3), (3, 2)1 is the intersection of
these two sets and has probability i·
Problem 11.1 You roll a pair of dice. What is the joint probability mas.• function
of the low and high points rolled?
Problem 11.2 Let X denote the number ofhearts and Y the number of diamonds
in a bridge hand. What is the joint probability mass function of X and Y?
JJ. J Joint probability densities 315
Example 11.2 A point is picked at random inside a circular disc with radius r.
Let the random variable X denote the length of the line segment between the
center of the disc and the randomly picked point, and let the random variable
Y denote the angle between this line segment and the horizontal axis (f is
measured in radians and so 0 :S Y < 2n-). What is the joint distribution of X
and Y?
Definition 11.1 The continuous random variables X and Y are said to have
a joint probability density function f (x, y) if the joint cumulative probability
distribution function P(X :Sa, Y :Sb) allows for the representation
--·-It
la ....... the joint pnmbility denlity ftancdcm ii faaad by det11minlna
. . the ClllDll. . . . joint pmbabillty dlllrilladma faacdlllll llld takina Mat the
,... clldWldWtL Hawvm; ii ...... lad the joint pnlllability
demlty ftmcdan by uana* problNlildciatelpnllldcm. 1bil ii iUUltrated wkll
tbeam•......_
Bzn ... 11.3 The paialm of a lpi•• of ..... r ii 1p1111 dne Ii-. The
line apina .., pmfa11ned lndepmdenely of ed atber. \Vldl ed lpin. the
painler . . . ••.........,..paint• the cin:le. The raadam Ylrilble L1
CC111....... 1Dthe ....... oft.bem: 6am the tapofthedn:letot.bepoint wbens
the paialll 1tap1C11 theldaapin. The leaadaoft.be m:il IDlliltndclockwile.Let
X • mia(L1e Li, Ls) and Y • ma(L1e Li, Ls). What ii the joint problbility
demlty ftmedoa /(z, y) of the two ccninaGlll raadam wrilblel X IDd Y?
. . . . . WeCID derive the joint pmbabillty deality fulldiaa /(.r, y) by 1llina
the iDtlrpreaadm dlat the problbility P(z < X S .r +Al', 1 < Y S 1 + Ay)
ii appnD"imetely equal to /(z, y)Al'Ay far Al' and Ay ..U. Tbe event
(.r < x s .r +Al',, < r :s 1 + Ay) ocean anly if oae of the L1 am.•
a VII• betwem .r 11111 .r +Al', one of the L1 a-.. betwem 1 IDd y + Ay,
IDd the....-... L1 a._ betwem .randy, wbens 0 < .r < y. Tblle _,
3 x 2 x I • 6 waya ha wbicb L1t £2, Ls CID be ll'faapd IDd the problbility
that for fixed I the raadam Vllilble £1 tms Cll a._ betwem a 11111 b eqalla
I I. I Joint probability densities 317
(b - a)/(2Jrr) for 0 <a < b < 2lfr (explain!). Thus. by the independence of
L 1, L 2• and L 3 (see the general Definition 9.2)
I
6tv-xl
forO < x < y < 2rrr
j(x, y) = ~2nrr
1
otherwise.
for any set C of pairs of real numbers. In calculating a double integral over a
nonnegative integrand. it does not matter whether we integrate over x first or
over y first. This is a basic fact from calculus. The double integral can be written
as a repeated one-dimensional integral. The expression for P((X, Y) EC) is
very useful to determine the probability distribution function of any function
g( X. Y) of X and Y. To illustrate this. we derive the useful result that the sum
Z = X + Y has the probability density
= 1:_co1: 00
f(u. v- u)dudv,
showing that the random point (X, Y) has the above density f(x, y).
In the following problems you are asked to apply the basic expression
=
P((X, Y) e C) ffc/(x,y)dxdyyourselvesinordertofindtheprobability
density of a given function of X and Y.
Problem 11.3 A point (X, Y) is picked at random inside the triangle consisting
of the points (x, y) in the plane with x, y ~ 0 and x + y ~ 1. What is the joint
probability density of the point (X, Y)? Determine the probability density of
each of the random variables X + Y and max(X, Y).
Problem 11.4 Let X and Y be two random variables with a joint probability
density
= {6~'~
for x, y > c
f(x, y)
otherwise,
In the same way, the random variable Y has probability density function
The probability density functions /x(x) and fr(y) are called the marginal
probability density functions of X and Y. The following interpretation can be
given to the marginal density f x(x) at the point x = a when a is a continuity
point of fx(x). For A.a small, /x(a)A.a gives approximately the probability
that (X, Y) falls in a vertical strip in the two-dimensional plane with width A.a
and around the vertical line x =a. A similar interpretation applies to fr(b) for
any continuity point b of fy(y).
Example 11.4 A point (X, Y) is chosen at random inside the unit circle. What
is the marginal density of X?
Solution. Denote by C ={(x, y) I x 2 + y 2 :S I} the unit circle. The joint prob-
=
ability density function /(x, y) of X and Y is given by f(x, y) l/(area of C)
320
/(.r.y) • {t for(.r,y) EC
odlerwiae.
Using the fact that /(.r. y) i1 equal to J.el'O for thole y milfying r > I - .r2,
if follows that
l.tr=i' -I dy.
and so
/x(.r) •
l-OU
oo
/(.r, y)dy •
-.tr=i'
'Ir
/r(y) • { ~ : : . : :dr,
1be calculltiom lad to the iDtaidvely obvious result that the ansle Y bu a
uniform distribution on (0, 2'1r). A IOllleWblt men surprising result ii tblt tht:
11.2 Marginal probability den.\'ities 321
listance X and the angle Y are independent random variables. though there is
Jependence between the components of the randomly picked point. The inde-
Jendence of X and Y follows from the observation that .f(:c. y) = .fx(:c)fr(v)
'or all :c. y.
To conclude this subsection, we give a very important result for the expo-
1ential distribution.
~:xample 11.5 Suppose that X and Y are independent random variables, where
X' is exponentially distributed with expected value I /a and Y is exponentially
listributed with expected value I //3. What is the probability distribution of
nin(X. Y)'! What is the probability that X is less than Y'!
\lso,
Jsing the foct that fl((x) =cu -iu and .fy(y) = pe-fl·''. it is next a matter of
;imple algebra to derive the results. The details are left to the reader.
t>roblem ILi The continuous random vuriables X and Y are nonnegative and
ndependent. Verify thut the density function of Z = X + Y is given by the
:onvolution formula
ft1r u11.v fun('ti1m R(X • .v) pmvidrd 1ht111h' intrRml ;,, Wt!ll drji11r1/.
=1~
-au
lnu U.tf(X.,\')dXd,\'
-nu
+/"" lnu
_.,., -nu
b,\'f(X •.\•)d.td.\•
=1,,..
.(•-nu
tl.fd.tlni.i /(.t,y)d,\•+11'11.1
.ra-nu ."•-nu
b.\•d,\·1"'
.(•-""1
/(.f •.\•)d:c
which proves the desired result It is left to the reader to verify fmm Rules 11.1
and 11.2 that
= 1'() dx [1x(x
0
- y)dy + f
x
1(y -x)dy]
f'(lix 2
+ i1- 1,, ] 1
=Jo ix- - x( 1 - x) dx =
3.
Hence, the answer to the question is i.
As another illustration of Rule 11.2, consider Example 11.2 again. In this
example, a point is picked at random inside a circular disk with radius r and the
point (0, 0) as center. What is the expected value of the rectangular distance from
the randomly picked point to the center of the disk? This rectangular distance is
given by IX cos(Y)I +IX sin(Y)I (the rectangular distance from point (ti, b) to
=
(0, 0) is defined by lt1 I + lb!). Forthe function g(x, y) Ix cos(y )I + Ix sin(y )!,
we find
1
rL~
E[g(X, Y)J = o o
{x!cos(y)I
t
+xlsin(y)IJ~dxdy
rrr
r3 [L211'
= -3rrr 2
I cos(y)I dy + J,211' I sin(y)I dy ] = -8r .
0 0 3rr
The same ideas hold in the discrete case with the probability mass function
assuming the role of the density function
when the random variables X and Y have the joint probability mass function
p(x, y) = P(X = x. Y = y). •
this question will be given under the assumption that the transfonnation is one-
=
lo-one. That is, it is assumed that the equations v g(.r. y) and u1 /1(x. y) =
can be solved uniquely to yield functions x = a(v. u1) and .v b(v. u1). Also=
assume that the partial deriYalives of the functions a(v. u1) and b(a•. u•) wilh
respect to v and u1 are continuous in (v. w). Then the following transfonnali<m
rule holds:
Rule JJ.3 The joint pmhabilit.v density function ti V a11d W i.r R;,,..,, h.\'
It !ii=-~.
Since X and Y are independent N(O. I) random variablea. it follows from
Rule 11.1 that their joint deDRity function is given by
I _1..-2 l _1yJ
fx.r(x •.v) = $'" 1 x $e l· • -oo < x • .\' < oo.
Applying Rule 11.3. we obtain that the joint density function of V and W is
given by
2ir
The random vector (X, Y) can be considered as a point in the two-dimensional
plane. Let the random variable V be the distance from the point (0, 0) to the point
(X, Y) and let W be the angle that the line through the points (0, 0) and (X, Y)
makes with the horizontal axis. The random variables V and W are functions
J
of X and Y (the function g(x, y) = x 2 + y 2 and h(x, y) = arctan(y / x )). The
inverse functions t1(v, w) and b(v, w) are very simple. By basic geometry,
x = v cos( w) and y = v sin( w ). We thus obtain the Jacobian
lcos(w)
. ( )
sm w
-v sin(w)
vcos w
I-
2( ) .• 2( ) _
( ) - v cos w + v sm w - v,
using the celebrated identity cos2 ( w) + sin2 ( w) = 1. Hence, the joint probabil-
ity density function of V and W is given by
for 0 < v < oo and 0 < w < 2ir. The marginal densities of V and W are given
by
O<V<OO
and
fw(w) = -I
2ir
10
00
ve-2I 11 • dv
t I
= -,
2ir
0 < w < 2ir.
density function ve-i 11• for v > 0 and W is uniformly distributed on (0, 2ir).
This result is extremely useful for simulation purposes. Using the inverse-
transformation method from Section 10.3, it is a simple matter to simulate
326 J11int(v distributed rund<Hn variables
Next. one obtains two random observations X and Y from the standard nonnal
distribution by taking
Pnblelll 11.10 A point ( V, W) ia choKen inside the unit circle 811 foll<>Ws. First.
a number R is choKen at random between 0 and I. Next. a point i11 chollen at
random on the circumference of the circle with radius R. Use the tranRformation
formula to find the joint density function of this point CV. W). What is the
marginal density function of each of the components of the point ( V. W)? Can
you intuitively explain why the point (V, W) is not uniformly distributed over
the unit circle?
Pnblelll ll.11 Let (X, Y) be a point choKen at random inside the unit circle.
Define V and W by V = XJ-21n(Q>/Q and W = Y J-21n(Q)/Q. where
Q = X 2 + Y2• Verify that the random variables V and W are independent and
N (0, I) distributed. This method for generating normal variates is known a.~
Managlia's polar method.
Problem 11.18 What is the variance of the number of distinct birthdays within
a randomly formed group of 100 persons? Hint: define the random variable X;
as l if the ith day is among the 100 birthdays. and as 0 otherwise.
Problem 11.19 You roll a pair of dice. What is the correlation coefficient of the
high and low points rolled?
Problem 11.20 What is the correlation coefficient of the Cartesian coordinates
of a point picked at random in the unit circle?
,,=-
R Pxrtrr and
a=µy--µx.
Pxrtrr
ax ""
For these values of a and fl, we have the minimal value
439
440