3. In the class, we learned how to do integral where the limit is finite. Sometimes we need to do the integral when the limit is not finite. For example, a lot of time in statistic we need to evaluate the integral of normal distribution function f(t) 1 = -e-t² Υπ from a to certain point oo. From statistics you will see a table for complementary error function like one you found here(see page2) http://www.geophysik.uni-muenchen.de/~malservisi/GlobaleGeophysik2/erf_tables.pdf t=oo 2 erfc(x) = I d -t² dt t=x If you try to use trapezoid rule directly with this you will find that computer has problem with understanding oo. Thus, we need to do a change to variable such that it turns the improper integral into a proper integral. Remember that tan(π/2) = ∞, if we let then the integral above becomes t = tan(u) u= erfc(x) = 2 e-tan(u)² √π COS(u)² du u=arctan(r) Even though it looks much scarier than before, all the ∞ are gone. However, using trapezoid rule for all pieces is bad since the right end point still has e¯∞/0; computer will scream at this. We can avoid that trouble by first subdivide this into many pieces. Then, we use trapezoid rule for all pieces except the right most piece at . For this piece, we can use mid-point rule A = ƒ((1+r)/2)h instead. Your job for this problem is to find the value for er ƒc(0), er fc(0.5), er fc(1.0) and er fc(1.5). Pick appropriate number of subdivisions. You should get something very close to the table. This is actually a general techique for dealing with infinity in numerical computation: try tan(u) first. Sometimes we use sigmoid function instead because of some of its nice property, you will see some of the use in Pattern Recognition. It should be noted that there is actually a better but adhoc way to avoid imporoper integral for normal distribution but we won't go there. 1 Python
3. In the class, we learned how to do integral where the limit is finite. Sometimes we need to do the integral when the limit is not finite. For example, a lot of time in statistic we need to evaluate the integral of normal distribution function f(t) 1 = -e-t² Υπ from a to certain point oo. From statistics you will see a table for complementary error function like one you found here(see page2) http://www.geophysik.uni-muenchen.de/~malservisi/GlobaleGeophysik2/erf_tables.pdf t=oo 2 erfc(x) = I d -t² dt t=x If you try to use trapezoid rule directly with this you will find that computer has problem with understanding oo. Thus, we need to do a change to variable such that it turns the improper integral into a proper integral. Remember that tan(π/2) = ∞, if we let then the integral above becomes t = tan(u) u= erfc(x) = 2 e-tan(u)² √π COS(u)² du u=arctan(r) Even though it looks much scarier than before, all the ∞ are gone. However, using trapezoid rule for all pieces is bad since the right end point still has e¯∞/0; computer will scream at this. We can avoid that trouble by first subdivide this into many pieces. Then, we use trapezoid rule for all pieces except the right most piece at . For this piece, we can use mid-point rule A = ƒ((1+r)/2)h instead. Your job for this problem is to find the value for er ƒc(0), er fc(0.5), er fc(1.0) and er fc(1.5). Pick appropriate number of subdivisions. You should get something very close to the table. This is actually a general techique for dealing with infinity in numerical computation: try tan(u) first. Sometimes we use sigmoid function instead because of some of its nice property, you will see some of the use in Pattern Recognition. It should be noted that there is actually a better but adhoc way to avoid imporoper integral for normal distribution but we won't go there. 1 Python
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
%matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
from math import sin, cos, exp, pi, sqrt
import math
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education