Announcements for This Lecture

Size: px
Start display at page:

Download "Announcements for This Lecture"

Transcription

1 Lecture 26 Sorting

2 Announcements for Tis Lecture Prelim/Finals Prelims in andbac room Gates Hall 216 Open business ours Get tem any day tis wee Final: Survey Dec still 17 up t for 2:00-4:30pm A5 Study All new guide questions! by end of wee Eac person must answer Conflict wit Final time A6 due Monday, Dec. 9 Submit to Final Conflict assignment 2.5 wees including on CMS T-Day 2 wees witout te brea Must be in by December 10t Assignments/Lab A6 will be graded by Turs. Will give grade breadown Will review survey too A7 is due next Wednesday One wee left Keep up wit deadlines Lab 13 is optional Good study for te final Consultant ours still open 12/2/14 Sorting 2

3 Linear Searc Vague: Find first occurrence of v in b[..-1]. 12/2/14 Sorting 3

4 Linear Searc Vague: Find first occurrence of v in b[..-1]. Better: Store an integer in i to trutify result condition post: post: 1. v is not in b[..i-1] 2. i = OR v = b[i] 12/2/14 Sorting 4

5 Linear Searc Vague: Find first occurrence of v in b[..-1]. Better: Store an integer in i to trutify result condition post: post: 1. v is not in b[..i-1] 2. i = OR v = b[i] pre: b post: b i v not ere v 12/2/14 Sorting 5

6 Linear Searc Vague: Find first occurrence of v in b[..-1]. Better: Store an integer in i to trutify result condition post: post: 1. v is not in b[..i-1] 2. i = OR v = b[i] pre: b post: b i v not ere v OR b v not ere i 12/2/14 Sorting 6

7 Linear Searc pre: b post: b i v not ere v OR i b v not ere inv: b i v not ere 12/2/14 Sorting 7

8 Linear Searc def linear_searc(b,c,): """Returns: first occurrence of c in b[..]""" # Store in i te index of te first c in b[..] i = # invariant: c is not in b[0..i-1] wile i < len(b) and b[i]!= c: i = i + 1 # post: c is not in b[..i-1] # i >= len(b) or b[i] == c return i if i < len(b) else -1 Analyzing te Loop 1. Does te initialization mae inv true 2. Is post true wen inv is true and condition is false 3. Does te repetend mae progress 4. Does te repetend eep te invariant inv true 12/2/14 Sorting 8

9 Binary Searc Vague: Loo for v in sorted sequence segment b[..]. 12/2/14 Sorting 9

10 Binary Searc Vague: Loo for v in sorted sequence segment b[..]. Better: Precondition: b[..-1] is sorted (in ascending order). Postcondition: b[..i] < v and v <= b[i+1..-1] Below, te array is in non-descending order: pre: b post: b i < v >= v 12/2/14 Sorting 10

11 Binary Searc Loo for value v in sorted segment b[..] pre: b post: b inv: b < v i < v >= v i j >= v New statement of te invariant guarantees tat we get leftmost position of v if found Example b if v is 3, set i to 0 if v is 4, set i to 5 if v is 5, set i to 7 if v is 8, set i to 10 12/2/14 Sorting 11

12 Binary Searc Vague: Loo for v in sorted sequence segment b[..]. Better: Precondition: b[..-1] is sorted (in ascending order). Postcondition: b[..i] <= v and v < b[i+1..-1] Below, te array is in non-descending order: pre: b post: b inv: b < v i >= v i j < v > v Called binary searc because eac iteration of te loop cuts te array segment still to be processed in alf 12/2/14 Sorting 12

13 Binary Searc pre: b post: b i < v >= v i j New statement of te invariant guarantees tat we get leftmost position of v if found inv: b < v >= v i = ; j = +1; wile i!= j: Looing at b[i] gives linear searc from left. Looing at b[j-1] gives linear searc from rigt. Looing at middle: b[(i+j)/2] gives binary searc. 12/2/14 Sorting 13

14 Sorting: Arranging in Ascending Order 0 n pre: b post: b 0 n sorted Insertion Sort: 0 i n inv: b sorted i = 0 wile i < n: # Pus b[i] down into its # sorted position in b[0..i] i = i+1 0 i i /2/14 Sorting 14

15 Insertion Sort: Moving into Position i = 0 wile i < n: pus_down(b,i) i = i+1 def pus_down(b, i):" j = i wile j > 0: if b[j-1] > b[j]: swap(b,j-1,j) j = j-1 swap sown in te lecture about lists 0 i i i i /2/14 Sorting 15

16 Te Importance of Helper Functions i = 0 wile i < n: pus_down(b,i) i = i+1 def pus_down(b, i):" j = i wile j > 0: if b[j-1] > b[j]: swap(b,j-1,j) j = j-1 VS i = 0 wile i < n: j = i wile j > 0: Can you understand all tis code below if b[j-1] > b[j]: temp = b[j] b[j] = b[j-1] b[j-1] = temp j = j -1 i = i +1 12/2/14 Sorting 16

17 Insertion Sort: Performance def pus_down(b, i): """Pus value at position i into sorted position in b[0..i-1]""" j = i wile j > 0: if b[j-1] > b[j]: swap(b,j-1,j) j = j-1 Insertion sort is an n 2 algoritm b[0..i-1]: i elements Worst case: i = 0: 0 swaps i = 1: 1 swap i = 2: 2 swaps Pusdown is in a loop Called for i in 0..n i swaps eac time Total Swaps: (n-1) = (n-1)*n/2 12/2/14 Sorting 17

18 Algoritm Complexity Given: a list of lengt n and a problem to solve Complexity: roug number of steps to solve worst case Suppose we can compute 1000 operations a second: Complexity n=10 n=100 n=1000 n 0.01 s 0.1 s 1 s n log n s 0.32 s 4.79 s n s 10 s 16.7 m n 3 1 s 16.7 m 11.6 d 2 n 1 s 4x10 19 y 3x y Major Topic in 2110: Beyond scope of tis course 12/2/14 Sorting 18

19 Sorting: Canging te Invariant 0 n pre: b post: b 0 n sorted Insertion Selection Sort: 0 i n inv: b sorted, sorted b[i..] b[0..i-1] i = 0 wile i < n: # Find minimum in b[i..] # Move it to position i i = i+1 First segment always contains smaller values i i i n n n 12/2/14 Sorting 19

20 Sorting: Canging te Invariant 0 n pre: b post: b 0 n sorted Insertion Selection Sort: 0 i n inv: b sorted, sorted b[i..] b[0..i-1] i = 0 wile i < n: j = index of min of b[i..n-1] swap(b,i,j) i = i+1 First segment always contains smaller values /2/14 Sorting 20 i i Selection sort also is an n 2 algoritm n n

21 Partition Algoritm Given a list segment b[..] wit some value x in b[]: pre: b x Swap elements of b[..] and store in j to trutify post: i i+1 post: b <= x x >= x cange: b i into b or b i x is called te pivot value x is not a program variable denotes value initially in b[] 12/2/14 Sorting 21

22 Sorting wit Partitions Given a list segment b[..] wit some value x in b[]: pre: b x Swap elements of b[..] and store in j to trutify post: i i+1 post: b y <= y <= y x >= y x >= x Partition Recursively Recursive partitions = sorting Called QuicSort (wy) Popular, fast sorting tecnique 12/2/14 Sorting 22

23 QuicSort def quic_sort(b,, ): """Sort te array fragment b[..]""" if b[..] as fewer tan 2 elements: return j = partition(b,, ) # b[..j 1] <= b[j] <= b[j+1..] # Sort b[..j 1] and b[j+1..] quic_sort (b,, j 1) quic_sort (b, j+1, ) pre: b post: b Worst Case: array already sorted Or almost sorted n 2 in tat case Average Case: array is scrambled n log n in tat case Best sorting time! x i i+1 <= x x >= x 12/2/14 Sorting 23

24 Algoritm: Final Word About Algoritms Step-by-step way to do someting Not tied to specific language Implementation: An algoritm in a specific language Many times, not te ard part Higer Level Computer Science courses: We teac advanced algoritms (pictures) Implementation you learn on your own List Diagrams Demo Code 12/2/14 Sorting 24

Lecture 26. Sequence Algorithms (Continued)

Lecture 26. Sequence Algorithms (Continued) Lecture 26 Sequence Algorithms (Continued) Announcements for This Lecture Lab/Finals Lab 12 is the final lab Can use Consulting hours Due next Wednesday 9:30 Final: Dec 10 th 2:00-4:30pm Study guide is

More information

CS 1110: Introduction to Computing Using Python Sequence Algorithms

CS 1110: Introduction to Computing Using Python Sequence Algorithms CS 1110: Introduction to Computing Using Python Lecture 22 Sequence Algorithms [Andersen, Gries, Lee, Marschner, Van Loan, White] Final Exam: Announcements May 18 th, 9am-11:30am Location: Barton Hall

More information

Lecture 25. Designing Sequence Algorithms

Lecture 25. Designing Sequence Algorithms Lecture 25 Designing Sequence Algorithms Announcements for This Lecture Next Week Assignment 7 There is no lab next week But Tuesday hours are open Open to EVERYONE Go for help on lab or A7 But lecture

More information

CS1110. Lecture 20: Sequence algorithms. Announcements

CS1110. Lecture 20: Sequence algorithms. Announcements CS1110 Lecture 20: Sequence algorithms Announcements Upcoming schedule Today (April 4) A6 out: A4 due tomorrow. Fix to memotable printing posted; see Piazza @303. Tu Apr 9: lecture on searching &sorting

More information

Efficient algorithms for for clone items detection

Efficient algorithms for for clone items detection Efficient algoritms for for clone items detection Raoul Medina, Caroline Noyer, and Olivier Raynaud Raoul Medina, Caroline Noyer and Olivier Raynaud LIMOS - Université Blaise Pascal, Campus universitaire

More information

Introduction to Derivatives

Introduction to Derivatives Introduction to Derivatives 5-Minute Review: Instantaneous Rates and Tangent Slope Recall te analogy tat we developed earlier First we saw tat te secant slope of te line troug te two points (a, f (a))

More information

REVIEW LAB ANSWER KEY

REVIEW LAB ANSWER KEY REVIEW LAB ANSWER KEY. Witout using SN, find te derivative of eac of te following (you do not need to simplify your answers): a. f x 3x 3 5x x 6 f x 3 3x 5 x 0 b. g x 4 x x x notice te trick ere! x x g

More information

Numerical Differentiation

Numerical Differentiation Numerical Differentiation Finite Difference Formulas for te first derivative (Using Taylor Expansion tecnique) (section 8.3.) Suppose tat f() = g() is a function of te variable, and tat as 0 te function

More information

Combining functions: algebraic methods

Combining functions: algebraic methods Combining functions: algebraic metods Functions can be added, subtracted, multiplied, divided, and raised to a power, just like numbers or algebra expressions. If f(x) = x 2 and g(x) = x + 2, clearly f(x)

More information

1. (a) 3. (a) 4 3 (b) (a) t = 5: 9. (a) = 11. (a) The equation of the line through P = (2, 3) and Q = (8, 11) is y 3 = 8 6

1. (a) 3. (a) 4 3 (b) (a) t = 5: 9. (a) = 11. (a) The equation of the line through P = (2, 3) and Q = (8, 11) is y 3 = 8 6 A Answers Important Note about Precision of Answers: In many of te problems in tis book you are required to read information from a grap and to calculate wit tat information. You sould take reasonable

More information

WYSE Academic Challenge 2004 Sectional Mathematics Solution Set

WYSE Academic Challenge 2004 Sectional Mathematics Solution Set WYSE Academic Callenge 00 Sectional Matematics Solution Set. Answer: B. Since te equation can be written in te form x + y, we ave a major 5 semi-axis of lengt 5 and minor semi-axis of lengt. Tis means

More information

Lab 6 Derivatives and Mutant Bacteria

Lab 6 Derivatives and Mutant Bacteria Lab 6 Derivatives and Mutant Bacteria Date: September 27, 20 Assignment Due Date: October 4, 20 Goal: In tis lab you will furter explore te concept of a derivative using R. You will use your knowledge

More information

Preface. Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

Preface. Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed. Preface Here are my online notes for my course tat I teac ere at Lamar University. Despite te fact tat tese are my class notes, tey sould be accessible to anyone wanting to learn or needing a refreser

More information

Central Algorithmic Techniques. Iterative Algorithms

Central Algorithmic Techniques. Iterative Algorithms Central Algorithmic Techniques Iterative Algorithms Code Representation of an Algorithm class InsertionSortAlgorithm extends SortAlgorithm { void sort(int a[]) throws Exception { for (int i = 1; i < a.length;

More information

Searching. Sorting. Lambdas

Searching. Sorting. Lambdas .. s Babes-Bolyai University arthur@cs.ubbcluj.ro Overview 1 2 3 Feedback for the course You can write feedback at academicinfo.ubbcluj.ro It is both important as well as anonymous Write both what you

More information

ASYMPTOTIC COMPLEXITY SEARCHING/SORTING

ASYMPTOTIC COMPLEXITY SEARCHING/SORTING Quotes about loops O! Thou hast damnable iteration and art, indeed, able to corrupt a saint. Shakespeare, Henry IV, Pt I, 1 ii Use not vain repetition, as the heathen do. Matthew V, 48 Your if is the only

More information

lecture 26: Richardson extrapolation

lecture 26: Richardson extrapolation 43 lecture 26: Ricardson extrapolation 35 Ricardson extrapolation, Romberg integration Trougout numerical analysis, one encounters procedures tat apply some simple approximation (eg, linear interpolation)

More information

Quicksort. Recurrence analysis Quicksort introduction. November 17, 2017 Hassan Khosravi / Geoffrey Tien 1

Quicksort. Recurrence analysis Quicksort introduction. November 17, 2017 Hassan Khosravi / Geoffrey Tien 1 Quicksort Recurrence analysis Quicksort introduction November 17, 2017 Hassan Khosravi / Geoffrey Tien 1 Announcement Slight adjustment to lab 5 schedule (Monday sections A, B, E) Next week (Nov.20) regular

More information

Printed Name: Section #: Instructor:

Printed Name: Section #: Instructor: Printed Name: Section #: Instructor: Please do not ask questions during tis exam. If you consider a question to be ambiguous, state your assumptions in te margin and do te best you can to provide te correct

More information

SECTION 3.2: DERIVATIVE FUNCTIONS and DIFFERENTIABILITY

SECTION 3.2: DERIVATIVE FUNCTIONS and DIFFERENTIABILITY (Section 3.2: Derivative Functions and Differentiability) 3.2.1 SECTION 3.2: DERIVATIVE FUNCTIONS and DIFFERENTIABILITY LEARNING OBJECTIVES Know, understand, and apply te Limit Definition of te Derivative

More information

MATH 1020 TEST 2 VERSION A FALL 2014 ANSWER KEY. Printed Name: Section #: Instructor:

MATH 1020 TEST 2 VERSION A FALL 2014 ANSWER KEY. Printed Name: Section #: Instructor: ANSWER KEY Printed Name: Section #: Instructor: Please do not ask questions during tis eam. If you consider a question to be ambiguous, state your assumptions in te margin and do te best you can to provide

More information

Printed Name: Section #: Instructor:

Printed Name: Section #: Instructor: Printed Name: Section #: Instructor: Please do not ask questions during tis exam. If you consider a question to be ambiguous, state your assumptions in te margin and do te best you can to provide te correct

More information

2.8 The Derivative as a Function

2.8 The Derivative as a Function .8 Te Derivative as a Function Typically, we can find te derivative of a function f at many points of its domain: Definition. Suppose tat f is a function wic is differentiable at every point of an open

More information

MAT244 - Ordinary Di erential Equations - Summer 2016 Assignment 2 Due: July 20, 2016

MAT244 - Ordinary Di erential Equations - Summer 2016 Assignment 2 Due: July 20, 2016 MAT244 - Ordinary Di erential Equations - Summer 206 Assignment 2 Due: July 20, 206 Full Name: Student #: Last First Indicate wic Tutorial Section you attend by filling in te appropriate circle: Tut 0

More information

Chapter 4: Numerical Methods for Common Mathematical Problems

Chapter 4: Numerical Methods for Common Mathematical Problems 1 Capter 4: Numerical Metods for Common Matematical Problems Interpolation Problem: Suppose we ave data defined at a discrete set of points (x i, y i ), i = 0, 1,..., N. Often it is useful to ave a smoot

More information

AVL trees. AVL trees

AVL trees. AVL trees Dnamic set DT dnamic set DT is a structure tat stores a set of elements. Eac element as a (unique) ke and satellite data. Te structure supports te following operations. Searc(S, k) Return te element wose

More information

Blueprint Algebra I Test

Blueprint Algebra I Test Blueprint Algebra I Test Spring 2003 2003 by te Commonwealt of Virginia Department of Education, James Monroe Building, 101 N. 14t Street, Ricmond, Virginia, 23219. All rigts reserved. Except as permitted

More information

The derivative function

The derivative function Roberto s Notes on Differential Calculus Capter : Definition of derivative Section Te derivative function Wat you need to know already: f is at a point on its grap and ow to compute it. Wat te derivative

More information

MATH 1020 Answer Key TEST 2 VERSION B Fall Printed Name: Section #: Instructor:

MATH 1020 Answer Key TEST 2 VERSION B Fall Printed Name: Section #: Instructor: Printed Name: Section #: Instructor: Please do not ask questions during tis exam. If you consider a question to be ambiguous, state your assumptions in te margin and do te best you can to provide te correct

More information

Investigating Euler s Method and Differential Equations to Approximate π. Lindsay Crowl August 2, 2001

Investigating Euler s Method and Differential Equations to Approximate π. Lindsay Crowl August 2, 2001 Investigating Euler s Metod and Differential Equations to Approximate π Lindsa Crowl August 2, 2001 Tis researc paper focuses on finding a more efficient and accurate wa to approximate π. Suppose tat x

More information

Polynomials 3: Powers of x 0 + h

Polynomials 3: Powers of x 0 + h near small binomial Capter 17 Polynomials 3: Powers of + Wile it is easy to compute wit powers of a counting-numerator, it is a lot more difficult to compute wit powers of a decimal-numerator. EXAMPLE

More information

Lecture 15. Interpolation II. 2 Piecewise polynomial interpolation Hermite splines

Lecture 15. Interpolation II. 2 Piecewise polynomial interpolation Hermite splines Lecture 5 Interpolation II Introduction In te previous lecture we focused primarily on polynomial interpolation of a set of n points. A difficulty we observed is tat wen n is large, our polynomial as to

More information

Time (hours) Morphine sulfate (mg)

Time (hours) Morphine sulfate (mg) Mat Xa Fall 2002 Review Notes Limits and Definition of Derivative Important Information: 1 According to te most recent information from te Registrar, te Xa final exam will be eld from 9:15 am to 12:15

More information

Average Rate of Change

Average Rate of Change Te Derivative Tis can be tougt of as an attempt to draw a parallel (pysically and metaporically) between a line and a curve, applying te concept of slope to someting tat isn't actually straigt. Te slope

More information

Section 2.7 Derivatives and Rates of Change Part II Section 2.8 The Derivative as a Function. at the point a, to be. = at time t = a is

Section 2.7 Derivatives and Rates of Change Part II Section 2.8 The Derivative as a Function. at the point a, to be. = at time t = a is Mat 180 www.timetodare.com Section.7 Derivatives and Rates of Cange Part II Section.8 Te Derivative as a Function Derivatives ( ) In te previous section we defined te slope of te tangent to a curve wit

More information

LIMITATIONS OF EULER S METHOD FOR NUMERICAL INTEGRATION

LIMITATIONS OF EULER S METHOD FOR NUMERICAL INTEGRATION LIMITATIONS OF EULER S METHOD FOR NUMERICAL INTEGRATION LAURA EVANS.. Introduction Not all differential equations can be explicitly solved for y. Tis can be problematic if we need to know te value of y

More information

1 The concept of limits (p.217 p.229, p.242 p.249, p.255 p.256) 1.1 Limits Consider the function determined by the formula 3. x since at this point

1 The concept of limits (p.217 p.229, p.242 p.249, p.255 p.256) 1.1 Limits Consider the function determined by the formula 3. x since at this point MA00 Capter 6 Calculus and Basic Linear Algebra I Limits, Continuity and Differentiability Te concept of its (p.7 p.9, p.4 p.49, p.55 p.56). Limits Consider te function determined by te formula f Note

More information

Review for Exam IV MATH 1113 sections 51 & 52 Fall 2018

Review for Exam IV MATH 1113 sections 51 & 52 Fall 2018 Review for Exam IV MATH 111 sections 51 & 52 Fall 2018 Sections Covered: 6., 6., 6.5, 6.6, 7., 7.1, 7.2, 7., 7.5 Calculator Policy: Calculator use may be allowed on part of te exam. Wen instructions call

More information

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17 Decision Procedures Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg Winter Term 2016/17 Jochen Hoenicke (Software Engineering) Decision Procedures Winter Term 2016/17 1 / 436 Program

More information

CSCE 478/878 Lecture 2: Concept Learning and the General-to-Specific Ordering

CSCE 478/878 Lecture 2: Concept Learning and the General-to-Specific Ordering Outline Learning from eamples CSCE 78/878 Lecture : Concept Learning and te General-to-Specific Ordering Stepen D. Scott (Adapted from Tom Mitcell s slides) General-to-specific ordering over ypoteses Version

More information

Bob Brown Math 251 Calculus 1 Chapter 3, Section 1 Completed 1 CCBC Dundalk

Bob Brown Math 251 Calculus 1 Chapter 3, Section 1 Completed 1 CCBC Dundalk Bob Brown Mat 251 Calculus 1 Capter 3, Section 1 Completed 1 Te Tangent Line Problem Te idea of a tangent line first arises in geometry in te context of a circle. But before we jump into a discussion of

More information

Math 31A Discussion Notes Week 4 October 20 and October 22, 2015

Math 31A Discussion Notes Week 4 October 20 and October 22, 2015 Mat 3A Discussion Notes Week 4 October 20 and October 22, 205 To prepare for te first midterm, we ll spend tis week working eamples resembling te various problems you ve seen so far tis term. In tese notes

More information

MAT 145. Type of Calculator Used TI-89 Titanium 100 points Score 100 possible points

MAT 145. Type of Calculator Used TI-89 Titanium 100 points Score 100 possible points MAT 15 Test #2 Name Solution Guide Type of Calculator Used TI-89 Titanium 100 points Score 100 possible points Use te grap of a function sown ere as you respond to questions 1 to 8. 1. lim f (x) 0 2. lim

More information

. Compute the following limits.

. Compute the following limits. Today: Tangent Lines and te Derivative at a Point Warmup:. Let f(x) =x. Compute te following limits. f( + ) f() (a) lim f( +) f( ) (b) lim. Let g(x) = x. Compute te following limits. g(3 + ) g(3) (a) lim

More information

Loop Invariants and Binary Search. Chapter 4.4, 5.1

Loop Invariants and Binary Search. Chapter 4.4, 5.1 Loop Invariants and Binary Search Chapter 4.4, 5.1 Outline Iterative Algorithms, Assertions and Proofs of Correctness Binary Search: A Case Study Outline Iterative Algorithms, Assertions and Proofs of

More information

Fundamentals of Concept Learning

Fundamentals of Concept Learning Aims 09s: COMP947 Macine Learning and Data Mining Fundamentals of Concept Learning Marc, 009 Acknowledgement: Material derived from slides for te book Macine Learning, Tom Mitcell, McGraw-Hill, 997 ttp://www-.cs.cmu.edu/~tom/mlbook.tml

More information

Recap: Prefix Sums. Given A: set of n integers Find B: prefix sums 1 / 86

Recap: Prefix Sums. Given A: set of n integers Find B: prefix sums 1 / 86 Recap: Prefix Sums Given : set of n integers Find B: prefix sums : 3 1 1 7 2 5 9 2 4 3 3 B: 3 4 5 12 14 19 28 30 34 37 40 1 / 86 Recap: Parallel Prefix Sums Recursive algorithm Recursively computes sums

More information

1. AB Calculus Introduction

1. AB Calculus Introduction 1. AB Calculus Introduction Before we get into wat calculus is, ere are several eamples of wat you could do BC (before calculus) and wat you will be able to do at te end of tis course. Eample 1: On April

More information

Teaching Differentiation: A Rare Case for the Problem of the Slope of the Tangent Line

Teaching Differentiation: A Rare Case for the Problem of the Slope of the Tangent Line Teacing Differentiation: A Rare Case for te Problem of te Slope of te Tangent Line arxiv:1805.00343v1 [mat.ho] 29 Apr 2018 Roman Kvasov Department of Matematics University of Puerto Rico at Aguadilla Aguadilla,

More information

5.1 We will begin this section with the definition of a rational expression. We

5.1 We will begin this section with the definition of a rational expression. We Basic Properties and Reducing to Lowest Terms 5.1 We will begin tis section wit te definition of a rational epression. We will ten state te two basic properties associated wit rational epressions and go

More information

HOW TO DEAL WITH FFT SAMPLING INFLUENCES ON ADEV CALCULATIONS

HOW TO DEAL WITH FFT SAMPLING INFLUENCES ON ADEV CALCULATIONS HOW TO DEAL WITH FFT SAMPLING INFLUENCES ON ADEV CALCULATIONS Po-Ceng Cang National Standard Time & Frequency Lab., TL, Taiwan 1, Lane 551, Min-Tsu Road, Sec. 5, Yang-Mei, Taoyuan, Taiwan 36 Tel: 886 3

More information

1. State whether the function is an exponential growth or exponential decay, and describe its end behaviour using limits.

1. State whether the function is an exponential growth or exponential decay, and describe its end behaviour using limits. Questions 1. State weter te function is an exponential growt or exponential decay, and describe its end beaviour using its. (a) f(x) = 3 2x (b) f(x) = 0.5 x (c) f(x) = e (d) f(x) = ( ) x 1 4 2. Matc te

More information

A Reconsideration of Matter Waves

A Reconsideration of Matter Waves A Reconsideration of Matter Waves by Roger Ellman Abstract Matter waves were discovered in te early 20t century from teir wavelengt, predicted by DeBroglie, Planck's constant divided by te particle's momentum,

More information

CSCE 222 Discrete Structures for Computing

CSCE 222 Discrete Structures for Computing CSCE 222 Discrete Structures for Computing Algorithms Dr. Philip C. Ritchey Introduction An algorithm is a finite sequence of precise instructions for performing a computation or for solving a problem.

More information

Lecture 14: Nov. 11 & 13

Lecture 14: Nov. 11 & 13 CIS 2168 Data Structures Fall 2014 Lecturer: Anwar Mamat Lecture 14: Nov. 11 & 13 Disclaimer: These notes may be distributed outside this class only with the permission of the Instructor. 14.1 Sorting

More information

Simpson s 1/3 Rule Simpson s 1/3 rule assumes 3 equispaced data/interpolation/integration points

Simpson s 1/3 Rule Simpson s 1/3 rule assumes 3 equispaced data/interpolation/integration points CE 05 - Lecture 5 LECTURE 5 UMERICAL ITEGRATIO COTIUED Simpson s / Rule Simpson s / rule assumes equispaced data/interpolation/integration points Te integration rule is based on approximating fx using

More information

NUMERICAL DIFFERENTIATION. James T. Smith San Francisco State University. In calculus classes, you compute derivatives algebraically: for example,

NUMERICAL DIFFERENTIATION. James T. Smith San Francisco State University. In calculus classes, you compute derivatives algebraically: for example, NUMERICAL DIFFERENTIATION James T Smit San Francisco State University In calculus classes, you compute derivatives algebraically: for example, f( x) = x + x f ( x) = x x Tis tecnique requires your knowing

More information

Phy 231 Sp 02 Homework #6 Page 1 of 4

Phy 231 Sp 02 Homework #6 Page 1 of 4 Py 231 Sp 02 Homework #6 Page 1 of 4 6-1A. Te force sown in te force-time diagram at te rigt versus time acts on a 2 kg mass. Wat is te impulse of te force on te mass from 0 to 5 sec? (a) 9 N-s (b) 6 N-s

More information

Sin, Cos and All That

Sin, Cos and All That Sin, Cos and All Tat James K. Peterson Department of Biological Sciences and Department of Matematical Sciences Clemson University Marc 9, 2017 Outline Sin, Cos and all tat! A New Power Rule Derivatives

More information

5. (a) Find the slope of the tangent line to the parabola y = x + 2x

5. (a) Find the slope of the tangent line to the parabola y = x + 2x MATH 141 090 Homework Solutions Fall 00 Section.6: Pages 148 150 3. Consider te slope of te given curve at eac of te five points sown (see text for figure). List tese five slopes in decreasing order and

More information

Section 2.1 The Definition of the Derivative. We are interested in finding the slope of the tangent line at a specific point.

Section 2.1 The Definition of the Derivative. We are interested in finding the slope of the tangent line at a specific point. Popper 6: Review of skills: Find tis difference quotient. f ( x ) f ( x) if f ( x) x Answer coices given in audio on te video. Section.1 Te Definition of te Derivative We are interested in finding te slope

More information

Sorting. Chapter 11. CSE 2011 Prof. J. Elder Last Updated: :11 AM

Sorting. Chapter 11. CSE 2011 Prof. J. Elder Last Updated: :11 AM Sorting Chapter 11-1 - Sorting Ø We have seen the advantage of sorted data representations for a number of applications q Sparse vectors q Maps q Dictionaries Ø Here we consider the problem of how to efficiently

More information

Numerical Analysis MTH603. dy dt = = (0) , y n+1. We obtain yn. Therefore. and. Copyright Virtual University of Pakistan 1

Numerical Analysis MTH603. dy dt = = (0) , y n+1. We obtain yn. Therefore. and. Copyright Virtual University of Pakistan 1 Numerical Analysis MTH60 PREDICTOR CORRECTOR METHOD Te metods presented so far are called single-step metods, were we ave seen tat te computation of y at t n+ tat is y n+ requires te knowledge of y n only.

More information

Fractional Derivatives as Binomial Limits

Fractional Derivatives as Binomial Limits Fractional Derivatives as Binomial Limits Researc Question: Can te limit form of te iger-order derivative be extended to fractional orders? (atematics) Word Count: 669 words Contents - IRODUCIO... Error!

More information

Calculus I, Fall Solutions to Review Problems II

Calculus I, Fall Solutions to Review Problems II Calculus I, Fall 202 - Solutions to Review Problems II. Find te following limits. tan a. lim 0. sin 2 b. lim 0 sin 3. tan( + π/4) c. lim 0. cos 2 d. lim 0. a. From tan = sin, we ave cos tan = sin cos =

More information

The Krewe of Caesar Problem. David Gurney. Southeastern Louisiana University. SLU 10541, 500 Western Avenue. Hammond, LA

The Krewe of Caesar Problem. David Gurney. Southeastern Louisiana University. SLU 10541, 500 Western Avenue. Hammond, LA Te Krewe of Caesar Problem David Gurney Souteastern Louisiana University SLU 10541, 500 Western Avenue Hammond, LA 7040 June 19, 00 Krewe of Caesar 1 ABSTRACT Tis paper provides an alternative to te usual

More information

These errors are made from replacing an infinite process by finite one.

These errors are made from replacing an infinite process by finite one. Introduction :- Tis course examines problems tat can be solved by metods of approximation, tecniques we call numerical metods. We begin by considering some of te matematical and computational topics tat

More information

Solutions. Prelim 2[Solutions]

Solutions. Prelim 2[Solutions] Prelim [Solutions]. Short Answer [ pts] (a) [ pts] A traversal of an expression tree produces the string + + 3. i. What kind of traversal is it? Preorder; the operator is printed before the operands. ii.

More information

Outline. 1 Introduction. 3 Quicksort. 4 Analysis. 5 References. Idea. 1 Choose an element x and reorder the array as follows:

Outline. 1 Introduction. 3 Quicksort. 4 Analysis. 5 References. Idea. 1 Choose an element x and reorder the array as follows: Outline Computer Science 331 Quicksort Mike Jacobson Department of Computer Science University of Calgary Lecture #28 1 Introduction 2 Randomized 3 Quicksort Deterministic Quicksort Randomized Quicksort

More information

Math 102 TEST CHAPTERS 3 & 4 Solutions & Comments Fall 2006

Math 102 TEST CHAPTERS 3 & 4 Solutions & Comments Fall 2006 Mat 102 TEST CHAPTERS 3 & 4 Solutions & Comments Fall 2006 f(x+) f(x) 10 1. For f(x) = x 2 + 2x 5, find ))))))))) and simplify completely. NOTE: **f(x+) is NOT f(x)+! f(x+) f(x) (x+) 2 + 2(x+) 5 ( x 2

More information

2.3 Product and Quotient Rules

2.3 Product and Quotient Rules .3. PRODUCT AND QUOTIENT RULES 75.3 Product and Quotient Rules.3.1 Product rule Suppose tat f and g are two di erentiable functions. Ten ( g (x)) 0 = f 0 (x) g (x) + g 0 (x) See.3.5 on page 77 for a proof.

More information

PHYSICS 1050 Mid-term Test 1 University of Wyoming 15 February 2005

PHYSICS 1050 Mid-term Test 1 University of Wyoming 15 February 2005 Name: (4 points) PHYSICS 1050 Mid-term Test 1 University of Wyoming 15 February 2005 Tis test is open-note and open-book. Tis means tat any reference material is permitted during te test. Calculators also

More information

Honors Calculus Midterm Review Packet

Honors Calculus Midterm Review Packet Name Date Period Honors Calculus Midterm Review Packet TOPICS THAT WILL APPEAR ON THE EXAM Capter Capter Capter (Sections. to.6) STRUCTURE OF THE EXAM Part No Calculators Miture o multiple-coice, matcing,

More information

Solving Continuous Linear Least-Squares Problems by Iterated Projection

Solving Continuous Linear Least-Squares Problems by Iterated Projection Solving Continuous Linear Least-Squares Problems by Iterated Projection by Ral Juengling Department o Computer Science, Portland State University PO Box 75 Portland, OR 977 USA Email: juenglin@cs.pdx.edu

More information

Notes on Neural Networks

Notes on Neural Networks Artificial neurons otes on eural etwors Paulo Eduardo Rauber 205 Consider te data set D {(x i y i ) i { n} x i R m y i R d } Te tas of supervised learning consists on finding a function f : R m R d tat

More information

Prelim 2[Solutions] Solutions. 1. Short Answer [18 pts]

Prelim 2[Solutions] Solutions. 1. Short Answer [18 pts] Prelim [Solutions]. Short Answer [8 pts] (a) [3 pts] In a model/view/controller, Swing is likely to be part of (there may be more than one): i. the model ii. the view iii. the controller The view and the

More information

Chapter 2. Limits and Continuity 16( ) 16( 9) = = 001. Section 2.1 Rates of Change and Limits (pp ) Quick Review 2.1

Chapter 2. Limits and Continuity 16( ) 16( 9) = = 001. Section 2.1 Rates of Change and Limits (pp ) Quick Review 2.1 Capter Limits and Continuity Section. Rates of Cange and Limits (pp. 969) Quick Review..... f ( ) ( ) ( ) 0 ( ) f ( ) f ( ) sin π sin π 0 f ( ). < < < 6. < c c < < c 7. < < < < < 8. 9. 0. c < d d < c

More information

CS 4407 Algorithms Lecture 3: Iterative and Divide and Conquer Algorithms

CS 4407 Algorithms Lecture 3: Iterative and Divide and Conquer Algorithms CS 4407 Algorithms Lecture 3: Iterative and Divide and Conquer Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline CS 4407, Algorithms Growth Functions

More information

7.1 Using Antiderivatives to find Area

7.1 Using Antiderivatives to find Area 7.1 Using Antiderivatives to find Area Introduction finding te area under te grap of a nonnegative, continuous function f In tis section a formula is obtained for finding te area of te region bounded between

More information

Chapter 1. Density Estimation

Chapter 1. Density Estimation Capter 1 Density Estimation Let X 1, X,..., X n be observations from a density f X x. Te aim is to use only tis data to obtain an estimate ˆf X x of f X x. Properties of f f X x x, Parametric metods f

More information

Hoare Logic (I): Axiomatic Semantics and Program Correctness

Hoare Logic (I): Axiomatic Semantics and Program Correctness Hoare Logic (I): Axiomatic Semantics and Program Correctness (Based on [Apt and Olderog 1991; Gries 1981; Hoare 1969; Kleymann 1999; Sethi 199]) Yih-Kuen Tsay Dept. of Information Management National Taiwan

More information

3.4 Worksheet: Proof of the Chain Rule NAME

3.4 Worksheet: Proof of the Chain Rule NAME Mat 1170 3.4 Workseet: Proof of te Cain Rule NAME Te Cain Rule So far we are able to differentiate all types of functions. For example: polynomials, rational, root, and trigonometric functions. We are

More information

CSE 21 Practice Exam for Midterm 2 Fall 2017

CSE 21 Practice Exam for Midterm 2 Fall 2017 CSE 1 Practice Exam for Midterm Fall 017 These practice problems should help prepare you for the second midterm, which is on monday, November 11 This is longer than the actual exam will be, but good practice

More information

Exercises for numerical differentiation. Øyvind Ryan

Exercises for numerical differentiation. Øyvind Ryan Exercises for numerical differentiation Øyvind Ryan February 25, 2013 1. Mark eac of te following statements as true or false. a. Wen we use te approximation f (a) (f (a +) f (a))/ on a computer, we can

More information

Introduction to Machine Learning. Recitation 8. w 2, b 2. w 1, b 1. z 0 z 1. The function we want to minimize is the loss over all examples: f =

Introduction to Machine Learning. Recitation 8. w 2, b 2. w 1, b 1. z 0 z 1. The function we want to minimize is the loss over all examples: f = Introduction to Macine Learning Lecturer: Regev Scweiger Recitation 8 Fall Semester Scribe: Regev Scweiger 8.1 Backpropagation We will develop and review te backpropagation algoritm for neural networks.

More information

Continuity and Differentiability Worksheet

Continuity and Differentiability Worksheet Continuity and Differentiability Workseet (Be sure tat you can also do te grapical eercises from te tet- Tese were not included below! Typical problems are like problems -3, p. 6; -3, p. 7; 33-34, p. 7;

More information

General Physics I. New Lecture 27: Carnot Cycle, The 2nd Law, Entropy and Information. Prof. WAN, Xin

General Physics I. New Lecture 27: Carnot Cycle, The 2nd Law, Entropy and Information. Prof. WAN, Xin General Pysics I New Lecture 27: Carnot Cycle, e 2nd Law, Entropy and Information Prof. AN, Xin xinwan@zju.edu.cn ttp://zimp.zju.edu.cn/~xinwan/ Carnot s Engine Efficiency of a Carnot Engine isotermal

More information

Mathematics 5 Worksheet 11 Geometry, Tangency, and the Derivative

Mathematics 5 Worksheet 11 Geometry, Tangency, and the Derivative Matematics 5 Workseet 11 Geometry, Tangency, and te Derivative Problem 1. Find te equation of a line wit slope m tat intersects te point (3, 9). Solution. Te equation for a line passing troug a point (x

More information

INTRODUCTION TO CALCULUS LIMITS

INTRODUCTION TO CALCULUS LIMITS Calculus can be divided into two ke areas: INTRODUCTION TO CALCULUS Differential Calculus dealing wit its, rates of cange, tangents and normals to curves, curve sketcing, and applications to maima and

More information

Announcements. Exam 4 - Review of important concepts

Announcements. Exam 4 - Review of important concepts Announcements 1. Exam 4 starts Friday! a. Available in esting Center from Friday, Dec 7 (opening time), up to Monday, Dec 10 at 4:00 pm. i. Late fee if you start your exam after 4 pm b. Covers C. 9-1 (up

More information

Definition of the Derivative

Definition of the Derivative Te Limit Definition of te Derivative Tis Handout will: Define te limit grapically and algebraically Discuss, in detail, specific features of te definition of te derivative Provide a general strategy of

More information

CS 4407 Algorithms Lecture 2: Iterative and Divide and Conquer Algorithms

CS 4407 Algorithms Lecture 2: Iterative and Divide and Conquer Algorithms CS 4407 Algorithms Lecture 2: Iterative and Divide and Conquer Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline CS 4407, Algorithms Growth Functions

More information

MVT and Rolle s Theorem

MVT and Rolle s Theorem AP Calculus CHAPTER 4 WORKSHEET APPLICATIONS OF DIFFERENTIATION MVT and Rolle s Teorem Name Seat # Date UNLESS INDICATED, DO NOT USE YOUR CALCULATOR FOR ANY OF THESE QUESTIONS In problems 1 and, state

More information

Notes on wavefunctions II: momentum wavefunctions

Notes on wavefunctions II: momentum wavefunctions Notes on wavefunctions II: momentum wavefunctions and uncertainty Te state of a particle at any time is described by a wavefunction ψ(x). Tese wavefunction must cange wit time, since we know tat particles

More information

Physics 207 Lecture 23

Physics 207 Lecture 23 ysics 07 Lecture ysics 07, Lecture 8, Dec. Agenda:. Finis, Start. Ideal gas at te molecular level, Internal Energy Molar Specific Heat ( = m c = n ) Ideal Molar Heat apacity (and U int = + W) onstant :

More information

3.1 Extreme Values of a Function

3.1 Extreme Values of a Function .1 Etreme Values of a Function Section.1 Notes Page 1 One application of te derivative is finding minimum and maimum values off a grap. In precalculus we were only able to do tis wit quadratics by find

More information

160 Chapter 3: Differentiation

160 Chapter 3: Differentiation 3. Differentiation Rules 159 3. Differentiation Rules Tis section introuces a few rules tat allow us to ifferentiate a great variety of functions. By proving tese rules ere, we can ifferentiate functions

More information

Finding and Using Derivative The shortcuts

Finding and Using Derivative The shortcuts Calculus 1 Lia Vas Finding and Using Derivative Te sortcuts We ave seen tat te formula f f(x+) f(x) (x) = lim 0 is manageable for relatively simple functions like a linear or quadratic. For more complex

More information

Name: Answer Key No calculators. Show your work! 1. (21 points) All answers should either be,, a (finite) real number, or DNE ( does not exist ).

Name: Answer Key No calculators. Show your work! 1. (21 points) All answers should either be,, a (finite) real number, or DNE ( does not exist ). Mat - Final Exam August 3 rd, Name: Answer Key No calculators. Sow your work!. points) All answers sould eiter be,, a finite) real number, or DNE does not exist ). a) Use te grap of te function to evaluate

More information

3.4 Algebraic Limits. Ex 1) lim. Ex 2)

3.4 Algebraic Limits. Ex 1) lim. Ex 2) Calculus Maimus.4 Algebraic Limits At tis point, you sould be very comfortable finding its bot grapically and numerically wit te elp of your graping calculator. Now it s time to practice finding its witout

More information