Using Molecular Biology to Teach Computer Science

Slides:



Advertisements
Similar presentations
Algorithms Algorithm: what is it ?. Algorithms Algorithm: what is it ? Some representative problems : - Interval Scheduling.
Advertisements

Algorithmic Complexity Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Scott Grissom, copyright 2004 Chapter 5 Slide 1 Analysis of Algorithms (Ch 5) Chapter 5 focuses on: algorithm analysis searching algorithms sorting algorithms.
1 Essential Computing for Bioinformatics Bienvenido Vélez UPR Mayaguez Lecture 4 High-level Programming with Python Part I: Controlling the flow of your.
Concept of Basic Time Complexity Problem size (Input size) Time complexity analysis.
Analysis of Algorithms 7/2/2015CS202 - Fundamentals of Computer Science II1.
Analysis of Algorithm.
Elementary Data Structures and Algorithms
Algorithmic Complexity Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Analysis of Algorithms CPS212 Gordon College. Measuring the efficiency of algorithms There are 2 algorithms: algo1 and algo2 that produce the same results.
Algorithmic Complexity 3 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CS Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a.
Algorithm Analysis (Big O)
COMP s1 Computing 2 Complexity
MARC: Developing Bioinformatics Programs July 2009 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
Time Complexity Dr. Jicheng Fu Department of Computer Science University of Central Oklahoma.
1 Chapter 24 Developing Efficient Algorithms. 2 Executing Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
{ CS203 Lecture 7 John Hurley Cal State LA. 2 Execution Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
 The following material is the result of a curriculum development effort to provide a set of courses to support bioinformatics efforts involving students.
Analysis of Algorithms These slides are a modified version of the slides used by Prof. Eltabakh in his offering of CS2223 in D term 2013.
Growth of Functions. Asymptotic Analysis for Algorithms T(n) = the maximum number of steps taken by an algorithm for any input of size n (worst-case runtime)
MARC: Developing Bioinformatics Programs July 2009 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
Algorithm Analysis (Big O)
تصميم وتحليل الخوارزميات عال311 Chapter 3 Growth of Functions
COM S 228 Algorithms and Analysis Instructor: Ying Cai Department of Computer Science Iowa State University Office: Atanasoff 201.
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
1 Chapter 2 Algorithm Analysis All sections. 2 Complexity Analysis Measures efficiency (time and memory) of algorithms and programs –Can be used for the.
Analysis of Algorithms & Recurrence Relations. Recursive Algorithms Definition –An algorithm that calls itself Components of a recursive algorithm 1.Base.
Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning with Python 1 Introduction to Python programming for Bioinformatics.
1 Chapter 2 Algorithm Analysis Reading: Chapter 2.
MARC: Developing Bioinformatics Programs Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning.
Analysis of Algorithms Spring 2016CS202 - Fundamentals of Computer Science II1.
GC 211:Data Structures Week 2: Algorithm Analysis Tools Slides are borrowed from Mr. Mohammad Alqahtani.
MARC: Developing Bioinformatics Programs June 2012 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Using Molecular Biology to Teach Computer Science High-level Programming with Python Finding Patterns.
High-level Programming with Python Expressions and Variables Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer.
MARC: Developing Bioinformatics Programs Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning.
MARC: Developing Bioinformatics Programs Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning.
Lecture 3COMPSCI.220.S1.T Running Time: Estimation Rules Running time is proportional to the most significant term in T(n) Once a problem size.
(Complexity) Analysis of Algorithms Algorithm Input Output 1Analysis of Algorithms.
MARC: Developing Bioinformatics Programs June 2012 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
Algorithm Analysis 1.
Chapter 2 Algorithm Analysis
Using Molecular Biology to Teach Computer Science
Analysis of Algorithms
COP 3503 FALL 2012 Shayan Javed Lecture 15
GC 211:Data Structures Week 2: Algorithm Analysis Tools
Introduction to Analysis of Algorithms
Analysis of Algorithms
Computer Science 112 Fundamentals of Programming II
Introduction to Algorithms
Introduction to Analysis of Algorithms
GC 211:Data Structures Algorithm Analysis Tools
CMPT 120 Topic: Searching – Part 1
Essential Computing for Bioinformatics
Essential BioPython Retrieving Sequences from the Web
Recursion
Introduction to Algorithms
What/how do we care about a program?
GC 211:Data Structures Algorithm Analysis Tools
Data Structures Review Session
Analysis of Algorithms
Algorithm Analysis and Design
Analyzing an Algorithm Computing the Order of Magnitude Big O Notation
Algorithmic Complexity
Time Complexity Lecture 14 Sec 10.4 Thu, Feb 22, 2007.
Order Statistics Def: Let A be an ordered set containing n elements. The i-th order statistic is the i-th smallest element. Minimum: 1st order statistic.
And now for something completely different . . .
Analysis of Algorithms
Presentation transcript:

Using Molecular Biology to Teach Computer Science Runtime Complexity Measuring the Efficiency of Algorthms MARC: Developing Bioinformatics Programs Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning with Python

Essential Computing for Bioinformatics

Runtime Complexity - 'Big O' Notation def fact(n): if (n==0): return 1 else: return n * fact(n - 1) How 'fast' is this function? Can we come up with a more efficient version? How can we measure 'efficiency' Can we compare algorithms independently from a specific implementation, software or hardware? These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center

How about Comparing Actual Runtimes? Idea: Run each algorithm on same input and compare execution times Must account for differences such as: Hardware Computing Capacity and Efficiency Operating System Efficiency Compiler Optimization and othe PL issues Computer Loads Programmer Skill Want to compare algorithms even before they are implemented!

Runtime Complexity - 'Big O' Notation Big Idea Measure the number of steps taken by the algorithm as an asymptotic function of the size of its input What is a step? How can we measure the size of an input? Answer in both cases: YOU CAN DEFINE THESE! These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center

'Big O' Notation - Factorial Example A 'step' is a function call to fact The size of an input value n is n itself def fact(n): if (n==0): return 1 else: return n * fact(n - 1) Step 1: Count the number of steps for input n T(0) = 0 T(n) = T(n-1) + 1 = (T(n-2) + 1) + 1 = … = T(n-n) + n = T(0) + n = 0 + n = n Step 2: Find the asymptotic function A.K.A Linear Function T(n) = O(n) These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center

Various Asymptotic Runtimes

Some Famous Algorithms and their Runtimes Sequentially searching a list of n objects O(n) comparisons Binary search within sorted array of n objects O(logn) comparisons QuickSort an array of n objects using comparisons O(nlogn) comparisons Aligning two sequences of length n and m: BLAST, NW, SW, FASTA O(nm) matrix Traveling Salesman Problem O(2n)