4 Pages

270lect12

Course: CDF 270, Fall 2009
School: University of Toronto
Rating:
 
 
 
 
 

Word Count: 1048

Document Preview

ERROR TRUNCATION There are instances where a computation is represented by an infinite series. For example, the series: 1 - 1/2 + 1/4 - 1/8 + 1/16 - ... Is an infinite series. Often we need can represent a function by its Taylor expansion (another infinite series): f(x) = f(c) + f'(c)*(x - c) + f''(c)/2! * (x-c)^2 + ... However, computers cannot perform infinite calculations. We approximate...

Register Now

Unformatted Document Excerpt

Coursehero >> Canada >> University of Toronto >> CDF 270

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
ERROR TRUNCATION There are instances where a computation is represented by an infinite series. For example, the series: 1 - 1/2 + 1/4 - 1/8 + 1/16 - ... Is an infinite series. Often we need can represent a function by its Taylor expansion (another infinite series): f(x) = f(c) + f'(c)*(x - c) + f''(c)/2! * (x-c)^2 + ... However, computers cannot perform infinite calculations. We approximate our answers by choosing where to terminate (or "truncate") the series. So, for example, the above Taylor series could have been truncated as follows: (n) f(x) = f(c) + f'(c)*(x-c) + ... + f (x)/n! * (x-n)^2 Truncation error occurs when you only use a finite number of terms in an infinite series. The larger n (i.e. the more terms in the series), the more accurate the result. REAL-LIFE EXAMPLES OF FLOATING POINT ERRORS - The Patriot missile failures in Desert Storm were due to roundoff error because the system was designed to be on alert for only a few minutes at a time. Instead, they ran continuously for *days*. Thus, the clock, which was storing time in floating-point, began to have too many digits to the left of the decimal place and not enough after the decimal place to do accurate timings of incoming SCUD velocities. - The Vancouver Stock Exchange ran for 22 months with a bad algorithm for computing the index. The initial value of the index was normalized to be 1000.000. Instead of the obvious algorithm of adding up all the current values of the stocks, somebody thought it would be more efficient (bonehead!) if only the stocks that actually changed that day were included in the computation, since some stocks don't change price on some days. So, instead of the obvious "add all the stock prices up" algorithm, they used for each stock S if S changed in price today then index := index + change in S end if end for Of course, the changes are almost always small compared to 1000.000, and we're adding a bunch of small numbers to a big number. Result: loss of precision, and after 22 months, when the actual value of the VSE had become about 1098.892, the accumulated roundoff error of 22 months had the index valued at 520. - Another interesting fact from the software engineering point of view is that they had decided to "cut costs" and re-use alot of code from the Ariane 4 launcher. This is fine and dandy, but they decided to cut costs *further* by not even reviewing some of the code to ensure that it would still work on the Ariane 5. The overflow mentioned in the article occurred simply because, during the initial launch phase, the Ariane 4 was a slower rocket and never had a horizontal velocity greater than 32768, and nobody noticed this fact during the truncated code reviews that were performed. - An excellent page with many more examples is at: http://dutita0.twi.tudelft.nl/users/vuik/wi211/disasters.html MORE EXAMPLES OF UNSTABLE COMPUTATIONS (1) A first example of a stable and unstable computation is: Unstable: [[...((...(1+eps)^(1/2))^(1/2))...)^1/2)]^2]^2]..]^2 Stable: [[...((...(1+eps)^2)^2)...)^2)]^(1/2)]^(1/2)]...]^(1/2) That is for small eps if you compute 1+eps, take K square roots followed by K squarings you would recover 1+eps in exact arithmetic. An easy anlysis of the round-off error bound predicts growth exponential in the error (exponential in K) and this can be observed in computation. Reversing the order (squaring first, followed by K square roots) yields a uniform bound on the error (as a function of K) and this is observed in practice. The example is probably better if what is computed are the above expressions minus 1.0 (as then the exact answer should be eps in both cases. (2) A second example of a stable and unstable computation is the following Taylor's series expansion for approximating the value of e^x e^x = 1 + x + x^2/2! + x^3/3! + ... + x^n/n! + ... Obviously, the more terms we eliminate from the end, the less accurate our result will be due to truncation error. But recall that even if we did implement this equation in a program, it would be subject to roundoff error. What is the best way to see this? Let's compress the above equation into a sum as follows: n e^x = SUM { x^i / i! } i=0 As 'i' increases, you need to determine what will be increasing or decreasing faster -> the numerator or denominator of each term. It should be apparent that i! grows much more quickly than x^i. Initially, we could propose to sum the series *backwards* since the rightmost numbers will most likely be smaller due to relatively larger denominators. This may decrease the problem of overflow and roundoff error since we begin summing with smaller numbers instead of starting with larger numbers. But what if the numerators x^i of the end terms are very large? If we summed backwards or forwards, we would run into the same problem of roundoff error and possible overflow. A better solution is to use what is referred to as "Horner's Rule". By inspecting the equation, you should realize that you can take out common factors of 'x' since it continuously increases its exponent. So, for example, if we truncated our equation for e^x to 10 terms as follows: 1 + x + x^2/2! + ... + x^9/9! It can be rewritten a...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

University of Toronto - CDF - 270
OVERFLOW AND UNDERFLOW- Consider the following floating point number system s = 3, Beta = 10, E_min = -9, E_max = 9 (this system is 3-digit, base 10, 1-digit exponent) The largest possible absolute value that can be represented is the *overflow* va
University of Toronto - CDF - 270
= INTRODUCTION TO NUMERICAL ANALYSIS =REPRESENTATION OF INTEGERS- * A short introduction to number representations: - To represent unsigned integers, we simply store them in binary form. So if we have n bits available, integers are represented as str
University of Toronto - CDF - 270
All-Pairs Shortest Path-- Recall that Dijkstra's algorithm was used to locate the shortest path from a *single* source node to every other node in the graph.- What if we want to find the shortest path between every two nodes in a graph (i.e. from *an
University of Toronto - CDF - 270
MATRIX CHAIN MULTIPLICATION-Basics of Matrix multiplication-Consider the following matrices:M_1 = - - M_2 = - - | 5 2 | | 1 | | 8 1 | | 2 | - - - -Dimensions 2 x 2 2 x 1What is the product, P, that results from multiplying these matrices:P = -
University of Toronto - CDF - 270
~CDF Lab Basics~From my web page, please read the "Notes on UNIX". This will give you a good introductionon how to use the CDF lab.The CDF lab is located in the Engineering Annex. The entrance is in the alley just south ofthe Sandford Fleming buildi
Sanford-Brown Institute - AM - 169
University of Toronto - CSC - 148
The target of a referenceConsider this code:public class A cfw_ ? / 4. Variable in class A? public interface I cfw_ static final int CNST = 66; ? / 3. Constant in I? public class B implements I extends A cfw_ ? / 2. Variable in class B? public void m(
University of Toronto - CSC - 148
TIME ANALYSIS OF ALGORITHMS WITHOUT RECURSION284Time eciencyWe like to know the time eciency of a program for several reasons: To get an estimate of how long a program will run. Waiting for it to nish may not be feasible! To get an estimate of how larg
Binghamton - EE - 301
EECE 260 Electrical Circuits Prof. Mark FowlerComplex Number Review1/16Complex NumbersComplex numbers arise as roots of polynomials.Definition of imaginary # j and some resulting properties:j = - 1 j 2 = -1 (- j )( j ) = 1 (- j )(- j ) = -1Recall t
University of Texas - EE - 382
SystemC TutorialJohn MoondanosStrategic CAD Labs, INTEL Corp. & GSRC Visiting Fellow, UC BerkeleySystemC IntroductionWhy not leverage experience of C/C+ developers for H/W & System Level Design? But C/C+ have nonotion of timeNo event sequencingConc
University of Florida - ZOOM - 102
# # # # # # # # # # # #
Radford University - ECON - 695
Entrepreneurship in the Global EconomyECON 695 Summer I 2005Professor: Phone: Office: Email: URL: Office hours: Alex Orlov 831-5889 Davis 112 aorlov@radford.edu www.radford.edu/~aorlov/econ695 after class and by appointment1Purpose of the CourseThe p
Delaware State - PHYS - 202
Phys202 - Dynamics - Spring 2007Chapter 15, Problems 106, 108, 110, 137, 149. Chapter 16, Problems 1 and 9HW13 Solutions1Problem 15.106After the sliding collar A hits a stationary collar B with the speed of 5 m/s, it rebounds with a speed of 2.5 m/s,
Lake County - CI - 332
Day 1 PretestObjectives: To find the students current knowledge on Objectives: charts and recording Introduce charts to data. the students in a formal manner. Description: The test will include the Description: We will concepts that we discuss how we can
Olivet College - STATS - 0809
Ted Barclay Spring InvitationaDates: 04/03-04/04, 2009Round: 2FINAL RESULTSPar-Yardage: 71-6559 Fin. School 1 1 T 4 T 10 T 10 T 73 T 2 T 4 T 8 T 10 T 41 T 41 T 2 T 4 T 8 T 41 T 50 T 56 T 4 2 T 17 T 22 T 31 T 50 T 4 7 T 17 T 17 T 17 T 63 6 T 14 T 27 T
UMass Dartmouth - CE - 1840
Social MovementsUniversity of Massachusetts @ Dartmouth Summer Term 2009Professor: Karen Straight, Ph.D. Phone: 307-735-4177 Required Text: Goodwin and Japser. 2003. The Social Movements Reader: Cases and Concepts. Malden: Blackwell Publishing. Addition
Lake County - MCB - 240
Reflexes and Spinal cord function (Coloring book plates 95; Vander Chapter 10, pp. 323-332) General motor organization: motor programs, motor control hierarchy; upper and lower motor centers Structure of spinal cord; gray matter vs. white matter; which pa
Maine - EGN - 100
The HexA Challenge Spring 2006Design, construct, test and demonstrate a wheeled vehicle that will go, under its own power, up the ramp on the first floor of the John Mitchell Center using two NiMH AAA batteries as the sole energy source. The vehicle must
MD University College - ASIA - 2098
BIOL 398 L Bacteria, Fungi and Fermentation University of Maryland University CollegeInstructor: Dr. Rick Martin Email: rmartin@asia.umuc.edu TEXTBOOK: The following textbook will be used in this course: Wild Fermentation: The Flavor, Nutrition, and Craf
Johns Hopkins - ECON - 334
Econometrics: Homework 3 Due: 10am, Monday March 301. Consider the regression model Yi = 0 + 1 X1i + 2 X2i + 3 X1i X2i + ui . Please show: Y (a) X1 = 1 + 3 X2 (eect of change in X1 holding X2 constant). (b)Y X2=2+3 X1(eect of change in X2 holding X
East Los Angeles College - IT - 620
Relational Databases for Querying XML Documents: Limitations and OpportunitiesJayavel Shanmugasundaram Kristin Tufte Gang He Chun Zhang David DeWitt Jeffrey Naughton Department of Computer Sciences University of Wisconsin-Madison cfw_jai, tufte, czhang,
University of Toronto - AST - 320
Mini-Problem Set VIII: Dating stars using Lithium: contractiondue 6 Feb 2009As pre-main-sequence stars contract, at some point their internal temperature becomes suciently hot that Lithium is destroyed. This will occur earlier for more massive stars, an
University of Toronto - AST - 320
Mini-Problem Set VII: Gravity from the end of the Balmer seriesdue 2 Feb 2009Fig. 8.15 in CO2 (8.14 in CO1) shows that the Balmer lines are broader in stars with higher gravity. We will show below that these stars also show fewer higher Balmer lines, be
University of Toronto - AST - 320
Mini-Problem Set V: Completely convective starsdue 26 Jan 2009Stars with masses < 0.3 M are completely convective, and a polytropic model should work fairly well. We will check this using the models shown in Fig. 3.3. Note: since we determine how well i
Ill. Chicago - MATH - 180
Math 180Final ExamDecember 13, 2007For each problem give a complete written solution which states the method being used and clearly shows all the mathematical steps. Numerical answers can be given in terms of constants such as e, , ln 2, 5. A calculato
UCLA - EDUC - 230
Computer Example #17 Computer Example #17: Stepwise Hierarchical Selection - GPAuse http:/www.gseis.ucla.edu/courses/data/gpa sw regress gpa (greq grev) (mat ar), pr(.01) hierp = 0.0113 >= 0.0100 p = 0.0001 < 0.0100 begin with full model removing mat ar
Lake County - CI - 499
Details Four circular tables and twenty-four brightly colored chairs occupy much of the space in the Merit Workshop classroom. A recent addition also includes ceiling fans and a window air-conditioner. The room is located in the basement of the mathematic
St. Xavier - CSCI - 320
%!PS-Adobe-3.0 %Creator: psdit %For: andvari:hoca (fbs proj account,unknown) %Title: stdin (ditroff) %CreationDate: Thu Aug 24 22:48:36 1995 %DocumentNeededResources: (atend) %DocumentSuppliedResources: DIThacks %Pages: (atend) %EndComments % psdit.pro -
MD University College - ASIA - 2098
University of Maryland Asian Division BMGT 380 BUSINESS LAW I Instructor: Timothy G. Cooper, JD, MBA REQUIRED TEXT: Business Law Today, Standard Edition, Miller and Jentz (West, 7th Ed., 2005) COURSE DESCRIPTION: BMGT 380 will introduce the student to var
LSU - APPL - 003
Department of Communication Sciences & DisordersDepartmental Plan University Objective 1. Increase Research Productivity and Long-term Economic Development by Increasing Faculty and Staff in Areas of Research That Have Potential for Growth. Departmental
MD University College - ASIA - 2098
BIOL 230 General MicrobiologyINSTRUCTOR: Dr. Rick Martin Email: rmartin@asia.umuc.edu TEXTBOOK: Microbiology, 9th Edition, by Tortora, Funke & Case (*note* an electronic version of the text is available for subscription by the publisher at a reduced pric
University of Rochester - PHYS - 231
RW14 About this assignmentNuclear reactions with change of rest mass. Section 4.7 (p. 143 -147). 3. A nucleus whose mass is 3.707776e-25 kg undergoes spontaneous "alpha" decay. The original nucleus disappears and there appear two new particles: a He-4 nu
University of Toronto - CS - 309
CSC309 Tutorial CSS & XHTMLLei JiangJanuary 27, 20031CSSCSC309 Tutorial -CSS & XHTML2Spring 2003Sampel XML Document<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml-stylesheet type="text/css" href="bookDB.css"?> <!- File: bookDB.xml ->
National Taiwan University - AST - 294
The Early UniverseThursday, January 24(planetarium show tonight: 7 pm, 5th floor Smith Lab)Hot, dense, opaque objects emit light.Color (or wavelength) of light depends on object's temperature.Temperature is inversely proportional to wavelength.red-h
Sonoma - USERS - 304
Econ 304 Sonoma State University Dr. Robert Eyler Fall 2007 Symbol List y = real GDP yD = real disposable income Sp = personal or private savings Sg = government savings D = government deficit = G T G = government spending, T = tax receipts of government,
Grinnell College - CS - 302
Programming Languages (CS302 2007S)Ousterhout - Scripting Higher-Level Programming for the 21st CenturyComments on: Ousterhout, John K. (March 1988). Scripting: Higher-level programming for the 21st century. IEEE Computer 31(3), pp. 23-30. Also availabl
Lake County - IBMP - 690
* "@(#)12 1.6 src/ppe/pdf/ppe.pdf.README, ppe.pedocs, ppe_rlyn, rlynt9f1"- How to view a softcopy of this document from CD -(These instructions assume that your CD drive is cd0.1) To view a softcopy of this document from the ISMS CD: 1) View the componen
Maryland - ENCH - 250
MATLABThe Language of Technical ComputingComputation Visualization ProgrammingUsing MATLABVersion 6How to Contact The MathWorks:www.mathworks.com comp.soft-sys.matlab support@mathworks.com suggest@mathworks.com bugs@mathworks.com doc@mathworks.com s
Washington University in St. Louis - CSE - 332
C+ STL Algorithms Generic algorithms Apply to a wide range of types E.g., sorting integers (long) or intervals (long, long) Dont require inheritance relationships Types substituted need not have a common base class Need only to be models of the algor
Kansas State University - NCERA - 210
NCREA-194http:/docs.google.com/PresentationView?docID=dgchzr.Measuring Economic Impact for CooperativesBrent Hueth and Reka Sundaram-StukelMotivationNo systematic reporting on cooperative business activity Balkanized research programs on cooperatives
Lake County - CI - 407
Jon Weatherford Stansell805 West Daniel Street Champaign, IL 61820 Phone: 217-355-5351 Email: jonstansell@gmail.comObjective: Assistant Professor, English University Education2003-08University of Illinois at Urbana-Champaign, ILPh.D. Curriculum and I
Cornell - MATH - 293
Math 293 Practice Prelim #3 (The actual exam will not be as long as this one.) Integration formulas which may be useful:Spring 2000cos ax sin ax sin ax cos ax x cos ax dx = x + + 2 a a a a2 cos ax sin ax cos ax x2 sin ax dx = -x2 + 2x 2 + 2 3 a a a cos
University of Toronto - CS - 347
Networking Background(with a focus on security) 347 - Tutorial Lionel LittySource: http:/en.wikipedia.org/wiki/Image:IP_stack_connections.pngSource: http:/www.nap.edu/html/coming_of_age/ch3_f2.htmlEncapsulationSource: http:/en.wikipedia.org/wiki/Imag
Lake County - PHYS - 580
Warning Concerning Copyright RestrictionsThe Copyright law of the United States (Title 17, United States Code) governs the making of photocopies or other reproductions of copyright material. Under certain conditions specified in the law, libraries and ar
Banard College - BC - 3800
Organic Contaminants' Affinity for Protozoan-Modified Dissolved Organic Matter (DOM)Nella Green, Environmental Science Dep't, Barnard Elizabeth Kujawinski, Research mentor, Barnard Dallas Abbott, Seminar advisor, LDEOProtozoa: Flagellates & CiliatesPro
University of Toronto - CSC - 309
CSC309: Web ProgrammingSingin' the Tomcat BluesGreg messed upWeb Programming: CSS and XSLHad an old version of hsqldb.jar in one of the (many) directories Tomcat reads from So something that didn't work appeared toIf you:Greg Wilson gvwilson@cs.utor
Duquesne - LEGISLATIV - 1968
Duquesne - LEGISLATIV - 1968
Duquesne - LEGISLATIV - 1968
Duquesne - A - 1968
PRIOR PASSAGE - NONE PRINTER'S NO.291THE GENERAL ASSEMBLY OF PENNSYLVANIASENATE BILL No. 284REFERRED TO FINANCE, JANUARY 24, 1995Session of 1995INTRODUCED BY JUBELIRER, HART, DAWIDA, GERLACH, BRIGHTBILL, SHAFFER, SALVATORE, LEMMOND, PETERSON, PUNT,
Duquesne - A - 1968
PRIOR PASSAGE - J.R. 1998-3 PRIOR PRINTER'S NO. 241 PRINTER'S NO.2191THE GENERAL ASSEMBLY OF PENNSYLVANIASENATE BILL No. 231Session of 1999INTRODUCED BY CONTI, TOMLINSON, EARLL, BELL, MELLOW, LEMMOND, WAUGH, THOMPSON, WHITE, WOZNIAK, CORMAN AND BRIGH
Duquesne - A - 1968
PRINTER'S NO.1015THE GENERAL ASSEMBLY OF PENNSYLVANIASENATE BILL No. 888Session of 1979INTRODUCED BY HESS, LINCOLN, PECORA, PRICE, JUBELIRER, ZEMPRELLI AND MURRAY, JULY 4, 1979 REFERRED TO CONSTITUTIONAL CHANGES AND FEDERAL RELATIONS, JULY 4, 1979A
Duquesne - A - 1975
PRINTER'S NO.22THE GENERAL ASSEMBLY OF PENNSYLVANIASENATE BILL No. 22Session of 1975INTRODUCED BY KURY, NOLAN, FRAME, MESSINGER, FLEMING, AMMERMAN, MURRAY, EWING, WOOD, HOWARD, MYERS, STAPLETON, JUBELIRER, BELL AND DOUGHERTY, JANUARY 20, 1975 REFERRE
Duquesne - A - 1975
HOUSE AMENDED PRIOR PRINTER'S NOS. 1742, 2009, 2060, 2170PRINTER'S NO.2388THE GENERAL ASSEMBLY OF PENNSYLVANIASENATE BILL No. 1409Session of 1974INTRODUCED BY KURY, MESSINGER, AMMERMAN, ORLANDO, McCREESH, LAMB AND MURRAY, JANUARY 21, 1974 AS AMENDED
InterAmerican Aguadilla - COMP - 2555
PARTIdatabase conceptsDatabase Systems1Data Models2Copyright 2005 by Thomson Course Technology. All rights reserved. This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in w
InterAmerican Aguadilla - COMP - 2555
35547_02 7/15/2005 11:56:4 Page 282 T W OData ModelsIn this chapter, you will learn: Why data models are important About the basic data-modeling building blocks What business rules are and how they influence database design How the major data models e
Duquesne - A - 1968
SESSION OF 1996JR. 1996-31547~Thisoint Resolution No. 3 was passed for the first time at the Legislative Session of 1996.) J No. 1996-3 A JOINT RESOLUTION SB 284 Pmposing an amendment to the Constitution of the Commonwealth of Pennsylvania, authorizing
Duquesne - A - 1968
PRIOR PASSAGE - NONE PRIOR PRINTER'S NO. 291PRINTER'S NO.1450THE GENERAL ASSEMBLY OF PENNSYLVANIASENATE BILL No. 284SENATOR HART, FINANCE, AS AMENDED, OCTOBER 3, 1995Session of 1995INTRODUCED BY JUBELIRER, HART, DAWIDA, GERLACH, BRIGHTBILL, SHAFFER
Duquesne - A - 1968
SESSION OF 1997J.R. 1997-1633(This Joint Resolution No. 1 was passed for the first time at the Legislative Session of 1996 as Joint Resolution No.3 and for the second time at the LegislativeSessian of 197 and was approved by the electorate on November
Duquesne - A - 1968
HOUSE AMENDED PRIOR PASSAGE - NONE PRIOR PRINTER'S NOS. 4, 68PRINTER'S NO.112THE GENERAL ASSEMBLY OF PENNSYLVANIASENATE BILL No. 4Special Session No. 1 of 1995INTRODUCED BY FISHER, GREENLEAF, SHAFFER, BRIGHTBILL, MELLOW, ANDREZESKI, WAGNER, WENGER,
Duquesne - A - 1968
SENATE AMENDED PRIOR PASSAGE - J.R. 1995-3(SS1) PRIOR PRINTER'S NO. 1842 PRINTER'S NO.3470THE GENERAL ASSEMBLY OF PENNSYLVANIAHOUSE BILL No. 1520Session of 1997INTRODUCED BY GANNON, DALEY, COY, RUBLEY, BOSCOLA, FARGO, LEDERER, EGOLF, BENNINGHOFF, WOG