NUMERICAL DIFFERENTIATION

Size: px
Start display at page:

Download "NUMERICAL DIFFERENTIATION"

Transcription

1 EP08 Computational Metods in Psics Notes on Lecture Numerical Dierentiation 1 NUMERICAL DIFFERENTIATION For a unction irst and second derivatives are given as ollows: Metod First Derivative Truncation Error order FDA CDA REA 4 Metod Second Derivative Error order FDA CDA REA 4 Partial Derivatives or a unction [CDA onl] ere is small but not ero ' '' 4 ' ' ''

2 EP08 Computational Metods in Psics Notes on Lecture Numerical Dierentiation EXAMPLE Comparison o te numerical irst derivative metods or = e at = 3 wit = 0.01 Metod Error True FDA single precision % CDA single precision % REA single precision % C Pseudo code to compute te irst derivative o a unction. C Te FDA CDA and REA metods are implemented or comparison. unction deinition =... input "input " input "input " da = +-/ cda = +--/* rea = -*-8*-+8*+-+*/1* output "FDA = " da output "CDA = " cda output "REA = " rea Fortran PROGRAM FirstDerivative IMPLICIT NONE REAL :: da cda rea PRINT *"Input " READ * PRINT *"Input " READ * da = +-/ cda = +--/* rea = -*-8*- + & 8*+-+*/1* PRINT *"FDA = " da PRINT *"CDA = " cda PRINT *"REA = " rea CONTAINS REAL FUNCTION F REAL INTENTIN :: F = EXP-* END FUNCTION END PROGRAM FirstDeivative Input 3 Input 0.01 FDA = CDA = REA = C++ #include <iostream> #include <cmat> using namespace std; loat loat { loat = ep-*; return ; int main{ loat da cda rea; cout << "Input "; cin >> ; cout << "Input "; cin >> ; da = +-/; cda = +--/*; rea = -*-8*- + 8*+-+*/1*; cout << "FDA = " << da << endl; cout << "CDA = " << cda << endl; cout << "REA = " << rea << endl; return 0; Input 3 Input 0.01 FDA = CDA = REA =

3 EP08 Computational Metods in Psics Notes on Lecture Numerical Dierentiation EXAMPLE Comparison o te numerical second derivative metods or = 3sin + at = π/4 wit = 0.01 Metod Error True CDA double precision % REA double precision C Pseudo code to compute te second derivative o a unction. C Te FDA CDA and REA metods are implemented or comparison. unction deinition =... input "input " input "input " cda = / rea = / 1 output "CDA = " cda output "REA = " rea Fortran PROGRAM SecondDerivative IMPLICIT NONE INTEGER PARAMETER :: K = 8 REALKIND=K :: cda rea = _K/4.0_K = 0.01_K cda =--*++/** rea =--*+ 16*- - & 30* + 16*+ - & +*/1*** PRINT *"CDA = " cda PRINT *"REA = " rea CONTAINS REAL KIND=K FUNCTION F REALKIND=K INTENTIN :: F = 3*sin + ** END FUNCTION END PROGRAM SecondDerivative C++ #include <iostream> #include <cmat> using namespace std; #deine Real double Real Real { Real = 3.0*sin + *; return ; int main{ Real cda rea; = M_PI/4.0; = 0.01; cda = --*++/*; rea = --* + 16*- - 30* + 16*+ - +*/1**; cout << "CDA = " << cda << endl; cout << "REA = " << rea << endl; return 0; i KIND = 4 CDA = REA = i KIND = 8 CDA = REA = i Real is loat CDA = REA = i Real is double CDA = REA =

4 EP08 Computational Metods in Psics Notes on Lecture Numerical Dierentiation Errors in Numerical Derivative Te approimation metods FDA CDA and REA can be used to demonstrate te eect o truncation errors and round-o errors. Te error or eample /6.``` inerent to te CDA metod is an eample o a truncation error i.e. b truncating iger order terms in te Talor epansion te metod becomes onl approimate. Anoter source o error eists wen te FDA CDA or REA are computed; tis is te round-o error due to limited precision in numerical aritmetic numerical values are stored in te computer wit a limited number o binar bits. Round-o errors are compounded in aritmetic operations. Te total error is tereore a combination o te two error sources: Total Error = Truncation Error + Round-o Error due to truncating iger order terms in Talor epansion due to limited precision in numerical aritmetic Te important parameter ere is te value o ; te truncation error increases wit increasing te round-o error decreases wit increasing Given a particular metod or eample te CDA te most accurate computed derivative is obtained b minimiing te total error tis corresponds to inding te optimal value o. Tis optimal value will dier depending on i. Te numerical metod FDA CDA REA etc. ii. Te unction being dierentiated and te value o. iii. Te precision o te aritmetic single- double- quad-precision. To arrive at te optimal value some stud o te output o our program is needed. Te total error in te CDA is given b: Error = CDA ` We can orm a plot o Error against log to indicate te eect o on error See Fig.1. A minimum error eists at some intermediate value o corresponding to a minimum in te plot. I ` is unknown we can onl plot CDA versus but as ' is a constant te plot will ave te same sape onl sit up or down. In tis case again a minimum or stationar value in te plot will be observed corresponding to a minimum error. 4

5 EP08 Computational Metods in Psics Notes on Lecture Numerical Dierentiation Fig.1: Error = CDA- vs plots or te unction = e at = 3 or single- and double-precision aritmetic. Optimum values o corresponding to minimum error are about 10 and 10 5 respectivel. Te rise on te let as increases is due to truncation error wic as te orm o and te rise on te rigt as decreases is due to round-o errors. 5

6 EP08 Computational Metods in Psics Notes on Lecture Numerical Dierentiation Eercise 1. Consider te position o a particle in meters is given b unction t = 1/t. [ v = t = 1/t and a = t= -/t 3 ] 1 st derivative o te unction at t=3 s is 3 = m/s nd derivative o te unction at t=3 is 3 = m/s a For te irst derivative compare te accurac o FDA CDA and REA. For tis use = 0.01 s and double precision data tpe. b For te second derivative compare te accurac o FDA CDA and REA. For tis use = 0.01 s and double precision data tpe.. Write a program to ind te partial derivatives / and / at = = 1 or te unction = + sin/. 6

CHAPTER The elevation can be determined as. The partial derivatives can be evaluated,

CHAPTER The elevation can be determined as. The partial derivatives can be evaluated, 1 CHAPTER 14 14.1 Te elevation can be determined as (.8,1. (.81. 1.5(1. 1.5(.8 Te partial derivatives can be evaluated,.5 (1..5(.8.4 1.5 4 (.8 1.5 4(1. 1.7 (1. 5 5.4 wic can be used to determine te gradient

More information

12.2 TECHNIQUES FOR EVALUATING LIMITS

12.2 TECHNIQUES FOR EVALUATING LIMITS Section Tecniques for Evaluating Limits 86 TECHNIQUES FOR EVALUATING LIMITS Wat ou sould learn Use te dividing out tecnique to evaluate its of functions Use te rationalizing tecnique to evaluate its of

More information

9.8 Graphing Rational Functions

9.8 Graphing Rational Functions 9. Graphing Rational Functions Lets begin with a deinition. Deinition: Rational Function A rational unction is a unction o the orm P where P and Q are polynomials. Q An eample o a simple rational unction

More information

Section 2.3: Calculating Limits using the Limit Laws

Section 2.3: Calculating Limits using the Limit Laws Section 2.3: Calculating Limits using te Limit Laws In previous sections, we used graps and numerics to approimate te value of a it if it eists. Te problem wit tis owever is tat it does not always give

More information

Background Functions (1C) Young Won Lim 12/6/17

Background Functions (1C) Young Won Lim 12/6/17 Background Functions (1C) Copright (c) 2016-2017 Young W. Lim. Permission is granted to cop, distribute and/or modi this document under the terms o the GNU Free Documentation License, Version 1.2 or an

More information

Outline. First Quiz Results. Exercise Five Goals. Question Three. Questions One and Two. Exercise five if statements February 28, 2006

Outline. First Quiz Results. Exercise Five Goals. Question Three. Questions One and Two. Exercise five if statements February 28, 2006 Eercise five if statements February 8, 6 Laboratory V Program Control Using if Statements Larry Caretto Computer Science 6 Computing in Engineering and Science February 8, 6 Outline Review first quiz Summarize

More information

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol.

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. 1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. B. Outputs to the console a floating point number f1 in scientific format

More information

o Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement

o Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement Last Time Let s all Repeat Together 10/3/05 CS150 Introduction to Computer Science 1 1 We covered o Counter and sentinel controlled loops o Formatting output Today we will o Type casting o Top-down, stepwise

More information

2.3 Additional Relations

2.3 Additional Relations 3 2.3 Additional Relations Figure 2.3 identiies additional relations, indicating te locations o te object and image, and te ratio o teir eigts (magniication) and orientations. Ray enters te lens parallel

More information

Excel based finite difference modeling of ground water flow

Excel based finite difference modeling of ground water flow Journal of Himalaan Eart Sciences 39(006) 49-53 Ecel based finite difference modeling of ground water flow M. Gulraiz Akter 1, Zulfiqar Amad 1 and Kalid Amin Kan 1 Department of Eart Sciences, Quaid-i-Azam

More information

ES 240: Scientific and Engineering Computation. a function f(x) that can be written as a finite series of power functions like

ES 240: Scientific and Engineering Computation. a function f(x) that can be written as a finite series of power functions like Polynomial Deinition a unction () that can be written as a inite series o power unctions like n is a polynomial o order n n ( ) = A polynomial is represented by coeicient vector rom highest power. p=[3-5

More information

12.2 Techniques for Evaluating Limits

12.2 Techniques for Evaluating Limits 335_qd /4/5 :5 PM Page 863 Section Tecniques for Evaluating Limits 863 Tecniques for Evaluating Limits Wat ou sould learn Use te dividing out tecnique to evaluate its of functions Use te rationalizing

More information

Programming I Lecture 7

Programming I Lecture 7 1. Deinition: eal types simulate real numbers. eal types are discrete whereas the set o real numbers is continuous. eal types are called loating-point numbers. The density o loating-point numbers is shown

More information

KFUPM. SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture (Term 101) Section 04. Read

KFUPM. SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture (Term 101) Section 04. Read SE3: Numercal Metods Topc 8 Ordnar Dfferental Equatons ODEs Lecture 8-36 KFUPM Term Secton 4 Read 5.-5.4 6-7- C ISE3_Topc8L Outlne of Topc 8 Lesson : Introducton to ODEs Lesson : Talor seres metods Lesson

More information

Section 3. Imaging With A Thin Lens

Section 3. Imaging With A Thin Lens Section 3 Imaging Wit A Tin Lens 3- at Ininity An object at ininity produces a set o collimated set o rays entering te optical system. Consider te rays rom a inite object located on te axis. Wen te object

More information

Composite functions. [Type the document subtitle] Composite functions, working them out.

Composite functions. [Type the document subtitle] Composite functions, working them out. Composite unctions [Type the document subtitle] Composite unctions, workin them out. luxvis 11/19/01 Composite Functions What are they? In the real world, it is not uncommon or the output o one thin to

More information

Lab 2: Pointers. //declare a pointer variable ptr1 pointing to x. //change the value of x to 10 through ptr1

Lab 2: Pointers. //declare a pointer variable ptr1 pointing to x. //change the value of x to 10 through ptr1 Lab 2: Pointers 1. Goals Further understanding of pointer variables Passing parameters to functions by address (pointers) and by references Creating and using dynamic arrays Combing pointers, structures

More information

Understanding main() function Input/Output Streams

Understanding main() function Input/Output Streams Understanding main() function Input/Output Streams Structure of a program // my first program in C++ #include int main () { cout

More information

Math 1131 Practice Exam 1 Spring 2018

Math 1131 Practice Exam 1 Spring 2018 Universit of Connecticut Department of Mathematics Spring 2018 Name: Signature: Instructor Name: TA Name: Lecture Section: Discussion Section: Read This First! Please read each question carefull. All questions

More information

EP241 Computing Programming

EP241 Computing Programming EP241 Computing Programming Topic 4 Loops Department of Engineering Physics University of Gaziantep Course web page www.gantep.edu.tr/~bingul/ep241 Sep 2013 Sayfa 1 Introduction Loops are control structures

More information

Neighbourhood Operations

Neighbourhood Operations Neighbourhood Operations Neighbourhood operations simply operate on a larger neighbourhood o piels than point operations Origin Neighbourhoods are mostly a rectangle around a central piel Any size rectangle

More information

19.2 Surface Area of Prisms and Cylinders

19.2 Surface Area of Prisms and Cylinders Name Class Date 19 Surface Area of Prisms and Cylinders Essential Question: How can you find te surface area of a prism or cylinder? Resource Locker Explore Developing a Surface Area Formula Surface area

More information

Computer Programming

Computer Programming Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty Department of Computer Science and Engineering Session: Parameter Passing in Function Calls Dr. Deepak B. Phatak & Dr. Supratik Chakraborty,

More information

Section 1.2 The Slope of a Tangent

Section 1.2 The Slope of a Tangent Section 1.2 Te Slope of a Tangent You are familiar wit te concept of a tangent to a curve. Wat geometric interpretation can be given to a tangent to te grap of a function at a point? A tangent is te straigt

More information

1) What of the following sets of values for A, B, C, and D would cause the string "one" to be printed?

1) What of the following sets of values for A, B, C, and D would cause the string one to be printed? Instructions: This homework assignment focuses primarily on some of the basic syntax and semantics of C++. The answers to the following questions can be determined from Chapters 6 and 7 of the lecture

More information

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements Review: Exam 1 9/20/06 CS150 Introduction to Computer Science 1 1 Your First C++ Program 1 //*********************************************************** 2 // File name: hello.cpp 3 // Author: Shereen Khoja

More information

Rational Functions. Definition A rational function can be written in the form. where N(x) and D(x) are

Rational Functions. Definition A rational function can be written in the form. where N(x) and D(x) are Rational Functions Deinition A rational unction can be written in the orm () N() where N() and D() are D() polynomials and D() is not the zero polynomial. *To ind the domain o a rational unction we must

More information

Advanced Tree. Structures. AVL Tree. Outline. AVL Tree Recall, Binary Search Tree (BST) is a special case of. Splay Tree (Ch 13.2.

Advanced Tree. Structures. AVL Tree. Outline. AVL Tree Recall, Binary Search Tree (BST) is a special case of. Splay Tree (Ch 13.2. ttp://1...0/csd/ Data tructure Capter 1 Advanced Tree tructures Dr. atrick Can cool of Computer cience and Engineering out Cina Universit of Tecnolog AVL Tree Recall, Binar earc Tree (BT) is a special

More information

Computer Programming

Computer Programming Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty Department of Computer Science and Engineering Session: Programming using Structures Dr. Deepak B. Phatak & Dr. Supratik Chakraborty, 1

More information

The American University in Cairo Department of Computer Science & Engineering CSCI &09 Dr. KHALIL Exam-I Fall 2011

The American University in Cairo Department of Computer Science & Engineering CSCI &09 Dr. KHALIL Exam-I Fall 2011 The American University in Cairo Department of Computer Science & Engineering CSCI 106-07&09 Dr. KHALIL Exam-I Fall 2011 Last Name :... ID:... First Name:... Form I Section No.: EXAMINATION INSTRUCTIONS

More information

2.8 The derivative as a function

2.8 The derivative as a function CHAPTER 2. LIMITS 56 2.8 Te derivative as a function Definition. Te derivative of f(x) istefunction f (x) defined as follows f f(x + ) f(x) (x). 0 Note: tis differs from te definition in section 2.7 in

More information

CPS 303 High Performance Computing. Wensheng Shen Department of Computational Science SUNY Brockport

CPS 303 High Performance Computing. Wensheng Shen Department of Computational Science SUNY Brockport CPS 303 High Perormance Computing Wensheng Shen Department o Computational Science SUNY Brockport Chapter 4 An application: numerical integration Use MPI to solve a problem o numerical integration with

More information

Binary recursion. Unate functions. If a cover C(f) is unate in xj, x, then f is unate in xj. x

Binary recursion. Unate functions. If a cover C(f) is unate in xj, x, then f is unate in xj. x Binary recursion Unate unctions! Theorem I a cover C() is unate in,, then is unate in.! Theorem I is unate in,, then every prime implicant o is unate in. Why are unate unctions so special?! Special Boolean

More information

Summary of basic C++-commands

Summary of basic C++-commands Summary of basic C++-commands K. Vollmayr-Lee, O. Ippisch April 13, 2010 1 Compiling To compile a C++-program, you can use either g++ or c++. g++ -o executable_filename.out sourcefilename.cc c++ -o executable_filename.out

More information

Piecewise Polynomial Interpolation, cont d

Piecewise Polynomial Interpolation, cont d Jim Lambers MAT 460/560 Fall Semester 2009-0 Lecture 2 Notes Tese notes correspond to Section 4 in te text Piecewise Polynomial Interpolation, cont d Constructing Cubic Splines, cont d Having determined

More information

C++ basics Getting started with, and Data Types.

C++ basics Getting started with, and Data Types. C++ basics Getting started with, and Data Types pm_jat@daiict.ac.in Recap Last Lecture We talked about Variables - Variables, their binding to type, storage etc., Categorization based on storage binding

More information

MTH-112 Quiz 1 - Solutions

MTH-112 Quiz 1 - Solutions MTH- Quiz - Solutions Words in italics are for eplanation purposes onl (not necessar to write in te tests or. Determine weter te given relation is a function. Give te domain and range of te relation. {(,

More information

6, 1 0, f x x 1 2 x h x x x 3, f x sin x cos x, f x x 2 6x 5 f x 4x 3 5x 30. g x x3 8x 31. f x x f x x2 3x 4 33.

6, 1 0, f x x 1 2 x h x x x 3, f x sin x cos x, f x x 2 6x 5 f x 4x 3 5x 30. g x x3 8x 31. f x x f x x2 3x 4 33. Chapter Applications o Dierentiation Review Eercises See CalcChat.com or tutorial help and worked-out solutions to odd-numbered eercises. Finding Etrema on a Closed Interval In Eercises, ind the absolute

More information

The Graph of an Equation Graph the following by using a table of values and plotting points.

The Graph of an Equation Graph the following by using a table of values and plotting points. Calculus Preparation - Section 1 Graphs and Models Success in math as well as Calculus is to use a multiple perspective -- graphical, analytical, and numerical. Thanks to Rene Descartes we can represent

More information

EP578 Computing for Physicists

EP578 Computing for Physicists EP578 Computing for Physicists Topic 3 Selection & Loops Department of Engineering Physics University of Gaziantep Course web page wwwgantepedutr/~bingul/ep578 Oct 2011 Sayfa 1 1 Introduction This lecture

More information

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable Basic C++ Overview C++ is a version of the older C programming language. This is a language that is used for a wide variety of applications and which has a mature base of compilers and libraries. C++ is

More information

Lab Instructor : Jean Lai

Lab Instructor : Jean Lai Lab Instructor : Jean Lai Group related statements to perform a specific task. Structure the program (No duplicate codes!) Must be declared before used. Can be invoked (called) as any number of times.

More information

CSE 332: Data Structures & Parallelism Lecture 8: AVL Trees. Ruth Anderson Winter 2019

CSE 332: Data Structures & Parallelism Lecture 8: AVL Trees. Ruth Anderson Winter 2019 CSE 2: Data Structures & Parallelism Lecture 8: AVL Trees Rut Anderson Winter 29 Today Dictionaries AVL Trees /25/29 2 Te AVL Balance Condition: Left and rigt subtrees of every node ave eigts differing

More information

GE U111 Engineering Problem Solving & Computation Lecture 6 February 2, 2004

GE U111 Engineering Problem Solving & Computation Lecture 6 February 2, 2004 GE U111 Engineering Problem Solving & Computation Lecture 6 February 2, 2004 Functions and Program Structure Today we will be learning about functions. You should already have an idea of their uses. Cout

More information

Larger K-maps. So far we have only discussed 2 and 3-variable K-maps. We can now create a 4-variable map in the

Larger K-maps. So far we have only discussed 2 and 3-variable K-maps. We can now create a 4-variable map in the EET 3 Chapter 3 7/3/2 PAGE - 23 Larger K-maps The -variable K-map So ar we have only discussed 2 and 3-variable K-maps. We can now create a -variable map in the same way that we created the 3-variable

More information

C++ For Science and Engineering Lecture 12

C++ For Science and Engineering Lecture 12 C++ For Science and Engineering Lecture 12 John Chrispell Tulane University Monday September 20, 2010 Comparing C-Style strings Note the following listing dosn t do what you probably think it does (assuming

More information

Limits and Continuity

Limits and Continuity CHAPTER Limits and Continuit. Rates of Cange and Limits. Limits Involving Infinit.3 Continuit.4 Rates of Cange and Tangent Lines An Economic Injur Level (EIL) is a measurement of te fewest number of insect

More information

Programming Language. Functions. Eng. Anis Nazer First Semester

Programming Language. Functions. Eng. Anis Nazer First Semester Programming Language Functions Eng. Anis Nazer First Semester 2016-2017 Definitions Function : a set of statements that are written once, and can be executed upon request Functions are separate entities

More information

Better Living with Automatic Differentiation

Better Living with Automatic Differentiation Better Living with Automatic Differentiation clab lecture: September 2, 2014 Chris Dyer Empirical Risk Minimization Define a model that predicts something given some inputs and modulated by parameters

More information

4.4. Concavity and Curve Sketching. Concavity

4.4. Concavity and Curve Sketching. Concavity 4.4 Concavit and Curve Sketching 267 4.4 Concavit and Curve Sketching f' decreases CONCAVE DOWN 3 f' increases 0 CONCAVE UP FIGURE 4.25 The graph of ƒsd = 3 is concave down on s - q, 0d and concave up

More information

Structured Programming Using C++ Lecture 2 : Introduction to the C++ Language. Dr. Amal Khalifa. Lecture Contents:

Structured Programming Using C++ Lecture 2 : Introduction to the C++ Language. Dr. Amal Khalifa. Lecture Contents: Structured Programming Using C++ Lecture 2 : Introduction to the C++ Language Dr. Amal Khalifa Lecture Contents: Introduction to C++ Origins Object-Oriented Programming, Terms Libraries and Namespaces

More information

Engineering Problem Solving with C++, 3e Chapter 2 Test Bank

Engineering Problem Solving with C++, 3e Chapter 2 Test Bank 1. Match each of the following data types with literal constants of that data type. A data type can be used more than once. A. integer B 1.427E3 B. double D "Oct" C. character B -63.29 D. string F #Hashtag

More information

CSCI 111 First Midterm Exam Fall Solutions 09.00am 09.50am, Wednesday, October 18, 2017

CSCI 111 First Midterm Exam Fall Solutions 09.00am 09.50am, Wednesday, October 18, 2017 QUEENS COLLEGE Department of Computer Science CSCI 111 First Midterm Exam Fall 2017 10.18.17 Solutions 09.00am 09.50am, Wednesday, October 18, 2017 Problem 1 (10 points) The following C++ program has errors

More information

Computer Programming. Basic Control Flow - Loops. Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons

Computer Programming. Basic Control Flow - Loops. Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons Computer Programming Basic Control Flow - Loops Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons Objectives To learn about the three types of loops: while for do To avoid infinite

More information

Exam 1. CSI 201: Computer Science 1 Fall 2018 Professors: Shaun Ramsey

Exam 1. CSI 201: Computer Science 1 Fall 2018 Professors: Shaun Ramsey Exam 1 CSI 201: Computer Science 1 Fall 2018 Professors: Shaun Ramsey I understand that this exam is closed books and closed notes and is to be completed without a calculator, phone, or other computer.

More information

Chapter 17 - Notes Recursion

Chapter 17 - Notes Recursion Chapter 17 - Notes Recursion I. Recursive Definitions A. Recursion: The process of solving a problem by reducing it to smaller versions of itself. B. Recursive Function: A function that calls itself. C.

More information

EE 264: Image Processing and Reconstruction. Image Motion Estimation II. EE 264: Image Processing and Reconstruction. Outline

EE 264: Image Processing and Reconstruction. Image Motion Estimation II. EE 264: Image Processing and Reconstruction. Outline Peman Milanar Image Motion Estimation II Peman Milanar Outline. Introduction to Motion. Wh Estimate Motion? 3. Global s. Local Motion 4. Block Motion Estimation 5. Optical Flow Estimation Basics 6. Optical

More information

More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6

More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6 More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6 Ziad Matni Dept. of Computer Science, UCSB Administrative CHANGED T.A. OFFICE/OPEN LAB

More information

C++ For Science and Engineering Lecture 2

C++ For Science and Engineering Lecture 2 C++ For Science and Engineering Lecture 2 John Chrispell Tulane University Wednesday August 25, 2010 Basic Linux Commands Command ls pwd cd What it does. lists the files in the current directory prints

More information

Week 2: Console I/O and Operators Arithmetic Operators. Integer Division. Arithmetic Operators. Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5.

Week 2: Console I/O and Operators Arithmetic Operators. Integer Division. Arithmetic Operators. Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5. Week 2: Console I/O and Operators Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5.1) CS 1428 Fall 2014 Jill Seaman 1 2.14 Arithmetic Operators An operator is a symbol that tells the computer to perform specific

More information

Subject 1.- Introduction to Scheme language. First part: Scheme. Second part: Prolog

Subject 1.- Introduction to Scheme language. First part: Scheme. Second part: Prolog CÓRDOBA UNIVERSITY SUPERIOR POLYTECHNIC SCHOOL DEPARTMENT OF COMPUTER SCIENCE AND NUMERICAL ANALYSIS DECLARATIVE PROGRAMMING COMPUTER ENGINEERING COMPUTATION ESPECIALITY FOURTH YEAR FIRST FOUR-MONTH PERIOD

More information

An Artificial Immune System Approach for B-Spline Surface Approximation Problem

An Artificial Immune System Approach for B-Spline Surface Approximation Problem An Artiicial Immune Sstem Approach or B-Spline Surace Approimation Problem Erkan Ülker and Vesi İşler Selçuk Universit, Department o Computer Engineering, 4075 Kona, Turke eulker@selcuk.edu.tr Middle East

More information

Apllications. March 03, Indian Institute of Space Science and Technology. MA122 - Computer Programming and. Apllications.

Apllications. March 03, Indian Institute of Space Science and Technology. MA122 - Computer Programming and. Apllications. Indian Institute of Space Science Technology March 03, 2017 Lecture 18 1 2 3 1 #include 2 bool EvensFirst(int nx, int ny); 3 void SelectionSort(int *anarray, int nsize, bool (* pcomparison)(int,

More information

Search Algorithms. Linear Search Binary Search

Search Algorithms. Linear Search Binary Search Search Algorithms Linear Search Binary Search Searching The process used to find the location of a target among a list of objects Searching an array finds the index of first element in an array containing

More information

Three-Dimensional Object Representations Chapter 8

Three-Dimensional Object Representations Chapter 8 Three-Dimensional Object Representations Chapter 8 3D Object Representation A surace can be analticall generated using its unction involving the coordinates. An object can be represented in terms o its

More information

CS 101 Computer Programming and utilization. Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal Rekhi Building IIT Bombay

CS 101 Computer Programming and utilization. Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal Rekhi Building IIT Bombay CS 101 Computer Programming and utilization Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal Rekhi Building Bombay Lecture 4, Conditional execution of instructions Friday, August

More information

CSc Introduc/on to Compu/ng. Lecture 8 Edgardo Molina Fall 2011 City College of New York

CSc Introduc/on to Compu/ng. Lecture 8 Edgardo Molina Fall 2011 City College of New York CSc 10200 Introduc/on to Compu/ng Lecture 8 Edgardo Molina Fall 2011 City College of New York 18 The Null Statement Null statement Semicolon with nothing preceding it ; Do-nothing statement required for

More information

Approximate structural optimization using kriging method and digital modeling technique considering noise in sampling data

Approximate structural optimization using kriging method and digital modeling technique considering noise in sampling data Available online at www.sciencedirect.com Computers and Structures 86 (2008) 1477 1485 www.elsevier.com/locate/compstruc Approimate structural optimiation using kriging method and digital modeling technique

More information

13.5 DIRECTIONAL DERIVATIVES and the GRADIENT VECTOR

13.5 DIRECTIONAL DERIVATIVES and the GRADIENT VECTOR 13.5 Directional Derivatives and te Gradient Vector Contemporary Calculus 1 13.5 DIRECTIONAL DERIVATIVES and te GRADIENT VECTOR Directional Derivatives In Section 13.3 te partial derivatives f x and f

More information

s e

s e 1 Learning Hierarcical Partially Observable Markov Decision Process Models or Robot Navigation Georgios Teocarous Kasayar Roanimanes Sridar Maadevan teocar@cse.msu.edu kas@cse.msu.edu maadeva@cse.msu.edu

More information

Lab01: C++ Expressions ES036a: Programming Fundamentals Fall 2007

Lab01: C++ Expressions ES036a: Programming Fundamentals Fall 2007 Lab01: C++ Expressions ES036a: Programming undamentals all 2007 A. Rationale and Background Welcome to ES036b Lab01. In Lab00 we learned how to create a solution and then a project within this solution

More information

Other operators. Some times a simple comparison is not enough to determine if our criteria has been met.

Other operators. Some times a simple comparison is not enough to determine if our criteria has been met. Lecture 6 Other operators Some times a simple comparison is not enough to determine if our criteria has been met. For example: (and operation) If a person wants to login to bank account, the user name

More information

4.2 The Derivative. f(x + h) f(x) lim

4.2 The Derivative. f(x + h) f(x) lim 4.2 Te Derivative Introduction In te previous section, it was sown tat if a function f as a nonvertical tangent line at a point (x, f(x)), ten its slope is given by te it f(x + ) f(x). (*) Tis is potentially

More information

8/6/2010 Assignment Previewer

8/6/2010 Assignment Previewer Week 4 Friday Homework (1321979) Question 1234567891011121314151617181920 1. Question DetailsSCalcET6 2.7.003. [1287988] Consider te parabola y 7x - x 2. (a) Find te slope of te tangent line to te parabola

More information

EXERCISES 6.1. Cross-Sectional Areas. 6.1 Volumes by Slicing and Rotation About an Axis 405

EXERCISES 6.1. Cross-Sectional Areas. 6.1 Volumes by Slicing and Rotation About an Axis 405 6. Volumes b Slicing and Rotation About an Ais 5 EXERCISES 6. Cross-Sectional Areas In Eercises and, find a formula for te area A() of te crosssections of te solid perpendicular to te -ais.. Te solid lies

More information

Object-oriented Programming for Automation & Robotics Carsten Gutwenger LS 11 Algorithm Engineering

Object-oriented Programming for Automation & Robotics Carsten Gutwenger LS 11 Algorithm Engineering Object-oriented Programming for Automation & Robotics Carsten Gutwenger LS 11 Algorithm Engineering Lecture 3 Winter 2011/12 Oct 25 Visual C++: Problems and Solutions New section on web page (scroll down)

More information

1. Match each of the following data types with literal constants of that data type. A data type can be used more than once. A.

1. Match each of the following data types with literal constants of that data type. A data type can be used more than once. A. Engineering Problem Solving With C++ 4th Edition Etter TEST BANK Full clear download (no error formating) at: https://testbankreal.com/download/engineering-problem-solving-with-c-4thedition-etter-test-bank/

More information

Homework Assignment #2 (revised)

Homework Assignment #2 (revised) CISC 2000 Computer Science II Fall, 2018 1 Recall the following functions and operators: Homework Assignment #2 (revised) sizeof function: returns the size of a variable (i.e., the number of bytes used

More information

Kingdom of Saudi Arabia Princes Nora bint Abdul Rahman University College of Computer Since and Information System CS240 BRANCHING STATEMENTS

Kingdom of Saudi Arabia Princes Nora bint Abdul Rahman University College of Computer Since and Information System CS240 BRANCHING STATEMENTS Kingdom of Saudi Arabia Princes Nora bint Abdul Rahman University College of Computer Since and Information System CS240 BRANCHING STATEMENTS Objectives By the end of this section you should be able to:

More information

You should be able to visually approximate the slope of a graph. The slope m of the graph of f at the point x, f x is given by

You should be able to visually approximate the slope of a graph. The slope m of the graph of f at the point x, f x is given by Section. Te Tangent Line Problem 89 87. r 5 sin, e, 88. r sin sin Parabola 9 9 Hperbola e 9 9 9 89. 7,,,, 5 7 8 5 ortogonal 9. 5, 5,, 5, 5. Not multiples of eac oter; neiter parallel nor ortogonal 9.,,,

More information

CESILA: Communication Circle External Square Intersection-Based WSN Localization Algorithm

CESILA: Communication Circle External Square Intersection-Based WSN Localization Algorithm Sensors & Transducers 2013 by IFSA ttp://www.sensorsportal.com CESILA: Communication Circle External Square Intersection-Based WSN Localization Algoritm Sun Hongyu, Fang Ziyi, Qu Guannan College of Computer

More information

Sample Code: OUTPUT Daily Highs & Lows

Sample Code: OUTPUT Daily Highs & Lows Name1: Name2: Class Day / Time: Due Date: Sample Code: OUTPUT Daily Highs & Lows This program will obtain from the user 3 sets of data including a date, the high temperature and a low temperature for that

More information

Lesson 6 MA Nick Egbert

Lesson 6 MA Nick Egbert Overview From kindergarten we all know ow to find te slope of a line: rise over run, or cange in over cange in. We want to be able to determine slopes of functions wic are not lines. To do tis we use te

More information

by Pearson Education, Inc. All Rights Reserved. 2

by Pearson Education, Inc. All Rights Reserved. 2 1992-2010 by Pearson Education, Inc. All Rights Reserved. 2 1992-2010 by Pearson Education, Inc. All Rights Reserved. 3 1992-2010 by Pearson Education, Inc. All Rights Reserved. 4 1992-2010 by Pearson

More information

Today in CS161. Lecture #7. Learn about. Rewrite our First Program. Create new Graphics Demos. If and else statements. Using if and else statements

Today in CS161. Lecture #7. Learn about. Rewrite our First Program. Create new Graphics Demos. If and else statements. Using if and else statements Today in CS161 Lecture #7 Learn about If and else statements Rewrite our First Program Using if and else statements Create new Graphics Demos Using if and else statements CS161 Lecture #7 1 Selective Execution

More information

Materials: Whiteboard, TI-Nspire classroom set, quadratic tangents program, and a computer projector.

Materials: Whiteboard, TI-Nspire classroom set, quadratic tangents program, and a computer projector. Adam Clinc Lesson: Deriving te Derivative Grade Level: 12 t grade, Calculus I class Materials: Witeboard, TI-Nspire classroom set, quadratic tangents program, and a computer projector. Goals/Objectives:

More information

Exponential and Logarithmic Functions

Exponential and Logarithmic Functions Eponential and Logarithmic Functions Figure Electron micrograph of E. Coli bacteria (credit: Mattosaurus, Wikimedia Commons) CHAPTER OUTLINE. Eponential Functions. Logarithmic Properties. Graphs of Eponential

More information

Exercise 1.1 Hello world

Exercise 1.1 Hello world Exercise 1.1 Hello world The goal of this exercise is to verify that computer and compiler setup are functioning correctly. To verify that your setup runs fine, compile and run the hello world example

More information

Exponential and Logarithmic Functions

Exponential and Logarithmic Functions Eponential and Logarithmic Functions Figure Electron micrograph of E. Coli bacteria (credit: Mattosaurus, Wikimedia Commons) Chapter Outline. Eponential Functions. Logarithmic Properties. Graphs of Eponential

More information

Concavity. Notice the location of the tangents to each type of curve.

Concavity. Notice the location of the tangents to each type of curve. Concavity We ve seen how knowing where a unction is increasing and decreasing gives a us a good sense o the shape o its graph We can reine that sense o shape by determining which way the unction bends

More information

PIC 10A. Lecture 3: More About Variables, Arithmetic, Casting, Assignment

PIC 10A. Lecture 3: More About Variables, Arithmetic, Casting, Assignment PIC 10A Lecture 3: More About Variables, Arithmetic, Casting, Assignment Assigning values to variables Our variables last time did not seem very variable. They always had the same value! Variables stores

More information

BITG 1113: Function (Part 2) LECTURE 5

BITG 1113: Function (Part 2) LECTURE 5 BITG 1113: Function (Part 2) LECTURE 5 1 Learning Outcomes At the end of this lecture, you should be able to: explain parameter passing in programs using: Pass by Value and Pass by Reference. use reference

More information

Chapter Five: Functions. by Cay Horstmann Copyright 2018 by John Wiley & Sons. All rights reserved

Chapter Five: Functions. by Cay Horstmann Copyright 2018 by John Wiley & Sons. All rights reserved Chapter Five: Functions by Cay Horstmann Chapter Goals To be able to implement functions To become familiar with the concept of parameter passing To appreciate the importance of function comments To develop

More information

g(x) h(x) f (x) = Examples sin x +1 tan x!

g(x) h(x) f (x) = Examples sin x +1 tan x! Lecture 4-5A: An Introduction to Rational Functions A Rational Function f () is epressed as a fraction with a functiong() in the numerator and a function h() in the denominator. f () = g() h() Eamples

More information

Graphs of quadratics functions are parabolas opening up if a > 0, and down if a < 0. Examples:

Graphs of quadratics functions are parabolas opening up if a > 0, and down if a < 0. Examples: Quadratic Functions ( ) = a + b + c Graphs o quadratics unctions are parabolas opening up i a > 0, and down i a < 0. Eamples: = = + = = 0 MATH 80 Lecture B o 5 Ronald Brent 07 All rights reserved. Notes:

More information

Name Class Date. To translate three units to the left, 3 from the -coordinate. To translate two units down, 2 from the -coordinate.

Name Class Date. To translate three units to the left, 3 from the -coordinate. To translate two units down, 2 from the -coordinate. Name Class Date 1-1 Eploring Transormations Going Deeper Essential question: What patterns govern transormations o unctions? 1 F-BF.2.3 EXPLORE Translating Points Translate the point (-2, 5) three units

More information

Cryptanalysis of LOKI. Lars Ramkilde Knudsen. Aarhus Universitet Datalogisk Afdeling. Ny Munkegade. DK-8000 Aarhus C. Abstract

Cryptanalysis of LOKI. Lars Ramkilde Knudsen. Aarhus Universitet Datalogisk Afdeling. Ny Munkegade. DK-8000 Aarhus C. Abstract 1 Cryptanalysis of LOKI Lars Ramkilde Knudsen Aarus Universitet Datalogisk Afdeling Ny Munkegade DK-8000 Aarus C. Abstract In [BPS90] Brown, Pieprzyk and Seberry proposed a new encryption primitive, wic

More information

The American University in Cairo Department of Computer Science & Engineeringt CSCI &09 Dr. KHALIL Exam-I Fall 2009

The American University in Cairo Department of Computer Science & Engineeringt CSCI &09 Dr. KHALIL Exam-I Fall 2009 The American University in Cairo Department of Computer Science & Engineeringt CSCI 106-05&09 Dr. KHALIL Exam-I Fall 2009 Last Name :... ID:... First Name:... Form I Section No.: EXAMINATION INSTRUCTIONS

More information

WARM UP LESSONS BARE BASICS

WARM UP LESSONS BARE BASICS WARM UP LESSONS BARE BASICS CONTENTS Common primitive data types for variables... 2 About standard input / output... 2 More on standard output in C standard... 3 Practice Exercise... 6 About Math Expressions

More information

1.4 RATIONAL EXPRESSIONS

1.4 RATIONAL EXPRESSIONS 6 CHAPTER Fundamentals.4 RATIONAL EXPRESSIONS Te Domain of an Algebraic Epression Simplifying Rational Epressions Multiplying and Dividing Rational Epressions Adding and Subtracting Rational Epressions

More information