Lecture01-intro

# Cost cost of computing a solution to a problem of a

• Notes
• 31

This preview shows page 26 - 31 out of 31 pages.

Cost § Cost of computing a solution to a problem of a particular size: (Work) Space How should this be measured? Time How should this be measured?

Subscribe to view the full document.

§ How to measure time cost? § Want to measure the algorithm , not the implementation § i.e., independent of: § computer speed § programming language § compiler quality, etc. Cost
Elementary Operation C c T op

Subscribe to view the full document.

Efficiency § Efficiency is how cost grows with the difficulty of the instance § “Difficulty” means “size” of the instance § i.e., the number of parameters needed to completely characterize the instance § Size of a list, matrix, etc. § Example: we expect the cost of sorting a list of 100 numbers to be worse than sorting 10 numbers ) ( ) ( n C c n T op
Orders of Growth § Suppose § How much longer will the algorithm run if we double the input size? 1 ( ) ( 1) 2 C n n n = - 2 2 2 1 2 1 2 1 ) 1 ( 2 1 ) ( n n n n n n C - = - = 4 2 1 ) 2 ( 2 1 ) ( ) 2 ( ) ( ) 2 ( 2 2 = n n n C c n C c n T n T op op

Subscribe to view the full document.

Orders of Growth § Implementation constant cop is irrelevant § Also, the coefficient ½ on C(n) cancelled § Order of growth describes the functional form of C(n) up to a constant multiple as n goes to infinity 4 2 1 ) 2 ( 2 1 ) ( ) 2 ( ) ( ) 2 ( 2 2 = n n n C c n C c n T n T op op
You've reached the end of this preview.
• Spring '08
• Jones,M
• Computer Science, Computational complexity theory, Elementary Operations

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern