Sale!

Math 240 Hw 1-7 Solutions

Original price was: $150.00.Current price is: $135.00.

Download Details:

  • Name: MATH-240-HW-SOLUTIONS-mivxpd.zip
  • Type: zip
  • Size: 2.05 MB

Category:

Description

5/5 - (1 vote)

Math 240 Hw 1 Solved

 

 1. Given the function f(x) = x

2 + 2x+ 1, estimate f

(2) using the points (1, 4) and (2, 9).
The actual answer is 6–how close is your estimate?
2. For the function f(x) = sin(x), estimate f

π
7

using the points
π
6
,sin(π
6
)

and

π
4
,sin(π
4
)

. How good is your estimate?
3. For the function f(x) = √
x, estimate f

(0.5) using the points (0, 0) and (1, 1). How
good is your estimate?
4. Using the table below for f(x), estimate f

(1.5).
x f(x)
1 2
1.5 2.25
2 2.5
1

 

Math 240 Hw 3 Solved

 In today’s class, we continued Lagrange polynomials, which provide us with a way of finding

the polynomial of degree n − 1 that goes through n points. The example we did today
was three points to find a degree 3 polynomial (a quadratic). For a reminder, the Lagrange
polynomial is constructed from basis polynomials, denoted as ℓi(x). It is
L(x) = y1ℓ1(x) + y2ℓ2(x) + . . . + ynℓn(x).
These basis elements are constructed from only the x-values of the points. They are defined
as multiplying the following terms:
x − xm
xi − xm
where m never equals i. The notation used in math is
ℓi(x) = Y
m,m̸=i
x − xm
xi − xm
.
That big pi-looking symbol means multiply all the terms.
The example we did in class was with the points {(−2, −8),(−1, −1),(1, 1),(2, 8)}. So we
will use the index i for the first point, 2 for the second, and 3 for the third. This means:
i xi yi
1 −2 −8
2 −1 −1
3 1 1
4 2 8
When we compute the basis elements, we compute the following:
• ℓ1(x) =
x+1
−2+1
 x−1
−2+1
 x−2
−2−2

= −
1
12 (x
3 − 2x
2 − x + 2)
• ℓ2(x) =
x+2
−1+2
 x−1
−1−1
 x−8
−1−2

=
1
6
(x
3 − x
2 − 4x + 4)
• ℓ3(x) =
x+2
1+2
 x+1
1+1
 x−2
1−2

= −
1
6
(x
3 + x
2 − 4x − 4)
• ℓ3(x) =
x+2
2+2
 x+1
2+1
 x−1
2−1

=
1
12 (x
3 + 2x
2 − x − 2)
To construct the Lagrange polynomial, we now multiply each basis polynomial by its corresponding yi value:
L(x) = −8ℓ1(x)−1ℓ2(x) + 1ℓ3(x) + 2ℓ4(x)
= x
3
We see that we get a degree 3 polynomial. Let’s check that it works with our points and
even graph our points with the function we found.
1
−2 −1 1 2 −8
−1
1
8
x
L(x)
Now, I would like you to repeat the same procedure with the following points.
1. Find the cubic polynomial that passes through (0, 3),(−1, 2),(2, 11),(1, 4) using the
method of Lagrange polynomials illustrated in the example above.
2

 

Math 240 Hw 5 Solved

Solve the following differential equations.
1. x

(t) = 2 sin(t), x(π) = 2
2. x

(t) = 3 cos(t), x(0) = 1
3. x

(t) = e
−t
, x(1) = 0 (try to write your answer in a nice form)
4. x

(t) = x, x(0) = 1
5. x

(t) = x
2
, x(0) = 1
6. x

(t) = xt, x(0) = 0
7. x

(t) = e
−x
, x(1) = 1
1

 

Math 240 Hw 6 Solved

We stated in class that computing anti-derivatives from a specific point to another is an area
under the curve. We can approximate this with rectangles and triangles.
1 2 3 4 5
5
10
15
20
25
(2, 4)
(1, 1)
(3, 9)
(4, 16)
x
f(x)
For this problem, we can estimate the area under this curve from 1 to 4 by computing the
areas explicitly.
The first column can be approximated by the area 1
2
(1)(3) = 3
2
(for the triangle) and (1)(1) =
1 is the area. The total area is 5
2
.
The second column can be approximated by the area 1
2
(1)(5) = 5
2
(for the triangle) and
(1)(4) = 4. The total area 13
2
.
THe third column can be approximated by the area 1
2
(1)(7) = 7
2
(for the triangle) and
(1)(9) = 9. The total area 25
2
.
Putting these all together, we get the area 5
2 +
13
2 +
25
2 =
43
2
.
Some things to notice: first, the y-values are coming from the function x
2
. The area of a
rectangle is base times height. And the area of a triangle is half of base times height.
1. Estimate the area under 2x
for x-values between 1 and 4.
2. Estimate the area under x
3
for x-values between 1 and 3.
1

 

Math 240 Hw 7 Solved

Consider a small dataset with the following points:
x y
1 2a
2 3
3 5
4 4
We want to fit a linear model y = mx + b to this data using gradient descent.
1. Identify a good set of initial parameters for your model.
2. Compute the mean absolute error of your initial parameters:
E(m, b) = 1
n
Xn
i=1
|yi − (mxi + b)|
3. Make one adjustment to m and b using the derivative of E with respect to m and b.
What is your updated model?
4. compute the mean absolute error of your updated model.
1