Intro to Computer Algorithms Lecture 15 Phillip G. Bradford Computer Science University of Alabama.

Slides:



Advertisements
Similar presentations
Chapter 3 Brute Force Brute force is a straightforward approach to solving a problem, usually directly based on the problem’s statement and definitions.
Advertisements

Transform and Conquer Chapter 6. Transform and Conquer Solve problem by transforming into: a more convenient instance of the same problem (instance simplification)
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
Transform & Conquer Replacing One Problem With Another Saadiq Moolla.
Transform and Conquer. Algorithms based on the idea of transformation –Transformation stage Problem instance is modified to be more amenable to solution.
Chapter 6: Transform and Conquer
Bar Ilan University And Georgia Tech Artistic Consultant: Aviya Amir.
Design and Analysis of Algorithms - Chapter 61 Transform and Conquer Solve problem by transforming into: b a more convenient instance of the same problem.
Transform & Conquer Lecture 08 ITS033 – Programming & Algorithms
COSC 3100 Transform and Conquer
MA/CSSE 473 Day 25 Transform and Conquer Student questions?
Lecture 8 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Solving Systems of Linear Equations Part Pivot a Matrix 2. Gaussian Elimination Method 3. Infinitely Many Solutions 4. Inconsistent System 5. Geometric.
TCSS 343, version 1.1 Algorithms, Design and Analysis Transform and Conquer Algorithms Presorting HeapSort.
Lecture 33 CSE 331 Nov 20, Homeworks Submit HW 9 by 1:10PM HW 8 solutions at the end of the lecture.
Design and Analysis of Algorithms - Chapter 61 Transform and Conquer Solve problem by transforming into: b a more convenient instance of the same problem.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (3) Recurrence Relation 11/11 ~ 11/14/2008 Yang Song.
New Mexico Computer Science For All Introduction to Algorithms Maureen Psaila-Dombrowski.
LIAL HORNSBY SCHNEIDER
Multivariate Linear Systems and Row Operations.
Matrix Solution of Linear Systems The Gauss-Jordan Method Special Systems.
BIT Presentation 4.  An algorithm is a method for solving a class of problems.  While computer scientists think a lot about algorithms, the term.
AN INTRODUCTION TO ELEMENTARY ROW OPERATIONS Tools to Solve Matrices.
Copyright © 2011 Pearson, Inc. 7.3 Multivariate Linear Systems and Row Operations.
Intro to Computer Algorithms Lecture 8 Phillip G. Bradford Computer Science University of Alabama.
MA/CSSE 473 Day 20 Josephus problem Transform and conquer examples.
1 Decrease-and-Conquer Approach Lecture 06 ITS033 – Programming & Algorithms Asst. Prof. Dr. Bunyarit Uyyanonvara IT Program, Image and Vision Computing.
Intro to Computer Algorithms Lecture 1 Phillip G. Bradford Computer Science University of Alabama.
Copyright © 2013, 2009, 2005 Pearson Education, Inc. 1 5 Systems and Matrices Copyright © 2013, 2009, 2005 Pearson Education, Inc.
MA/CSSE 473 Day 23 Transform and Conquer. MA/CSSE 473 Day 23 Scores on HW 7 were very high (class average was 93%). Good job! (Score was not included.
Intro to Computer Algorithms Lecture 11 Phillip G. Bradford Computer Science University of Alabama.
CMPS 1371 Introduction to Computing for Engineers MATRICES.
Lecture 28: Mathematical Insight and Engineering.
CS 403: Programming Languages Lecture 1 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
CS1101: Programming Methodology Aaron Tan.
MA/CSSE 473 Day 21 AVL Tree Maximum height 2-3 Trees Student questions?
Intro to Computer Algorithms Lecture 16 Phillip G. Bradford Computer Science University of Alabama.
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
1 CSC 421: Algorithm Design & Analysis Spring 2014 Complexity & lower bounds  brute force  decision trees  adversary arguments  problem reduction.
Lecture 14 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Intro to Computer Algorithms Lecture 21 Phillip G. Bradford Computer Science University of Alabama.
1 Numerical Methods Solution of Systems of Linear Equations.
CMSC201 Computer Science I for Majors Lecture 19 – Recursion (Continued) Prof. Katherine Gibson Prof. Jeremy Dixon Based on slides from UPenn’s.
CMSC201 Computer Science I for Majors Lecture 19 – Recursion
Introduction to Algorithms: Divide-n-Conquer Algorithms
Advanced Algorithms Analysis and Design
MA/CSSE 473 Day 20 Finish Josephus
CMSC201 Computer Science I for Majors Lecture 20 – Recursion (Continued) Prof. Katherine Gibson Based on slides from UPenn’s CIS 110, and from previous.
Subject Name: Design and Analysis of Algorithm Subject Code: 10CS43
Decrease-and-Conquer Approach
CMSC201 Computer Science I for Majors Lecture 18 – Recursion
Chapter 6 Transform-and-Conquer
CSCE350 Algorithms and Data Structure
CMSC201 Computer Science I for Majors Lecture 16 – Recursion
Chapter 6 Transform and Conquer.
Transform and Conquer This group of techniques solves a problem by a transformation to a simpler/more convenient instance [eg sorted] of the same problem.
Transform and Conquer This group of techniques solves a problem by a transformation to a simpler/more convenient instance of the same problem (instance.
Objective of This Course
CMSC201 Computer Science I for Majors Lecture 19 – Recursion
CSCE569 Parallel Computing
Solving Systems of Equations by Substitution
CMSC201 Computer Science I for Majors Lecture 17 – Recursion (cont)
Chapter 6: Transform and Conquer
Searching, Sorting, and Asymptotic Complexity
Transform and Conquer This group of techniques solves a problem by a transformation to a simpler/more convenient instance of the same problem (instance.
Transform and Conquer Transform and Conquer Transform and Conquer.
Transform and Conquer Transform and Conquer Transform and Conquer.
CSC 380: Design and Analysis of Algorithms
Announcements Assignment #4 is due tonight. Last lab program is going to be assigned this Wednesday. ◦ A backtracking problem.
Algorithm Course Algorithms Lecture 3 Sorting Algorithm-1
Presentation transcript:

Intro to Computer Algorithms Lecture 15 Phillip G. Bradford Computer Science University of Alabama

Announcements Advisory Board’s Industrial Talk Series Departmental Colloquium 27-Oct, in 110 East Engineering Featuring Dr. Gary McGraw “Building Secure Software Why the standard approach to security doesn't work”

CS Story Time Prof. Jones’ research group See

Association of Computing Machinery “The First Society in Computing” Meeting & Information Session: Tuesday, October 21 Time and Place: EE 119 at 5:00 p.m. Join us on Tuesday for FREE FOOD and good information: Guest Speaker: Beth Green, Wal-Mart ISD Recruiting Who & What is Wal-Mart hiring? For more info, visit

Outline Transform and conquer Technique Examples

Transform and Conquer Start with a problem instance PI Change or transform PI into SI Simpler Instance So that solving SI solves PI Solve the simpler SI

Transformation in more detail Instance Simplification Make simpler or more convenient Representation Change Different representation of the same problem Problem Reduction Instance of a problem that has already been solved

Classic Examples: Element Uniqueness Presorting Once a list is sorted, then it is easy to get some forms of information from it Element Uniqueness Determine if any two elements in a list are the same How? Sort and then check neighbors Cost? O(n log n) counting the sort!

Classic Examples: Mode Computing the Mode of a list of elements What is the mode? Most common occurring element How? Brute force method For each element count how often it occurs Track the largest occurring element so far

Classic Examples: Mode The O(n 2 ) solution mode_freq  0 mode_value  0 run_value  0 run_length  0 The algorithm at the board

Classic Examples: Mode A better solution using transform and conquer Sort first! Transforming the challenge into a simpler one Algorithm on Page 196 Cost?

Classic Examples: Searching vs. Sorting Given the cost of comparison based sorting is O(n log n) The cost of searching a sorted list is O(log n) How many searches through a length n list do we have to do to justify a sort?

Gaussian Elimination Classic Transform and conquer Transformation uses row operations Exchange two rows Replace an equation with an non-zero multiple Replace an equation with the sum or difference of itself and another equation Examples at the board