A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.15.

Slides:



Advertisements
Similar presentations
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.24.
Advertisements

Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
 The amount of time it takes a computer to solve a particular problem depends on:  The hardware capabilities of the computer  The efficiency of the.
Chapter 9: Searching, Sorting, and Algorithm Analysis
Analysis And Algorithms CMSC 201. Search Sometimes, we use the location of a piece of information in a list to store information. If I have the list [4,
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.16.
CS 263.  Classification of algorithm against a model pattern ◦ Each model demonstrate the performance scalability of an algorithm  Sorting algorithms.
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Dynamic Programming Optimization Problems Dynamic Programming Paradigm
Algorithmic Complexity 2 Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 Algorithms and Analysis CS 2308 Foundations of CS II.
Using Inverse Matrices Solving Systems. You can use the inverse of the coefficient matrix to find the solution. 3x + 2y = 7 4x - 5y = 11 Solve the system.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.8.
BIT Presentation 4.  An algorithm is a method for solving a class of problems.  While computer scientists think a lot about algorithms, the term.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.11.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.15.
1 Complexity Lecture Ref. Handout p
Searching – Linear and Binary Searches. Comparing Algorithms Should we use Program 1 or Program 2? Is Program 1 “fast”? “Fast enough”? P1P2.
1 Growth of Functions CS 202 Epp, section ??? Aaron Bloomfield.
ITEC 2620A Introduction to Data Structures
1 Ethics of Computing MONT 113G, Spring 2012 Session 13 Limits of Computer Science.
Ch 18 – Big-O Notation: Sorting & Searching Efficiencies Our interest in the efficiency of an algorithm is based on solving problems of large size. If.
Traversing an array 1.Definition 2.Use the for loop 3.Some new functions 4.Use the while loop 1.
Arrays Tonga Institute of Higher Education. Introduction An array is a data structure Definitions  Cell/Element – A box in which you can enter a piece.
Lecture 6: Problem Solving Dr John Levine Algorithms and Complexity February 10th 2006.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.19.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.8.
Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy Walters, and Godfrey Muganda Modified for use by MSU Dept. of Computer Science.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.32.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.30.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: Tel 3049.
Erdal Kose CC30.10 These slides are based of Prof. N. Yanofsky Lecture notes.
Lecture on Binary Search and Sorting. Another Algorithm Example SEARCHING: a common problem in computer science involves storing and maintaining large.
Big Oh Notation Greek letter Omicron (Ο) is used to denote the limit of asymptotic growth of an algorithm If algorithm processing time grows linearly with.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
Solving equations with polynomials – part 2. n² -7n -30 = 0 ( )( )n n 1 · 30 2 · 15 3 · 10 5 · n + 3 = 0 n – 10 = n = -3n = 10 =
CS 206 Introduction to Computer Science II 01 / 30 / 2009 Instructor: Michael Eckmann.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.10.
C++ How to Program, 7/e © by Pearson Education, Inc. All Rights Reserved.
1. Searching The basic characteristics of any searching algorithm is that searching should be efficient, it should have less number of computations involved.
Multiply Matrices Chapter 3.6. Matrix Multiplication Matrix multiplication is defined differently than matrix addition The matrices need not be of the.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.9.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.2.
Copyright © 2009 Curt Hill Look Ups A Recurring Theme.
3.5 Perform Basic Matrix Operations Add Matrices Subtract Matrices Solve Matric equations for x and y.
John Levine, Computer and Information Sciences, Strathclyde University 1 Algorithms and Complexity 2: Complexity Notation.
Algorithm Analysis with Big Oh ©Rick Mercer. Two Searching Algorithms  Objectives  Analyze the efficiency of algorithms  Analyze two classic algorithms.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.29.
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices.
1 5. Abstract Data Structures & Algorithms 5.6 Algorithm Evaluation.
Section 1: Problem solving AQA Computing A2 © Nelson Thornes 2009 Examples of problems with different time complexities Section 1.2: Comparing algorithms.
Brute Force A straightforward approach, usually based directly on the problem’s statement and definitions of the concepts involved Examples: Computing.
Brute Force II.
Searching – Linear and Binary Searches
Algorithmic Efficency
Lesson Objectives Aims Understand the following: The big O notation.
Intro to NP Completeness
Parallel Quadratic Sieve
Solve System by Linear Combination / Addition Method
Big O Notation.
A core Course on Modeling
Chapter 11 Limitations of Algorithm Power
ITEC 2620M Introduction to Data Structures
Introduction to Data Structures
Eigenvalues and Eigenvectors
3.6 Multiply Matrices.
Homework Check Everyone should have their homework out.
1.8 Matrices.
1.8 Matrices.
Presentation transcript:

A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.15

Scalability: to which extent can some characteristic dimensions of the problem increase, where the model still functions? Scale: n (=number of elements, states, records, time steps, …) Performance: O(1) – solving effort (SE) does not depend on n O(log n) – SE hardly depends on n O(n) – SE proportional to n O(n log n) – SE slightly worse than proportional O(n p ) – SE polynomial O(2 n ), O(n!), … – SE worse than polynomial Criteria for modeling: scalability

O(1) – solving effort (SE) independent of n O(log n) – SE hardly depends on n O(n) – SE proportional to n O(n log n) – SE slightly worse than proportional O(n p ) – SE polynomial O(2 n ), O(n!), … – SE worse than polynomial O(1) n Example: to find something in a database using indexing takes no more time if ther are more stored records. Compare this to using an index in a thick book: no need to browse over the pages.

Criteria for modeling: scalability O(1) – solving effort (SE) independent of n O(log n) – SE hardly depends on n O(n) – SE proportional to n O(n log n) – SE slightly worse than proportional O(n p ) – SE polynomial O(2 n ), O(n!), … – SE worse than polynomial O(log n) n Example: to find something in an ordered, non-indexed set takes place by repeatedly halving (cf. guessing a number between 0 and 1024: this takes no more than 10 higher-lower guesses). With N trials you search a set of size 2 N, so a set of size M is searched in log M trials.

Criteria for modeling: scalability O(1) – solving effort (SE) independent of n O(log n) – SE hardly depends on n O(n) – SE proportional to n O(n log n) – SE slightly worse than proportional O(n p ) – SE polynomial O(2 n ), O(n!), … – SE worse than polynomial O(n) n Many problems require that something (with a fixed amount of effort) needs do be done for each item in a set. In such cases, the total effort grows proportially with the size of the set.

Criteria for modeling: scalability O(1) – solving effort (SE) independent of n O(log n) – SE hardly depends on n O(n) – SE proportional to n O(n log n) – SE slightly worse than proportional O(n p ) – SE polynomial O(2 n ), O(n!), … – SE worse than polynomial O(n logn) n Sorted sets allow things to be done (e.g., searching) much faster. So if you frequently need to search some set, it may pay off to sort it once and keep it sorted. Sorting a set of n elements can be done in O(n log n) steps.

Criteria for modeling: scalability O(1) – solving effort (SE) independent of n O(log n) – SE hardly depends on n O(n) – SE proportional to n O(n log n) – SE slightly worse than proportional O(n p ) – SE polynomial O(2 n ), O(n!), … – SE worse than polynomial O(n p ) n The dot product of two vectors takes O(n) in the dimension n. Multiplying a vector with a matrix O(n 2 ). Multiplying two matrices O(n 3 ). Solving a linear set of equations O(n 3 ). Many of these operations allow alternative approaches to win some efficiency (). ( ).

Criteria for modeling: scalability O(1) – solving effort (SE) independenten of n O(log n) – SE hardly depends on n O(n) – SE proportional to n O(n log n) – SE slightly worse than proportional O(n p ) – SE polynomial O(2 n ), O(n!), … – SE worse than polynomial O(1) n Given n points; asked for the shortest route visiting them all (traveling salesman problem, TSP). Many problems can be transformed to this type.