80 likes | 90 Views
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 3 6, Monday, December 1. 7. 2. Divide-and-Conquer Relations. Homework (MATH 310# 1 1M): Read 7. 2,7.3 Do 7.1,7.2: all odd numbere d problems Turn in 7. 2 : 2, 4,6,8. Divide-and-Conquer.
E N D
MATH 310, FALL 2003(Combinatorial Problem Solving)Lecture 36, Monday, December 1
7.2. Divide-and-Conquer Relations • Homework (MATH 310#11M): • Read 7.2,7.3 • Do 7.1,7.2: all odd numbered problems • Turn in 7.2: 2,4,6,8
Divide-and-Conquer • Divide the problem in two smaller parts, solve each subproblem nad combine solutions. • an = can/2 + f(n).
Divide-and-Conquer • Divide the problem in two smaller parts, solve each subproblem nad combine solutions. • an = can/2 + f(n).
Example 1: Rounds in a Tournament • Number of rounds in a tennis tournament. Number of players: n = 2k, for some k. • an = an/2 + 1. • an = log2n + A. • Observe that a1 = 0, and so A = 0. • On the left: n = 8, a8 = 3.
Example 2: Finding the Largest and the Smallest Element in a Set • an = 2an/2 + 2 • a2 = 1 • an = (3/2)n – 2. m,M m2,M2 m1,M1 m= min{m1,m2} M= max{M1,M2}
Example 3: Efficient Multidigit Multiplication • g = [g1,g2] = g1£ 10n/2 + g2. • h = [h1,h2] = h1£ 10n/2 + h2. • g £ h = (g1£ h1) £ 10n + (g1£ h2 + g2£ h1) £ 10n/2 +(g2£ h2). • We need only (g1£ h1), (g2£ h2) and (g1 + g2) £ (h1 + h2). • an = 3an/2. • an = nlog2 3 = n1.5849....
Theorem • Let an = can/k + f(n) be recurrence relation with positive constant c and the positive function f(n). • (a) If for large n, f(n) grows proportional to n logk c, then an grows proportional to nlogk c log2 c. • (b) If for large n f(n) · pnq, where p is a positive constant and q < logk c, then an grows at most at rate proportional to nlogk c.