57 Slides--Complexity classes

57 Slides--Complexity classes - CS103 HO#57...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS103 HO#57 Slides--Complexity Classes May 25, 2010 1 maps to A B ¬ Solvable(A) ¬ Solvable(B) A language known not to be decidable A language whose decidability we are trying to determine If B D Then A D But A D So B D A m B Using Mapping Reductions: The Most Common Scenario Using Mapping Reductions: A Less Common Scenario maps to A B A language known to be decidable A language whose decidability we are trying to determine If B D Then A D A m B Solvable(B) Solvable(A) Big-O Notation • The exact running time of an algorithm may be a complicated function of the length of its input, so we typically just estimate it. • The question we generally ask is: how does the running time of an algorithm change as we size of the input gets very large. This is called asymptotic analysis. Big-O Notation Suppose the running time, where n is the length of the input, is f(n) = 6n 3 + 2n 2 + 20n + 45 6022045 45 2000 20000 6000000 100 164445 45 600 1800 162000 30 49245 45 400 800 48000 20 6445 45 200 200 6000 10 73 45 20 2 6 1 n 6n 3 2n 2 20n 45 f(n) Big-O Notation Let f and g be functions f, g: N R + . We say that f(n) = O(g(n)) if there are positive integers c and n such that for every integer n > n f(n) c g(n). We say that g(n) is an asymptotic upper bound for f(n). c g(n) f(n) n Big-O Notation Suppose the running time, where n is the length of the input, is f(n) = 6n 3 + 2n 2 + 20n + 45 For the right c , f(n) 7n 3 We say that f(n) = O(n 3 ) , meaning that f(n) n 3 if we disregard the lower order terms and a constant factor. Big-O supresses the constant on the high-order term. CS103 HO#57 Slides--Complexity Classes May 25, 2010 2 Big-O Notation Suppose the running time, where n is the length of the input, is f(n) = 6n 3 + 2n 2 + 20n + 45 We say that f(n) = O(n 3 ) , meaning that f(n) n 3 if we disregard the lower order terms and a constant factor....
View Full Document

This document was uploaded on 02/08/2011.

Page1 / 4

57 Slides--Complexity classes - CS103 HO#57...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online