Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Standard view
Full view
of .
×
0 of .
Results for:
P. 1
ch10

# ch10

Ratings: 0|Views: 9|Likes:

Published by: Jonah Chua on Feb 22, 2012

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See More
See less

04/18/2013

pdf

text

original

.'1-63
u
to
v
=
(V,E).
Let
a,
b
e
V.
Wemustshowthatthedistancebetween
a
and
b
inGdoesnotexceed3.If
{a,
b}
rt
E,
theresultfollows,soassumethat
{a,b}
E
E.
Becausethediameterof
G
isgreaterthanorequalto3,thereexistvertices
u
and
v
suchthatthedistancein
G
between
u
and
v
isgreaterthanorequalto
3.
Either
u
or
v,
orboth,isnotintheset
{a,
b}.
Assume
u
isdifferentfromboth
a
and
b.
Either
{a,u}
E
E
or
{b,
u}
E
E;
otherwise
a,u,
b
isapathoflength2inG.So,withoutlossofgenerality,assume
{a,u}
E
E.
Thusvisdifferentfrom
a
andfrom
b.
If
{a,
v}
E
E,
then
u,a,
visapathoflength2in
G,
so
{a,
v}
rt
E
andthus
{b,
v}
E
E
(orelsetherewouldbeapath
a,v,
b
oflength2in
G).
Hence,
{u,
b}
rt
E;
otherwise
u,
b,
v
isapathoflength2inG.Thus,
a,
v,
u,
b
isapathoflength3inG,asdesired.41.
a,
b,
e,
Z
43.
a,
c,
b,d,
e,
Z
45.IfGisplanar,thenbecausee
::0
3v-6,Ghasatmost27edges.(IfGisnotconnectedithasevenfeweredges.)Similarly,Ghasatmost27edges.Buttheunionof
G
andGis
K
ll,
whichhas55edges,and55
>
27
+
27.47.SupposethatGiscoloredwith
k
colorsandhasindependencenumber
i,
Becauseeachcolorclassmustbeanindependentset,eachcolorclasshasnomorethan
i
elements.Thusthereareatmost
ki
vertices.49.a)ByTheorem2ofSection6.2,theproba-bilityofselectingexactly
m
edgesis
C(n,
m)pm(l-p)n-m.
b)ByTheorem2inSection6.4,theexpectedvalueis
np.
c)Togeneratealabeledgraph
G,
asweapplytheprocesstopairsofvertices,therandomnumber
x
chosenmustbelessthanorequalto
112
when
G
hasanedgebetweenthatpairofverticesandgreaterthan
112
when
G
hasnoedgethere.Hence,theprobabilityofmakingthecorrectchoiceis
1/2
foreachedgeand
1/2
C(n.2)
overall.Hence,alllabeledgraphsareequallylikely.51.Suppose
P
ismonotoneincreasing.Ifthepropertyofnothaving
P
werenotretainedwheneveredgesareremovedfromasimplegraph,therewouldbeasimplegraph
G
nothaving
P
andanothersimplegraph
G'
withthesameverticesbutwithsomeoftheedgesofGmissingthathas
P.
But
P
ismonotoneincreasing,sobecause
G'
has
P,
G'.
CHAPTER10Section10.1
I.
(a),(c),(e)3.a)
a
b)
a,
b,
c,
d,f,h,
j,
q,t
c)
e,
g,
i,k,l,m,n,o,p,r,s,ud)q,r
e)c
f)pg)/,b,a
h)
e,f,I,m,n
5.No7.Level0:
a;
levelI:
b,c,d;
level2:
e
through
k
(inalphabeticalorder);level3:
1
through
r;
level4:
s,
t;
level5:
u
9.a)Theentiretreeb)c,g,
h,
0,
p
andthefouredges
cg,ch,ho,hp
c)
e
alone11.a)Ib)213.a)3b)915.The"onlyif"partisTheorem2andthedefinitionofatree.SupposeGisaconnectedsimplegraphwith
n
verticesand
n-
Iedges.IfGisnotatree,itcontains,byExercise14,anedgewhoseremovalproducesagraph
G',
whichisstillconnected.If
G'
isnotatree,removeanedgetoproduceaconnectedgraph
Gil.
n-
Istepsbecausethereareonly
n-
I
dges.ByTheorem2,theresultinggraphhas
n-
I
dgesbecauseithas
n
vertices.
It
followsthatnoedgesweredeleted,so
G
m
=
2or
m
=
84.27.
Completebinarytreeofheight4:Complete3-arytreeofheight3:
29.a)ByTheorem3itfollowsthat
n
=
mi
+
I.
Because
i+l=n,
wehave
l=n-i,
so
l=(mi+I)-i=(m-l)i
+
I.
b)Wehave
n
=
mi
+
Iand
i
+
l
=
n.
Hence,
i
=
n-l.
It
followsthat
n
=
men-l)
+
I.
Solv-ingfor
n
gives
n
=
(ml-1)/(m-
I).From
i
=
n-1
weobtain
i
=
[(ml-1)/(m-1)]-1
=
(1-
1)/(m-
I).31.
n-
t
33.a)1b)3c)535.a)Theparentdirec-toryb)Asubdirectoryorcontainedfilec)Asubdirec-toryorcontainedfileinthesameparentdirectoryd)Alldirectoriesinthepathnamee)Allsubdirectoriesandfilescontinuedinthedirectoryorasubdirectoryofthisdirectory,andsoon
f)
Thelengthofthepathtothisdirectoryorfileg)Thedepthofthesystem,i.e.,thelengthofthelongestpath37.Let
n
=
2k,
where
k
isapositiveinteger.If
k
=
n-
I
=
Iprocessorinlog2
=
n
=
2k
numbersinlog
n
stepsusingatree-connectednet-workof
n-
Iprocessors.Let
Xl,
XZ,...,X2n
be
2n
=
2n-
Iprocessorsconsistsofthetree-connectednetworkof
n-
Iprocessorstogetherwithtwonewprocessorsaschil-drenofeachleaf.Inonestepwecanusetheleavesofthelargernetworktofind
Xl
+X2,X3+X4,..,X2n-1+x2n,giv-
ingus
n
n
stepsusingtherestofthenetwork.Becausewehaveusedlog
n
+
Istepsand
log(2n)
=
log2
+
log
n
=
I
+
log
n,
thiscompletestheproof.39.conly41.eand
h
43.Supposeatree
T
hasatleasttwocenters.Let
u
andvbedistinctcenters,bothwitheccentricity
e,
with
u
T
isconnected,thereisasimplepath
P
from
u
tov.Letebeanyothervertexonthispath.Becausetheeccentricityofcisatleast
e,
thereisavertex
w
suchthattheuniquesimplepathfromcto
w
haslengthatleast
e.
Clearly,thispathcannotcontainboth
u
andvorelsetherewouldbeasimplecircuit.Infact,thispathfromcto
w
leaves
P
anddoesnotreturnto
P
onceit,possibly,followspartof
P
toward

u
orv.Withoutlossofgenerality,assumethispathdoesnotfollow
P
toward
u.
Thenthepathfrom
u
to
c
to
w
issim-pleandoflengthmorethan
e,
u
T
wouldcontain
K
3,
T2
T7
47.
Thestatementisthat
every
treewith
n
verticeshasapathoflength
n-
I,
anditwasshownonlythatthereexistsatreewith
n
verticeshavingapathoflength
n-
I.
Section10.2
1.
bananaapplepeachcoconutpearmangopapaya
3.a)3
b)1
c)
4
d)5
8-64
5.
the
quickbrownfoxdogjumps
over
lazy
7.
Atleast
[log,
41
=
2weighingsareneeded,becausethereareonlyfouroutcomes(becauseitisnotrequiredtodeterminewhetherthecoinislighterorheavier).Infact,twoweighingssuffice.BeginbyweighingcoinIagainstcoin2.Iftheybal-ance,weighcoinIagainstcoin3.Ifcoin1andcoin
3
arethesameweight,coin4isthecounterfeitcoin,andiftheyarenotthesameweight,thencoin3isthecounterfeitcoin.Ifcoin1andcoin2arenotthesameweight,againweighcoin1againstcoin3.Iftheybalance,coin2isthecounterfeitcoin;iftheydonotbalance,coin1isthecounterfeitcoin.
9.
Atleast[log)131
=
3weighingsareneeded.Infact,threeweighingssuffice.Startbyputtingcoins1,2,and3ontheleft-handsideofthebalanceandcoins4,5,and6ontheright-handside.
If
equal,applyExample3tocoins1,2,7,8,9,10,
11,
and12.Ifunequal,applyExample3to1,2,3,4,5,6,7,and8.11.Theleastnumberisfive.Calltheelements
a,
b,
c,
and
d.
Firstcompare
a
and
b;
thencompare
c
and
d.
Withoutlossofgenerality,assumethat
a
<
b
and
c
<
d.
Nextcompare
a
and
c.
Whicheverissmalleristhesmallestelementoftheset.Againwithoutlossofgenerality,suppose
a
<
c.
Finally,com-pare
b
withboth
c
and
d
tocompletelydeterminetheordering.13.Thefirsttwostepsareshowninthetext.After22hasbeenidentifiedasthesecondlargestelement,wereplacetheleaf22by
-00
inthetreeandrecalculatethewinnerinthepathfromtheleafwhere22usedtobeuptotheroot.Next,weseethat17isthethirdlargestelement,sowerepeattheprocess:replacetheleaf17by
-00
andrecalculate.Next,weseethat14isthefourthlargestelement,sowerepeattheprocess:replacetheleaf14by
-00
andrecalculate.Next,weseethatIIisthefifthlargestelement,sowerepeattheprocess:replacetheleafIIby-
00
andrecalculate.Theprocesscontinuesinthismanner.Wedeterminethat9isthesixthlargestelement,8isthesev-enthlargestelement,and3istheeighthlargestelement.Thetreesproducedinallsteps,exceptthesecondtolast,areshownhere.

5-65
11
11
15.Thevalueofavertexisthelistelementcurrentlythere.andthelabelisthename(i.e.,location)oftheleafresponsibleforthatvalue.procedure
tournamentsortia.,...,an)
k:=
[Iog
»]
buildabinarytreeofheight
k
for
i
:=
Ito
n
setthevalueoftheithleaftobe
a,
anditslabeltobeitselffor
i
:=
n
+
Ito
2k
setthevalueofthe
ith
leaftobe
-00
anditslabeltobeitselffor
i
:=
k-
Idownto0foreachvertex
v
atlevel
i
setthevalueof
v
tothelargerofthevaluesofitschildrenanditslabeltobethelabelofthechildwiththelargervaluefor
i
:=
1to
n
begin
ci
:=
valueattherootlet
v
bethelabeloftherootsetthevalueof
v
tobe
-00
whilethelabelattherootisstill
v
begin
v
:=
parent(v)
setthevalueof
v
tothelargerofthevaluesofitschildrenanditslabeltobethelabelofthechildwiththelargervalueendend{cl,...,
C
n
isthelistinnonincreasingorder}
17.k-l,wheren=2
k
19.a)Yesb)Noc)Yesd)Yes
2t.a:000,e:001,i:01,k:
1100,0:
1I01,p:
oo
w
v
27.A:000I;B:IOIOOI;C:II001;D:OOOOO;E:IOO;F:OOIIOO;G:OOIIOI;H:OIOI;1:0100;J:IIOIOOIOI;K:IIOIOOO;L:OOOOI;M:IOIOI;N:OIIO;0:0010;P:IOIOOO;Q:IIOIOOIOOO;R:IOII;8:0111;T:III;U:OOIII;V:II0101;W:IIOOO;X:II0100II;Y:IIOII;Z:IIOIOOIOOI29.A:2;E:I;N:OIO;R:OII;T:02;Z:0031.
n
33.Becausethetreeisratherlarge,wehaveindicatedinsomeplacesto"seetext."RefertoFigure9;thesubtreerootedatthesesquareorcircleverticesisexactlythesameasthecorrespondingsubtreeinFigure9.Firstplayerwins.

## Activity (0)

### Showing

AllMost RecentReviewsAll NotesLikes
You've already reviewed this. Edit your review.
No activity yet