Lecture 1Easy, Hard, Impossible!Handout Easy: Euclid Sequences Form a sequence of number pairs (integers) as follows: Begin with any two positive numbers.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Introduction to Algorithms NP-Complete
Section 9.1 – Sequences.
8.5 Factoring x 2 + bx + c. Factoring with Positives x 2 + 3x + 2 ◦Find two factors of 2 whose sum is 3. ◦Helps to make a list (x + 1)(x + 2) Factors.
Types of Algorithms.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Analysis of Algorithms
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
Calculus I – Math 104 The end is near!. Series approximations for functions, integrals etc.. We've been associating series with functions and using them.
Lecture # 38 Algorithms & Problem Solving: How Hard Can it Get?
The Theory of NP-Completeness
Section 7.4: Closures of Relations Let R be a relation on a set A. We have talked about 6 properties that a relation on a set may or may not possess: reflexive,
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
ITERATIVE CONSTRUCTS: DOLIST Dolist is an iterative construct (a loop statement) consisting of a variable declaration and a body The body states what happens.
Mar. 2015Easy, Hard, Impossible!Slide 1 Easy, Hard, Impossible! A Lecture in CE Freshman Seminar Series: Puzzling Problems in Computer Engineering.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
Apr. 2007Easy, Hard, Impossible!Slide 1 Easy, Hard, Impossible! A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering.
Revision Using Recursion1 Recursion. Revision Using Recursion2 Recall the Recursion Pattern Recursion: when a method calls itself Classic example--the.
Chapter 11: Limitations of Algorithmic Power
Ch 13 – Backtracking + Branch-and-Bound
Discrete Mathematics Recursion and Sequences
CSC 2300 Data Structures & Algorithms January 30, 2007 Chapter 2. Algorithm Analysis.
13.1 Sequences.
Lecture 5 Overview Does DES Work? Differential Cryptanalysis Idea – Use two plaintext that barely differ – Study the difference in the corresponding.
MATH 224 – Discrete Mathematics
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Factorial Notation For any positive integer n, n! means: n (n – 1) (n – 2)... (3) (2) (1) 0! will be defined as equal to one. Examples: 4! = =
Fundamentals of Algorithms MCS - 2 Lecture # 7
Lecture#16 Discrete Mathematics. Recursion Now, 1 is an odd positive integer by the definition base. With k = 1, = 3, so 3 is an odd positive integer.
February 4, 2005 Searching and Sorting Arrays. Searching.
Counting Techniques and Some Other Math Team Strategies Susan Schwartz Wildstrom Walt Whitman High School Bethesda, MD NCTM National Meeting April 6, 2001.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Lecture 4,5 Mathematical Induction and Fibonacci Sequences.
Dr Zhang Fall 2014 Fordham University
Sequences & Series Section 13.1 & Sequences A sequence is an ordered list of numbers, called terms. The terms are often arranged in a pattern.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
SEQUENCES A sequence is a function whose domain in the set of positive integers. So if you have a function but limited the domain to the set of positive.
NP-Complete problems.
Hard Problems Sanghyun Park Fall 2002 CSE, POSTECH.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Pythagorean Theorem – Prove It! Converse of Pythagorean Theorem 1.) Is a triangle with side measures of 30, 40, and 50 units a right triangle? Prove it!
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
LIMITATIONS OF ALGORITHM POWER
Make a list of numbers that begin with a ‘start number’ and increase by a fixed amount we will call the ‘jump number’. Let’s all use 3 as the start number.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Polynomials Count! CS Lecture 9 X1 X1 X2 X2 + + X3 X3.
Recursion1 © 2013 Goodrich, Tamassia, Goldwasser.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Exhaustive search Exhaustive search is simply a brute- force approach to combinatorial problems. It suggests generating each and every element of the problem.
CMSC201 Computer Science I for Majors Lecture 19 – Recursion (Continued) Prof. Katherine Gibson Prof. Jeremy Dixon Based on slides from UPenn’s.
The Theory of NP-Completeness
Recursion 5/4/2018 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M. H.
CMSC201 Computer Science I for Majors Lecture 20 – Recursion (Continued) Prof. Katherine Gibson Based on slides from UPenn’s CIS 110, and from previous.
Sequences and Series 9.1.
Number Systems.
EECS 203 Lecture 20 More Graphs.
Lecture Outline for Recurrences
Easy, Hard, Impossible! A Lecture in CE Freshman Seminar Series:
Chapter 11 Limitations of Algorithm Power
Section 2.1 Arithmetic Sequences and Series
Easy, Hard, Impossible! A Lecture in CE Freshman Seminar Series:
The Theory of NP-Completeness
CSC 380: Design and Analysis of Algorithms
Complexity Theory: Foundations
Presentation transcript:

Lecture 1Easy, Hard, Impossible!Handout Easy: Euclid Sequences Form a sequence of number pairs (integers) as follows: Begin with any two positive numbers as the first pair In each step, the next number pair consists of (1) the smaller of the current pair of values, and (2) their difference Stop when the two numbers in the pair become equal Challenge: Repeat this process for a few more starting number pairs and see if you can discover something about how the final number pair is related to the starting values (10, 15) (10, 5) (5, 5) (9, 23) (9, 14) (9, 5) (5, 4) (4, 1) (1, 3) (1, 2) (1, 1) (22, 6) (6, 16) (6, 10) (6, 4) (4, 2) (2, 2) Why is the process outlined above guaranteed to end?

Lecture 1Easy, Hard, Impossible!Handout Not So Easy: Fibonacci Sequences Form a sequence of numbers (integers) as follows: Begin with any two numbers as the first two elements In each step, the next number is the sum of the last two numbers already in the sequence Stop when you have generated the j th number (j is given) Challenge: See if you can find a formula that yields the j th number directly (i.e., without following the sequence) when we begin with j = 4 j = 9 j =

Lecture 1Easy, Hard, Impossible!Handout Very Hard: Collatz Sequences Form a sequence of numbers (integers) as follows: Begin with a given number To find the next number in each step, halve the current number if it is even or triple it and add 1 if it is odd Challenge: Repeat this process for 27 and some other starting values. See if you can discover something about how various sequences end; i.e., do all sequences end in the same way, fall into several categories, or do not show any overall pattern at all? The pattern repeats (5 steps to reach the end) (15 steps) (19 steps) Reference:

Lecture 1Easy, Hard, Impossible!Handout Two Other Easy-Looking Hard Problems The subset sum problem: Given a set of n numbers, determine whether there is a subset whose sum is a given value x S = {3, –4, 32, –25, 6, 10, –9, 50}x = 22 Can’t do fundamentally better than simply trying all 2 n subsets (exponential time, intractable for even moderately large n) The traveling salesperson problem: Given a set of n cities with known travel cost c ij between cities i and j, find a path of least cost that would take a salesperson through all cities, returning to the starting city A C D E F B In the worst case, must examine nearly all the (n – 1) ! cycles, which would require exponential time