MA/CSSE 473 Day 20 Questions before exam More decrease and Conquer.

Slides:



Advertisements
Similar presentations
CSC 421: Algorithm Design & Analysis
Advertisements

Today’s topics Decision Trees Reading: Sections 9.1 CompSci 102.
HandoutLecture 6Binary Search Weighing with a Balance A large container is known to hold 24 oz of nails. The hardware store has a balance, but no weights.
What is divide and conquer? Divide and conquer is a problem solving technique. It does not imply any specific computing problems. The idea is to divide.
Design and Analysis of Algorithms – Chapter 41 Decrease and Conquer II Dr. Ying Lu RAIK 283: Data Structures & Algorithms.
Chapter 5: Decrease and Conquer
Design & Analysis of Algorithms CS315
Discrete Structure Li Tak Sing( 李德成 ) Lectures
How to find the heavier one by weighing 2 times only?
HandoutMay 2007Binary Search A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering.
May 2007Binary SearchSlide 1 Binary Search A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering.
Adversarial Search and Game Playing Examples. Game Tree MAX’s play  MIN’s play  Terminal state (win for MAX)  Here, symmetries have been used to reduce.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Trees.
Deviation = The sum of the variables on each side of the mean will add up to 0 X
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Solving System of Linear Equations. 1. Diagonal Form of a System of Equations 2. Elementary Row Operations 3. Elementary Row Operation 1 4. Elementary.
MA/CSSE 473 Day 22 Gray Code More Decrease and Conquer Algorithms No class Day 22 in because of Abby's broken arm.
MA/CSSE 473 Day 03 Asymptotics A Closer Look at Arithmetic With another student, try to write a precise, formal definition of “t(n) is in O(g(n))”
MA/CSSE 473 Day 20 Josephus problem Transform and conquer examples.
A few leftover Decrease-and-conquer Algorithms
MA/CSSE 473 Day 17 Permutations by lexicographic order number.
Solving Equations. What will happen if you add or subtract an equal amount of weight on both sides of the scales? Solving equations is like balancing.
Chapter 5 Decrease-and-Conquer Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
MA/CSSE 473 Day 14 Permutations wrap-up Subset generation (Horner’s method)
3.1 – SOLVING EQUATIONS BY USING ADDITION AND SUBTRACTION.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
MA/CSSE 473 Day 19 Exam Prep. MA/CSSE 473 Day 19 If you want additional practice problems for Tuesday's exam: –The "not to turn in" problems from various.
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 7.
Computer Science 101 A Survey of Computer Science QuickSort.
Asymptotic Behavior Algorithm : Design & Analysis [2]
1 Algorithms CSCI 235, Fall 2015 Lecture 19 Order Statistics II.
6 th Grade Math: Chapter 2 LEARNING GOAL Students will understand variables, expressions, and equations by being able to do the following: Identify and.
MA/CSSE 473 Day 21 In , Day 21 was the exam.
MA/CSSE 473 Day 09 Modular Division Revisited Fermat's Little Theorem Primality Testing.
329 3/30/98 CSE 143 Searching and Sorting [Sections 12.4, ]
MA/CSSE 473 Day 14 Strassen's Algorithm: Matrix Multiplication Decrease and Conquer DFS.
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division Fermat's little theorem intro.
MA/CSSE 473 Day 11 Knuth interview Amortization (growable Array) Brute Force Examples.
Data Structures & Algorithms Lecturer : Kritawan Siriboon, Room no. 913 Text : Data Structures & Algorithm Analysis in C, C++,… Mark Allen Weiss, Addison.
1 Section 5.1 Analyzing Algorithms Let P be a problem and A an algorithm to solve P. The running time of A can be analyzed by counting the number of certain.
MA/CSSE 473 Day 20 Finish Josephus
Some more Decrease-and-conquer Algorithms
13.4 Product of Two Matrices
Decrease-and-Conquer
CSC 421: Algorithm Design & Analysis
CSC 421: Algorithm Design & Analysis
Measures of Center.
Matrix Multiplication
CSC 421: Algorithm Design & Analysis
ONE STEP EQUATIONS.
ONE STEP EQUATIONS.
Decrease-and-Conquer
Divide and Conquer / Closest Pair of Points Yin Tat Lee
“MM – Median of Medians”
Decrease-and-Conquer
Decrease-and-Conquer
Chapter 5 Decrease-and-Conquer
CSC 421: Algorithm Design & Analysis
CSC 380: Design and Analysis of Algorithms
CSC 380: Design and Analysis of Algorithms
CSC 380: Design and Analysis of Algorithms
Adversarial Search and Game Playing Examples
Matrices and Determinants
ONE STEP EQUATIONS WHAT?!?!.
ONE STEP EQUATIONS.
CSC 421: Algorithm Design & Analysis
“MM – Median of Medians”
How to find the heavier one by weighing 2 times only?
ONE STEP EQUATIONS.
Presentation transcript:

MA/CSSE 473 Day 20 Questions before exam More decrease and Conquer

MA/CSSE 473 Day 20 See announcements from Day 19 HW 8 has been updated for this term Student Questions (especially about upcoming exam) More decrease and conquer

OTHER DECREASE-AND-CONQUER ALGORITHMS Decrease by a constant factor Decrease by a variable amount

Fake Coin Problem We have n coins All but one have the same weight One is lighter We have a balance scale with two pans. All it will tell us is whether the two sides have equal weight, or which side is heavier What is the minimum number of weighings that will guarantee that we find the fake coin? Decrease by factor of two.

Decrease by a Constant Factor Examples that we have already seen: –Binary Search –Exponentiation (ordinary and modular) by repeated squaring –Multiplication à la Russe (The Dasgupta book that I followed for the first part of the course called it "European" instead of "Russian") Example Then strike out any rows whose first number is even, and add up the remaining numbers in the second column.

Decrease by a variable amount Search in a Binary Search Tree Interpolation Search –See Levitin, pp –Also Weiss, Section Median Finding –Find the k th element of an (unordered) list of n elements –Start with quicksort's partition method –Best case analysis