Professional Documents
Culture Documents
Probability, Statistics,
and Random Processes
for Electrical Engineering
Third Edition
Alberto Leon-Garcia
Prentice Hall
New York Boc;ron Stlll Franusco
London Toronto Syd ney Tokyo Singapore t..tadnd
Mexico City Mun1ch Paris Cape Town I long Kong t..lonncal C.
Vice Prc,idcnt nnd Edilorinl OirC<"Ior. EC lnrcia J. I Ionon
A't<lodole Eclilnr: Alice 1)\\o rkin
Edilurial "~'i.,lunl: \\ rlliam Opaluch
Oirt-ctor nfTcom-OsN d Project l\luno~ement: Vince O'Brien
enior 1\lonngin~ Erlifor: Scull l>isannu
Art Oirectur: "cnn\ Beck
Co,er Oc, igncr: Kri\linc Carne)
Art Erli1or: Cm:g Dulle~
MnnuJ'nciUring Mnnngcr: Alan nschcr
MunuJ'ucturin~ On)Cr: I "" McOo\\cll
Cnver imn~e: I oughcre\\- mcg<thlhir mound Counl) Meath. l rdancJ.
Photu l<lf..cn h) A. l.con-Garcra. Nmcnrhcr 2006.
Copyrighl @) 20119 hy Pcn~cm Educnliun, lnc., Upper Saddle Rher, Ne" Jer<~C) 1174514.
All ngh1s reserved. Print ell in 1h1.. Uniccd Slelh!S nf Amerrca. Thi\ puhlicatinn j, prcllcct~.od h) \tlp) rig.hl and permis it'n
shoulcJ he obtarned from the puhh~hcr plior I\\ any prohihitecl reproduction, ~lw np.c i nn rctrrc\UI ,yqcm. or 1ransmission
in any form or hy any mcnn~. clcctrnnic.mcchunical. phulocupying, recording. or likcwisc. I'm inln11na1ion regarding
permission(~) . 'Mile lo: Righls ami Permissions Oeparlmcnl.
Prentice Hall
is an imprint of
----
llltJX76543l
Ill
Chapter 1: Probability Models in Electrical and
Computer Engineering
b) The outcomes are equa lly likely with the conditio11s spccilicd bclo\\:
PII - PI 1/2 if both sides arc eq ually likely (fa ir coin)
P1 - {JJ. f'l P = p; =P6 = 1/6 if the dice is fair
pn = PI - /}'1 PI= P4 = p; =Po= P7 Ps "" = 1/ 10 if the balls nrc identical
Toss I
I 2 3 4 5 6
(I. I) (I, 2) (I. 3) (I. 4) ( I . 5) (I. 6)
2 (2. I) (2. 2) (2. 3) (2. 4) (2. 5) (2. 6)
C"t
Vl 1 (3. I) (3. 2) (3. 3) (3. 4) (3. 5) (3. 6)
Vl
0
I- 4 (4. I) (4. 2) (4. 3) CL ~) (4. 5) (4. 6)
5 (5. I) (5, 2) (5, J) (5. ~) (5. 5) (5. 6)
6 (6, I) (6. 2) (6. 3) (6.4} (6. 5) (6. 6)
c) Draw t\\O canh v.ith replacement. S..:kct balls from urn as in part b). but ~i(h
52 52 label pairo.;. Alt~rnntively, we could make 1\Hl dra\\S from an urn \vith 52 balls.
Without replacement: elect balls from an urn as in part b). but "ith 52 x 51
label pairs. Allcmativcl). make two draws. '"ithout replacement. from an um "ith 52
lnbcled balls.
1
2 Student Solutions Manual
@ a) In the first draw the ou tcome can be black (h) or '"hite (tl'). If the first draw is
black. then the second outcome can be h or 1r. However if the first dra" is while, then
the run on ly contains black balls so the second outcome must be b. 1 hereforc .)' = {hh.
bw, ll'b}.
b) In this case all outcomes can be b or II'. Therefore S = {bb. h11, wh. ll'll'}.
c) In part a) the outcome lt 'll' cannot occur so.f;,, = 0. In part b) let N be a large
number of repetitions or the experiment. The number of times the first outcome is II' is
approximately N/3 since the urn has one white ball and two black balls. Of these N/3
outcomes approximate ly 1/3 are also white in the second draw. Thus N/9 ifthe outcome
result is It'll', and thus .r;,,..= I /9.
d) In the first experiment, the outcome of the first draw afrects the probability of
the outcomes in the second draw. In the second experiment, the outcome of the lirst draw
does not aiTect the probability of the outcomes of the second draw.
Thus.fit(n) = I - fAn).
@ l ite ouiCOill'' of this experiment conc;i!'tc; nf a pai1 of nnmht-r.. (:r.y) whf>re -.r =
nu:nb r of d ots 111 fhst oc:s and y = nmuh"I of dot~ in 'ccond to-.. Therefore, S = ~et
of 0 1 de red pair" ( x : !J) wher....r. yc {1. 2, 3. 4 . .5, G} which arc lbte-<l in t h t> tnhlfl' hPlow:
I/
a) .r 3 -l (j
1 ( 1' 1 ) ( 1.2) ( 1.31 ( l A) ( 1.5} ( 1.6)
2 (2, 1) ( 2. ~) (2.3) (2,-1 ) (2.0) ( 2.0)
3 (:1. 11 (3.2) ( 3,3 ) ( 3..!) (3.0) (3 .6)
1 ( l ,ll (-!.21 (-! ,3' ( 4.4 ) (4.5) ( -!.G l
;; (5.11 (5.2) (5,3) (5.4 ) ( 5.;)) (5.6)
6 (6,1) (G.2J (6.31 ra.o (G.J) (G.G)
Cbcrkmmk~ indicalt" Plcmenh of en-u t ::~ hclow.
h) y r. )
,
X 1 2 3 4 G ;r 2 3 4 .) (j
1 .J
" 1
2 .J .J 2
3 .J .J .J 3
,J .J .J .J .J I
:;
5
6
.J
.J
.J
.J
.J
.J
-J
-!
={
" .J .J (j -J \I .J .J .J ..J
A :- t \ < No? }... N 1 ~ N1 } B =[ V - ClJ
3
4 Student Solutions Manual
2l "
3
4 "
5
6
~--------------~
@ a} Each testing ol' a pen has lwo poss ible outcome~: " pen good"(.~) or pen bad"
(b). TI1e experiment con-.ists nf te ~ ling pens until u good pen is found. I hcrcforc each
outcome o fthe experiment consists of a string of"b' s endcd b) a"}{. \\e assume that
cnch pen is not put bac~ in the drawer aner being tested. 1 hus S {g. b?,. bhg. hhhx.
hhhhg }.
c) J'he outcome now consists of a substring of "b 's" and one x in any order
fullowed hy a fina l g". S = {gg. hgg. xbg. ghbg. hhgg. gbhbg. hghhg. hhghg. hhhgg.
ghhhg. hghbbg. hhgbhg bhhgbg. bbbhggJ.
d) S= [2. 3. 4, 5, 6}
Ch 2. Basic Concepts of Probability Theory 5
@ If \\C sketch the e"ents A and B "e see that B = AvC. We also see that the
intcnals corresponding to ~ I and C have no points in common !>O . I ( -0.
\\ c also sc-: that (r. \I= (r. n)n(-oo. \I= (- 7" .r I n(-o". \1 that is C =A" n B.
@
.:.!_implies IJ ~implic' (
since
@ and then
.4isa
sunset
ore
@ I
1hen~ @J8 since 11 i~ a
~ul1-.c1 nf. I
@u)
'~
Wake at 11
Sleep at '~ > 11
': > '
2-1 '
flnm nc)(m miJn igtu 6 am
Nt)tc that the problem specifies that the student ''a"c~ up hd~lrc returning to <;leep in the
specified time pcrind. fhis condition co nstrains the sample space to the upper portion of
the square region in the graph above.
6 Student Solutions Manual
lz
IJ 6
@ a) rhe s.1111plc space in tossing a die isS : 1. 2. l4.' 6l. I d p fl: ill= J> since
all faces arc equ.tll) li"-cl). B) A \iom I
b) We c.\ press each e\ ent as the union o r clcrm:ntar) events and then appl)
Ax iom Ill ':
Pf I) P[> 3 dots] = ?[(4,5.6}] =P[ Hl ] + fi{ Sl] t- /'f {6l] = ~
c) We first lind the clements in each event of interest and then appl) A>.. iom Ill':
PI . I v B I = P[ {I. 3. 4, 5. 6} I = P[ ( I } I +PI P J I+ 1'1 I4l l + I 'I {5l J + PI {6} ] = t
P[A r'l fll - P[ {5}1 =t
@ ldentitiP.S of thic type: arc ~hown by applicntiun of th1~ nxiom.;, \\'c begin hy treating
( .\ U D) ;1s R sin~!~ cwmt, then
P{A U B U Cj
= P[(A U B} U CJ
= P[A U B)+ P{CJ- P [(A u B) n C) by C'm. 5
= P{AJ.l.. P(B]- P [.-t n BJ- PIC! hy Cor. Son .1 U B
-P!( tnC)u(B nC)J noel by distlibuti' pwpe..rty
= P(Aj.J. P[B] .t.. P (CJ- P[A n Bj
- P[A n CJ- P[D .., CJ by C'or. 5 on
I P[(.t n D! n (B n G')] \A n C) U ( FJ n C)
= P[llJ + fl(B' P[C']- P[.-1. 'I B)- P[ 1n G'J
-P[DnC] I P [AnBnCJ.
= L~ (-I )
1
c.
Pf/JJ - Pf i multipleof 3l = L:
A;l
-
2
(I)'* =1-I-i - 1= 7I.
8 Student Solutions Manual
PI ,I ~ B) -
1 1
I (_!2_)"
1
=- - - I - - smcc a multiple ol 2 nnJ 3 is u multiple ol 6.
) -~ 63
I 1 20 .
1'! ,1- Bj 1'[ 11 - f[A ~ Bl = - ---- SII1CC
3 63 63
, l "" ( l fJ} u (A n B)] anc.J ( . 1 - /J) ~ ( . J n /J) .
PIA n B~ C! (_!_)"
2
1
= - since A n
64
= IJ nC= (6J.
@ As5umc that the probahilit) of an)' subinh:nal /of 1- 1. 21 t'i propor1innal to its
length.
Pill k length(/).
l'f . I v B v C J = PI A I+ Pf Bl + PIC I
- P[ ,1n B] - f( .I r1 ('] - P[ B r1 C'I
0) l--q. (2.7)
+ PfA r1 B n C)
= t+t+ ,i -0 - 0-;1+ 0 = I
@ I he order in \\hich the 4 toppi ngs arc sckciCd docc; not matter so ''e have
sampling\\ itlmut ordering.
II' toppings may be repeated, we hnvc sampling '' ith rcplnccmcnt nnd without
ordering. I he number or such arrangements is
4 4
(' : ) - 3060 possible deluxe piuns
@ I here arc 3' permutations of "hich onl) l)nc cone..,ponds to the corr~ct order:
assuming cquiprohable permutations:
1 1
@ The nnmh"' uf "'"Y' of dooo<ing ,\I nut of IOU is ( ,~~ ) . Thi' i; th" tutal nnmhc.
of r>tpuprobflblP outr.011H'S in rhe sample spt1o.
\\'car(' inte-res11 din th~ outrmues in which m nf the clal)~en iHm~ are rle(edi,e and
.\1 - m arc IHmdt'fE'c:the.
The numlJer of ways of <hoo~ing m dr fcctiwR out of /; i:;; ( 1~ ) .
( ~~ ) ( ~~n--,~ )
f.!. rntcomt''i with k tl~>fP't i\e
'Tutal # of nutcomr~
k ) ( 100 - 1~ ')
( 111 .\1-m
= 100 )
( M
(
I 00 - k) f.. ( I 00 k)
M \/ - 1
b) f[lol accepted I = P[ 111 = 0 or m = II = + -..!...,..----..:_
c~)n c ~n
@ J\s-;uming the lorwan.ls and dcfensemen do not ha\e assigned posit ions, (that is.
lcfi/center/ right for forwards and left/ right for dcfenscmen). then
If the fon' anJc; and dcfcnsemen ha\ e ac;signed po. . itions then the nurn~r of teams
increases because there arc ~cvera l ways to ac;.ign ria) crs to positionc.,:
@A={N1 ~N 1 }
Prom Prob lem 2.2 we have that A ::J B. therefore
P[hhhgj = .lxl
I S
xl.xl.
I 3
= 152
P[hhhbol
~
1
b
xl-xl.x.!..x
~ I .I
I =_!_
I~
1'(1J - I'fbb~]
I
P141 - P[ hhhg]
,.
.1. J'
1'[51 = P(bhhhgl
c) PI t
tl =t (( + + (t f I + ... + (t t )
PI B I - t ((1 ) ~~ + + (t )~Q )
I
n[ . 1I ] -- 1110 A ,
""jj'ii'i'"" <llll1
Ch. 2. Basic Concepts of Probability Theory 13
Thus
flint <accepted] ='"'100' x oo-l
100
@a) ,\ r
n l2
+I
l hannd; 0
- I
.2 -2
I t
d > PI r = 21 r = k 1= P[ Y = k I x = 2l Pl x - 21
P[J' = k]
Iljl
8-1
- k=2
J. f 1-1 =I
~ k=I
=
V+ =t k =O
0 other k
14 Student Solutions Manual
@ For l\\(.) C\cnts \\ e check \\ hcthcr Cq. (2.11) holds lhr the l' cnts A amJ lJ'
PI A 0 :I
8 1- 1'1 J] = += P[ A ]P[ BJ=t 1 ..J
P( I n ( J-= PIPJJ -+= P(.l)PIC1 =1.1
P(/J n CI-1'1{1}1 =-1 =P[/JJI'[C'J -=t~ .,f
1 hcrcl(m: the pairs or cvenb are independent. for three event.., \\C need to check for
pc1im isc indcpcndt:nce as \\CII o" for:
1'1 . 1n B n C I = P( fill=+ - f[ A]P[ BIPI C I :::1 tt = -k. No!
1his rc~ ult implic" that the tripkt ofc\(.!nts is not indcpcm.Jcnt.
@ Tht 1'\'ent A jg the uuiou of the mutually exdusiw C\'etltS A '1 Band A n a~. thus
Finoll~
P[A PIB I
=> Ac fii d B' 11t l ' i tlt:pl'lldiul
Ch. 2. Basic Concepts of Probability Theory 15
@ We U\C a tree diagram to show the sequence of C\>Cnts. I ir... t ,.,e choose an urn. so
A or . I occur-\. We then select a ball. so 8 or fl occurs:
B D [)
/, ./1 (17)
~
= J,( n)fH(n)
~
r~l li cq. ''' rei. l'rcq.'s of .I and 11
Jllllll nccurn:ncc in isol:u ion
u f I lllll.l II
16 Student Solutions Manual
= p~'
@ fl!k tossc' required until heads comes up three timL'<iJ PlhLatls in kth los~ I 2
heads in A I tosc;cs J 1'12 hl!ado; ink - I tosseo;] P[.l l BJ l'[fl].
N U\\ d. .
Jlf I I fl] = 1'[2 hca s m fl~t k - J to,scsl (*-I2 JI' , (I - t') k l
.
k lj \
Thus fl[AIRJPI H] = /'I AIB]p= (
2
J'' <l - J'r 1
1. 4....
Ch. 2. Basic Concepts of Probability Theory 17
@a) PuCI)=f
h) +i p 1(n)
f1,. (11 +I)=~ /}0 (11)
c) p(O)
-
=(.!...!.]
2 2
E< I) - E(O)I>
1
E(2)- E( l)l' = E(O)PP = (0)P
In general.
E<n) = E<O>P".
To lind P" \\1! note that if P has eigem aJues J. 1 ).~ and cig~o:n\lcctor~ ~ 1 ~ then
and
P" -( E/\E ' )(E/\E ') ... (E/\E ') n times
= EA{E 1E)/\ ... (E 1E)/\E- 1
1~/\''E I
amJ
pUt )= p<O)P"
[ ][1. .
I I l+l"~
I ( I ) '' I 3:! -:l1 ( -1 ) " I]
J J .. ) 3 3 -
c) p(n) [ ~ J ns 11 oo
@ lhe l"ollm.. ing Octave code produces a 21) scath.!rgram in tht.: unit ~quart.::
X rand(lOOO,l)
Y ran<.J(lOOO,l)
plot(X,Y,"+")
rr h a fl= a
=> ) II = ( h - (I)(/, + {/
h) I he l(liiO\\ ing Octm e code computes th~ ..... mplc mean and \aria nee of 1000
C\amples of the random variabk~ in the abm c experiment:
a = -s
b .. 15
Y = (b-a ) rand(lOOO,l ) +a ones(lOOO,l);
mean (Y) \ <\m1putc' ....unplc mean
cov ( 'i, Y) \ Com pull., ,,uuph: 'uriance
1~
1 1
cov('i,Y) = 34.065 \S . = ) ). '1 1
Ch. 2. Basic Concepts of Probability Theory 19
@ I n I lumcr"s sample space j{r) = R. _/{g) G. and /{1) (, . llomers e\'ents are
quite simple: 0. I R}. fG). {R.G} = SH. We shm\ the idcnlilic-. by 1!\aluating the rcle,ant
C\ cnts in each idcnt it):
n) .f
1
( { R}v {G}) = / - 1( { R. G: )= :r. g. tl
anti somt:
f 'U RIJ uF' ((G}) = {r} u lg.l) =lr. g. I} )
c)
and same
@a) n [a
,
f,. h+ ~~l= [a.h]
u) I he nc\\ mapping maps a pair of outcomes ofS to each va lue in S1. o;o
PI ) = -., J = J>~ 1- I' ( = 1."
c) X - 0 corrcsponuo., to II}: } 0 correspond" to ( I. 21 .
b) ,\' 00 10 1111
~ ~
2 15
d) PIOhh
I l hI J = l.xl
~ 8 = ..L
11
I
p,, = j J, = ... = 1'7 =l i
, , I
1}II1 - ,,. -
11
-
-
f>'I~-
-...!.
l.?
20
Ch. 3. Discrete Random Variables 21
2nd bill
I, 1:! I 'I 50
""'
I,
11
~
")
1
~
2
2
..0 51
....
VI
2 2
J,l 2 2 X
50 51 X
Outcomes along I he diagona I cannot occur because sn mrl ing j., \\ ithout rcrlaccment. A II
other outcomes ha ve probability -kt = ~~ .
3 4
I~
1'1 X >81 - L
I X
"' = I~> = +
IS
1'1> '> 8J L, p; = 8x J~ = ~~ =7
'~
I d \' 1+ 2 + .. + k
\ k + (k - 1)+ .. + 1
=> s = ~I - k<k i I)
A L_. ")
' I -
I!\' I -
'' .L "" .=
1\
lt L_. f
I I
If> ~
..L 1 = .!i2 = 7-
c;
I~ A
V f\ RI \" J =~-
1 ( ~)1-
1 - JHI ~ n~- "'
- ~
I I
I [u+lf - i ]= L: <3i 1
+3i + I>=Ji i + J ...!....!.!l +~
I
Wilhoul n.!plm.:cment:
xf +51xt = ': = 11 .80
1~'1 .\' 1-: 2
Fl X , I = 4 X 1+ 5 12 X * = ~ 21 17
VA RI \' I -: :c~, - ( ~Q )
1
= 9~~ =384. 16
~
~ ] -!'
I +=o. 11 n
p1 [I += L
II ~
I
,_,
Ch. 3. Discrete Random Variables 23
k=I
k =2
Carlos
0 I 1
..,
I~~,
-;; 0
.s:::
2
I I I
~
~ 2 0 25
0.25 0.5 0 25
I j = 51
/'I \' = j I I st drow =50] = { . since all remaining bills arc 1"
0 OtherWISC
V1\RI X I= it+ 2( ~~) -( 11~8 t =38~. 16. '"hich also ugrccs \\ ith Problem 3.25.
24 Student Solutions Manual
b) S= [O, Il A = {0 .3<~< 0 . 7}
P[f I = 0] = J>f'::; O.J[+ P[O. 7 <'::; I] = 0.6
f>[ I 1 = I] = f>[ 0.3 < t; $ 0.71 = 0.4
[7 ,] = Ox 0.6 + Ix 0.4 = 0.4
b) i'[ N = 41 = ( ~ } 0.}5 )'(0. 75)' = 0.0865 since the order <lues not matter
c) rl, = {U, < 0.25} F[ .l1A2 ,tl 8,B,C,.C7 C8 ] - (0.25)' (0.5) (0.25)'
8, = {0.25 < l I < 0.751 = (0.25)"(0.5)' = 6.10 x l0 5
d) rhe three events lhrm a rartition or the sample space. so the number (lr
occurrences of the three events has a multinomial di stribution :
( ~ ) p'=qn-A u!
11. J.!(u - ~)!p (r-k+l)p
- ( n ) ,.'<-lqn-kl = u! q = l:q
k- 1 . (1.:- 1)!
tn + l )p -1(1- q) =
1
.;.. (n + l)p - 1. =..:....(,_1-_k_-_,;_
l):.. . .p
kq kq kq
l> ) Fitl:lt ..;uppo..:e (n + l)p j,. not ;m integer. l h t'O rm 0::; k $ [(n + l)pJ < (n + l)p
( n ;- 1 )J'- ~ >0
p;. (n + 1 )p - k
- =1 + >1
Pk- 1 J~q
~ }?J.. increas{'l) CIS k increases Irom 0 to I( 11 + l )pj for /.: > (11 + 1 )p ~ [( n + 1 )pj
(n +Up-/.:< 0
111; (n+1)p-k
--=1+ < 1
Jli;-1 hf
~ Plr decren,c_c: ns k inrrcac:f"'S bcyo::Hl [(n -J l)t>)
:. l'k nttnins h~ maximum at /.:"M.H = [ru 1 lp] +
If (rl + l}p = k.\IAX then r1bon impliffl that.
. s
,_
c) 0.99 = /'f\ > k,, ] = I<t - p)( p = p(l - p)A ' _L(l - td
I I I I
@Note: The probkm statement shoulu read: r ind the number or employees
requircu ~o that more than 4 orders are \\ailing i-. less than I0" o
since a ...L=.i
"I' II
I r II 2 then f[.\ ; 41 - 0.891. lhcrefon: I\\ 0 cmplo) ccs art! almost sullicicnl to
allain 0.9.
@ I= 10 ]J = 0.1 7!JI = 1
J.: = 0 J:_J !.=2 A= 3
Bi nnmiol 0.34~7 0.3S7 0.1937 0.0~74
Poisson 0.3079 O.:i6i0 l.1~30 O.Oti 13
II= 20 p = 0.05 np =1
1: = 0 "'- 1 k=2 J, = 'J
Hiunmial 0.3.:J80 11.3ii4 O.JSSI 0.06
Poisson 0.367!) o.:l67!> 0.1839 0.0613
II - JQ(J p = 0.01 np= 1
k=O ~ I 1.:=2 A= 3
Biuomial 0.3f3G 0.3GD7 0.184!> 0.()61
Poissoll 0.3G79 0.3679 0.1839 0.0013
\\'c :-ec that fot 1lp = onc::tnut. as n inaeasec:: cllul 1J cl nc R"C" t lte ;\l'ru rar.y of the
approximation improves.
Ch. 3. Discrete Random Variables 27
~
~ \' lllll'f'orm .Ill 1 f 'l
' ")
-......... )
4 ,\ p =[ .\' =./'] ='i
I
and
VARI \ I VAR[UI = rs:~ 11 = ~;
~ II
~/)~ - = ctrHJO ~ In 1000+0.57721 - 7.485
<'woo k
@"I! need to calcuiJte fJ the fraction ofpopulation \\ilh \\l'alth less thank. and HI.
the proportion of \\Calth <mned b) the population that has \\~ulth k or lc<t..,:
1
PIX =.l. l =< l -p>Jl fork=1.2 ....
A
I. iq>' I Lk>'
'
I
Wll11 o
Ch. 3 Discrete Random Variables 29
X (0:1:10);
lambda = 0.5;
figure;
plot(x, poisson_pdf(x, lambda));
figure;
plot(x, poisson cdf(x, lambda));
figure;
plot(x, 1-poisson_cdf(x, lambda));
X (0:1:20];
lambda = 5;
figure;
plot(x, poisson_pdf(x, lambda));
figure;
plot(x, poisson_cdf(x, lambda));
figure;
plot(x, 1 - poisson_cdf(x, lambda));
X (0:1:100];
lambda = 50;
figure;
plot(x, poisson_pdf(x, lambda));
figure;
plot(x, poisson_cdf(x, lambda));
figure;
plot(x, 1-poisson_cdf(x, lambda));
@ a) 'I he l()llowing Octave commands generate the requested plot lbr part a). Parts
b) and c) arc done in a similar manner.
-
Chapter 4: One Random Variable
/. I 2 3 ..J 5 6
.A(~) 0 I I 2 2 3
}'(~) I I 2 2 3 3
,\' (1 . 2.11
I 111 1 j(_l)
~ -1.-
......._
- }{
II I 2 I
1--t---f-..o
.,
30
Ch. 4 . One Random Variable 31
I or 0 r < 2 _I _
() 2
Pl.\" ~ 0 I= F, (0) = t
P[I \' tl < I] = P (-I < X - t < I] = P[- r< \' < { ]
"" P( -t<X~f]=F,( I .5)-F ( 05)
=t{}+ l)-t(--1+ 1)
= 1 (}+ 1+!- l) =t
P[ r >-t] = t -r [ .r ~-t]=l --\-(-!+ 1) =7.
0.75~
1
I I I I I I I X
- 1 0 I 2 3 4
\' i<~ a random variab le of mixed type. so ''C have tn watch out for \alues '"here
the cdf IS not continuous.
\\here \\C tool.. the limit from the left to exclude the point X== 0.
= t:{2-{-2]=tc:
--~------~-----+------- X
-l $x~ l ()
-""""f"L~---:_+~-----+-------+
- 1 ()
X
FIX 01 - o
fl 0 < .\' " 0.5 j - F, (0.5) - F_\ (0)
~ ~ [<t +I)-t(t+ I)) -1[1 -1)
-- ll!l
@n)
~
{~.75c5{x)
x <O 0.75 0.5
./ \ (x) ::. x=O ____._L==
_ o._' , '"
0.5e ~f x>O
0
h) To lind the probabilit) that X = 0. \\e need to integrate the delta function:
II I
@X is a di ...crctc random variable and so arc random variables that arc defined as
functions of X. The pdf of X consists of8 eq ually spaced dc llu l'unctions wi th mass 1/8.
1
n> r\,r) - I I 1
tc><x- j)
x< - 3
l+.l < - < _.:..!.
, _ .x_ 1 ' .i = - J ..... J
34 Student Solutions Manual
.L 1M~-
I I --+-1---fJ--+-1- - fl-,lfliftl--+j---+ X
J -2 -1 -J .., - 1 0 I
Thl! mapping Irom X to ) and the pdf and cc.H or> nr\! as shn\\ n he low:
0)
3 -2 -1 0 2 3 4
15 -5 I 3 5 15 29
f
.) 5(1' -l 29) + 1.8
(J') - lR o(I'+ I S) +l.b'(
A .I'+ 5) + lo(
M I' - I) + .lrY(
H . I' - 3 )
F 1(1)
Yx
X
Ys
Yx
2l) 15 5 )
.\"~0.25
X < 0.25
-'t
- l (! - ,~ _1.1
2 = 2e- ... = X ~ 0.25
- I .!!fl
- ,e
{
0 X 5 0.25
~
~ n ) J"'l'olll t Il P. 11e fi mtw11
. . oi" cont1'Jbonl'.J
. 1 proI>n 1'1'
11 uy we IlRYP:
,_. . b.
F' r.r Io ..:::: X ~ J =
r f{ x s , }r {a :s x < ,, }1
n( ... , . ,. IJ
.~ - (J::: .-\ !:: )
----4---------~
J ----------~~ X
(l II
P[~J =0 .r < o
P[o <X< hJ
P[n S X < b} =
1 .r>h
Pfa $X $ uj
b) hfr!tr 5 X~ b) =
J' < IJ
36 Student Solutions Manual
/:t:(x)
~~l.----!.-.-1~ (l b
.. ;r
1\
I
I
I
I
a [,
l j.\ 1
1
=i f, X
1
(1 - x ! )dx =+[-fj~, -tl', J= :[i-i]=t
I he ' ariancc is then
V'\RI .\ ] = /.l.\ ]- [.Y] =t
1 1
mean of exponential R V
'--y---1
f . second moment of l!\l')(lllential RV
'-;ec Prohlcm 4.48 for a solution of this integral.
'
- -a [e ' 2 ;:,.: ]~ + m = m
&u L
a~ I (r - Ill} 2 e _, ~IT' dr = I
.. ,: I'!e ,: I' JrrJ ell.
J2;u &a ,
_&a {[ u 2ye '
1
2u~J: +u~ J>-'~ 1rr'((\'}
- a2 where we used integration hy purls with
-~ J ) ~
u = .1' d1 = ye- ' -u
@ /1 X J = f 1
X I , dT +
;r( l +x)
Jc;r( l +x") /.r
X ,
J';r(l_,+X"
I
_.-,-f/r
)
=_I_ In( I + x:! >I' = In( I - y) ~
2;r 2;r 0
V"J
/1) 2
J- a' r 1 (- a)+ [x~fr(x)dri-o'(I-F,(u))
Vi\ HI r] = [> , J- EfYf
=0 = ()
@a) y
b ----------or-----
ll '' a
,\'
\\ c ''rite the general e\.pres~ion for the C\~ctcd '.tluc in lhc terms:
and finall)'
/~' I>' I --2PI X ~-2 1+ 2P(X ~ 2l+ f 2(xt l)e'clrt J' 2(r l)e-'c/, ...., 0
~ ~ -----------------
te' tel = ()
Fl> 1
1- 4 x t e-1 + 4 x te 2 + 4 f 1 (x + I)2 e' ch: ~ 4 f( r - I) ' e 'dr
@a)
0 x S cl
F 1 (r) - f 1 (d) cl ~ r ~ 2c/
F, (2d) F, (d)
I x ~ 2d
r,
.
I
(x) = --
2xma.~
x + xma
F \ (.r) = '
2x,.,
I
! , (xld 5 x ~ 2d)= -------
. 2d + X111 ~, - d - t, " cl
40 Student Solutions Manual
1
= I x '' =-I (4c/ c/
---- =-
3d
1 1
J
d2 d d 2 2 2
~ r :: tl~ -e~'}
I x' ~., 9d' 7c( 9d 1 d '
=-- - - = - - - = -
d 3 " 4 3 4 12
.,
~ ~' x
c) E[(.A -ctl d <.\ <2d]= f' - cb: -2c J'' -x dr + c-J
, ., , '" -dr
I
lid l c/ l r/
=7c1
1
---2c
3
(3d)
2 +c,( dI)d =c,-Jed t
1
7tl
- -
3
d) 2c - 3c/ + 0 = 0.
3d
c =- This is the midp()int of the inlcrvnl (d. 2d).
2
c) E[(X-q(x))~]= [ ., (x-q(x))' ~ dr
-\111\
where M = 2R and Aid 2xm0 ,. In eftcct. we're adding the contributions to the mean
square error from the m intervals. Note that c:k denotes the representation point in the in
kth interval.
The dcrivntions in parts c) and d) can be used to show thatc! - kcl t 4=<k+!>d,
that is. q is the midpoint of each interval. Therel()rc,
I
=-
12
since there arc AI terms in the sum. and since Md - 2.rmil\ This is the same result that was
obtained in Example 4.2 0.
Ch. 4. One Random Vanable 41
Fx 11)
~,: ----------;;-:---
;~ ~((- X1 2 ~ T3 I t
x, -In-.1
In 1 ln5
X, = -' x~ = T
- A A
() x)
\!( I i
= ,;:;- eI . ~'dI= I - I
,;:;- J'e I 1
t II
"2Jr .r V 2Jr "
1
= 1- - - r' e_, 2 (-dt') where 1 = - 1
1
& JTJ
=1- I ")
I' e
I
- 1' '2
dt , = 1-Q(x)
-!C
t!
+ I) -f,(y!X -+1) = } , (1' - 1)
c(l'
.r. (.1' .\ - I ) = / , () I) =
a&
I e 1 It !o
b) Dec1dc o.. if .f1 <.r IX = - I )f[ X = -I]> .f. <Y I X - I) /'I \" = -t II
J) l
3e I ' .n >I
-4)'
2a
(I)
, > In -
3
@a>
L-( \ a) ={ X - a
0 X~a
X>a () (,( X
Nntc that the \aluc oL\'in the intcnal (0. o) are mapped onto L = 0 :
Ch. 4. One Random Variable 43
0 : <0
P[X ~a]= l -e-u
1
2'': =1-e 12
== 0
1'1/ ~ :1 =
P[ X -a ~ :] = P[ X ~ : 1- crl => 0
@.\'has nontero probability massatO. so >'wi ll have thi'i massa ty =- 4(0) +2=2.
y =g(x) = -4x + 2
2 / \ (x)
~('>(,\)
.l'
0 2
0 y<-b
P[X:::;; -b] .1' = - h
P[ ,~ti (X +u)::=;;y] = F\ ( \" y - a) -b < )' < 0
F;.(y) =
P(X ::=;;a] y=O
Pf ,~.,(X -a):::;; yJ = F r ( h/,C' y+a ) O<y<b
I y=b
Note that typically. the cdf will have discontinuities at y = - b, 0. and h. The cdf and the
corresponding pdrare shown below:
------------- y
b 0 b
y
0 b
Ch 4. One Random Variable 45
I
. I
{I')
.
F.'(r)
I
= f I (r)+f
.\
.(- .rv) for .r > O.
b) lhccqui va lenl event for {c(v < >' :S y + c(l 'l is shown bc luw:
!f T d!l
Therefore
Pb < }'!Sy + t(l'] = P[v < X :S y + c(vl + Pl -y- c~1 <X !S-yl
c) If.f,(x) is an even function ofx. thcn.f\(x) /I( x) anu thus /)lr) 2 / 1{y) .
y>O
46 Student Solutions Manual
-b 0
E:xnl"t:
<T~ h~
P'IX - m > c] <
-
---
I'!
= -
3t~
PJY- m , > c]
1
bound
c
h
P[I.Y - ml > rj
c
L 1
n
"
Ch. 4. One Random Variable 47
= =-------
iw( b - (-b)) 2jwb
Hl .\' l =-1 d, ( w) I
J' c:I II' ... o
-h--1'-h [-J.b2
2
+J...b2]
2
- t (h - h) = O
E[ \' 2] = 1
- ct'\(w)l
2
I
I
l II'
2 ,.;{)
I [ I 'h' I . ' ]
= j(h-a) --o +-ua " "
~ E[XJ -
=
-
E[\"2] -
-
l'AR[XI -
48 Student Solultons Manual
oo 'P
AfTT F =
la 0
R (l)dt =a-! ..2.
2
Ch 4. One Random Variable 49
i-a
c) R(t) = I - ~ = 0.99::. t = o + 0.01.1-;,
= ( ~ ) (c-1)2( 1 - c- 1) + ( ~ ) (e-')J
= 3e-:u- 2e-31
b) Now R1 U) = ll (t ) =
2 ,-: and R3 (i) = e- 1/"l. U(t) = P[2 or more working at.
time i)
0
O <U~-} u -te'
produces negat ive values o f r
,. - In 2u
The fo llm\ ing Octa\ e commands gene rate the requested sample and plot:
X= (-6 :0.01:6);
u = rand(l, 1000);
\Multiply all values by discLetely generated -1 or 1
z = -log(u). discrete_rnd(length(u), 1- 1 1), [0.5 0.5));
figure;
hold on;
\Normalize to 2 because bar width is 0.5
hist(z, l -6 :0.5:6), 2);
plot (x, laplace_pdf (x) , "1") ;
Ch. 4. One Random Variable 51
@ l"hc foiiO\\-ing Octave commands describe the fu nction for performi ng the
rejection mcthm.l and the code to call the function :
X [ - 4:0.01: 4 ];
z "' gaussian_tejection_method (10000);
figure;
hold on:
hist(z, (-4:0 . 125:4], 8);
plot(x, normal_pdf(x, 0, ~). "1");
'[1 < \' 1 . J_l ,. d] _ P({X1 accepted} n {.r _ X 1 < 'J.' + ,J;r}
_ " < ' + ch< \.l acceptt> - fJ[ v I]
' \ J lli'CCJif.C
4.10 *Entropy
@ t) ll~=log6
h) llxiA = log:J
lJ 1i - X ~p = log G-log 3 = log 2
@~ ) ll1 = logi
b) X= 4, 1 = 3 or 5, Hr = log2
@ \i 1
nuifo11n H\. in [-a,a], .f-x. xk) = 2c .
]\
~ 3 31 I 1 1 J 1
~ IIx - -2 Slog B- B log B- 16
log J6 - 2
32
log :l:l
3 4 5
- l.06 + 8 + Hi + J6
- 2.0bils
X p Codeworu
I .1/ 8 0
2 3/8 10
3 1/8 110
4 1/ 16 UlO
.5 lj;32 11110
6 1/32 11111
@~cl
P - Ce .a Ca'
'
1- L'~ =( a+Ca 2 +Ca'+Ca~
{
2 FJX I= I xCa+ 2xCa~ +3xCa' +4 xCa 1
('- 0.64.a 0.66
I~ - 0 42. /~ = 0.2 8.[~ = 0. 18. P. = 0.12
Chapter 5: Pairs of Random Variables
5.1 Two Random Variables
@ a) The underlying sample spaceS consists or the pair of outcomes in Carlos and
Michael's e>.perimcnts. The random pair (X. l) is generated for the pair from S b) the!
mopping shown helm\ :
s
...
')
~ 02
~
..c
0
II 1'2
~ 2 ~ @
Pr .\ T - - 1] --,1>
- 2}' -- J_
7I
54
Ch 5. Pairs of Random Variables 55
@ We show the joint pmf of (.X: >1 below hy identifying tht.: probability mass at the
valut.:s (x,, y 1) in th ~: plane. We show the associntcd marginal pm r.-; of \' nnd Y along the
corresponding margino;;.
() .. X 0 Y.~oo 0 ~
X
() Y...
0 2 0 2
y.,.
() fh
I
v...
I
2
'X
'%.
0 :r
I
%,
.,
'I x '-.hill In higher
Hlluc'> ll I.\
@ i) W<:. obtain the marginal pmf of X ( J) by ndding the prohubilities along a row
{column ) in the array of joint probabilities.
P[X = i] .L ;{ :- 1.0. 1:
0 I P[ r = i] = t
' i E {-1.0. 1}
- I X. y,: 0 Yl
P[X>O ] = P[X - l l=t
~ 0 0 0 y, Yl
P[X ~ r) = P[(X. }') e !C- 1. - 1).(0.-1).(1.-1),
y,: y, 0 ~J
(0.0).( I. 0).( 1. 1)I]= t+ t+t = 2
y, y, y,
P[X = - }'j = PI(.\'.}') e f(-1.1 ).(1. - I).(O.O)n = *
56 Student Solutions Manual
@ a ) The vector (X. }) as::,umcs va lues in the triangular region s hO\\ Il below. The
joint cur
is eva luated sepamtCI) in the four regions indicated below. In each instance \ \C
consider an arbitrary po int (x. y) in a region and calcu late the probabi lity lhnt (X :5 x.
r < y} by finding the area of the overlap hetween the triangular rcgion and the g iven
region and normali7ing b) ~. the area of the triangular region.
10 /\rea oftrinnglc is lh
rnanple 1c.:lun~le
""""'~
PIX ~ x. r ~ .rl
T + y(x - y)
X
= 2 (xy- '; )
y < x.x> l
( '"'}
x > l. y< l
f(.\' s xY s .1 l = l
Ch 5. Pairs of Random Variables 57
b) I he marginal cdf is found by applying property (iii) of the cclf '"hich involves
taJ...ing the limit of one of the variables to inlinity. In this problem, the cdf reaches its
limiting value at finite value<;. Thu!> the limiting value of/, 1(x. y) as x increases is
attained at Fu( I. y) (sec Region 3 above). Simi larl} F, 1(x, y) npproaches F., 1(x. x) as y
(Region 2).
-
- rI. \1
(lI l~ )- F \I (l~ l.)-
J
F.\I (l.I ..!)
I
+ F \ (l.I'~l.)
1- .-
1 x>l.y > l
I" ( ' . .1') ={ 0 . ,
all x > I
+--!- ' I '
(ro. .l'ol
F 11 (xu,J'o) = r r
lQ' 2e 'e 1 dx
l" ( l' I
~~~ XnYu)= ' ~' I L
fr,, ') e
I ,. I
lX
= 1- 2e-2'" -e '
P) I he marginal curs are obtained b) ta"ing the nppropriatc limitS of the joint
nlr:
58 Student Solutions Manual
@ a ) I he joint cdf is found O) integrating the joint pdf: For x > O.y > 0
F (x. r) =
\) "
J'J'( (.\". r' )dY'dl'' = J'J.e-.r' ~c/r' J2 ,,
1 J' ' ) ' 12
,,. ell' = (I - e
.r ! )(I - e_,.: )
h) We lind the probability of an event invoh ing \' amJ > hy integrating the pdf
0\ cr the region that corresponds to the evenl. In the Cihe below. for curh \'alut: u r' "~:
integrate the joint pdfo,cry from minus infinit) toJ,.
12
=[[ -c ]: fe- 1tl\
= -t
'
I (I - e (
1
I
)e ' clx
Altcrnati' el} \\e could ha\e inll.:gmtcd the joint pdf using Eq. (5.17uh).
60 Student Solutions Manual
= j 'x J--,
I e r 'a'
rdrd8
2,T(r
''here \\e lctx - r cos O.y r sin()
/" Jre
- -,
a ,
r" ">n
ur
1
= I- 1!
-w 2.,.:
.I'
0
Note that :
() X ){.
~ I K. }{ 7{, Pj) 01 -1 /,j) - II
2 X. X. Yo P[ \ ()I * PI \' = 31
3 X. fll .\ - II -+.= fll X = 21
Yu
~ ~
@ F 11 (.\.l ')-(1 -e 2
}(1-e )=F (x)/~ (.1') all.r.y
=:> , \ nnd r are imlependcnl
\\hcrc thc lirsl cqua lil) f()llows from the independence ofXam.l ).
Ch 5. Pairs of Random Variables 61
= ..n
I ( :! )
2
= ..nI (J)
:t -w
_ l
-- J.(.i)
2 4
= I- t Jr:~ dr ( I - tr)
= 1--!-[ r - ! ln .\ ]~
.ty<l.
= 1--!-[1 -f-! ln 2]
=f+f ln2.
- I
} -1 0 1 } ";! -1 0
X x l I 1
a) -J
0 !
~
[]]]
~ ~1
..
0 l l !
1 2
} 0
-~ _y2 I
b) -l
i I! IJ
0
0
2 I
62 Student Solutions Manual
@ 1 he e\pcctcd 'alue of a sum of random 'an.tblcs is the sum l)l the c:-.pected
'values of the indi\ iduJI random \ariables.
) t[X = t Vj = 0
&[X}) = 1' j_./t-z- :r.~dydx
-1 -..!1-" ;z:
= 0
=> p = 0 orthogonal & unconelated
ii) &( rJ = P ] = o
&(.\ } = rl ;_l-l :rydyd.r = u
1-t -(1-lxl
~ p =0 orthogonal & uncorrelatetl
1
)
2x (1- x)dx = ~
1
2 2
t:'[X ] :
V AU[ X]=~- ( ~) = -
2
1
t:!,.\' } j =
G 3. 13
1' l.l-r
2rydyd-.c: = 2 I
1' x( l - '.l') tl = Y,
r.
1 (~) :.!'' 0 -
i2- 3 - _ _1
p = 1 not orthogonal & uncorrclatcd
18 2
If we view this as a quadratic equation in/, then the equation is nonnegati\e and
therefore has at most a double real root. Therefo re the di scriminunt is nonpositive:
( 2 1~'[.\")' 1)
2
4 E[X 2 1 E[ Y 2 ] ~0
=> EI.\T I2 ~ EI X 2 ]EI1 ' 2 j
1'1 \TJI ~ ) E[X 2 ]E[Y 1 ]
64 Student Solutions Manual
@ rhc conditional pmls tal-.c a column or nm of probabiliti~s from the joint pmf and
rcnormnlize it to have unit mass.
a)
y % ~ f'( '.:)
2 Y.,. )(h Y...
0 I fJ(.\' I .I ==)-..:.---
/'{ )' =
=)
X X
x. r... 0
fl( ,.I y = I)
I
0 ., .\' p<xly-0)
0 0
c
()
y,
..,
X
'Y p(ylx - 0)
Y: ~
I
., I' pCylx I)
H[ }' I X =0 I 0 Xt + I X++ 2 Xt = t
E[ )' I X = IJ - I X+ +2 X* = !
El }' I X =21 - 2
L'f ) _ 1 S ~
') I _
r. 1- 1 xu, rzXv,+-Xu,-"ji;'
!~
I
ii ) l<tlx>=-
1
2
- - l ~.r~ l. - (1 - lxl)$y~1 -l xl
1-lxl
.,
iii) .f, (I' I X)=-( - O<x< l 0 <1'< 1-x
2 1-J:)
Ch. 5. Pairs of Random Variables 65
ii) L:.JYJxl=-!-.
, _,_, '-11-t'l
J yc~r=O lornllr ~ fi>'I = O
2
iii) Ell., X] =
{I- J}
f y dy = (1-.t}.
I
.
--
2
I (I - t ) ( I -.\)
=...;.__
2
0
= f( I - 2x + x 2 }i"
II
=[1- 1+t]=t.
.
an d "anance CT!, (I - p ' )
r A+o)
r(k + o)
=
r(o)k!
" )Q ( I+.A
( l+A 1 )'"
~
= I > (}
I ct t' = H /0 then
@a) p 11 (m)=P [ M = m]
- P[ K + N = m]
Ill
Therefore the pmfofa sum of discrete random \ariahles is the convolution ofthe pmfs of
the im.li'vidual randnm variables.
b) \\ c evaluate the summation from part a)" here \f and A arc binomial:
, 0
-t("]p'(l-
,., I
k )p"' '( I
p)" '(
m-1
p)' ,,.,
_1l'(l -piw"'i:(n)( k )
,_0 I 111 - 1
/1
( Ill
~k)
therefore the sum of independent binomial random \aria hies is also hinomial.
,
c) P11 (m) - LP, (l)p~. (m-1)
"
68 Student Solutions Manual
., ,_,
~ a.t -n. a, -tl
- L. - e x - e
1 I /! (m-f)!
= a ,(:
m 1 '" ' ' I I Ill.I ( _
{.( , )'
m! ~~ t!(m - /)! a2
( 11~)-
(1:
= =+ f r (~l'lf
T
= =+ (.: lnxf
=:-.: ln.: X
othcm ise
@ \'. }art! RJ) leigh random \ariables "ith a. = fl = I. / XIY. l"or: > 0
= I.lb xe -:
' ' [e-(.
)! ' ]
= f cLr xe :('~Y
I -~
= =
(t+ ~1 -) :! +I
x=--
ll' += 11"- .:
2 .\'= - 2-
b)
- -e
I ':=) -f ...~=j
. e . ' - - - - - - -.\"
2 '---rl '---rl
{' I ,~/21
.In (.r.y ) = - - - -
2m:
2 1- p
' )
a; = 2
' - 0
a1
2
=4I and a 2 = I.
2
@a) y
/0
Ch. 5. Pairs of Random Variables 71
b)
!I
o I
/:, } IX= ;r.J = m - fl (.r.- m 1 ) = -;-px
a1 2
c) ' l'h( riots iu pa.rlli a) a.nd b) are tlw s;unt' uuly wlw11 f1 =I. lu this t'<t<:e E[''j.'(--"
Jj- .~J, i (',
1
tiln u = 2'' t<m
')
_fl =
tan tl
2 ttlll
, = v:;1
0
1 4
o = - un1an - - 0
2 ;3
V AR[XIvJ + E(XIy)
2
\\ here w a.'>!lume [..\1 = (} ] = 0
'l
= ax(1- .,
p) ..J..
( ax )z
p-y
0"}'
2
= E.([X'2Y pJ] = (Y2 f.j.\ 2 IF]]
2
- t.'(a~ {1- p 2 )Y2 + /'~1. 1 ]
IT}
- n}af.-(1 - p") + p2 a:
2
t'[Y1]}
<7y ..._,_..
~lmwn llclow
::1 :
r (~J
72 Student Solutions Manual
r (~) = ~r (~) = Hr 0)
= ~vhf
us 2~\l'i
$.u 2 ( tzf
1
- 3a
xl I
- - = ln - -
2a, 1- u
= 2a~ ln--
2 1
\'
1-u
I
x= 2cr 2 1n--
l -u
function z rayleigh_rnd(s)
u = 1and;
z s . * <2 . * 1 og (1. I (1-u l ... <1 I 2 l ;
end
b) The lllllC between in!>pections is the sum or the /If mtcrarrival time~:
1/
T =L:X,
1 I
I hl!refore
c) Choose p so that
/4 = I if the Ath llnl\\ is black Since the urn hac; I R, anu 2 W. 1'114 I] =t.
a) lfthe hall is put bad, in the urn. \\C have tlm:c Bernoulli trials:
unu the joint pmf of J ( \ , }./.) is tletermined by the 1()110\\ ing. marping.:
l
X ) /
000 0 0 0 Pl [OOOl =(tf
001 0 I 1
I Pl [l 0 I] = 3 (t )( t )
010 0
100 0 I Pl[20Jl =3 (~ )' (+)
011 2 0 I
101 2 0 I Pl [31 11 = (1 )'
110 2 0 I
Ill 3 I I
74
Ch. 6. Vector Random Variables 75
1
PI \" =0J =(f ) P[r =OJ= 1- (+)~ 1,/ - 0I =(f)'
fl( .\' = IJ =J (+)( ;l Pfr=IJ =(tf /'[/. 11 =1- (t f
2
?[ \' = 21= 3 ( t ) ( t)
P( r = J J- ( +)I
n)
1
l, (X) =t (X + y + t) CO' = t [.\)I:, + 1
2. [ 1- t .rl:, J=f l.r + II
76 Student Solutions Manual
= /x 1 lXl}fx:(c2lx,)Jx,(xslxhx:z)
I 1
= 1-
Xt
-
r2
for 0 < .13 < :r2 :r, < l.
WP cuultl also lind the mar~inal pdf of X 2 by noting from the way the cxperirrlf'nl i!! dP.fined
that:
Thu~
b:. (.r
Clearl) X1 i uniform in {0,1). Nevertheless we carrj out thf! integral to lind fx 1 (:r.1 ):
h 1 Xt) = r 0
1
tfX2 { .
Jo XtZ2
Jr.s
Pl .\
=
( 1 ) '' ( 1 ) '
J ~- L (n -.r
,
I -. '
r )'
."
"'
' ~ I ( t )' (t )" .., .rl '
={ !' ) (+)':
~ l1!
.;__;c._.:.....;...;______ _ ( -I i -I ) "-' .1.
w hcr~: '' c u-.cd the Oinomial theorem for the ~umrnat ion.
@ a) Z. = [ V J= [ 1
(! 0l 0 J [ .~~~2 l IAI =I
lV
-------
1 1 1
A
-Yt - =U
X.--.
x2 - V- X1 = V- U
x3 - tl'- x.- x2 = w- ''
(!f.)
fz_(u, u. w) = f.xIAI I ,_,!!.
~=
= h:(u.,.- u, w- )
b) fz.(u,t.w)
J (z- .w\
'
=I (1~-=F 0
-~~-=
l
I= __ u_
(I - z J~
aud
= fxy :w ) lwl
Jz,w(z.w) ( 1 _ z'w (i-z)2
78 Student Solutions Manual
h)
fz(z)
I . \ ,1 - \I
N Ull!llUl - .\' -~=~ I
' ' ' ' .tlCll 1
2
=tE[t(xl-x2 ) ]
=f( !.l.\'1 )-2[ .\ 1 ]EIXl]+fX; l]
= l[...t.-
a _.: '-) + ..l..J = 1. = 1..
j_j_
..1 ,t 8 4
To find EIX' l for an c\poncntial mndom \ariahlc. ll'l! lhc thanu.:h:rbtic function
in E:\amplc 4.43.
<J) , '"(II') I = - 6j). I = -6_j). = /C[X ' l
). ~
1
o ( ). - jw) o
~ Fl \ ' ] = ;,
Ll \II l=tf--t=t.
Ch. 6. Vector Random Variables 79
FJ \I = 3xt= I
[)']=1x(1)' =z17
( / J = I (I -(t) I)= ~~
X
ur t
E[., , 1= 3 x 1x =
E[ .\'7. J t+
= IX IX t+ 2X IX 3X I X 1
27 =I
F[ L/.1 =1 1 *r =
1
x x( 27
f~l X 2 I = 12 X t + 22 X t + 3, X ( t ) = ~:
1
111'J
27
1- l xJ.!?_
I
~ 2(~1~)~~
1'1
l
.l
27 ,,
=[~ ..
2
:!.7 l7
~~.
n: !~:
8 I~!
!1 ~ 17:
@ a ) 'I he linear trans formation oft = (U .V,IV) 1 in tcrmr; of J: =(.\'1.X, . X,)T is:
u-x,
r' =.\' +.\'
1 2 mi =Q K J.. - I :l iid Gaussian
w- x, t X 2 -+ _\ ,
and so
> - [:
I
~ ~]x
I I
I rom Lq. (6.3 I):
K = K,A'=.I'=[~ O :J
- e1"'c exp [- iw 2
(2a 2 + 6ab + 5b
2
)]
j\'(v) - 1
/2(2a' + fiab + :'ib
2 2
)
exp [
2 </1
(v- c 2
+ Gab I 5b2 )
l
( IJ. () - +<TJ{t-l) ,
.. - e
In Problem 5.C)2 '"c ootaincd these results using the convolution ufthc pml" of.\, and \~ .
Ch. 6. Vector Random Va riables 81
[
I
11
Y.][e,]
I e
=f[e,]
e
11 l ~
e1 -1le -1. e
1 2 - I I
te, t-fel =0
e1 - If, IJ '
L', " II'
e, [i-JrJ' e, -[i.-iJ'
In the last step. \\C normalized the eigenvccto~ so they have norm I .
h) P io.; gi\-cn b)' the matrix \\<ith the eigenvec tors ao.; co lumns:
\ ""' /I}
= [I I][I'] [I] -Jr[ I] -Jr[I' 1',]
-j; I - I
I
y1
= r,
1
7 I
+ l',
.- - I
= I
+
y, - y.!
82 Stuclent Solutions Manual
K l
\
=1[3(x - 1
2
1) t.\ 1 (x 1 I) l .\ , (.r1 I) 1 Jx;J
= ~ [ (x1 - I)' +xi +t r , ( r 1 - I) J
C\P {-~C)[ (x1 - 1)
2
+ x; + ~ x2 (.r1 - I)]}
2Jr.fi
d) A = [~ ~] I [-1~I]
- .J2 P--
- 1
for K,
@>a) A. [~ ~] Q~ =[X0 ~]
M o ~] [y, () y,]
A,= 0 I 0 Q, = 0 I () lkt[K, J=2
[Y. o M
-Y. 0 !.
h)
=
ex+H 1
x, - 2 + ,;[!- :)( "1 - 1)+ ox;])'}
t662'
~ we necu to co cu ate:
.I ' ' <J) 1( w ) - - J.' .,IAII . 1'11c terms 111 t '1e expo nent are:
= e Jlll/11
[wI
.l 1[']= .
w2 O jwI
-l(w
..! I
-l[J.ll'~ - U'1
--~21 II' 2+! 2
. !ttl J
84 Student Solutions Manual
@ ) r
i) ii) iii)
\ 0 - I 0 X 0
I Jl,. Yt. - I ~ ~ y, ~
,K }(, y, y.
"
0 0 0
Jl,. }{. y, }(, y, ,K
From Problem 5.61 vvc have the terms needed to cvaluult: l q. ((L55):
COVI.Y. )' 1- 0 COV[.\'. )'] = 0 COVI Y.rl =f
V/\Rf\ j - ( l) '~ t{l)' +
VARIXl =t V/\R[ \') =f
=t'
VAR(YJ =-f Vt\RPI =t
VARI> I pq =0 l.1
p ' - () P \l = ~~ = I
a) )' = Pn <T, +m ,= Y =X
0" ,
@ I ir~l \\C {1btain th~.: marginal pdfs. so "e can calculate the rcquin:d moments.
/( .\ . .J'. : ) = t (r + y + :) 0 ~ X < I. () < y < I, () ~ : ~ I
((x.y> -+[x ty+ !] O~x~ I, O:S: I' I
f(x) +[x + l] O~x5 1
;I
'
\' 2 1-- 11 j(' , .2 ( ,. + I ) (/, -1.[.!
' ' l -1
+ .!.)
- l
_ 1. 2.. _..::..
- l 12 - II
1
'
v \RI \ I =,'~- ( tY = .~- i: = o:~~ = .~ =v \Rf I > \ \RI / 1
= jr '" [ "~ +
I 1 2 +]
~ + x .!. +.!. _ =1. [ +J. + ~
l J. ++.q.,
~ = J1
l .::,;. 11o
I I I
Ti Ti 11
Ch. 6. Vector Random Variables 85
"] - [
[a
2
VAR[:\'~
CO Vj,\ ,7. 1
COVIX,Z]] '[C.OVIY..
VAR[Z]
. '---------------'
COVP,%1
~\'1] = [
-
n:
l
21
!'] [=~J =[=0.04]
Ill!
I
0.04
nt
A
-
p D 112 = [ ."0 10 I
1.94 107
1.163
- .4~190
121
A = [ .80l01 I.16:H2 J
1.9!101 -.1 '190
Check
\ l+- [ .80101 L16342 J[ .8010 1 J.tl:H07 ] = [ ~ 1 ] I
It l.9ll07 -.48190 l.lG3 J2 -. 18190 I 4
86 Student Solutions Manual
@a)
t; lk] = ~CfX~:) + ~CIX~:-d = 0
1 ! f)
:j" I
0 0
! 1 ! 0
... /( = 0
I
1 11
t
1
.j 0
whrH'
UO\ { ." XJ) - \
0 CO\I(X" .\ n) = ~
! 1 !
0 0
ol
0 I
4
1
~
X n ormal_rnd (O,l,l,lOOO) ;
Y (X+ (0 X(l:length(X)-1)))./2;
cov(Y);
1\
I
= [X11 y,J
X
I' - [ YJi]
)!.;,
[ah O
('
J[ X - y;][a
.X 0
-~
bJ =[ I OJ
(. 0 2
a OJ [ Xa y; h - ~ c: J [ I OJ
[ h c -Yz a -Yz h +~ c = 0 2
Match terms lnr the entries in the matrices in the kli-haml !"ide to th1.' ctlrrcsponding
entric-. un the right-hand side:
a=Jf
Ch. 6. Vector Random Variables 87
0 J and
, J_
[.ffi
JX..JX
A K.1 A 1 = [ O
' 012 .
a) If \\e assume the signals are zero mean. then th\! cornpon~.:nt~ of~ correspond
to the jointI) Gaussian random variables in [~. 5.1 H "hich arc transferred into an
independent pair 1 b) the inner transformation given in I ' 5.45:
A--
- J2
I [ I I] I I
h) Consider how two consecuti ve bloc "-s Kt and jl arc lranslimned into It and Y-,:
}"
I I I 0 0 x,
>; I - I I 0 0 ,r,
r, -Jf 0 0 X,
)' 0 0 -I
I x-~
A'
88 Student Solut1ons Manual
(j + per 0 l...r
- 2- -~
l
, .
() u ' - pu- -,-
1'0 _!!._
II\ t' = 2
!!:._
~
{'0
T (]" + pa ()
J1<1~
(tn
--2- - -,- 0 (1 prrz
@ a)
89
90 Student Solutions Manual
E.(S/~ = n) = [t .~\;~] =
k=l
nE[X) ,
thuc:
since E[X1 .X 1 ) = ( x:z] if i - j and E[XaXJ] = t:[ ') 2 ir i "f:. J. 'I hus
I hen
Tht>n
[z5 ] - E([zs-IJ\)
- f.(G~(z))
- ..."'w rv] (z)
Ch. 7. Sums of Random Variables 91
- -=-
Nolc lhc signiricanl discrepancies between lhc bounds and the exact values.
92 Student Solutions Manual
~ Q( -2 )- Q(2) = 1- 2Q(2)
- I 2(2.2R) x l o-z = 0.9544
1'[ 50 N <55] :::: {?(0) - Q(l) = y- 0.159 =0.441
@ n NO). 1 1
/(S ,] - nA- 20
1k-!
1.-+~ e-(cr-:ZO),/Z(?O)d.,.
... a. per Eqn. 7. 2H
/2;;{20)
e-(k-20)'1 to
as per Eqn. 7. 30
A comparbon of the c\act value of P[S'n = I.. I am.J the a htl\C nppro\imation i~ gi.,en
bciO\\ :
~ Pui .,~on npprox. k Poisson apprux
@ 1 he total number of errors S 1111r is the sum of iid Bernoulli rondom variables
@ h~:
I number or faulty pens in the duration nf I~
wcd,s b a Poisson random
\ariable \\ith mean 15. According to Problem 7.34 "e have
for a > 15
Thcrcfhrc
t.> " '"1" ' ~).... - ' 5 =0.0 I
~ - aln (.~ ) t- a 15 =In 0.0 I
11} trial and ..:rror we lind a= 28, so the student <;houiJ bu) 28 pens.
u, UJ = e
ll2(~ ) = ~
l/3( ~) = ~
0
94 Student Solutions Manual
c'
1 - - - %1 l~)- t -<t-1 )
b)
U,.( ) = ~
! {
"'
{
. 2 {
3 (
4
...
I I l
n
1 2 3 4
W,(O =<en.
~eJ
{c2
!e
4
ee
...
I _I _l
n
1 2 3 ~ 5
+1
...
I
0 n
-1
1
t 3 4 5
96 Student Solutions Manual
1 2 3 1 5
Tl e firl!l lv.o terms approaclt iero :::ince X,. - t \ ' and )';.- }' in me11n square sense. \\e
need tu how I hat the last tenn a)so goes to zero. This re<1uires the Schwarz Inequality:
E[ZWi
:::} minimum attained by a = Efll'~]. Thus
. r _ 2 _ E(ZWJ 2 e[ZW] 1
0 $ E[(Z +a l1 )~- E[Z J- 2 8(W2J + I:;(W'll
Ne\t we -.ho\\ that {S., ~ t} => { V(l) ~ n). If {S, <;; ll then the nth event occurs
bcl(.m! time 1
=>{:\(l) ~ nJ ..J
98 Student Solutions Manual
=1-(1 L(a7~
' k.
e""''')
=L e-UI( a l)4
0 k!
but .\ , 1 i~ an I rlang RV 'IO b} Cq. (-L57) \Ye have lhat \'(1) 1s u Poi ~son 1<IIH.lom Htriable.
whcu the X, ar,. iid t'.Xponcutinl m nt!orn \'ariablt!s with ownn X,J T.
Th mean "f .V, i :
t[.\,) - fo 3
T x-f~ -~ITd.r + 3TP( x > 37'] T l - (' )
a) Thcreture the
lon.!!;Lerm
1 1
rep latement
. [X) = T(l c-3 )
ratP
b) I..t>t
1 X,~ 3T
0 X,< ~~ T
'I heu
f!CJ = P (X, ~ 3Tj = ,- 3
@ a ) Sintl' the age a(/) is the time that ha clupscd fmm the Ja.,t arrival up to time 1.
then
11
lim -I
I "" I
r au'>dt' = lim-1I 2:
j, I >Y
'"' r
IJ, I
'
au'>dt'
I ',,,
= Ilim -
. ... I~
' CI
t=l
N 8;
I? .. l/2;
n = [ O :N-11;
ems= fft(hinomial_pdf(n, N, P), 16);
%You can also evaluate the characteristic function ditectly ...
%w ~ 2.*pi .* n . /N;
\ems"" (1-PiP. e."(j. w))."N;
pmf ifftlcms. cms);
figure;
stem([1:16), pmf, "b");
@ f he li.>IIO\\ ing Octave code produces the ffoT to ohtain th~ pdl ol i:
function fx ift(phix, n, N)
phixs [phix( (N/2+1) ::tl) phix(1: (N/2))];
fxs f f t.(phixs) ./(2. *pi) ;
fx [ftshifL(fxs) ;
end
N = 512;
n = [-(N/2): (N/2-1)];
d 2. *pi. *n./N;
alphnX 1;
alphaY 2;
phiX l./(1 1 alphaX."2. *n . "2);
phiY 1./(1 1 alphnY."2. *n . 2);
phiZ c phiX. *phiY;
pdf ift(phiZ, n, N);
figure;
plot(d, pdf, "b");
hold on;
plot(d, ift(phiX, n, N), "g");
plot(d, iCt(phiY, n, N), "r");
Ch. 7. Sums of Random Variables 101
v ,.
a, ~n - A1 + "'2 + ... + ..,,1n, ,c.,,.
~ . ('
ts
.
~auss1an
E[S,.J - 1l }I
l AHI <;',.] E{it.\1 - m) + ... - l.\"11- m)j 2)
= (o- 2 ..!. pcroz\- (pJ 2 + 0'7 ~ 7w 7 ) + (pl-r2 + u 2 + pa 2 )
+...+ (p~ ~ a2 +paz)+ (l)(Tl + 172)
na"J + (l ~ 2(r?- 2) -1 l]pt7 2
(n + (2n - 2)p)r.r?
b) Suppose n;::: m.
c) Assume n < m .
.I.
rvSm.Sn (
w1,W2 ) _ E[!;.j""lSm+J~"lStt]
- E[E!eiw!S,.,.+.r..-:zs"ISm]J
E[eJwtSm [~~"lSniSmJJ
@ p = I 0 l'T~ - 4 11 - 9
c) P( ma~(.r, ..... X., ) < 12]= P(X, < 12). ..1,[ \,, < 12]
= (1-Q{' 2!"')f - (1 {}(1))"
=.02 112
<
d) P[lx, toj 1]= P[ x:-2 / -Jo
..r;;
<-'- ]
2 / J*;;
102
Ch. 8. Statistics 103
I'o find the sample mean of each group of9usc the fnllm,ing Octme command:
mean(normal_rnd(10,4,9,100))
0. I 9 = ,::, had ma,x of group less than 12 vs. 0.2 I 12 (t he tlu:orclical value)
0.18 - ,:~, hnd min of group less than 8 vs. 0.2 112 (the theoretica l va lue)
l'hc maximum and minimum were obtained using the following coue:
max(normal_rnd(10,4,9,100))
min(normal_rnd(l0,4,9,100))
@ a).\'isuniformin[O.O]. E[XJ=1
, ,,_*t x, =1-
I I
=> e= 21i1,
= ;;- c[f. I(
I I I I
X I - E[ X J)( \'1 - I I \' n]
=-;- t !:.[( XJ - ELXJ)] +II H[ x j
2
=..!.nVA R[X]
~f,V/\ RfX].
104 Student Solutions Manual
\', is Pobson. a = 4.
V/\Rjti,] VAR[.\'J = a
4 4
= 7; np - ;-[ npq + ( np )
2
J
= p - ':: - ti = ( p- p~ )- '::
'--v---' ;;.
\iJJq,~
crBemobn.
=E[(a,:)"]-2 ~ p( l - p)+Ji(J-p)'
1<1 f''1<11 II
II
J= E [ ~l (I - ~~ + ~~~ )]
2
E[ ( a,: ) J= H[ (*) 1
( I - f.)
2
= .J... E[ k 2 I- 2
, El k J+..!, E[e )
3
'' n ......___.._. ,,
"'""'''""fir;!
ln{lll\ctth'
These moments can be found liom the generating function discussed in the deri vation of
Eq. (4.86). Taking the first four derivatives of the generati ng function and evaluating at
- I. we obtain the first four moments of the binomial random variable:
G~ (I) = E[N ] = m1
=> m1 = G~ (I) = np
G~ ( I) = E[N(N - I)] = E[N ' -N j = m2 - m1
=> m1 = v~. (l)+m 1 = n(n - l)p 2 - np
G~(l) = E[N(N -I)( N - 2)1 = m, -3m2 + 2m1
G~. (1) = np. G~ (I) = n(n - l)p' . G,~( I) = n(n - l)(n - 2)p'
G_~.1l (I) = n(n I )(n- 2)(n- 3) p '.
..L
,, J~ [k I =.L
4
,., . 11(1t - l }(ll-2)(n-3)JJ
1
l ., J
4 6n(n - l )(n - 2)p +7n(n - l )p -+ ll np - )o Jl
'l hll<i r[(cr; )2]-) 1/ - 2p 1 +p~ = p~ (l - p)~ and ~ 1 " 1 (a; j 0 Sl) the C~timator IS
com.i-.tcnt.
@ Us ing thl.' md hnd in Example 6.22, \\ e find that the folln\'.ing mntri>.. gi ve~ the
dcs ircd covariance matri~
JJ -I
2 2
A
J3 .,...
2
x n o t ma l _tnd(O,l,2,2000)
y A x
plot(X,Y,H+H)
cxyl = y(l, :) . yC2, :)
z teshape(cxyl,20,100)
mPan(cxy2')
Ch. 8. Statistics 107
@a) j(.r)-~e
f}
n x~ O
. I ,
In /(x1. .... x, IB) =-nlnB - -
() 1
L \" I
1
h) Hy invariance property:
I
A~ll =-
... -= n
8,1._ .!..'Lx,
11 I
n -..IL
/(.r, ..... x, I A)= A"O e
'I
0- ..!!__In
d).
f(:r 1 , ... ,x, I A)= .i_[n In A A
d).
L:x~]- ': - L:x,~ i = - 11
-
II.
L:x,
~~~
= -8.-
I
~ /,.(y)
.fo (+)
=- -,-, y > 0, "here .f, is n-Erlang.
1\11 y-
...
d) 0" 1 is unbiao;ed and consistent because it i~ a sample mean.
108 Student Solutions Manual
d d ~
0- -ln.f(x1 ,, ) =-LJ - Ina +(a- l)ln .r, )
t!a cia ~I
- L'(I
1
- I (l
t- lnx, )= --+ n
(l
''
L:tnx,
1- l
~ 11
a- II
L:lnx,
I I
@ Im ariuncc Property
Ml estimator l(lr h({}) linds h* such that:
.f ( ,, ..... x" I It*}= max l (x1......" , I h*)
Ml c~timator lor() finds(}* such that:
.I ( ,., ..... x I(}*)= ma:\ l(x, ..... x, I B*)
let On - h"1(h*) the imer;e image of the optimum h* wu.l suppose that 01 4
0*. the
optimal ~ II I li.)r 0. then
@ a ) Binomial
I i12 I I X I )] ~- ] ~ n- 1!1 k, I
Ef k,-+
-!
[ -r O n ( p =+ ~ ~
rr , , (1- p)
'
2
11 n2 11 '
= - + - - = -- -
p 1-p p(l - p)
( IOo- ~
1
,100+ 1.~ )= <98.9. 1 0 1. 1)
30 30
@ I he ample mean and variance of the hatch sample mennc; are \fw = 24.9 and
I ;~= 3.42. 'I he mean number of heads in a batch is /1 q \/u.] I \1 = SOp
I rum I able 8.2. "ith I - a= 95 o and 11 I 9 \\ c ha"c
=,, :! ,ll 2.262
@ a ) / / ,: a=30 n =8 meac;urements
~
'I he e\~ rimcnt im ohe\ n measurements ofn Poisson random \.trtahlc. \\e tak.e
3
the sum nfthc total numhcr of order-. X= L,N, (eq ui-.. ulcnt tu t.tking thc Mtmplc mean).
I I
~ 240
1
~ --(!
WI -\. - I \
' - i"
k!
~1
,rx:.~-3o
r.;>
r-Jol
~ r.;j=Q(1.6-l>
vJO v8 v30t v8
II,
' I (T-q)~ I I ( SJ >
InA(x) =- .1l 1n .:.!:.----
,, l Y.
+-,-I In .:o..!..t-,--
'
r. < 1 {I -
H
II,
fl
Ch. 8. Statistics 111
II
>
- x 2 1 18r 81-t Y
2
- 16x+64 t'
<
,,
>
X I
<
II
~ 17= 2 1.64
2.326
22 then t" = 8 + ,-;::;; = 8.4959.
v22
a = 0.10 = /'[,\', > c I Hu]= 2Q( cJ;;) ~ c:- =, ,I j;; = 1.64 44 1-J;;
mu (-10:0.10:10]
plot (mu, 1.- ( -normal_cdf ( -1.644 9. -Bmul + (nounal_cdf ( 1. 6449. -Bmul) )
\\ c ohtnin:
II
() ()
Reject
z (j
p+-'-
.r;;
, =a)
p - ,u + " I
= 1-Q
[ atf;;
J;;J \J~lh:: p' < I'
,
=I-{!( p-,u +-
(j /..{;;
~
-u )
0
Ch. 8. Statistics 113
a I : .. .,, = 2.3263
y- 4 - ..{,; ::" =4 - 2
( I O) z" ,
.:11 M= 1.6449
3.8837 a=O.O l
r= { 3.917R a =0.05
[- ] (3 3-4)
b) p - 1' X ,,<3.3I H11 =Q (t }I IO = {!(.7(20))
1'1
' tr.n I :
'
x:I'IJI I
114 Student Solutions Manual
11 8 64
x.,.,.P , 1.2390 39.85 205.4 X~... I - ~
r=--<To
Il - l
}' 0.708 2.53 3.22
( 'uu =0 C'10 - 3 =5
C'01 - C110
C'u, -5 <'11 - o c~~~ - ell =3
1\cccpt 1111 if
/,< xi /-1 1 ) )11 x5~Co'>l ol '> hOlt lite so ld as long
< - - =-
~ j-1 ,,x3~Cn ... t oflnng life snld as short
- t +2x< In ~
~x< In ~
~ ..
x <.} In ; =0.3423
Ch. 8. Statistics 115
fl[ v - k , ,,, ,_ (k 1- p p
n)( )t .. '
- ( 1- p )1* /) ,
I'] II =k I II., I - (; ) p' ( _ Pf
1 - p (If,)
( _!!_Jil-l~
1-p
II,
;
<
"
(n - 2k) ln(_E_) > 0
1-p <
'-----v---' II''
"J
'--v---J
<.0
If
> ">
II
<
2k T< k Majurit} Rule
II, II
"
( n - 2k) In ( _!!_) >
1- p <
In(~)
a
II,
">
ln(l- a) / a _ 1.3861 =-.
ll - 2k 2006
< ln p /(1 - p) - 6.91
If,,
II,
J. > {0.1 ....,4} ~ 11..
- (8.2) k
< {5.6. 7.8} :...> // 1
"
i11l pc I error] = t (!)! 10' )' ( 1-10 )' ' "'( : Jl!r"
~( 8 )( 1-1 0
PII ) pc II error] = L- ,)1-1 ( I0 1
)A~ (R) I0 p
~ k 4
1
~x i5+(4 ) ,o-' x..!.~ ( ) 1o ~'x 51
8 2 8
8
/' ( ) 10
5 54
116 Student Solutions Manual
Thi'> implies that g( '\) selects (} so that./(0 I '\) is m<l\. this i~ the murimum a
pm/C!riori estimate.
@
Oh.... I \peeled (0 - r.)~ 'r.
0 0 10 5 10.5
I () 10.5 10.5 No. of dcgn.:c'> or li ~cdum - 9
.., 24 10 5 17.36 l 0 o signilicancc lc\d -=> ::!1.7
3 , 10.5 6.88 D2 ~ 21.7
4 25 10.5 10.02
5 3 10.5 5.36 ~ R~ject h) pothc.,ic-. that the
6 12 10.5 44.02 #'s arc unifhrm l) di.,lributcd
7 15 10.5 1.93 in{O. I .... 9l
R 2 10.5 6.88
9 2 I 0.5 6.88
lOS j)'J.-"' 130.33
@ t
\\'e flucl the prohnhili ie" of the
he cquhaJ,nt e\'ents of;:
ew~nts {X 1 = l 1 X,= J} in tt'rms of the pzobabili~i,....
P[X1 = 1. X2- 1] - P [~ < ~ =~ < I]
P[X1 = 0, X2 = 1] = P [~4 < { < !]
?.
-!I
P IXl = 1,X1 =OJ = J> f2I .. '<
4:1] = :tI
f'[.t.=O.X2=0J = Pl0<{<7]=T
=> PIXt = i,X, = j] = P(X1 = ijP[X2 = J] all r,j E {0, I}
::? \., X 2 independent RV's
b) (t) _ { 1 P [X(t)
77l.Ji - 0
= lJ + (- 1)P(X(I) =- I)= 0 0$ t $ 1
h .
ot erw1se
11 7
118 Student Solutions Manual
g(u) (and hence P[g(u) :S x]) is a periodic function of u with pcnod, so we can chatiAe the
limits of lh above integral to any iull period. 'I'hu"
P[g(u) :5 x] = { 01 u: g(u) ~x
11 :g(tt) > :r
g(u)
u
0
So finally
1
P[X(t) $ .rj = f
la:!l(,.)5r
1 du = /.1-X I du = x
Ch. 9. Random Processes 119
1 1
=
l1) m, tt) E(X(t)] =1 0
x dx = -.
2
Th~ correlation is again found using conditioning on 7':
- ~~ 1 g(u)g('' + r)du
g( 11 )g( 11 i r) is a periodic function in u so we can chang~ t.l!e limits t<> (0, 1):
) ( ll + T) = 2 - (1U + T)
0 lT
fo -~{l - u)(l- u
1
Cx(t.t+r)
120 Student Solutions Manual
CO!" 2(1
- C'()!\wT
Ch. 9. Random Processes 121
@ }', Xn I ~(II)
a) /~P :, J = ElX, J+g(n)
V /\R j >;, J= V 1\RlX, + g( n)] = V 1\ Rl X" I
>:=X.,+ n
1/
>.-=X + /n
ic;c;imil.u
122 Student Solutions Manual
@ b ) I or It 11,, 111_ 1(/I.X )\\e define t\\O nuxilia!) \ariablc-. II' and/:
~> ~~].dt:l(A) -- 1
1
I 0
.r' = oI o0 11
1
[
0 I 0
For ./, 11, 111 , 1(11,1') we need to define two auxiliary vuriublc!:l a-. \\1.!11.
fherl! Iuri!
1'[ ~. ). ~ = t) =
=
P[Sn
PjS =;JP[Sn-n
----
= j. Sr;.'
iu~rt JUt>JIL
n - 1 -
= i-J)
J
P rs~~-7. .:>1=t
.. .J
p) l - t]
=
r [s,, - s , = 1 - iJr s , = i]
PIS.. , =tl
= P(S., - Sn 1 _ j- 1 - ( n; - ~11 )
1,-'(1 _ p)"l-r.t-J + i
I
I
I
I
',
I I
0 1 ~ 3 4 5 6 7 S :J tO
I I I I I I I I
J 2 3 4 5 0 7 8 9 lO
124 Student Solutions Manual
~f(X"J + 4[Xn-d = ~P + ~P = P
= '-'" [ 4.An
1 2+42 A- \"n-1 1
-.-
-l-
I \'2 -1 ]
4~
- ~p(X~)-2:.\
4 ..__,_......
~
)(X"-d-' ~E[X!
.... 1)
..
p p ,.
j
= -p(l- pl
2
E[lnl~,+J] = ~t:[X.,X,H +.\~-L.\,._, X"""'I +~ .. 1X'n)
~[p 1- Jpl]
2 I
C(Zn] =
3 {.~n} + ;-(.,\n-d
.~
=P
1 .CO(( l':: \" \" ,5 4
C(Z,) g" 4" 4, .,.\n-1 + 'n
,-'l
l
)]
= gP + !jP 2
@ .\'
11
1
l ( ) 11 I } 11 1}. ) 11 i id
j+
t ,~rn ~+ r,, ) 1 ] - m 1 =! [l' 2 J -.L m = 1 V\RP ' I l(lrA = O
= tf(}:+ r,_,)(r ,+r,)]=tf> 2 l+~m-ml= 1 \ \R]) I fiJrkl
q o, t r, I )]E[O', ' + >~ . 4" >I =() othcm i..c
Ch 9. Random Processes 125
" fl
Fork > I:
= n(n+ k ) I. L...____
_ ,
Ef(_
1 1
111 }( \ ', Ill) I
X I_-.,.._ ____.
1
COV I I 1 \ ,I
=
n(n+k)
1
{n~a~+(2n
2
- l)a;}
4
= a ,2(4n-l) / 4 fork ~ l
n(n+k)
1he figure bclo" shows the terms im olved in the a[,o,e dnuhlc summation. Fork > I.
onl} the tcrmc; in the shaded region arc nonzero. I or k 0. the upper diagonal has n - I
tcrmo,. notn. so
11 t k
I
I
I k I diagonal has '' - I entries
lkl:> I
I
I
k 0 diagonal has n entries
k 1I diagonal has n entries
irk 1
IAJ I
(11 - l ) nlt.'f'llh
126 Student Solutions Manual
@ let V,- the numher of items dispensed. Note that \\C must have A \\here I is I~
the numhcr or coins ucpositcd in the machine. 1 his affects the IO\\Cr limit in the second
equation tx:km.
'I his that il \\-C create a llC\\ process b) selecting C\Cnts from a Pni,son process
\llll\\S
accoruing to Lkrnoulli trials. the resulting process is aJ,u Pobson.
@ l'li\(1 t/)- .,
.I
j\ (/) = kl = f>[ N(I-c/) = j. i\'(1)- k I
PfN(t) = kj
P[N(I - tl) = .ilPI J\ (I) - I\ U d) k .i I
=
PINu> - k l
1
). (1 -c/)' -)( / II ) ), 1 ' " ' I ).,/
-1-,-e (A /1 1 C!
= ,~, ' )./
A' ~
The ntlmher or C\ cnts looking into the future has a Poisson ubtrihutiun. hut the abO\ e
equation shO\\ S that the number of e\ents looking inw the past h.t._ a nmomial
di"itrihution.
Ch. 9. Random Processes 127
@ a ) P{X1 (1) = i.N,(I)=kl N(t) =k+ i l-= fli heads ink+ j toss~s]
=( I j +kJ p' (1- p)'
=( j+kJ A/ 411
. p '(l - {J)A _ . C! It
J (A +.J)!
.(pAl)'
.:. . :. . _____:_ e fMI (( l - fi )AI)A
e fl J)J.t
j! k!
This shows that nmuom splitti ng of a Poisson process results in incJcpcnuent Poisson
rn ndom processes.
P[7.{t) = OIZ(O) = 1] =
P(outl # t1ansitionsin [O.t]} :L-1 -tl -1 ( -1 --tC\t-nt)JJ+ = 1 +at2o:t
= ;::oo <"<:
11
1
b) mz(t) = 1 P{ZV) = 1] =2
128 Student Solutions Manual
X{l) and X(l ') an.: juinll) Gau ~ ian random variahh:" "ith
then 1, 1, 1 1111 _,( Y1.x, ) can be obtained using Eq. (9.47) a-; folhm s:
in '' hich
Ch. 9. Random Processes 129
b) Because , ( and Bare jointly Gaussian random variables. X(l) - A cos w f t B sin
M l and .\'(1 1 s)A cos w(l + s) + B sin w (l I s) arc also jointly Gaussian. with zero
means and covariance matrix
A
Irll/' -- ,. . '1 1
1\ .... I l1 I
cos ro.\ =a s1n ros
A'
A:= {cos- 1
x , - wl, - :.:r < e ~ c.os-1 z, - wt, - WT + R}
-x?
l
Siucc a i unifor m !~ rlistributed. P[Ai} = P{AH.
In addit ion
P(A, n 2 n A3j = PI A~ n ...t; n A;J
since the intersection depends only on the rclat i;c values of t 1 , t 2 and t3 The ~a.rue
prorcrlurc C'lltl h~ used for nth order pdfs.
:. X(t) is a stat.ion~n random proce~<>.
Ch. 9. Random Processes 131
@ As~urne X" i<~ rlisrrclc-valued. for -.i rnplir.ity, so thaL \\f' c n work wt t h profs. Cou~idPr
tltP tl ud-ordcr joiut prnf of} ~: for n 1 < n2 < n;t we ueed tu lihvw that for a ll T >0
:. (*)hold~ if Xn is a slationuy rr.ndom JII'Ou:ss nmlm pcu licul& if X, is a.n ild process.
c) In order for .\:, and l'n to be jointl} stational). their joint distributions should be
in variant to shills in the origin. In parts a) and b) \ .,.C cx prcs..., the joint pmfof }', 's in terms
of the X,'s. 'I herel<)rc \\e can a lso express joint pm fC\ of \ , 'sand ) ~, s in terms of joint
pm fs of .\ ,'s only. rhe stationarity of .A~, then imp lies shin invariancc lo r the joint pmfs
0 r .\', and r,.
l'hercforc \', and r, are jointly stationary if X, is iid und if X, i<; stationary.
~ /.( n is w ~s
h) L(l) is a Gaus<;ian random variable \\ ith 1.cro mean and covariance ( \ {0).
132 Student Solutions Manual
c) /(I) i.., a \\ ~~ Gaus.,ian random variable" ith 7Cro mc,m and em artanc~
C\ (I~ -11 )cosm(t, -11 )
lhcrcl('lrc (/(11)./(1 )) has ajointl~ Gaussian pJf\\ilh
c) B) using au\iliar) variables "e can c;how that sarnp l~: p()ints ul L(l) and .\"(1)
arc ohtain~:d ac; linear tran'>formations ofX(t) and }"(I). lur c\ampk.
/. j lcus0 ~][/.]
()
II =
(1)/
1
0 sin {tJ/
I 0
1
J[.\',', ] I () II'
l,. o o rI
0 () I I'
I hcrclllrc il' s:.unplco, of' X(l) anti HI) arc join11y Un ussiu n. then snmplcs nf /.(f) and XU)
arc also jointly (,au<;sian. rherefore the joinl pdf of X( I} and /{1) has pararnltcrs
m1 {1) - 0, C , (/ 1 - 12 )
Ill (I) 0. ( z (/ 1 ,/_)=C' r {/~-/ )COSftJ(/, /1 )
and
R, (ll - 11 )COS(I)/1 ]
( 1 ( 12 - / 1 ) ens (tJ(f , /1 )
Ch. 9. Random Processes 133
T h us the mean and autocorr~>lation of X.t t) c\lf! determined by time averages of s( t).
Tf .~ ( t) is <\.'! belo\\
\( II
+I. .\(l)c// = 0.
t J'.\(I)~( I
I
- r )d r ;;;; [
I
( I )( - I )dt + 1,1. (I )( I )dl t
r
f/:., (
;!z
I )( - I )dH ('
J/:+r
( 1)( - l)d/
= r +(f- r} - r +(f-r )
= T - 4r
1
134 Student Solutions Manual
@Recall the application ofthe clmal7 lnequalil) (Fq. 9.67) during the di scussion
of the mean squ~trc periodic process. We had:
'Jhu!>
II< \(I 1- r +d)- X(t + r)X(t))f =0
~ (1~1 \'(f t r + c/)X(f)]- E[X(I + r)X(I )I) ~ - 0
~ Fl X (I 1- r 1 c/)X(I)l = E[X(I + r)X(I)l
:...::> RI (1, I c/,12) R.\ (1, ,12)
0 s
a) Pl ..\'(1) dbcontinuous at lul = P[s - to I= 0
h)
X(l)-X (t )=0
t0 t S
X (z)- X (to) = 1
S t0 t
Ch. 9. Random Processes 135
=e-'"l' l e <runlr.r':'- IJ
~ 0 as c, anu t:, ~ 0.
~ .\ (I) i'\ m.s. continuous
c) \\ c C'\fX!Ct that the mean sq uare dcn\-alhc i., tcro (if it e'\ists). We thus
con"tiucr the limit:
;., I
=e - ~ 'Y:>,
1:
1 I lJ I
=e (-J./1 -1) +e : (- A/ 2 - 1)
A.."! .;t 2
0 0
e .t'(-J.I- 1) - (- 1)
=e-.t. (-JtA2- 1) - ( - 1)
t--~--~~---
J~
I ct
) (I) - f. .\'(A)c/..1.
1hen f'mm l q. (9.9 I ):
@ II (r)- A I - j:-1).
Hx(r)
1
= -
'2T
('lT ( 1 - !')"1r ) H yltt)dn
1
1 'U
< '2~' [.'/ R\(lt)du
= 21
l 27 .4( 1 - lu ),fu
-n
=
1
?.T \ 2
/.4.) for 7 >1
0 ;1..<; , . _
~ .\(t) 1 m..:an-~rgodic.
~
~ VARI < X >]=-2TI+-I: 2T ( lkl- ) c (k) < I ,,
1- - I: (').
- AI <- 2
-
11 I J A- -21 2T + I \ 27' + l it ., 2 27' + I
-t 0 as T -t oo
=> X, is mean crgod ic
~ln order for< X(t) X (t+r) >1 to be a vall estimlltl" for R (r), Y(t) = .\(t} \.(t+.,)
iuust I e mea-n-ergodic.
Nole t haL
1
f.{< X(t) X (t ..1.. .,.) >~1- 'l.T IT &[
-T :\"(t)X(t + T)}dt = Rx( ~)
docs not dtpend ou l. T hus X{t}X(H r) is mean ergodic iff Cx(r)X(HT)(t., lz) is l:;uch that.
138 Student Solutions Manual
l - ll(u - X )
,
~ L/ -=- I u(a- X ,)
I I .'
'----v-----'
\:1\llllling rrti(\.'S'> felr
C\1!01 ,,\,~)
II
@ cl -~ar all;
close all;
T = 1:5:100;
\P.9.l06
H2 2 *0.5;Cxl = O.S*((T+l) .H2-2 * T.~H2+(T-l).~H2);
H2 2 *0.6;Cx2 = O.S*((T+l)."H2-2 T.AH2-t(T-l)."H2);
H2 ~ 2 *0.7S;Cx3 O.S * ((T+l). AH2-2 *T."H2+(T-li.AH2l:
H2 =
2 * 0.99;Cx4 = O.S* ((T+l) . "H2-2 *T."II2-t(T-ll."'f12\;
plot(T, Cxl , ' - ' , T, Cx2, '- * ', T,Cx3, - " , T,Cx4, '-x'l;
legend('HO.S', 'H=0.6', 'H=0.75', 'fl=0.99');
\if you have problem with legend in octc~ve usc follow~ng:
\- plot(T, Cxl, ' -;H=O.S;', T, Cx2, ' - * ;H0.6; ' , T,Cx3, '-+;
\H0.75;', T,Cx4, '-x;H=0 . 99;');
tl n "
II fll, o
(1 11 Jl h -
11 , !i'i' '
Q8
07
0~ \
0--' \
'
02
---- ---.......
30 JJ TO 1110
Ch. 9. Random Processes 139
T ltis is Gq 9 118.
If X( I) i!'l rn.c; . po>riodic then Ux ( li) is periodic nnd the inner integral is 111. thus
@a)
\P9 .11 8
\part a
clear all;
close all;
140 Student Solutions Manual
sazeros(200,10,3);
ls dimensions are: (n, realization , p)
p[0.25 0.5 0.75];
for sample c 1:1:10
fot i 1:1:3
i f (rand < p(il)
end
s(1,sample,i) 1 .
for n c: 2:1:200
s(n,sample,i) = s(n-l,aamplc,i);
.1 (rand< p(i))
s(n,sample,i) = s(n-l,snmple,i)+l;
end
end
end
Ugu re (sample) ;
, 1: 2 0 0, s ( : , fHI.mpl e, 2) , ' - * '
p loL ( 1 : 2 00, s ( : , sample, 1 ) , ,
1 1
--
1:200, s(:,sample,3) , -o 1 ) ; 1
end
--...., ..,.
b) \P9.ll8
\patt b
clear all;
close all;
a(1:200,1:50) = 0;
p 0.5;
for san.ple 1:1:50
if (rand < p)
s(l,sample) 1;
end
fot n 2:1:200
s(n,sample) = s(n-l,sample);
1f (rand < p)
s(n,sample) = s(n-l,sample) t1;
end
end
Ch. 9. Random Processes 141
m mean(s');
v var(s');
plot(l:200, m(l:200), ' 1:200 1 v(l:200), '-o');
1 egend ( 'mean' . 'var .t.ance ' ) ;
xlabel ( 'n')
ylabel('mean variance')1
title('Problem 9.118b');
c) and d)
\P9 . 118
\parts c & d
clear all;
close all;
s(1:200,1:50) 0;
inc ( 1 : 4 1 : 50)
I 0;
p a 0.5;
fot sample = 1:1:50
i f (rand < p)
s(1 sample)
1 1;
end
for n = 2:1:200
\{
\for the distortion case at th~ end of part d uncomment
\ this part
\if (0<50)
\ p 0.9;
\else
\ p 0.5;
\end
\)
s(n sample) = s(n-1,sample);
1
i f (rand < p)
s(n,sample) = s(n-l Sample)+l;
1
end
end
inc(l,sample) s(50 sample)-s(l,sample);
1
inc(2,sample) s(lOO,sample)-s(Sl,sample);
inc(3,sample) s (150, sample) -s () 01, oample);
inc(4,sample) s(200,sample) -s(l51,sample);
end
figute(l);
subploL(2,2,l);
histCinc(l, :),5);
xlabelC'increments [1-50] ');
ylabel('number of samples');
suhp1ot(2,2,2);
hist(inc(2, :) ,5);
xlabel('increments [51-100) ');
ylabel('number of samples');
subplot(2,2,3);
hist (inc (3,:) 5); I
flgure (2);
plot (inc ( 1, : l , Inc ( 2, : l , * l ;
xlabel('inc in [1,50] ');
ylabel ( '1nc In [51, 1001 ');
axis ( [ 1 50 1 50)) ;
title('Problem 9.118d');
\for test we can distort inc in one range and see if it affects
tincrements in the other range, for example we can modify the
'l.p<nametet p for range (1,50) and chang( i t bi1ck to the o.tiginal
\value fot the range (51,100)
"'...... '!lljd
~
..
:ILl
RX
., l.J
;; r.
~ ' i i ...l. :
ll
Ci
II
II " l'l
IU !ilj
~tl}
clear Clll;
closP a 11;
y zpros(S,200,3,2);
%dimensions in y ate: (realization, n, alpha, p)
alpha [0.25 0.5 0.9];
step = 0;
p = [0.5 0.25);
for sample 1:1:5
fori 1:1:3
fot j 1:1:2
rn rand;
step= -l (rn <= p(j))+l* (rn > p(j)l;
y(sample,1,i,j) =seep;
for n = 2:1:200
rn rand;
step= -1 *(rn < = p(j))+1* (rn > p(j));
y(sample,n,i,J) = alpha(il*y(sample,n -1, 1,jl+step;
end
end
Ch. 9. Random Processes 143
figure(sample*4+il;
plot(l:200,y(sample,1:200,i,l), --',1:200,y(sample,l:200,i,2));
legend ( 'p = 0. 5', 'p = 0. 25') ;
xlabel ( 'n')
ylabel('Yn, random process')
str sprintf('Problem 9.123a, alpha \l.lf',alpha(i));
title Cstr);
end
end
xlabel ( 'n l 1
ylabel( variance of Yn
1 1
)
title (str);
end
\histogtam
for sample = 1:1:5
fori 1:1:3
figure(300+sample *4+i);
for j .. 1:1 : 2
subplot(2,l,j);
hist (y (sample, : , i, j));
xlabel('Yn , output ' )
ylabel ('Histogram cow1t')
st.:r = sprintf( ' Problem 9.123a, histog1am for alpha U.lf,
p = \l.lf,sample#%d' ,alpha(]) ,p(j),sample);
title(str);
end l:l
I'"(\~
o-.. 2$
end w
. ~Atlil{/lV,w/1 (\ftt1
end
1
k~ fV~
2
~
I
,
' U, V' /\ r
v~\l \. ~~ fVI'
o
~
~~~VV\ \\
-2
I
...
~
0 2? ..., 60 ro 100 lXI
ft "" 160
'"' ;om
144 Stucl ent Solutions Manual
h) clear all;
close a 11;
y zeros(50,200,2);
\dimensions are: (realization, n, p)
alpha .. 0.5;
step 0;
p ( 0.5 0.25);
for somple 1:1:50
for j .. 1:1:2
1n = rand;
step = -1 * (rn < = p ( j)) tl * (rn > plj) l;
y(sample, l ,j) step;
for n "' 2:1:200
1:n = rand;
step .. -1 * ( r n < = p ( j ) ) + 1 ~ ( t. n > tJ ( i ) ) ;
y(sample , n,j) = a l p ha"' y(sample, n - l,j) t sLcp;
end
end
m mean(y);
v vat (y);
\ploLting mean and variance:
figute (100);
oubplot(2,1,l);
plot(l:l:200, m(l,l:200,1), -- 1 :1:200, m(l,l:200,2));
1 egend ( p = 0 . 5 , p = o . 2 5 ) ;
xlabel ( 'n')
yl<'lbel ( mean of Yn')
stt~sprintf('Problem 9.123b, alpha \f',alpha):
tille(str);
subplot!2,1,2l;
plot(l:l:200, v(l,l:200,1), --~ 1:1:200, v(l,l:200,2));
1 egen d ( 1 p .. 0 . 5 I I I p : 0 . 2 5 I ) j
xlabP 1 ( u 1 )
ylabel('variance of Yn ' )
title (st;l):
flgu.Le ;
%hio Log1am
f i glll e ( 2 0 0) ;
for j 1:l :2
aubplot(2,3, (j-1) *3+1) ;
hj Sl (y (; 1 51 j) ) i
xlabel('outcome')
str sprintf('p = %f',p(j));
ylabel(str)
str sprintf('P.9.123b, n = 5');
ti tlP (str);
subplot(2,3, (j-1) *3+2);
hist(y(:,50,j));
Stl" m Sptintf('P.9.123b, 11 50');
title (str);
subplot(2,3, (J-1) *3+3);
hist(y(:,200,j));
str sprintf('P.9.123b, n 200');
title (str);
end
Ch. 9. Random Processes 145
I 4
1l
..
c:
'8
oe
06
f
-&r.
0 o &) eo no ~ leG
20
"''
n
U:l 200
i /fl\~~~"~\'~~~~~~~ 1 ~~~ ~.
~ I'>
t; t J
17
'lf/')~~Vfdr
Dll
I
I "
f rlf
iI
' ' J
l4
OIJ
04
0 ]() In r.o till 100 tJ(J ItO I(,(I to :>00
c)
cl~ar all;
close all;
y zeros(50,200,2);
\y dimensions: (realization, n, p)
incl(l:4,1:50) 0;
inc2(1:4,1:50) = 0;
alpha 0.5;
step = 0;
p - (0.5 0.25];
for sample = 1:1:50
for j = 1:1:2
rn == rand;
step== -l * (rn < p(j))+l*(rn > p(j));
y(sample,l,j)==sLep;
for n = 2:1:200
rn = rand;
step= -l * (rn <= p(j))+l*(m > p(j));
y(sample,n,j) = alpha*y(sample,n-l,j)+step;
end
end
inc1(1,sample) y(sample,50,1)-y(sample,l,l);
incl(2,sample) y(sample,100,1)-y(sample,5l,l);
inc1(3,sample) y(sample,l50,1)-y(samp1e,101,1);
incl (4,sample) y(sample,200,1)-y(sam~le,151,1);
~nc2(1,sample) y(sample,50,2)-y(sample,l,2);
l.nc2(2,sample) y(sample,l00,2)-y(sample,51,2);
inc2(3,sample) y(sample,l50,2)-y(sample,101,2);
inc2(4,sample) y(sample,200,2)-y(samplP,l51,2);
end
subplot(2,2,2);
146 Student Solutions Manual
Cigure (2);
( j nc2 ' , 5) ;
\ h ls t;
sulJploL(2,2,1);
hist (inc2 (1,:), 5);
title('P~oblem 9.123c, p = 0.25');
xlabel('increments [1-50] ');
ylabel('number of samples');
subplot(2,2,2l;
hi st.(inc 2(2, :l ,5 ) ;
title('Problem 9.123c, p = 0.25');
xlabel('increments [51-100] ');
ylabel ( 'numher of samples') ;
GUbplot(2,2,3 ) ;
hJ.Gt (inc2 (3,:) ,5);
tltle( 1 Problem 9.123c, p = 0.25');
xlabel ('increments [101-150] 'l;
ylabel ('number of samples') ;
subplot(2,2,4);
hi s l (inc2 (4,: l ,5);
xlabel ( 'inc1.ements (151-200) 1 ) ;
ylabel('number of samples');
tit l e( 1 Problem 9.123c, p = 0.25');
1 Pp l ot.:
14 .---.---.--.-~""T-"-....---,
lr>e I
''
f :
'I;
.!
~
"
.'
6
O~M-~---~~~~
2 I 0 I ,) 3 ) 0 1
11C~ I1501 ~ f' II QJI
~ 912.k. p>025
Ch. 9. Random Processes 147
~ clear
lambda*lOO=n*p,
all;
if lambda=l then n*p should be 100
close all;
\as n gro.,.:s N would be a better app~;oximation of a Poisson
\process. Probably n=lO*lOO would be a good pick
\you can draw N for n large than lO *t and you can see that the
\~;esult would not change significantly
n 1000;
p 100/n;
N(l:n) = 0;
N (1) 0;
fol. i - 2:l:n
i f (.Land < p)
N( i) N(i - 1)+1;
elae
N(i) N(i-1);
end
end
plot(N);
.I, 1 111 11J 1(x, .1') =/r 11)x)/1 11 1_.r11).1'- x) b) indep. increment propetty
1
AI AI I
=--x' e .lr ( 1'-x)': I 'e ,.,, rt
r(t,) f(l, -I,) .
AI!
= XI'()'-X)' 11- I(.'.AI
r(/1 )f(/! - r1 )
/I \'(1,)1- a =i
A A
E[.\' 2
(1 1 >I - VAR[.X(t1 >l + E[X(I1 )] 2
2
I, /.
--t-
..t' ;.'
d)
/
1
5, / 2 ~ X(l) is N<H M.S. dilkrent iablc
1 his sug.l!csls that \"(1) ha'> thic; autocorrelation function if \\C J,.!cnerali zc the nution of
dcrh .llh c nl a mndom process.
Ch. 9. Random Processes 149
Gx(t3, t 1 } = E(X3Xt)-m3m1
= E[E(X3XdX2]] - m3m1
= E[E[XjiX'2jE(.XdX2 ' - m3m1
= F[{m3+P-z,3::(Xl-?lta)}{mt r!'t.2::(.X2-m2)}]-m3m'
== E [Pa,3 o-
3
O'l
{ ..\2- m1)p ,:~ CTz
OJ.l..\'2 - rnl)J
P2,30'aO"zP1 ,2a1 ua
=
f72U2
C, (ta. tJ)Cx(fz, I d
=
Cxft2.t-1)
b) Wieut-r Proce-:~
@ We nhtain the pm,cr ~ rectral densit) h} calcul.lling the I nuricr tran ~ro nn or the
nutocorrclulion function or b) using Fourier t ran~rorm lahks (Appcndi\ B). We obtain
the autocorrclatinn by cnlculating the inverse Fourier tmn<;I(Hm .
a) Sx(J)- :F [g
Table 111 1\ppr.ndix U.
b) S'x(/) = !1 ( 1{ , )
. W'
m - ~
llx(r) = .4W ( 1 ~,Z )
150
Ch. 10. Analysis and Processing of Random Signals 151
@ We find the po"'er spectral density b) eva luating the fo lio" ing summation:
~ I
La~ 1!-Jllllt. = 1+L ate 12~:tt + L { .~ f I! Jlzft
l I J
ae-11xr ae 2111
= I+ , + 'r
1-ae- = 1 1-af! .z
1-a'
= ----=------
2
1+a -2acos2ff/
S 1 C/) = ,\T [ 4(a) + 16(fJ) 1
' J
=4 1- (a)l
2
I + (a) -2(a)cos2ff/
+ 16 l - (j]) 2
2
I + (fJ) - 2(/J) cos 2ff/
d = ?.
--i
);~" I I/
-~ 0 Y2
h) Fl D,: J= R, (0) = 2R_, (0)- 2R 1 (d)
152 Student Solutions Manual
~
~ \P.J0.21
cleat all;
close all;
samples z: 50:
lenl28;
xrandn(len,samplPs);
xffft Cx);
pfcsqrt(xf'.*conj(xf'))/len;
sfmean(pf);
sflmean (p( (1: 10, :) ) ;
sf2=mean (pf (1:20,:));
sf3mean (pf (1: 30, : l);
sftmean (pf (1 :40,:));
onbplot(2,3,1);
p l ot (1: l en, sf);
ax i A ( ll 1 en 0 . 0 6 0 . 11 J ) ;
lille('All (50) realizations ' );
subplol:(2,3,2);
plot: (l: len, s(l);
axia([l len 0.06 0.11));
t:itl~( ' IO realizations');
subplot(2,3,3);
plot (1: len, sf2);
axis((l len 0.06 0.11]);
title('20 realizations');
subplot(2,3,4);
plot(l:len,sf3);
axis( (1 len 0.06 0.11]);
title('30 realizations');
subplot(2,3,5);
plot (1: len, sf4);
axis([l leu 0.06 0.11]);
title('40 realizations');
1o reat!lall(ll)!
0 I 1 r--1r--t~--r-....-,-,
t!llP t Qnc 1
01
~I JO 00 Oil 100120
line 1
UI 0 I
009
(103
007
@ n) S yy(f) ~ fl (f)Sx(f) = 1
:%:/
fly Y = :F 1 [SYJY (f) ) = Te-
So 1. r >0
N0 /2
b) sl'(f) = IH(!WSx(f) = 1 + 41r, r
f/l'(;)- ,r- t[Sy(J)] = !~O e-lrl
No
c) Rl'(O) = -
4
//(/) is a IO\\-pass filter and part b) shm\ c; that the trandcr function attenuates higher
frequcnc icc;.
N(t)
Hz(7) = t:[Z(t
X(t)
i ll(t)
Comment"': Ir we view }'(I) as our estimate lo r X(l). then Sl(/) is the pO\\ er spectral
dcn"iity orthc error s ignal Z(l} = 1'(1) - X(l). Equal ion (*) sugg~.:st'\ the li.lllowing:
154 Student Solutions Manual
@0 40
. a) II (/) L(2
u
-I )" e t"!.x"' I
- - -----=--
- l- 1 e-t1:rt
:Vo/ 2
t- l.e
I
'1"'
I \ '
' II
... /ly(OJ =
"
.La,R,(i) + Rw(OJ
=I
= L<t;R) (k- i)
i= l
~ r
=> R1(k) -
{
-
=
Rd-k)
-----
( R., (O) )
1 -rl
.. '1
=u~rlkf
I
k>O
k <O
156 Student Solutions Manual
~a)
~
//(/ ) = j2Jr I
T
. ltl<-t-
.
l t4rm (2m1)
and h(ll) = 0. 11 0.
@ Y t) = .4(t)cos(21r/cl ~ f>)--.N(l)
.\ ft)
Assuming Xtt) nnd JY(t) are independent random processes:
S)i (!) = ~fB..tU +/c)+ Ss(J + /,) + r.;A(f - fc) + ::,:.{! + !c)J
Sx(J)
_j_ __.. f
-Jc 0 J~
158 Student Solutions Manual
[
1 +r
,. 1-
r
r ) [ lzo
11 ,
~J = [ ,.1 J
u2
where r = f1~.
~
l I
f. j(Zt - 1~?1 = Rz(O)- L h!JRzx (B) = U7.(0) - L h 1w~rlfil
;3:0 (J (
1- r-r 2
l'r ]
= T1 [ l - (11 r p- r7 - (I 1 rp- r 2 ,.
=
[
rr.,.2 1 -
(1 + 1')(1 - r.!)J :!'I
;;:
.. (l + f )l- r2 (>.1
h) p 2:
l ,] [*]
[tI *Jfh I t h2
") h, =t h, =0
(I -1 e-J2trt )( 1- !eJl.Tt)
Nc~ t consider:
tiller p<trtiul
] rraclttln c'pansi(ln
ami linally
II . -IV . If - I - 2I t, -J 2.Tt ( fT )(
4 V' I J
(./)- (/) 2(()- 1-L,e ,v,, 1-f L, 1-fe ,~tel
160 Student Solutions Manual
{I 'i',l
=1 / e
1
121:'
-(/ t),_z:
lr. - ( / ----:}:, I ;, 0
@ l, (1.,1/111 1 11', 1
X, - / ~ N,
Gl, ,L I +II', I+,\ ,
=a, 1( \ , 1 - fir 1) + IT:, 1 + Y,
= (f, I \', I a Nil I + rr :. + N,
I
!1)
x fft(uniform_rn(0,1,50,128)); \ 'lO pcritdugrams
plot(mean( ({x. *conj(x)))/128 ) ) ); \ \' ~:r.11.!.~d IX' I iodngram"
Ch. 10. Analysis and Processing of Random Signals 161
n 19 ..,., _
r---.----.-----.----r--.---.----,
0!1
0~ ~-~-~-~-~--~-~-~
0 lO 40 6IJ ell liM I I .'0 110
l
A,,
= L
A I I L
[_. - I
R (m) e 'I
,,, k-I m~
l.t-\li(JR , ,.,,
A I
= L R, (m)e '2"""
11 !A II
l'hc estimate i-, hiascd because the limits o f the <;ummation ore finite.
P1CIIZII
p 10.87
close al l ;
clear all;
n 0:0.0 1 : 1 0.23;
r exp(-2 .* n);
%r (-0.5). "' n;
K a toeplitz(r);
(U,O,V) svd(K);
X norma l rndl0,1,1,1024 l;
y. v cu"'o~SI * X ' ;
plot{y);
z autocov(y,200) ;
plot {1 : 2 00, r ( 1 : 200) , 1:200 , z ( 1: 200) ) ;
tltle( ' Prob lem 1 0.87 ' ) ;
Probiern 10 R7
ue
06
0~
.01
0 6 rn ,. 2" ~ Ill M <10 w
Chapter 11: Markov Chains
11 .1 Markov Processes
@ t~) The number X, of black balls in the urn tomplclcly spec:ifi~s rhe probabilit) Jf
>111<' H 11~ of a tri<ll; t.here{ore X,. is indcpcndet1l of its past. \'alue and Xn is a Markov
pro< 1":-~~. f)
PIXn = 4IXn-1 = 5] =
10
= 1 - PIXn = 5IXn-l = 5]
4
P[Xn = 3lXr.-t = -!J =
9
= 1 - P[Xn = li.Xn -1 = 1]
a
P[Xn = 2IXn-t = 3] = 8 = J - f'[Xn = 3IXn-t = 3}
:?
P[X,. = l jX,_1 = 2) = -7 = 1- PIXn = 1jXn-l = 2}
1
P[X,. =0 Xn - 1 = 1] = 6- = 1- Prx.. = IIXn-1 =I]
PIX,. = O)Xn-1 = 0} = 1
PI X = k - 11X = k ] = , _ _k_
II " K +k
1'1\ 11
= k I X = k ] = -k-
II K+k
I'
12
K e I e () 0 0
1:~
K I
- ."--. .
K
(
ol I
0 0
., ~~-1 K+l i\ + I
K K 2
0
I
i\ .. , i\ +2 \::)
~-
()
---
.~.
/,;-.1
A
~ -;
2
.L
1
I
163
164 Student Solutions Manual
= (r., .r t)
P[~+t = (xn+t.Z,.llb = (:rn,:rn-l),Z... 1 = (.r:n Jt.Tn 2) ... ]
all past vector
= P[Zn+l = {:r:.+t 1 7n) X .. = .r
\: -11
all p.1st Bet noulli I rials
11'..XL trial
= P(\n+l ~ .r .....t)
= P[~+l = (:rnHr.n) b = (rn,:rn_t)J
:. Z.,. ill ,, 1\ larkov proct>.Ss.
@ 1 0 0 0
I ! 0 0
0 0
0 0
~
(I
5
0 0 0 0
a) r = ~ !
0 0 8 0 0
0 0 0 9~ :;
0
0 () 0 0 t
..&.
JO
.!.
10
Ch. 11 . Markov Chains 165
0 0 0 0 0
11 25
0 0 0 0
itt 25
0 0 0
b) p:.a = :Zl
0
lj4 [is 25
0 0
2~ 4f!l 64
9S 15
0 0 6 19'2 8t 0
2 1!1 !
0 0 0 9 ~ 4
19
]1.;4{:?) - from P 2
36
1- cltilnge(l) no r.hnoge(l)
P.s~(2) = Ps5no change(l)11s4change(!) Pt.t P4t
1 1 15 19
= 22 + 29 = 36 ..;
1 0 0 0 0 0
1 0 0 0 0 0
pn--+
I 0 0 0 0 0
1 0 0 0 0 0
1 0 0 0 0
()
1 0 0 0 0 0
@a)
0 0 0 0
,,
..L h
iii
'I
iii 0 0
1) -= 0 ..!.
lfo
.!.
Ill
i.
16 0
4 ll I
0 0 it. 16 16
0 0 0 0
h) and c)
fJ c
0 1.0000 0 0 0
0.0625 o. 3750 0. 5625 0 0
0 0.2500 0. 5000 0.7500 0
0 0 0.5625 0.3750 0.0625
I) 0 0 1.0000 0
p
' -
0.0625 0. 3750 0. 5625 0 0
O.Ol3o1 0. 3438 0.4922 0.1<106 0
0.0156 0. 2188 0. 5313 0.2186 0.0156
0 0.1406 0. 1922 0. 3<138 0. 0234
0 0 0.5625 o. 3750 O.Ou25
166 Student Solutions Manual
p
It ::
~
~ .'~uc{O.l} where 0 = workirag. 1 = not wnrking
a) p = [ 1-a
b
a ]
1- b
1-a l- b
E = [ '-t
~2 ] = [ 11 ~~
! ]
and
E-t _ _
1 [a b ]
" -a, b a -a
Ch. 11 Markov Chains 167
and I hu~
@ a)an<.lh)
i)
1 t:'U rnnt
i i}
{0} 1et'Ullt'JI.
11.21 recurrent
168 Student Solutions Manual
C)
,, =[~ ~] :~]
0 .L .4
.!
[A
(i) .L
2
A' =[l .L
.L
..
l
!] lm = .4 .4
.4 .4
"' =[~ ~]
0
(ii) I
1
A = .1 . 1'~- I ...,s =" ... ( I & I alternate)
() ()
Fo1 state I
c[1'l 1-
"
1
'J. -
3 -l - 5- => ""t
+ .. = -2r;
- 2
,____.. ..__.,
2 2
1--<U-1 l-J-o-1
lor sLate 2
,
p, = flo Po =5 = 1'1
1'! =1 p, I }2 -- 1~
ii) I hi-. i-. n multiclass MarJ...ov chain. Clac;s I consists of n c;ingle recurrent state.
Class 2 has 2 recurrent states and has period 2. ()uppusc \\C calculah: the stational) pmf:
l- a
Lei /)U a.. then p, = p2 = - - .
2
@a)
0 I 0 0 0
0 0 I 0 0
i) P = 0.5 0 0 0.5 0
0 0 0 0 I
() 0 0 0
d) '\s \\e take po\\ers ofn \\e obtain a periodic sequence of matrices:
q ~I'
q
p
r.l = --o
q
,
1 1 Jl
lf2=-(x-,-pxu)=- --p-ro=
q t7 q ( ) () p
q
'iro
tro = 1- (~)9A1+1
; 1-\~): . . w'
@ a) an= ./,(n) l h~ probability that the first n:tum occurs after 11 ~!cps.
h, = p (11 ) 1 he prubabilil)' that the return is inn sll.:ps.
1hcrcforc for 11 ~ I
,, 7_
h) ~1 ultip l} ing both sides of the abm.c c4u.llion h} ::!' and summing O\er n ''e
obtain
Bul i>,
"u
- lim B(z) = lim
1
1
= 1- A( z)
1
'I hcrcl'orc, stntc i is recurrent iff lim/J(z) =o:>and ifT lim A{:)- .1; = I .
:-)1 .,
Pt (t) ~
OTJ
+ (Pt (O)- - 0 - ) 1!-( +.O)t
ai{J
172 Student Solutions Manual
n) Now suppo ' c know the initial ~ale i!l 0, theu .ro(O) = 1 ~
Poo(i)
:. Ptl)
a)
l_]< II
= l - j)!'
p;0 (1) - P[t or more "'breakdm,us" in time t
-l (C\t)"
= 1- ~ - -e-'
<=n k'.
...._.
Ch. 11 . Markov Chains 173
0 0 0 0
1- e-ot e--<)' 0 0
1- t (at)k e-oc ate-oc e-"r 0
b) J> = A-=0 k!
c) 1J1t(O) = l
Jl ,,
Eqn.ll.42 applie" here. "0 we have.
P1 ~1 (.\) P, = (P')J+I P
= -;; 0
'I hi s is a birth-death process. so b} Example I I .44 it is rcvc rsibk. Ira process is time
re vc r~ ihl ~.: thcn
qoo - q = Poo
~ \P. l l.65
N 1 00;
b .. 0.5 ;
a 0.5;
iter 0;
X .. 0;
For i = 1: 1 000
p l = rand;
I f p l < a && X < N
x = x~ l ;
e nd
p 2 .. rand;
I [ p 2 < b && X > 0
X X -1 ;
e nd
res(i) X;
e nd
hist (res);
IRII r-
lhll 1- -
Jill .... ,...-- -
120 -
~
-
-
I()()
~
RO r--- -
60 - -
-
40 -
r--
:w -
(I
IJ 5 10 15 2(}
.,.
-~ J(l
176 Student Solutions Manual
t1Ui'
~ %P.ll.71
Nmax 50;
P = ZCtOD{Nmax+1,3);
mu = 1;
lambda .9;
delta . 1;
a delta lambda; \lambda/(lambda+mu);
b = delta mu; tmu/(lambda+mu);
P(l,:) [0,1 -a,a ];
r [ ( 1-a ) *'l.J, a *b~ ( 1-a) * ( 1-b), (1-b) *a];
f o r n 2:Nmax;
P(n, :) .. >r;
f'nd;
P ( Nma x 1 ) , : ) [ ( 1 -a) * b, 1.- ( 1.- a) * b, 0] ;
TC zeros(Nmax+l,l);
I C (1 ,1) 1;
!J 2000;
stseq zetos(l,L);
s [ 1 : Nmax 1 1] ;
step ( - 1 o, 1 J ;
Tnitst 1;
s seq(l) a Initst;
for n 2:L+l
stseq(n) = (stseq(n-l)+dscRnd(l,P(stseq(n-1), :),step);
end
.:!Cl
IX [
Ill
11
12
~~~~ \~
Q)
10
(/)
!!
/'
b
2
~~
II
II :\0(1 ((){)() 1500 :won 25110
~ll:p
Chapter 12: Introduction to Queueing Theory
12.1 & 12.2 The Elements of a Queueing Network and Little's Formula
a) lo'CWS
Nil)
5
-l
J .
... I
< .v >t3
< .\ >13 = =
13
1 Au .,.
.< T >n = -I:Ii = ~
An ,= 1 ,;
25 ~ "5 1
< N >u - = < ' > ta< 'I ' >13 = a ,c.,
"
13 13 5
177
178 Student Solutions Manual
h) LCF'~
.
~I T, D, W,=T.-T: r, = o, -s.
1 1 3.5 4.5 0 3.5
2 3 4 10.5 3.5 7.5
3 4 2 0.5 Oo -
-) -0
4 j I 13.0 5.0 G.O
5 8 1.5 12.0 2.5 4.0
~. . ~ ~
2 -
I .
I
I
J 5 7 t) II I .\ 1.5
2.1.5 5 1')15
< :~, >u = < .\ >t3 = <T't3 =
13 1'3 5
< N >t3 < ,\ >tJ<T>u
Nft)
~ .
1
-' .
~
I
3 5 7 () II 1.~ l!i
23 r, 2.1
< J'l >13 = 13 < ,\ >Jll = 13 < T >t3 = 5
< N >13 - <.X >ta< T >t3
Ch. 12. Introduction to Queueing Theory 179
total #
=X= \[f] by Lillie's formula
in system
b) .\m = 2
,, 5 ~
c ) 1 = :\ = o
(m)
2 = 52m
@ A) P[N~rl]=(l p) 2:
rn
<:<:
,r = o- p)--
l-('
= ""
(lfl
-A A 0 0 0 ()
)I (pt A) 2 0 () ()
() 0 0 Jl - (p +A ) A
() 0 0 0 Jl -p
- 0.5 0.5 0 0 0 0
I - 1.5 0.5 0 0 0
0 I - 1.5 0.5 0 0
=
0 0 I - 1.5 0.5 ()
0 0 0 I - 1.5 0.5
0 0 0 0 I - I
e ',:!1
0 0 0 0 0
e-:UII
0 0 0 0 ()
0 0 e-so1 0 0 0
k l J=
0 0 0 I 0 ()
liN t
0 0 0 0 I! ()
0 0 0 0 0 I!
1211 1 271
.J040e ' 711 -.0967e -. I I I I e \' + .2 340 .0462e 0 ;v, + .0340e -4
.J040e PZI +.0-Je-2211 -.0555e "' 1. 1270 . lll 5e o-'-.OJOe 0171
I'( I) -
-. 0246e 272
' +.02e-22 1' +.0555c 1 ~' 1.0635 .0557e 11
"'' t-.0587e ~' 27 '
.0 132e 2 721
- .0342e- 211 ' + .0278e 1 ~, + .03 17 1- .0 16Je 07
"' - .0549e-02 ''
272
- .0382e ' +.0142e-22 1' - .0278e 1
\t 1 .O l59-.0394e n?')' - .0379e-027'
l'or other initial conditions we can obtain XU) in the same way:
\ J?toblem 12. 17
% (1)
lambda 0.5;
mu 1;
v = -(lambdamu);
a "" lambda;
b "" mu;
L = (-a a 0 0 0 0
bv a o o o
ob v a o o
oob v a 0
oo0 b v a
0 0 0 0 b -b) ;
[ E D) eig(L) ;
t sym ( ' l ' ) ;
NO "" l;
pO = zeros( l ,6);
pO( NO) = 1;
p pO *E*expm(t *D)*inv(E);
f = inlinei'E*expm(t *D)*inv(E) ' );
f f = pO *f(D,E,t);
\Example: pO *f(D,E,2) will compute the amount of p!2)
\Plot symbolic function
ezplot (mcan(ff));
NO a 3;
pO zet OS ( 1, 6) ;
pO (NO) a 1;
p = pO~E*expm(t * D) * inv(E);
f = inline( ' E*expm(t *D) *inv( E) ' ) ;
ff .. pO*f (0, E, t) ;
%Plot: symboliC' fu nct: ion
ezploL (mean( [ f)) :
NO .. 6;
pO Zel'OS(l,6);
pO(NO) = 1;
p = pO*F.*exp(t*Dl *inv(E);
f = inline ( ' E*expm(t *D) *inv(E) ' );
ff .. pO *f(D,E,t):
\Plot symbolic function
ezplot(mean( f f));
L
-0.5000 0.5000 0 0 0 0
1.0000 -1.5000 0.5000 0 0 0
0 1.0000 -1.5000 0.5000 0 0
0 0 1.0000 -1.5000 0.5000 0
0 0 0 1.0000 -1.5000 0.5000
0 0 0 0 1.0000 -1.0000
>> E
E
0.0438 0.0733 -0.0976 -0.1091 -0.4082 -0.0957
-0.1950 -0.2504 0.1952 0.0639 -0.4082 -0.0430
0.3900 0.2074 0.1952 0.3084 -0.4082 0.0860
-0.5652 0.2074 -0.3904 0.3084 0.4082 0.2967
0.6046 -0.7082 -0.3904 - 0.1807 -0.4082 0.5547
0.3506 0.5867 0.7807 -0.8724 -0.4082 0.7654
D
-2.7247 0 0 0 0 0
0 -2.2071 0 0 0 0
0 0 -1.5000 0 0 0
0 0 0 -0.7929 0 0
0 0 0 0 -0.0000 0
0 0 0 0 0 -0.2753
ans
0.3490 -0.7764 0.7764 -0.5627 0.3009 - 0.0872
0.7722 -1.3183 0.5460 0.2730 -0.4661 0.1931
-1.1386 1.1386 0.5693 -0.5693 -0.2846 0.2846
-1.4456 0.4234 1. 0222 0. 5111 -0.1497 -0.3614
- 1.2442 -0.6221 -0.3110 -0.1555 -0.0778 -0.0389
- 1.5822 -0.3556 0.3556 0.6133 0.5733 0.3955
II 1(,/, I
(I ~~~ .7
( I (h67
-:::
~
t: 0 16!:17
0 1667
0 ' '"7
.1.
~ 2 0
I
2
t.
l
..
<
Ttn!<.'
184 Student Solutions Manual
NO = 3;
..
pO zeros (1,
pO(NO) 1;
- 'r
6);
0 ltll'7
(/ 1(1(,7
lllflh7
-,-..
ey tl lhll7
II l(oh7
II lfh7
0 l (t<t7
~------~------h-----~-------L---- I
(t 2 (J 2 4
lun.:
NO "" 6;
pO zetos(1,6 );
pO(NO) 1;
0 lft(7
n 16fi7
II lh17
::
;; lj 1{1117
r:a
111667
0.11>()7
ftl(ll'\7
L l.
c. 4 1 II (
Ttmc
Ch. 12. Introduction to Queueing Theory 185
Part (ii)
l.ambda .. 1;
NO 1;
pO = zeros(l,6);
pO(NO) c 1;
---r------.------.------~----~------,
f- ,. 1
..
~
(1 lllft7
[ij IJ lhlt7
() IM7
l) 1{17
Olf11>7
--.1.
- :! 0 l
lime
"'
Lambda
NO "" 1 ;
- 1i
pO
"' zeros(l,6);
pO (NO) 3;
lllhh7 I
() l f!M
j - , I.MIIt J
0 IM\l
II I I.Ct I
2
.-::
tr
0 1(,(,,
(I 1(1(>7
II 1(,(,7
1 IJ .! (I
rime
186 Student Solutions Manual
Lambda .. 1;
NO .. l;
pO = zetos(l,6l;
pO(NO) = 6;
'i J
lllhb7
ll 11><7
~
~
II It( l
0 lllh7
II 11..(>7
II H67
b 4 .! 0 ::! h
lime
@ -.=12
;; = ()0
5
r.=2
.\ a 1
::>(1=
p
= l P =-=-
~ 2
ll)
1
I I }- I
~ +21 -~
1
=3
@A 10
I
- =-
)1
1
2
-1
-=5=a
)1
8(0.5) = I
fl(I.S) = 5xl =5
I +5xl 6
8( 2.S) = S(i) = 25
2+5(i ) 37
S( 25 ) I 15
11(3.5) = Yi =-'--
3+500 236
kt j = J(- k
= I - 8 I K, !.!.)
\ (I
Erlang 11
1 1 11
/{ = 15 - = 2 - = lO - 15
fJ () 0
P = I-n(J\.~)=11-0J =0~2
I
,\ = liP = 20.H2 = 0. 11
I\. 1 1j
f!TJ - -\ - D
= -
0. 11
- :in ti.ti
188 Student Solutions Manual
1. "'T" l 3''
h) g = L,-!!-
.L
=~
2
= 16
p.
~
C' Tf ~ -A" - -1 = 20(2) 30 = JO
J1 Q
.\ :::: p=2
1 A-1
f/TJ - -
11 l-c
L (k + l)P{i\ 0 = AJ
l h -1 (o(p)~
~ ('
- L.. ,. ... J)K~t;-1-l)! U!t j = K - l - k I 1' - ]( - I - k'
II 1.-=0 ~ (o/IJ)It'
L- (h -l-Ie')!
lc'=O
1 K -1 fdcl:
- j; {;,(I<- j)--K=--1---'(~!.:.-.'!/_a....,.)'',...---
-~
~
J'!
probs of M/M/K-1 / K-1
[T]
(T)
Im 1/D/l (~ 0 S<)
whc:e S(X) i the total number of t!mes the machme breaks do\ n lo find C(r) w.. use
couditional expeclntiou
C(rJ = t:[t.."[riXlJ
finally
E[r~) - E[X 2 + 2aX:2E[R), aXE(H 2] + o2 X 2 C[R )
2
@ P = J1~ = (!!.)
2
I 11 =.!_
2
A B A = =.!J.iJ.
---=-- ~ zt-., partial fraction expansion
l - .l.z
8J
-r 1- .l.z
:2
B = ..!li.1.
ZJ-)
:. P[N = j)
P[ v = J I
-::
l [
1+
(-Lli+~)
l7t'1 ). + ( 2 1717 ) ,\ 1
2 s+ c-0) ,\ , + (7 , 17) ,\
Ch. 12. Introduction to Queueing Theory 193
i'(s) =
=
b) If df'partmt: leave!> the system l'rnpty, then the lime unLit the next departure
is equal to t he sum of an exponential interarrhal time (of mean 1/>.) followed by an
exponential ser\'ice time (of mea.n 1/JJ).
_JL_
when a departure leaves system nonempty
s+ Jt
).. J.'
when a departure leaves system empty
).. /J
..!,., +s+>.s+p U,
prob. svslcm prob. tiysteru
left nonempty left. emptv
\ ..\(t'- .-\) ,\(s + ).) + ,\1'- )..2
= s + J.' + (.~ + >.)(., + 11) = (s + .\)(.'l +I')
= ~\
s-
::::? T,; exponential with mean 1/>.
194 Student Solutions Manual
1=3
1ro = pro+ 1rt + 1r2 } wo = ...L
Jra = Hl- p)n-o 2
-P ...!..::~'...
~r, - HI- p)?ro '~~' a - ,., = '2(2-p)
n) Then
3+'1 +2 L lt 'l _J
I P[1V _OJ)_ flo Poflt floP2 r PoP'l r PoP1 PofltP2
PI' I - 0
- - P/1 (pa + p~ + p~)(p., + (11 t- P2) + P1P2Pa
Ch. 12. Introduction to Queueing Theory 195
plot (avg_seq);
s 8
r:r ~~n
(
~
c~
....
0
7
h
JA
r ,.
r-on
01
j
e
t1, I
t
.(
J I I i. I
:2rHI l()tl ()IKI l\IHI ICJOol I :!W 11!~1 I WO I KilO 'r~ ~~
St,l'
11 ~--r---r---~
- ,\(1)1 (j
,\ ''"'
1\tll t ~Ill
2
,l__ .__ _ _.___ _.__ _. - l --l---1
II :!till (,()(J IWO I)!Kt I ~00 fill )II I 1\11(1
Step
~
~ \ P.l2.73
' Pt epare Txansition Probability Matrix
ro ... 7;
El 1000;
cnt zeros(s+l,l);
P zeros(s,s);
for j l:s;
P(l,j) exp(-ro) *roAj/factorial(J);
P(2,j) = exp( - ro) *roAj/factorial(j);
end
Ch. 12. Introduction to Queueing Theory 197
fori .. 3:s
fot j = i-l:s;
P(i,j) = exp(-ro)toA(j-i+2)/factodal(j - i+2);
end
end
L c S;
stseq R zeros(l,L+l);
step = l:s;
Initst = ceil(lO *rand);
\Initst a 1;
stseq(l) Initst; =
for n 2:L~1
srseq(n) = dscRnd(1,P(stseq(n)+1, :) ,step);;
end
1 l engL h(stseq);
for i 1:1
idx = stseq(i);
cnt(idx+l) = cnt(idx+l)+l;
end
[Ol. i l:S+l
pmf(i) cnt(i)/s;
end
plot(stseq);
\if(sum(pdf) -= 1)
\ etror ('Probabilities do not sum up to 1' ) ;
\end
n length(pdf);
if(nargin == 2)
v [l:n];
end
sample zeros(l,np);
for j = l:n
ind = find((runi>cumprob(j)) & (runi<cumprou(j+l)));
sample(ind) = v(j);
end
198 Student Solutions Manual
0.5
0-15
()_.j
0.'\'i
ru
~
=
0. O::!'i
0.2
I),J'i
0.1 -
O!Ji
(I .J.___
0 2 4 (, 8 I() I~ J.t f(, 18 :!ll
<;tate
l II
i'
0.5
0
li 21~) .j.f){) 600 11100 1.!011
S1ep
% P.12 . 74
T = 1000;
lambda= 0.5;
arrtime = -log(rand)/lambda; %Poisson arrivals
i = 1;
while (min(arrtime(i, : ))<=T)
arrtime = [arrtime;arrtime(i, :) -log(rand)/lambda];
i = i+1;
end
n = length(arrtime); %arrival times t_1, ... ,t_n
Ch. 12. Introduction to Queueing Theory 199
w = ones(l,n+l);
for j:a2:n-l
w(j+l) = max(O,w(j)+l-(arrtime(j+l) arrtime(j)));
TT(j) = w(j)+arrtime(j)-arrtime(j - 1);
end
plot(TT);
')
1- ,;-:y}]
IJ T- '1
l /I a~ ~
11
Ill
:II
K
UJ
3 6
~
J
fl
II 111 lfl() JIKI 4011 5tlll (,(l{l 71111 )i(ll
~lo:p
200 Student Solutions Manual
0.1)
08
..."8
I) 1
O.l
02
0.1
II L L
II ::! J 4
!),:1.1)
09
IJ.S
117
tl"
...~ 0'1
II I
03
112
0 I
C) L
Cl :! .I
llt:h)
Ch. 12. Introduction to Queueing Theory 201
@ ") Suj>po~e a cu~tomer arri\ed at Lime t 1 < 11 then the customer ha:. completed it.<:
, r time hv rime i with probability
Therefo1e customers that arrived ~n the iuten.,) (0, t) have probability or completing ser-
vice:
Thus
NoLc thn.i
1
>.tp = >.fo }\(t -fl)dt,
------;---------- ----------
()
b) As t _. oo
>.t(l- p) -t >. fo' {l F'x(t))dt =>.E[XJ
.. P[N2 (t) = j] = (>.G~~\'])i e-.\F(X) PoiHson RV!
J
c) LiUle's formula
E[NJ = >.E(XJ