Pseudocode Analysis. COMP3600/6466 Algorithms Lecture 5. Recursive Algorithms. Asymptotic Bounds for Recursions


 Julius Berry
 1 years ago
 Views:
Transcription
1 COMP600/6466 Algorithms Lecture 5 Pseudocode Analysis Iterative Recursive S 0 Dr. Hassan Hijazi Prof. Weifa Liang Recursive Algorithms Asymptotic Bounds for Recursions Total running time = Sum of times in each node of the recursion tree. Substitution method: Guess a bound and use mathematical induction to prove that the guess is correct. Can also be written as a recursion! For example, the running time T (n) can be expressed: ( (1) if n is small, T (n) = T (b n c)+ (n) otherwise. Recursiontree method: Convert the recurrence into a tree, Use this tree to rewrite the function as a sum, Use techniques of bounding summations to solve the recurrence. We usually write: T (n) =T (b n c)+ (n) assuming that T (n) is constant for small values of n. 4
2 Substitution method The substitution method consists of two steps: Step 1. Guess the form of the solution. Step. Use mathematical induction to show that the guess is correct. It can be used to obtain either upper or lower bounds on a recurrence. A good guess is vital when applying this method. If the initial guess is wrong, it needs to be adjusted later. Mathematical Induction To prove that T (n) =O(g(n)) (Same principle for and ): Base case: Prove that there exists positive constants c, n 0 and n b such that T (n ) apple c g(n ) 8n s.t. n 0 apple n apple n b. Induction: Assume that T (n ) apple c g(n ) 8n s.t. n b apple n apple n, then show that T (n + 1) apple c g(n + 1). In the base case check for conditions on c and n 0. In the induction step, after substituting T (n + 1) using the recursion, make sure that the resulting number is n 0 and apple n. 5 COMP600/ Lecture Exercise 5.1 Using the substitution method, prove that T (n) =T + n = O(n log n) Complete the proof by hand Wrong Proofs T (n) =T + n T (n) =O(n)? 1. Base case: Let n b = 4, T (n )=c apple c n, n 0 apple n apple n b if c c, n Inductive step and substitution: assume that T (n ) apple c n, 8n s.t. n b apple n apple n, n +1 T (n + 1) = T apple c n +1 apple c(n + 1) apple (c + 1)(n + 1) = O(n) since n 0 apple n +1 Not same c! apple n, 8n n b 7 8
3 Wrong Proofs T (n) =T + n T (n) =O(n lg n)? Right Proof T (n) =T + n T (n) =O(n lg n)? 1. Base case: Let n b =, T (n )=c apple c n lg n, n 0 apple n apple n b if c c, n 0.. Inductive step and substitution: assume that T (n ) apple c n lg n, 8n s.t. n b apple n apple n, n +1 T (n + 1) = T n +1 apple c lg n +1 since n 0 apple n +1 apple n, 8n n b apple c(n + 1) lg(n + 1) c(lg )(n + 1) since lg a b =lga lg b apple c(n + 1) lg(n + 1) (n + 1)(c 1) (since lg = 1) apple c(n + 1) lg(n + 1) if c 1. Not True! Take n = nb 1. Base case: Let n b = 4, T (n )=c apple c n lg n, n 0 apple n apple n b if c c, n 0.. Inductive step and substitution: assume that T (n ) apple c n lg n, 8n s.t. n b apple n apple n, n +1 T (n + 1) = T n +1 apple c lg n +1 since n 0 apple n +1 apple n, 8n n b apple c(n + 1) lg(n + 1) c(lg )(n + 1) since lg a b =lga lg b apple c(n + 1) lg(n + 1) (n + 1)(c 1) (since lg = 1) apple c(n + 1) lg(n + 1) if c Exercise 5. Exercise 5. T (n) =T Show that l n m + T = O(n) Give an asymptotic upper bound for l n m T (n) =T + T +5 Complete the proof by hand Complete the proof by hand 11 1
4 Asymptotic Bounds for Recursions Also called iteration method How to make a good guess? Can be used to guess or find the solution Experience When guessing, we can make simplifying assumptions (e.g., ignore floor and ceiling) The goal is to expand the recurrence and express it as a summation 1 14 Consider the recurrence T (n) =T + cn 4 Simplification: we assume that n is a power of 4. 15
5 At depth d the subproblem size is n 4 d. We stop building the tree when we reach subproblem size 1, so when n = 1. 4 d This gives i = log 4 n.thus,thedepthof the tree is log 4 n. The number of levels is log 4 n + 1. d The cost at depth d is cn, except for the bottom level, whose cost is its number of nodes times T (1), that is, log 4 n T (1) = n log 4 T (1) = (n log 4 ). T (n) = Note that log 4 n 1 X i=0 log 4 n 1 X i=0 This leads to: i cn + (n log 4 )=cn log 4 n 1 X i=0 i + (n log 4 ). i = (largest term) = (1) (decreasing geometric sum). Finally, observe that n grows faster than n log 4 as its exponent is larger. Thus, T (n) = (n ) n T (n) =T + T n + cn Why is the depth of this tree log n? 19 0
6 Do all paths from the root to tree leaves have the same length? If all paths were equal to the longest path, what would the cost of the last level be? 1 Exercise 5.4 n T (n) =T + T n + cn Prove that T (n) =O(n lg n) by induction.
the recursiontree method
the recursion method recurrence into a 1 recurrence into a 2 MCS 360 Lecture 39 Introduction to Data Structures Jan Verschelde, 22 November 2010 recurrence into a The for consists of two steps: 1 Guess
More informationIntro. to the DivideandConquer Strategy via Merge Sort CMPSC 465 CLRS Sections 2.3, Intro. to and various parts of Chapter 4
Intro. to the DivideandConquer Strategy via Merge Sort CMPSC 465 CLRS Sections 2.3, Intro. to and various parts of Chapter 4 I. Algorithm Design and DivideandConquer There are various strategies we
More informationDivideandConquer Algorithms Part Four
DivideandConquer Algorithms Part Four Announcements Problem Set 2 due right now. Can submit by Monday at 2:15PM using one late period. Problem Set 3 out, due July 22. Play around with divideandconquer
More informationMany algorithms, particularly divide and conquer algorithms, have time complexities which are naturally
Recurrence Relations Many algorithms, particularly divide and conquer algorithms, have time complexities which are naturally modeled by recurrence relations. A recurrence relation is an equation which
More informationCS473  Algorithms I
CS473  Algorithms I Lecture 4 The DivideandConquer Design Paradigm View in slideshow mode 1 Reminder: Merge Sort Input array A sort this half sort this half Divide Conquer merge two sorted halves Combine
More informationDivide And Conquer Algorithms
CSE341T/CSE549T 09/10/2014 Lecture 5 Divide And Conquer Algorithms Recall in last lecture, we looked at one way of parallelizing matrix multiplication. At the end of the lecture, we saw the reduce SUM
More informationCSC148 Lecture 8. Algorithm Analysis Binary Search Sorting
CSC148 Lecture 8 Algorithm Analysis Binary Search Sorting Algorithm Analysis Recall definition of Big Oh: We say a function f(n) is O(g(n)) if there exists positive constants c,b such that f(n)
More informationCS 102: SOLUTIONS TO DIVIDE AND CONQUER ALGORITHMS (ASSGN 4)
CS 10: SOLUTIONS TO DIVIDE AND CONQUER ALGORITHMS (ASSGN 4) Problem 1. a. Consider the modified binary search algorithm so that it splits the input not into two sets of almostequal sizes, but into three
More informationDivide and Conquer. Textbook Reading Chapters 4, 7 & 33.4
Divide d Conquer Textook Reading Chapters 4, 7 & 33.4 Overview Design principle Divide d conquer Proof technique Induction, induction, induction Analysis technique Recurrence relations Prolems Sorting
More informationCost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:
CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm
More informationCSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015
CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Linda Shapiro Today Registration should be done. Homework 1 due 11:59 pm next Wednesday, January 14 Review math essential
More informationSection IV.1: Recursive Algorithms and Recursion Trees
Section IV.1: Recursive Algorithms and Recursion Trees Definition IV.1.1: A recursive algorithm is an algorithm that solves a problem by (1) reducing it to an instance of the same problem with smaller
More informationFrom Last Time: Remove (Delete) Operation
CSE 32 Lecture : More on Search Trees Today s Topics: Lazy Operations Run Time Analysis of Binary Search Tree Operations Balanced Search Trees AVL Trees and Rotations Covered in Chapter of the text From
More informationAppendix: Solving Recurrences [Fa 10] Wil Wheaton: Embrace the dark side! Sheldon: That s not even from your franchise!
Change is certain. Peace is followed by disturbances; departure of evil men by their return. Such recurrences should not constitute occasions for sadness but realities for awareness, so that one may be
More informationWorksheet on induction Calculus I Fall 2006 First, let us explain the use of for summation. The notation
Worksheet on induction MA113 Calculus I Fall 2006 First, let us explain the use of for summation. The notation f(k) means to evaluate the function f(k) at k = 1, 2,..., n and add up the results. In other
More informationData Structures and Algorithms Written Examination
Data Structures and Algorithms Written Examination 22 February 2013 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where
More informationCS473  Algorithms I
CS473  Algorithms I Lecture 9 Sorting in Linear Time View in slideshow mode 1 How Fast Can We Sort? The algorithms we have seen so far: Based on comparison of elements We only care about the relative
More information5.2 The Master Theorem
170 CHAPTER 5. RECURSION AND RECURRENCES 5.2 The Master Theorem Master Theorem In the last setion, we saw three different kinds of behavior for reurrenes of the form at (n/2) + n These behaviors depended
More informationThe UnionFind Problem Kruskal s algorithm for finding an MST presented us with a problem in datastructure design. As we looked at each edge,
The UnionFind Problem Kruskal s algorithm for finding an MST presented us with a problem in datastructure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints
More informationThe Tower of Hanoi. Recursion Solution. Recursive Function. Time Complexity. Recursive Thinking. Why Recursion? n! = n* (n1)!
The Tower of Hanoi Recursion Solution recursion recursion recursion Recursive Thinking: ignore everything but the bottom disk. 1 2 Recursive Function Time Complexity Hanoi (n, src, dest, temp): If (n >
More informationFull and Complete Binary Trees
Full and Complete Binary Trees Binary Tree Theorems 1 Here are two important types of binary trees. Note that the definitions, while similar, are logically independent. Definition: a binary tree T is full
More informationBinary Search Trees CMPSC 122
Binary Search Trees CMPSC 122 Note: This notes packet has significant overlap with the first set of trees notes I do in CMPSC 360, but goes into much greater depth on turning BSTs into pseudocode than
More informationIntroduction to Algorithms March 10, 2004 Massachusetts Institute of Technology Professors Erik Demaine and Shafi Goldwasser Quiz 1.
Introduction to Algorithms March 10, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik Demaine and Shafi Goldwasser Quiz 1 Quiz 1 Do not open this quiz booklet until you are directed
More informationLoop Invariants and Binary Search
Loop Invariants and Binary Search Chapter 4.3.3 and 9.3.11  Outline Ø Iterative Algorithms, Assertions and Proofs of Correctness Ø Binary Search: A Case Study  2  Outline Ø Iterative Algorithms, Assertions
More informationData Structures. Algorithm Performance and Big O Analysis
Data Structures Algorithm Performance and Big O Analysis What s an Algorithm? a clearly specified set of instructions to be followed to solve a problem. In essence: A computer program. In detail: Defined
More informationSECTION 102 Mathematical Induction
73 0 Sequences and Series 6. Approximate e 0. using the first five terms of the series. Compare this approximation with your calculator evaluation of e 0.. 6. Approximate e 0.5 using the first five terms
More informationAlgorithms and Data Structures
Algorithms and Data Structures CMPSC 465 LECTURES 2021 Priority Queues and Binary Heaps Adam Smith S. Raskhodnikova and A. Smith. Based on slides by C. Leiserson and E. Demaine. 1 Trees Rooted Tree: collection
More informationCMPS 102 Solutions to Homework 1
CMPS 0 Solutions to Homework Lindsay Brown, lbrown@soe.ucsc.edu September 9, 005 Problem.. p. 3 For inputs of size n insertion sort runs in 8n steps, while merge sort runs in 64n lg n steps. For which
More informationFinding the n th digit in a sequence of positive integers placed in a row in ascending order.
Katedralskolan, Uppsala Finding the n th digit in a sequence of positive integers placed in a row in ascending order. By Artem Los 12345...? Candidate number: 121032 Supervisor: Erik Östergren Page count:
More informationOutline BST Operations Worst case Average case Balancing AVL Redblack Btrees. Binary Search Trees. Lecturer: Georgy Gimel farb
Binary Search Trees Lecturer: Georgy Gimel farb COMPSCI 220 Algorithms and Data Structures 1 / 27 1 Properties of Binary Search Trees 2 Basic BST operations The worstcase time complexity of BST operations
More informationMath 115 Spring 2011 Written Homework 5 Solutions
. Evaluate each series. a) 4 7 0... 55 Math 5 Spring 0 Written Homework 5 Solutions Solution: We note that the associated sequence, 4, 7, 0,..., 55 appears to be an arithmetic sequence. If the sequence
More informationFindTheNumber. 1 FindTheNumber With Comps
FindTheNumber 1 FindTheNumber With Comps Consider the following twoperson game, which we call FindTheNumber with Comps. Player A (for answerer) has a number x between 1 and 1000. Player Q (for questioner)
More informationAnalysis of Algorithms: The Nonrecursive Case
Analysis of Algorithms: The Nonrecursive Case Key topics: * Introduction * Generalizing Running Time * Doing a Timing Analysis * BigOh Notation * BigOh Operations * Analyzing Some Simple Programs 
More informationLecture 1: Course overview, circuits, and formulas
Lecture 1: Course overview, circuits, and formulas Topics in Complexity Theory and Pseudorandomness (Spring 2013) Rutgers University Swastik Kopparty Scribes: John Kim, Ben Lund 1 Course Information Swastik
More informationRecursive Algorithms. Recursion. Motivating Example Factorial Recall the factorial function. { 1 if n = 1 n! = n (n 1)! if n > 1
Recursion Slides by Christopher M Bourke Instructor: Berthe Y Choueiry Fall 007 Computer Science & Engineering 35 Introduction to Discrete Mathematics Sections 717 of Rosen cse35@cseunledu Recursive Algorithms
More informationGrade Level Year Total Points Core Points % At Standard 9 2003 10 5 7 %
Performance Assessment Task Number Towers Grade 9 The task challenges a student to demonstrate understanding of the concepts of algebraic properties and representations. A student must make sense of the
More informationDynamic Programming Problem Set Partial Solution CMPSC 465
Dynamic Programming Problem Set Partial Solution CMPSC 465 I ve annotated this document with partial solutions to problems written more like a test solution. (I remind you again, though, that a formal
More informationSequential Data Structures
Sequential Data Structures In this lecture we introduce the basic data structures for storing sequences of objects. These data structures are based on arrays and linked lists, which you met in first year
More informationWhy? A central concept in Computer Science. Algorithms are ubiquitous.
Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online
More informationGRAPH THEORY LECTURE 4: TREES
GRAPH THEORY LECTURE 4: TREES Abstract. 3.1 presents some standard characterizations and properties of trees. 3.2 presents several different types of trees. 3.7 develops a counting method based on a bijection
More informationLecture 4: Properties of and Rules for
Lecture 4: Properties of and Rules for Asymptotic BigOh, BigOmega, and BigTheta Notation Georgy Gimel farb COMPSCI 220 Algorithms and Data Structures 1 / 13 1 Time complexity 2 BigOh rules Scaling
More informationSolutions of Equations in One Variable. FixedPoint Iteration II
Solutions of Equations in One Variable FixedPoint Iteration II Numerical Analysis (9th Edition) R L Burden & J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University c 2011
More informationClosest Pair Problem
Closest Pair Problem Given n points in ddimensions, find two whose mutual distance is smallest. Fundamental problem in many applications as well as a key step in many algorithms. p q A naive algorithm
More informationQuiz 1 Solutions. (a) T F The height of any binary search tree with n nodes is O(log n). Explain:
Introduction to Algorithms March 9, 2011 Massachusetts Institute of Technology 6.006 Spring 2011 Professors Erik Demaine, Piotr Indyk, and Manolis Kellis Quiz 1 Solutions Problem 1. Quiz 1 Solutions True
More informationSection 62 Mathematical Induction
6 Mathematical Induction 457 In calculus, it can be shown that e x k0 x k k! x x x3!! 3!... xn n! where the larger n is, the better the approximation. Problems 6 and 6 refer to this series. Note that
More informationA Note on Maximum Independent Sets in Rectangle Intersection Graphs
A Note on Maximum Independent Sets in Rectangle Intersection Graphs Timothy M. Chan School of Computer Science University of Waterloo Waterloo, Ontario N2L 3G1, Canada tmchan@uwaterloo.ca September 12,
More informationPolynomials and the Fast Fourier Transform (FFT) Battle Plan
Polynomials and the Fast Fourier Transform (FFT) Algorithm Design and Analysis (Wee 7) 1 Polynomials Battle Plan Algorithms to add, multiply and evaluate polynomials Coefficient and pointvalue representation
More informationAnalysis of Algorithms I: Binary Search Trees
Analysis of Algorithms I: Binary Search Trees Xi Chen Columbia University Hash table: A data structure that maintains a subset of keys from a universe set U = {0, 1,..., p 1} and supports all three dictionary
More informationA binary heap is a complete binary tree, where each node has a higher priority than its children. This is called heaporder property
CmSc 250 Intro to Algorithms Chapter 6. Transform and Conquer Binary Heaps 1. Definition A binary heap is a complete binary tree, where each node has a higher priority than its children. This is called
More informationResearch Tools & Techniques
Research Tools & Techniques for Computer Engineering Ron Sass http://www.rcs.uncc.edu/ rsass University of North Carolina at Charlotte Fall 2009 1/ 106 Overview of Research Tools & Techniques Course What
More informationSection 3 Sequences and Limits, Continued.
Section 3 Sequences and Limits, Continued. Lemma 3.6 Let {a n } n N be a convergent sequence for which a n 0 for all n N and it α 0. Then there exists N N such that for all n N. α a n 3 α In particular
More informationClass Overview. CSE 326: Data Structures. Goals. Goals. Data Structures. Goals. Introduction
Class Overview CSE 326: Data Structures Introduction Introduction to many of the basic data structures used in computer software Understand the data structures Analyze the algorithms that use them Know
More information1/1 7/4 2/2 12/7 10/30 12/25
Binary Heaps A binary heap is dened to be a binary tree with a key in each node such that: 1. All leaves are on, at most, two adjacent levels. 2. All leaves on the lowest level occur to the left, and all
More informationThe LCA Problem Revisited
The LA Problem Revisited Michael A. Bender Martín Faracholton SUNY Stony Brook Rutgers University May 16, 2000 Abstract We present a very simple algorithm for the Least ommon Ancestor problem. We thus
More informationThe Running Time of Programs
CHAPTER 3 The Running Time of Programs In Chapter 2, we saw two radically different algorithms for sorting: selection sort and merge sort. There are, in fact, scores of algorithms for sorting. This situation
More informationDiscrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof. Harper Langston New York University
Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof Harper Langston New York University Proof and Counterexample Discovery and proof Even and odd numbers number n from Z is called
More informationLecture 10 UnionFind The unionnd data structure is motivated by Kruskal's minimum spanning tree algorithm (Algorithm 2.6), in which we needed two operations on disjoint sets of vertices: determine whether
More informationMathematical Induction. Lecture 1011
Mathematical Induction Lecture 1011 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach
More informationAnalysis of Algorithms, I
Analysis of Algorithms, I CSOR W4231.002 Eleni Drinea Computer Science Department Columbia University Thursday, February 26, 2015 Outline 1 Recap 2 Representing graphs 3 Breadthfirst search (BFS) 4 Applications
More informationBinary Search Trees > = Binary Search Trees 1. 2004 Goodrich, Tamassia
Binary Search Trees < 6 2 > = 1 4 8 9 Binary Search Trees 1 Binary Search Trees A binary search tree is a binary tree storing keyvalue entries at its internal nodes and satisfying the following property:
More information3. Mathematical Induction
3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)
More informationCSE 5311 Homework 3 Solution
CSE 5311 Homework 3 Solution Problem 15.11 Show that equation (15.4) follows from equation (15.3) and the initial condition T (0) = 1. We can verify that T (n) = n is a solution to the given recurrence
More informationcsci 210: Data Structures Recursion
csci 210: Data Structures Recursion Summary Topics recursion overview simple examples Sierpinski gasket Hanoi towers Blob check READING: GT textbook chapter 3.5 Recursion In general, a method of defining
More informationThe Goldberg Rao Algorithm for the Maximum Flow Problem
The Goldberg Rao Algorithm for the Maximum Flow Problem COS 528 class notes October 18, 2006 Scribe: Dávid Papp Main idea: use of the blocking flow paradigm to achieve essentially O(min{m 2/3, n 1/2 }
More informationLecture 1: Jan 14, 2015
E0 309: Topics in Complexity Theory Spring 2015 Lecture 1: Jan 14, 2015 Lecturer: Neeraj Kayal Scribe: Sumant Hegde and Abhijat Sharma 11 Introduction The theme of the course in this semester is Algebraic
More informationAlgorithm Design and Analysis Homework #1 Due: 5pm, Friday, October 4, 2013 TA email: ada@csie.ntu.edu.tw. === Homework submission instructions ===
Algorithm Design and Analysis Homework #1 Due: 5pm, Friday, October 4, 2013 TA email: ada@csie.ntu.edu.tw === Homework submission instructions === For Problem 1, commit your source code and a brief documentation
More informationInformation Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay
Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture  17 ShannonFanoElias Coding and Introduction to Arithmetic Coding
More informationSmall Maximal Independent Sets and Faster Exact Graph Coloring
Small Maximal Independent Sets and Faster Exact Graph Coloring David Eppstein Univ. of California, Irvine Dept. of Information and Computer Science The Exact Graph Coloring Problem: Given an undirected
More informationSimplified Analyses of Randomized Algorithms for Searching, Sorting, and Selection
Simplified Analyses of Randomized Algorithms for Searching, Sorting, and Selection i Michael T. Goodrich Roberto Tamassia Dept. of Info. & Computer Science Dept. of Computer Science University of California
More informationCSC 180 H1F Algorithm Runtime Analysis Lecture Notes Fall 2015
1 Introduction These notes introduce basic runtime analysis of algorithms. We would like to be able to tell if a given algorithm is timeefficient, and to be able to compare different algorithms. 2 Linear
More informationBinary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( BST) are of the form. P parent. Key. Satellite data L R
Binary Search Trees A Generic Tree Nodes in a binary search tree ( BST) are of the form P parent Key A Satellite data L R B C D E F G H I J The BST has a root node which is the only node whose parent
More informationrecursion, O(n), linked lists 6/14
recursion, O(n), linked lists 6/14 recursion reducing the amount of data to process and processing a smaller amount of data example: process one item in a list, recursively process the rest of the list
More information6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008
MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
More informationInduction Problems. Tom Davis November 7, 2005
Induction Problems Tom Davis tomrdavis@earthlin.net http://www.geometer.org/mathcircles November 7, 2005 All of the following problems should be proved by mathematical induction. The problems are not necessarily
More informationSeries Convergence Tests Math 122 Calculus III D Joyce, Fall 2012
Some series converge, some diverge. Series Convergence Tests Math 22 Calculus III D Joyce, Fall 202 Geometric series. We ve already looked at these. We know when a geometric series converges and what it
More informationHOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!
Math 7 Fall 205 HOMEWORK 5 SOLUTIONS Problem. 2008 B2 Let F 0 x = ln x. For n 0 and x > 0, let F n+ x = 0 F ntdt. Evaluate n!f n lim n ln n. By directly computing F n x for small n s, we obtain the following
More information6.3 Conditional Probability and Independence
222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted
More informationIntroduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24
Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24 The final exam will cover seven topics. 1. greedy algorithms 2. divideandconquer algorithms
More informationCS/COE 1501 http://cs.pitt.edu/~bill/1501/
CS/COE 1501 http://cs.pitt.edu/~bill/1501/ Lecture 01 Course Introduction Metanotes These notes are intended for use by students in CS1501 at the University of Pittsburgh. They are provided free of charge
More informationL  Standard Letter Grade P  Pass/No Pass Repeatability: N  Course may not be repeated
Course: MATH 26 Division: 10 Also Listed As: 200930, INACTIVE COURSE Short Title: Full Title: DISCRETE MATHEMATIC Discrete Mathematics Contact Hours/Week Lecture: 4 Lab: 0 Other: 0 Total: 4 4 Number of
More informationMerge Sort. 2004 Goodrich, Tamassia. Merge Sort 1
Merge Sort 7 2 9 4 2 4 7 9 7 2 2 7 9 4 4 9 7 7 2 2 9 9 4 4 Merge Sort 1 DivideandConquer Divideand conquer is a general algorithm design paradigm: Divide: divide the input data S in two disjoint subsets
More informationBinary Search. Search for x in a sorted array A.
Divide and Conquer A general paradigm for algorithm design; inspired by emperors and colonizers. Threestep process: 1. Divide the problem into smaller problems. 2. Conquer by solving these problems. 3.
More informationAlgorithms. Margaret M. Fleck. 18 October 2010
Algorithms Margaret M. Fleck 18 October 2010 These notes cover how to analyze the running time of algorithms (sections 3.1, 3.3, 4.4, and 7.1 of Rosen). 1 Introduction The main reason for studying bigo
More informationInduction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition
Induction Margaret M. Fleck 10 October 011 These notes cover mathematical induction and recursive definition 1 Introduction to induction At the start of the term, we saw the following formula for computing
More information3.1. RATIONAL EXPRESSIONS
3.1. RATIONAL EXPRESSIONS RATIONAL NUMBERS In previous courses you have learned how to operate (do addition, subtraction, multiplication, and division) on rational numbers (fractions). Rational numbers
More information1 23 Trees: The Basics
CS10: Data Structures and ObjectOriented Design (Fall 2013) November 1, 2013: 23 Trees: Inserting and Deleting Scribes: CS 10 Teaching Team Lecture Summary In this class, we investigated 23 Trees in
More informationToday s Outline. Exercise. Binary Search Analysis. Linear Search Analysis. Asymptotic Analysis. Analyzing Code. Announcements. Asymptotic Analysis
Today s Outline Announcements Assignment #1 due Thurs, Oct 7 at 11:45pm Asymptotic Analysis Asymptotic Analysis CSE 7 Data Structures & Algorithms Ruth Anderson Autumn 2010 Exercise Analyzing Code bool
More informationFACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY
FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY LINDSEY R. BOSKO I would like to acknowledge the assistance of Dr. Michael Singer. His guidance and feedback were instrumental in completing this
More informationCOMP3420: Advanced Databases and Data Mining. Classification and prediction: Introduction and Decision Tree Induction
COMP3420: Advanced Databases and Data Mining Classification and prediction: Introduction and Decision Tree Induction Lecture outline Classification versus prediction Classification A two step process Supervised
More informationA single minimal complement for the c.e. degrees
A single minimal complement for the c.e. degrees Andrew Lewis Leeds University, April 2002 Abstract We show that there exists a single minimal (Turing) degree b < 0 s.t. for all c.e. degrees 0 < a < 0,
More informationMathematical induction. Niloufar Shafiei
Mathematical induction Niloufar Shafiei Mathematical induction Mathematical induction is an extremely important proof technique. Mathematical induction can be used to prove results about complexity of
More informationFractions and Decimals
Fractions and Decimals Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles December 1, 2005 1 Introduction If you divide 1 by 81, you will find that 1/81 =.012345679012345679... The first
More informationCS335 Program2: ConvexHulls A DivideandConquer Algorithm 15 points Due: Tues, October 6
CS335 Program2: ConvexHulls A DivideandConquer Algorithm 15 points Due: Tues, October 6 Convex Hulls There is a complex mathematical definition of a convex hull, but the informal definition is sufficient
More informationAlgorithms Chapter 12 Binary Search Trees
Algorithms Chapter 1 Binary Search Trees Outline Assistant Professor: Ching Chi Lin 林 清 池 助 理 教 授 chingchi.lin@gmail.com Department of Computer Science and Engineering National Taiwan Ocean University
More informationWRITING PROOFS. Christopher Heil Georgia Institute of Technology
WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this
More informationRandomized algorithms
Randomized algorithms March 10, 2005 1 What are randomized algorithms? Algorithms which use random numbers to make decisions during the executions of the algorithm. Why would we want to do this?? Deterministic
More informationCircles in Triangles. This problem gives you the chance to: use algebra to explore a geometric situation
Circles in Triangles This problem gives you the chance to: use algebra to explore a geometric situation A This diagram shows a circle that just touches the sides of a right triangle whose sides are 3 units,
More information2.3 Scheduling jobs on identical parallel machines
2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed
More information9.2 Summation Notation
9. Summation Notation 66 9. Summation Notation In the previous section, we introduced sequences and now we shall present notation and theorems concerning the sum of terms of a sequence. We begin with a
More informationThis assignment will help you to prepare for Algebra 1 by reviewing some of the things you learned in Middle School. If you cannot remember how to complete a specific problem, there is an example at the
More information