CS 4102 Algorithms Summer 2020 Can you tile

  • Slides: 15
Download presentation
CS 4102 Algorithms Summer 2020 Can you tile this? With these? 1

CS 4102 Algorithms Summer 2020 Can you tile this? With these? 1

CS 4102 Algorithms Summer 2020 2

CS 4102 Algorithms Summer 2020 2

Can I tile this with dominoes?

Can I tile this with dominoes?

Baseball Elmination If UVA loses all of these, then JMU wins them all Opponents

Baseball Elmination If UVA loses all of these, then JMU wins them all Opponents Team Wins Losses Games Left UVA VT JMU ODU UVA 83 71 8 -- 1 6 1 VT 80 79 3 1 -- 0 2 JMU 78 78 6 6 0 -- 0 ODU 77 82 3 1 2 0 -- Idea: Can we “distribute” wins so that all are less the VT’s best possible record?

Can VT Win the Season? Opponents Team Wins Losses Games Left UVA VT JMU

Can VT Win the Season? Opponents Team Wins Losses Games Left UVA VT JMU ODU UVA 83 71 8 -- 1 6 1 VT 80 79 3 1 -- 0 2 JMU 78 78 6 6 0 -- 0 ODU 77 82 3 1 2 0 -- Edge from Match-up to participating teams Capacity = games remaining 6 S 1 0 UVA JMU UVA ODU JMU ODU Node per non-VT Match-up UVA 8383= 0 JMU Capacity = additional wins before overtaking VT’s max wins ODU 83 -78=5 7=6 7 3 8 Node per Team (except VT) t Answer is “Yes” if max flow = total games remaining

You have 2 identical phones and a 100 -step ladder. Find the highest step

You have 2 identical phones and a 100 -step ladder. Find the highest step of the ladder from which the phones can fall without breaking using the minimum number of trials.

Recurrence Solving Techniques Tree ? Guess/Check “Cookbook” Substitution 9

Recurrence Solving Techniques Tree ? Guess/Check “Cookbook” Substitution 9

Substitution Method • Idea: take a “difficult” recurrence, re-express it such that one of

Substitution Method • Idea: take a “difficult” recurrence, re-express it such that one of our other methods applies. • Example: 10

 Tree method … … … … 11

Tree method … … … … 11

Substitution Method Master Theorem doesn’t like the ½ in the exponent Now the variable

Substitution Method Master Theorem doesn’t like the ½ in the exponent Now the variable is in the exponent on both sides! Rewrite in terms of exponent! Case 2! Substitute Back Whoa! Master Theorem! 12

Tree method … … … 13

Tree method … … … 13

Tree method … … … 14

Tree method … … … 14

Tree method … … … 15

Tree method … … … 15