Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

sSMAte

400+0O5 Date
UDDHAV AGGARWNAL Page

HOMEWORK -

Ans4 CALCULATION (p):


Mulhpole expansions o 89v&res Condeining e t folo wing

chasis n3n3, y5,543.14h3d.i,lA-


Dire alilaton opoknkal kom he ollou chapo

CALULATION )
Molkpele expansiend Sualis Centainirg 1lou
a ollouy
daya.S3,
Dive luladie
fe,S, ,k3A3,1n3
POknkal Lo He blloui chakA

CA LCULATON o L

Mulkpoke ewpansieno Squaus tondaunit e


ollouir
ollouirg

Dived alulalon Poknhal he Poll&u Chais

CALCWLATION aom)

MuLhpale parsien op sarts centduniv Whe


olown
Dive talakak poknhal om e dolouns chayea
DADAR COL ABA

Ex pecdea khe oA 200 +36 =


60 min

Since Expected ke 200 Runaig Whne


o201 we
a nore 20

T b COLA BA

Expecked wwe i 300 y + 30 130 mn

UT b DADAR

Expeched kime e 100 +50 0 mn

n eA t01= , * 65 s mmn
Expecked
,65+. So
Expeckedke fo i00+10 20

20 10 20

66+mu
Dadan - 667 +6o
Expecded kne lT b Col aba via
m
126.7 un

IIT o (olaba diveckls-130 m


Expe ched Wn

lo 60
IT Colaba
Expectad 20 o 60

IT b_ Cokaba
is o
haut yby
hait
e
Bet pan take Hhe bus Mat Coneo d
and 300, and nd kke ik
O0 10) Ma waid fov 200
cerds f s t
100,I00, 101
clASSMAte
Date
Page

Ans 3 HY POTHETICAL TREE


dnord

CBoh dildhon o
Ahe o0tLanot be
leanes J

We'l pVOve onbuadictoi

WLOG as SUme Chalades k


Subhee
W. i tit wo uld
ill hane ebined wext 5
ane Ombined b b beote

add uplo 1
b be case Sum o freapon ties must

Sane
At
wae umwlakve went Sihe

or d ha le have wepht

Bu hev woula hame mbined i v b beore


a 3
Thereore, hone a wnmadidien. Hene it is
alaned codenod o lonsth 1 le eNIS

( ( Sine each dhalae OCCA veg enu ess Hran


h ae ualureed ls he allast mbals
alphabel
cASSMALc

pr

Svppose here 1S a codewed keayh 4, T+ u l l


tvoe Say it
bLanch He ot he

Chatadha u muo X muo nAne ben mLa


ohea subhees C'
subhee consisli kup
A and B.
possibare been eavea)
BohA A and Bould hare wmkatve heint ls
uih
haw ohwwwise ,Ke ould ve cOnwbired
nalacha odeusA Bengh

But

This is niaadicben as he

add vplo 4,

ene2 it s anleed o4todiuoed na


ot exist

y GREEDY CHOICE Repeated ky ho os e On lea edge.


and He mode
Remove Me parerd mane hen aA
avd a l edg which
ndpond. Repeat

a lea edje and


OPTIMALITY CHoICE ASSuming
maximal matchuis SupPose
F is Oru
Fdoentlerdan . Then we
Cav make a a paut F and
Bnnove he hat Condetuh edA parent

leaf si2e oQu


Pregeered
We hane
maK ina rotehue
cASSMATe
Date
Page

OPTIMAL SUBSTRUCTURE
ALGORITH:
M[ As lan be seenm he
MarMateh Te T) alnouHn CEmbn. Me
nax makhiy T C
CT is enp inlan e
ahun
hrehin
Selker leat dae

M- M Vn-
T Remove bo modes o em T. all new Troe T

Mas Malt tT;


Sin e ve visit ead node l n a , kine

Compax h OCh). De s tleaf edap an


eaendly mainkained MS auEUE ala shauchu

Ans5 ALGORITHM

Seer all_phs in decreasi 04d apo


Thadeen 2obs decreasing ovde o
pot Qnd ov ench ob
A r d askut k s4 sot is Cmp and
Kdeadliv, d omaxiu k
Suh
) no such k exists move n e nekt
-

PROOF oFnMALITY

SuPPse we edp haNina ob wwich annot


be Latld anawhue kease_alQ os beoveiti
ciAsSMALe

Date.
Page

deaaline One Qod. To accomodale his


pb, e hae

le unove kese kn
SOne ob wich ha plaed
eaer he skp. Howeve) sina weileeati ae
n ode

decieasing proph Hus is not ophnal and n Mone

shoula sinp hohe Mhis ob

OPTIMAL SOBSTRUCTORE:

e
APlex having soved he Jphs, ne t t k schedule
his 70b
Ost poELle2pb. Afe hat, we naYe
uer he st and now o a o schedule he
SLOT HA
new ungtante2 7pbs7pbs CoNSIDERIN ONE
BEENCCOPJEDO
opkal sthedule He nw ins ane
Fvdnig he sthedule a e s t zob
aund m he opkunal schedule o Hhe oüral in&ene

ALGORITHM
o(nlegn
slols Ln 3 gobs Ln)
bool

>0 9; charg_oue
sot C pot,_profit+n, grales cint dealnes suikablp

Pti.n])
Hax Poft
Ci=
( DEin,
n41)brek)3

(ind Di);_j 2/:j


o ulotE) fale)
wtctiont
SlotL)= thve be elled
3obs Ci7 be n khmes

break tonup axi O(ntndeN


PÚi,..n)
(DCal,..n),
haPiofit

You might also like