Intro to Scientific Computing: Solutions

Similar documents
Civil Engineering Computation

Parabolic Path to a Best Best-Fit Line:

Taylor Series and Applications - (8.7)(8.8) b n!x # c" n for x # c " R.!x # c" # f %%!c" 2! T!x"! 1 # x # x2 2! # x3. 3! n!

EVALUATION OF TRIGONOMETRIC FUNCTIONS

9 x and g(x) = 4. x. Find (x) 3.6. I. Combining Functions. A. From Equations. Example: Let f(x) = and its domain. Example: Let f(x) = and g(x) = x x 4

Pattern Recognition Systems Lab 1 Least Mean Squares

Area As A Limit & Sigma Notation

The isoperimetric problem on the hypercube

Numerical Methods Lecture 6 - Curve Fitting Techniques

Alpha Individual Solutions MAΘ National Convention 2013

Math Section 2.2 Polynomial Functions

Lecture 18. Optimization in n dimensions

. Written in factored form it is easy to see that the roots are 2, 2, i,

Arithmetic Sequences

Math 10C Long Range Plans

Project 2.5 Improved Euler Implementation

South Slave Divisional Education Council. Math 10C

The Graphs of Polynomial Functions

Name Date Hr. ALGEBRA 1-2 SPRING FINAL MULTIPLE CHOICE REVIEW #2

PLEASURE TEST SERIES (XI) - 04 By O.P. Gupta (For stuffs on Math, click at theopgupta.com)

The Closest Line to a Data Set in the Plane. David Gurney Southeastern Louisiana University Hammond, Louisiana

Recursive Procedures. How can you model the relationship between consecutive terms of a sequence?

Chapter 18: Ray Optics Questions & Problems

A Note on Least-norm Solution of Global WireWarping

Consider the following population data for the state of California. Year Population

Lecture 5. Counting Sort / Radix Sort

Computational Geometry

Sorting in Linear Time. Data Structures and Algorithms Andrei Bulatov

Name Date Hr. ALGEBRA 1-2 SPRING FINAL MULTIPLE CHOICE REVIEW #1

Polynomial Functions and Models. Learning Objectives. Polynomials. P (x) = a n x n + a n 1 x n a 1 x + a 0, a n 0

1.2 Binomial Coefficients and Subsets

condition w i B i S maximum u i

The golden search method: Question 1

Algorithm Design Techniques. Divide and conquer Problem

EM375 STATISTICS AND MEASUREMENT UNCERTAINTY LEAST SQUARES LINEAR REGRESSION ANALYSIS

Section 7.2: Direction Fields and Euler s Methods

Examples and Applications of Binary Search

CS 683: Advanced Design and Analysis of Algorithms

Lower Bounds for Sorting

Lecture Notes 6 Introduction to algorithm analysis CSS 501 Data Structures and Object-Oriented Programming

LU Decomposition Method

Ones Assignment Method for Solving Traveling Salesman Problem

FURTHER INTEGRATION TECHNIQUES (TRIG, LOG, EXP FUNCTIONS)

A Very Simple Approach for 3-D to 2-D Mapping

A Resource for Free-standing Mathematics Qualifications

Module 8-7: Pascal s Triangle and the Binomial Theorem

COMP 558 lecture 6 Sept. 27, 2010

Administrative UNSUPERVISED LEARNING. Unsupervised learning. Supervised learning 11/25/13. Final project. No office hours today

27 Refraction, Dispersion, Internal Reflection

15 UNSUPERVISED LEARNING

Final Exam information

It just came to me that I 8.2 GRAPHS AND CONVERGENCE

Lecture 1: Introduction and Strassen s Algorithm

Lecture 7 7 Refraction and Snell s Law Reading Assignment: Read Kipnis Chapter 4 Refraction of Light, Section III, IV

Homework 1 Solutions MA 522 Fall 2017

Dynamic Programming and Curve Fitting Based Road Boundary Detection

How do we evaluate algorithms?

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance

The Nature of Light. Chapter 22. Geometric Optics Using a Ray Approximation. Ray Approximation

The number n of subintervals times the length h of subintervals gives length of interval (b-a).

CS Polygon Scan Conversion. Slide 1

Fundamentals of Media Processing. Shin'ichi Satoh Kazuya Kodama Hiroshi Mo Duy-Dinh Le

CIS 121 Data Structures and Algorithms with Java Fall Big-Oh Notation Tuesday, September 5 (Make-up Friday, September 8)

MATHEMATICAL METHODS OF ANALYSIS AND EXPERIMENTAL DATA PROCESSING (Or Methods of Curve Fitting)

The Platonic solids The five regular polyhedra

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence

Spherical Mirrors. Types of spherical mirrors. Lecture convex mirror: the. geometrical center is on the. opposite side of the mirror as

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only

Learning to Shoot a Goal Lecture 8: Learning Models and Skills

OCR Statistics 1. Working with data. Section 3: Measures of spread

MATH 152: Calculus 2, SET8 EXAMPLES [Belmonte, 2018] 6 Applications of Integration. 5.5 The Substitution Rule. 6.2 Volumes. 6.1 Areas Between Curves

Physics 11b Lecture #19

Optimal Mapped Mesh on the Circle

Apparent Depth. B' l'

Data Structures and Algorithms. Analysis of Algorithms

SD vs. SD + One of the most important uses of sample statistics is to estimate the corresponding population parameters.

arxiv: v2 [cs.ds] 24 Mar 2018

An Efficient Algorithm for Graph Bisection of Triangularizations

Fast Fourier Transform (FFT) Algorithms

2) Give an example of a polynomial function of degree 4 with leading coefficient of -6

Accuracy Improvement in Camera Calibration

15-859E: Advanced Algorithms CMU, Spring 2015 Lecture #2: Randomized MST and MST Verification January 14, 2015

V.T. Chow, Open Channel Hydraulics, 1959 problem 9-8. for each reach computed in file below and placed here. = 5.436' yc = 2.688'

Load balanced Parallel Prime Number Generator with Sieve of Eratosthenes on Cluster Computers *

Higher-order iterative methods free from second derivative for solving nonlinear equations

An Efficient Algorithm for Graph Bisection of Triangularizations

Mathematical Stat I: solutions of homework 1

Test 4 Review. dy du 9 5. sin5 zdz. dt. 5 Ê. x 2 È 1, 3. 2cos( x) dx is less than using Simpson's. ,1 t 5 t 2. ft () t2 4.

A graphical view of big-o notation. c*g(n) f(n) f(n) = O(g(n))

Dimensionality Reduction PCA

A Study on the Performance of Cholesky-Factorization using MPI

Reading. Parametric curves. Mathematical curve representation. Curves before computers. Required: Angel , , , 11.9.

CONTINUI TY. JEE-Mathematics. Illustration 1 : Solution : Illustration 2 : 1. CONTINUOUS FUNCTIONS :

Algorithms Chapter 3 Growth of Functions

Texture Mapping. Jian Huang. This set of slides references the ones used at Ohio State for instruction.

Counting the Number of Minimum Roman Dominating Functions of a Graph

Computer Science Foundation Exam. August 12, Computer Science. Section 1A. No Calculators! KEY. Solutions and Grading Criteria.

( n+1 2 ) , position=(7+1)/2 =4,(median is observation #4) Median=10lb

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Improved Random Graph Isomorphism

Transcription:

Itro to Scietific Computig: Solutios Dr. David M. Goulet. How may steps does it take to separate 3 objects ito groups of 4? We start with 5 objects ad apply 3 steps of the algorithm to reduce the pile to groups of 5 3 = 4.. How may steps does it take to separate 3 objects ito groups of less tha 3? Note that 4 < 3 < 5, ad i 3 steps of the algorithm, a group of 4 wold be reduced to groups of 4 3 =. Therefor, usig the last problem, it requires 3 steps. 3. If your haystack is origially a meter cube, ad you ca t see the eedle util the stack is a cetimeter cube, how may steps will the bisectio method require? Note that m 3 is ( 3 cm 3, so we eed to split,, ito groups of to be sure that we ve foud the eedle. log 7 3.5. Therefor, we require 4 steps. 4. If you have a set of spheres, cubes ad pyramids each i three differet colors, how may steps of the algorithm will guaratee that they are sorted ito groups of the same geometry ad color? So split the colors ito distict groups you eed steps. Now that each group is of similar color, you eed more steps to separate each ito differet geometries. Aother way to see this is to ote that there will be 9 groups at the ed, so it will require 4 steps because 3 < 9 < 4. 5. A kig is placed somewhere o a chess board but you are ot allowed to look at the board. You are allowed to pick a vertex ad this vertex is defied as the origi of a coordiate system. You are the told which

quadrat the kig lies i. How may iteratios of this quadsectio method will guaratee that you fid the kig. There are 64 total squares. We are essetially beig asked to split these ito groups of. So it requires log 4 64 = 3 steps.. Use the theorem to show that f(x) = x has a root somewhere i the iterval [, 3]. f() = ad f(3) = 8. Use the theorem to show that f(x) = e x (x + ) cos(x) has a root somewhere i the iterval [, π/]. f() = ad f(π/) = e π/ >. 3. If a ruer fiishes a mile race i 6 miutes, was there a mile sectio that the ruer ra i exactly 6 miutes? Let the ruer s distace traveled by time t be give by f(t). Now, defie g(t) = f(t) f(t 6). Note that g() =. Suppose that g(t) < for all t. The = f(6) f() = f(6) f(54) + f(54) f(48) +... + f(6) f() = g(6) + g(54) +... + g(6) < This is a cotradictio. So there is at least oe value of t [, 6] so that g(t). Because g() =, the itermediate value theorem tells us that there is at least oe value of t so that g(t) =.. If f() = ad f(8) =, how may steps of the bisectio method will be required to fid a approximatio to the root of f(x) accurate to.5? The width of the iitial iterval is 8. After 4 steps, the iterval will have width 8 4 =.5. So, choosig our guess to be the midpoit of this iterval, the error ca be o more tha.5.. You ve built a machie that shoots darts at a target. By aimig it at a agle θ = π/3, your first dart lads cm above the ceter of the bulls eye. You adjust the agle to θ = π/4, ad your secod dart lads

cm below the ceter of the bulls eye. Ca the bisectio method be used to fid the correct agle? Ca we say with certaity how may steps will be required? Our rage is iitially uits wide ad our domai is iitially π/ uits wide. I theory, we could keep bisectig domais util we ve arrowed the rage to a uit space aroud the ceter of the target. If there were a liear relatioship betwee θ ad y, the height at which the dart strikes, the we could apply step of the bisectio method ad hit the target i the ceter, usig θ = (π/3 + π/4)/ = 7π/4. Placig the dart machie at the origi of a coordiate system, ad usig Newtoia physics (igorig frictio), gives a equatio for the height at which the dart strikes. y = d ta θ g d sec θ Here d is the x-distace of the target from the machie ad g is the acceleratio of gravity. So, there is a o-liear relatioship betwee the iput, θ, ad the output y. So we ca ot easily coclude how may steps will be required.. Approximate a root of the polyomial x 5 3x 4 6x 3 + 8x + 8x 4 with a accuracy of at least.. From this, guess what the exact value is ad the use this iformatio to factor the polyomial. The apply the algorithm agai to fid aother root. Ca you fid all five roots this way? (Note: I kow that there are other tricks for root fidig, do t use them.) The iteger roots of this equatio are {±, 3}. They should be easy with the bisectio method after plottig the fuctio. Usig polyomial or sythetic divisio, we fid x5 3x 4 6x 3 +8x +8x 4 = x. This (x )(x+)(x 3) is easy to factor.. Obviously f(x) = x 4 has a root at x =. Ca the bisectio method approximate this root? f(x) > for x, so the bisectio method is ot useful because we eed a iterval o which the fuctio chages sig. 3

3. The bisectio method does ot help whe searchig for the roots of f(x) = x +. Why? Ca you thik of a way to modify the bisectio method to fid roots of f(x)? The roots are ot real because x + for real x. Lettig x = ıy gives y which has real roots that ca be foud with the bisectio method.. Does this method appear to coverge for f(x) = x, x = 3, ad x =? Newto s method takes the form x + = x (x )(x x ). The plot x x idicates covergece. 3 x=±.95e 5.5.5.5 3 4 5 6 7 Figure : Newto s method for x.. Ca you thik of a way to apply these ideas to higher dimesioal problems? Apply your idea to fidig the root of f(x, y) = x + y. First pick two guesses, (x, y ) ad (x, y ). The create the lie x = (x x )t + x y = (y y )t + y z = (f(x, y ) f(x, y ))t + f(x, y ) 4

f(x This crosses the x y plae at t =,y ) f(x,y ) f(x,y. This motivates the ) umerical scheme x + = x f(x, y )(x x ) f(x, y ) f(x, y ) y + = y f(x, y )(y y ) f(x, y ) f(x, y ). Does this method appear to coverge for f(x) = x si x, x =, ad x =? The plot idicates covergece. x=.57±8.93e 5.5.5.5.5.5 4 6 8 4 6 Figure : Newto s method for x si x.. Does this method appear to coverge for f(x) = e x, x =, ad x =? What about x = ad x =? I both cases, the iterates do ot coverge.. How ca you combie these two ideas together with Newto s method to fid the correct value of ω? Solvig for ω i the secod equatio ad isertig this ito the first gives θ ds cos(s) cos(θ) τ g/l = 5

8 6 4 4 6 8 4 6 8 Figure 3: Newto s method for e x. Blue o s show the first iitial data iterates, red x s show the secod The left had side ca be defied as g(θ). If Newto s method solves g(θ) = the we use this value of θ to calculate. Give the plot of f(x) = x ω = (g/l)( cos θ) ds, do you thik Newto s cos(s) cos(x) method will coverge? It may help to kow that f( + ) = 49 6.756. From the plot, we see that if τ g/l < 49 6 the there is o solutio to the problem. Otherwise this looks like the problem of fidig whe a parabola-like thig itersects the x-axis, which our experiece tells us may be doable with Newto s method. Be wared that the way this is coded, you ca t choose values for x outside of (, π). Do you thik that this will matter whe usig Newto s method? If we choose some valid value for τ g/l ad pick our iitial guesses i the rage (, π), it appears from the graph that our subsequet guesses will stay i this domai. So it may ot be a problem. Below we show how this ituitio is validated for τ g/l = 3, x =, ad x =. 6

.4 x=.477±.38e 8..8.6.4. 3 4 5 6 7 Figure 4: Covergece of Newto s method for the pedulum problem. 7