Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
100%
(2)
100% found this document useful (2 votes)
630 views
31 pages
Recurrent Problems
Recurrent Problems: TOH, Pizza Cutting Problem and Josephus Problem
Uploaded by
Supriyo Chakma
Copyright
© Attribution Non-Commercial ShareAlike (BY-NC-SA)
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Recurrent Problems For Later
100%
100% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
100%
(2)
100% found this document useful (2 votes)
630 views
31 pages
Recurrent Problems
Recurrent Problems: TOH, Pizza Cutting Problem and Josephus Problem
Uploaded by
Supriyo Chakma
Copyright
© Attribution Non-Commercial ShareAlike (BY-NC-SA)
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Recurrent Problems For Later
100%
100% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 31
Search
Fullscreen
“Recurrent Problem” Tih Tower af Hanoi (Tot): Hes ee disk.-on 3 diamond needle. Recurrent problem solve ®ST% stepsé ies oo Appropriate nota tion 2, Find Recurrence 2. Find Recurrence Relation. / epuertion 4. Starting fom the smaller ones, find / ques sol”, 5 Tf needed » break down the recurrence 4o gel 3o/* 6. Prove the sol™ to be valid.ig Source Tnlermedial e A 8 foge BY J Tne n S53? disk @ A Bi C ab movements Complete. So, for 3 disks, 2°3 -1 = 7 Moves required 2 acl move & Yecurrence relahen form=4T+2+1 Ged =a [axa 2 open form ; Ly aft caleulation @@r Or eTt(6 wrocorer PAO ar | [ if mg ie R42 closed form Las n gle direct” ans 1031 *r] i 4) T.20 Ta ni 5 aT al as guess b= 5 wae om aff Ty =F | Ty ls) | pete) 6. Induction method u Prove. Guta prove @a(6 ay The2™1Page 4 | nro = ee f Basis $ se OP for the lowes} value of n which isd, We show that Th 20s, holds To=8t=4- 19 [ @r eg prove @376 ae OST Cab value a ery ee Hypothesis’ For “alll. «Wales of 1 betweery I to n=l we assume that Th = 2" Sol” holds. 2 Weassume Tt =2%et)~1 ee a snk 2 TF q-! Sb ap vahie 20 1m RAF vig gn Awe Ua Fer OTS alt value 4 pr Me 0) CIOs gaior aa SRI clipe dice me MSI ra S arr eey hypothesis & way 43]Tnduction * n ay Hay ve curvenc é relation, hypoth esi: Te tony yrothesis C4 Tn-a OF value guess sey ai wer apt | = 262" 5) Cmpomessy /a@® ty reeurrence, prob solve @8/ 42°) Worst case. 4S no step. use Fl 2. @ TOK GF Ha closed eg” 2 @ Tou az ool OE PAO wall Le Qalby (ways ol @ ay iwabae proof 5122] Qt recturrénce Ds Da) direct far Proof & bil war */ from PDF => MUST See also: Double Tower of Hanoi (DTOH) and Triple Tower of Hanai (TTOH) (with their Inductive Proof Too!)7 in DTOH, the Tn = minimum no. of moves to solve Double Tower al ttonot the DTOH problem with{n pairs (2n disks] Each two consecutive disks have equal size, so either one can be placed above the other one of its equal size é Q: For DTOH problem, prove that Tn = 2 (24n- 1) vv Ans; see below Q: Prove that Tn = 2 (24n - 1) for the Double Towr of Av Hanoi problem using mathematical induction on n. Ans: do yoursclf (hint: basis: 10 = 0 obvious, as T0=2(2"0-1)=2(1-1)=0 Hypothesis: Tut =24(2°r-1 - 1) i =2Tmi+2 oar 7 2*(2Anat = 1)]4+2 — se =2[24n-2]+2 ats 7m al aens tt Mave Top n-I pairs ‘Move Bottom Two disks Now, Again Mave the (Largest Two) nel pairs from from LtoM a. ‘ ate 2 T from L to R (destination) Mt R (destination) == n= oD he pe ad n-) Tee] eal a 2 )* we =2 (Toot 2)+2 2 7 iitin TTOH, the Tn = minimum no. of moves to solve the DTOH problem with mtriplets of disks (3n-disks). a Each three consecutive disks have equal size, so cither Hoe NO) one can be placed above the other one/two of equal size —____ x Q: For TTOH problem, prove Tn = 3 2-1) eX) ans: see below Q: Give inductive Proof Tn= 2*n-1) for TTOH} ; v hint: basis => n=0 => TO = 3(2°0-1) = 0 obvious: § — Induction; Tn = 2Tn- Z Z s i =3(2!n-1) proved) s ais ge 4 => ae a sft L 3 3 Move Top =I triplets Move Bottom Three 5 ae from E Hi M disks from L to R Mave Remaining n-1 triplets from M to R (destination) In = my orn Ws = 2 +2 = 2 (2Tr2+ 3) +3 oe a =o AG 8 AO n-) i“ | nT 2G Sno a ee =. nn - * +2°.8 1 nat Bee ee m-) + | Pole eee ae S x “fsll Ghilepeapaneahe wanes fh Lines on ie PI = sae line Wy max” are cover. 361 Surface ta straight line fier we max, region. - infihity 74,
@lA no. position bl sage | J) = |] + curvivour's number number of people in arelé, | L@t/ ate “YO MAME OHH iy dive ee 4¥ WHC (n) wy the ofr ony no Mb] ae at Tale oO Oo few att Sa gt Ae Oe Spec leprea cep AGW span SIRE ee: ® An) = 24(n)- J (6) = a(2a 3) =2J (2) =I odd HP RET eee: 4 ge 0 ge 70 om Bo a2 £0 Ba 5 @ © er Bs vs @I(en+i) - 2G)e1 So, Ki) = J tven > J (an) = 29(n) -1 ee. odd —> Tanti): 2 Tfn) +4erie 3 ita Ie f 3 ier oe te | a a - ale) tlt 33 we [sn | ol “Odd -no. 47 »2 AF power GREE chan start 2 ,| ie ect dae Dies, [erat , neo es form & ey 5] IS 29747 Barer deek fre wl wee, myo, o¢b<2™ | FRA Joo = @ oS +68 wy area ay | dh: Pye = 6x83 0 - i ID = 9% 49 '= 941 > Bud tS £m Joo = 2+ 36-94) = 2x3b4t= 13 |lIdnductive Pronk angen) <24aN Basig.e Ne prove the closed form on m. for the lowest value of m which 1s zero, we show that o(24 4) = Ql+l is true if mis 0 yturll also be zero | og 42] . a I(2°+0) = 2x04) = 1 > ati shes hm, m4 L) = 2+ 1 holds for m=6 Hypo thesis= For all). yal edumboiieen() Yt) " ie hea : TMD. 21+) is tue. wrt Gee So, 12+ x)= 2x41 Tduchive proof t (24 1/2)=2(02)+ 1=1+1 [d(en) “U+ 1 proof #3(0 az for even en) Even Cases Ten) = 25 (n)-1here, 2n foes cn Lf gy et seri PRAT | J(tn) = a Cote dja) <4 [oor value ai@| 7 afe Alp +1] —1] hypothesis wet | 2 22 pla = H+) Jan) = adr J [odd case (enti) GF GH] © basic ,hypethes'> came only proof dtd] Opp coset Jlons J) = 2I(n)t 4 here, In¢d = OL JM = Mt1- 1 2 ae 2 i, Fee 4d ' "J dna!)- 2904 4) dare52] mag + ier feat = lf r Alt = 2L4] L pj(inri)= ales [50 odd even tld @RGe proof af Cra Give are indudlive proof wait reeurrence ep™ia Just Trae proof o 1a Ae wa problem proof Hat ayslbr a eg RUC GER Glo Cuan age —podd AF way at] dia evor 4 a > thn recurrence ie Ns Sosephys, prob aft evert/odd or ¢ven+odd 47 Gap OBE are |Mn) =3 (2" +) =2H1 Gy Binary Solution of Shgeplus problem é Question: Derive the Binary Property of the Josephus Problem. = 8t0 = 1° ene in =r ee is aloas ool | Since n= Het =n-2°m ken Janes * @x) tooo number (n-2" vis 0, rest af the bits are same as the hits of n. See exampte=> JS = Bt} = he On G h Toie® the last m bs of! dake a may Ong 8s - bs b, bee ee if n= 15(1 111) then [=P (OLD) pol= (a, E b 0), [ne of people Ce" cay Oe o. Li tet al wis an Ce far eat estng ‘om yee D+] = (bm) bigai aie by bol), n= lk
WP bit binary @ Slr L @e U0 bit {a» bin aty @ once Loe aay 5 J] MSB ‘0! opya (alos) Ea — Exe set og N=24 = 11000 100=3 00100 ged m é 28 2436 94 SOOFOOI=72 | oh, a Ca x re iiss 01900 i ‘ ze n@ bn @® evra binary no @4 conver} 8 MS @ alae WT left shit } SAA No CIC OMT Ahn OT dl ediral dowble z@r agar a k TIGR soludon OF 26F a* Ex —> "8" So, nike just aaa a ate aon je 21 $= 0 101 double ~" ag 0 = 1010 ca Ip] Generaliz = ver si0n_ a seaeorenena) ui blem: wire Yosephus problem ay a {=o GMA Yeeurrence Ch¥] W1TR, closed fan) = 28(n) +P form G3 9R(O 20 pied GA, p,? ay] Bae F(2n+3) 5 24n)t” Josephus Prablem Recurrence. spat Aan) = Dien) - 1 Qe pees $(2) = f(2mt) = 2F0) +B = 2h +P (3) =f (a1 +1) = 2009+ emma eS Lol + IK emma $0, fn) 9X QI GNA solulfon OFT d f(n)
You might also like
Numerical Analysis Notes
PDF
No ratings yet
Numerical Analysis Notes
52 pages
Maths XII OIG Solution
PDF
No ratings yet
Maths XII OIG Solution
182 pages
Master theorm DAA
PDF
No ratings yet
Master theorm DAA
14 pages
15 Worked Solutions
PDF
No ratings yet
15 Worked Solutions
51 pages
Divide and Conquer
PDF
No ratings yet
Divide and Conquer
44 pages
Adobe Scan 07-Jan-2024
PDF
No ratings yet
Adobe Scan 07-Jan-2024
22 pages
NTU PHD Supervisor List Sep 16
PDF
No ratings yet
NTU PHD Supervisor List Sep 16
16 pages
Ada
PDF
No ratings yet
Ada
89 pages
Discrete Mathematics
PDF
No ratings yet
Discrete Mathematics
7 pages
Recurrence1 (1)
PDF
No ratings yet
Recurrence1 (1)
16 pages
7 Recurrence Relations
PDF
No ratings yet
7 Recurrence Relations
21 pages
Lecture 4-Mathematical Induction
PDF
No ratings yet
Lecture 4-Mathematical Induction
33 pages
special fumctions
PDF
No ratings yet
special fumctions
46 pages
Math Note Full
PDF
No ratings yet
Math Note Full
14 pages
Recurrence Relations PDF
PDF
No ratings yet
Recurrence Relations PDF
8 pages
Divide Et Impera Si Programare Dinamica
PDF
No ratings yet
Divide Et Impera Si Programare Dinamica
64 pages
Lec2 dnc1 v1 Light 6up
PDF
No ratings yet
Lec2 dnc1 v1 Light 6up
8 pages
Problem Set 8 Solutions
PDF
No ratings yet
Problem Set 8 Solutions
6 pages
Tutorial 3 Solutions
PDF
No ratings yet
Tutorial 3 Solutions
3 pages
B A K N C B A: COMP2101 - Discrete Mathematics Binomial Theorem and Master Theorem
PDF
No ratings yet
B A K N C B A: COMP2101 - Discrete Mathematics Binomial Theorem and Master Theorem
5 pages
XI Mathematics (Newton Solved) CS
PDF
No ratings yet
XI Mathematics (Newton Solved) CS
72 pages
Ursule
PDF
100% (1)
Ursule
2 pages
DAA_module1_part3_Recurrence Relation
PDF
No ratings yet
DAA_module1_part3_Recurrence Relation
18 pages
1 Towers of Hanoi
PDF
No ratings yet
1 Towers of Hanoi
8 pages
Vectors and Their Representation:: Vector & Three Dimensional Geometry
PDF
No ratings yet
Vectors and Their Representation:: Vector & Three Dimensional Geometry
223 pages
05 Master Theorem
PDF
No ratings yet
05 Master Theorem
39 pages
Ad Endsem Imp
PDF
No ratings yet
Ad Endsem Imp
27 pages
Recurrence Relations
PDF
No ratings yet
Recurrence Relations
33 pages
maths exclude questions
PDF
No ratings yet
maths exclude questions
22 pages
Recurrences: Oscar Civit - Oscar - Civit@upf - Edu Daniel Giribet - Daniel - Giribet@upf - Edu
PDF
No ratings yet
Recurrences: Oscar Civit - Oscar - Civit@upf - Edu Daniel Giribet - Daniel - Giribet@upf - Edu
21 pages
MLE and MAP Classifier
PDF
No ratings yet
MLE and MAP Classifier
55 pages
ECE 6111 (Formerly 313) Syllabus Applied Probability and Stochastic Processes
PDF
No ratings yet
ECE 6111 (Formerly 313) Syllabus Applied Probability and Stochastic Processes
2 pages
PPT3 of pro next
PDF
No ratings yet
PPT3 of pro next
17 pages
LectureNotes DHolt
PDF
No ratings yet
LectureNotes DHolt
78 pages
MAFE208IU-L11 ODEs Part1
PDF
No ratings yet
MAFE208IU-L11 ODEs Part1
25 pages
Mathematics Formula
PDF
100% (1)
Mathematics Formula
54 pages
Regula Falsi Method
PDF
No ratings yet
Regula Falsi Method
50 pages
COMP2230 Introduction To Algorithmics: A/Prof Ljiljana Brankovic
PDF
No ratings yet
COMP2230 Introduction To Algorithmics: A/Prof Ljiljana Brankovic
39 pages
E7 2021 Lecture24
PDF
No ratings yet
E7 2021 Lecture24
38 pages
Examination in Basic Mathematics: A. Computation Part
PDF
No ratings yet
Examination in Basic Mathematics: A. Computation Part
7 pages
1 Towers of Hanoi
PDF
No ratings yet
1 Towers of Hanoi
8 pages
A Simple Yet Efficient Two Step Fifth Order Weighted Newton Method For Nonlinear Models
PDF
No ratings yet
A Simple Yet Efficient Two Step Fifth Order Weighted Newton Method For Nonlinear Models
23 pages
Data Structures and Algorithms: (CS210/ESO207/ESO211)
PDF
No ratings yet
Data Structures and Algorithms: (CS210/ESO207/ESO211)
22 pages
(311) Mathematics
PDF
No ratings yet
(311) Mathematics
21 pages
Divide and Conquer
PDF
No ratings yet
Divide and Conquer
2 pages
Classifiers: Numerical Problems and Solutions
PDF
No ratings yet
Classifiers: Numerical Problems and Solutions
13 pages
Ex 3 Sol
PDF
No ratings yet
Ex 3 Sol
3 pages
1001 Problems in Classical Number Theory (Solutions) PDF
PDF
No ratings yet
1001 Problems in Classical Number Theory (Solutions) PDF
238 pages
Recur
PDF
No ratings yet
Recur
7 pages
Recurrences PDF
PDF
No ratings yet
Recurrences PDF
24 pages
Week10 Differentiation
PDF
No ratings yet
Week10 Differentiation
27 pages
Naive Bayes Classifier
PDF
No ratings yet
Naive Bayes Classifier
46 pages
Chapter4
PDF
No ratings yet
Chapter4
7 pages
Assignment 3 Solutions
PDF
No ratings yet
Assignment 3 Solutions
12 pages
Queueing Theory MM1 Queue
PDF
No ratings yet
Queueing Theory MM1 Queue
8 pages
Queueing Theory MM1 Queue
PDF
No ratings yet
Queueing Theory MM1 Queue
8 pages
ISC 2019 Results
PDF
No ratings yet
ISC 2019 Results
22 pages
PDE - Most Important
PDF
100% (2)
PDE - Most Important
376 pages
H 2
PDF
No ratings yet
H 2
16 pages
Chapter 0 - Introduction
PDF
No ratings yet
Chapter 0 - Introduction
15 pages
Mat25 Hw4solns
PDF
No ratings yet
Mat25 Hw4solns
4 pages
Akra Bazzi Assignment
PDF
No ratings yet
Akra Bazzi Assignment
10 pages
CSE548 Lectures 7 8 PDF
PDF
No ratings yet
CSE548 Lectures 7 8 PDF
10 pages
Good Luck! I Hope You Find This A Good Review For The AP Test
PDF
No ratings yet
Good Luck! I Hope You Find This A Good Review For The AP Test
6 pages
SME IX Integer Part and Fractional Part PDF
PDF
No ratings yet
SME IX Integer Part and Fractional Part PDF
2 pages