Download presentation

Presentation is loading. Please wait.

1
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 36, Monday, December 1

2
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

3
Divide-and-Conquer Divide the problem in two smaller parts, solve each subproblem nad combine solutions. a n = ca n/2 + f(n).

4
Divide-and-Conquer Divide the problem in two smaller parts, solve each subproblem nad combine solutions. a n = ca n/2 + f(n). cf(n)anan 1dd d log 2 n e + A 2dAn – d >2dnan log2c + (2d/(2-c)) n 2dndn( d log 2 n e + A)

5
Example 1: Rounds in a Tournament Number of rounds in a tennis tournament. Number of players: n = 2 k, for some k. a n = a n/2 + 1. a n = log 2 n + A. Observe that a 1 = 0, and so A = 0. On the left: n = 8, a 8 = 3.

6
Example 2: Finding the Largest and the Smallest Element in a Set a n = 2a n/2 + 2 a 2 = 1 a n = (3/2)n – 2. m,M m 1,M 1 m 2,M 2 m = min{m 1,m 2 } M = max{M 1,M 2 }

7
Example 3: Efficient Multidigit Multiplication g = [g 1,g 2 ] = g 1 £ 10 n/2 + g 2. h = [h 1,h 2 ] = h 1 £ 10 n/2 + h 2. g £ h = (g 1 £ h 1 ) £ 10 n + (g 1 £ h 2 + g 2 £ h 1 ) £ 10 n/2 +(g 2 £ h 2 ). We need only (g 1 £ h 1 ), (g 2 £ h 2 ) and (g 1 + g 2 ) £ (h 1 + h 2 ). a n = 3a n/2. a n = n log2 3 = n 1.5849....

8
Theorem Let a n = ca n/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 a n grows proportional to n logk c log 2 c. (b) If for large n f(n) · pn q, where p is a positive constant and q < logk c, then a n grows at most at rate proportional to n logk c.

Similar presentations

© 2019 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google