The test will be on paper. You will have to write out all your answers and in some cases your Julia commands to receive full credit.
On the test you can use the computer and the internet, but you can not:
use your phone during the test – it must be out of sight
take any pictures or screenshots
communicate with others
Use any artificial intelligence sites in any way during the test.
Here are some sample questions. Many of these are designed for immediate feedback. The actual test questions will definitely be different. The following should be helpful nonetheless.
As in class, we use the following two packages and ask for the Plotly backend:
usingMTH229usingPlotsplotly()
[ Info: Precompiling MTH229 [ebaf19f5-aa55-568f-9bb2-d6722dad893b] (cache misses: wrong dep version loaded (4), incompatible header (14))
[ Info: Precompiling CalculusWithJuliaPlotsExt [2fd8ad5b-8953-5bb0-b347-fdafed1fb4cb] (cache misses: wrong dep version loaded (4), incompatible header (16))
[ Info: Precompiling PlotlyBase [a03496cd-edff-5a9b-9e67-9cda94a718b5] (cache misses: wrong dep version loaded (2), incompatible header (16))
┌ Warning: backend `PlotlyBase` is not installed.
└ @ Plots ~/.julia/packages/Plots/kLeqV/src/backends.jl:45
┌ Warning: backend `PlotlyKaleido` is not installed.
└ @ Plots ~/.julia/packages/Plots/kLeqV/src/backends.jl:45
Plots.PlotlyBackend()
Expressions
For the next several questions there is some math expression and a Julia expression. You are asked if the Julia code expresses the same calculation. Both are written as though \(a\) had some value assigned to it.
Question
Math code:
\[
\sin(\cos(a))
\]
Julia code:
sin(cos(a))
Does the Julia code do what the math formula expects?
The continuous function \(f(x) = x^2 e^{-x}\) has a maximum value over the interval \([0, 4]\). What is it. (The \(y\) value)
f(x) = x^2*exp(-x)plot(f, 0, 4)
Question
Two lines will intersect unless they are parallel. Consider this plot of \(f(x) = x^x\) over \([1/2, 2]\) along with its secant line over \([1/2, 2]\)and its tangent line at \(x=1\).
For these zero-finding problems, you can’t get enough accuracy for a correct answer just from reading the graph. You will need to use bisection or fzero.
Question
Consider \(f(x) = x^5 - x - 1\). The interval \([a_0, b_0] = [1,2]\) is a bracketing interval. From the output of bisection( f, 1, 2), you should be able to see that \([a_1, b_1] = [1, 1.5]\). What is \([a_3, b_3]?\)
\(a_3\) is equal to?
\(b_3\) is equal to?
What value is the zero of \(f(x)\) in \([1,2]\) guaranteed by the intermediate value theorem?
Question
Consider the functions \(g(x) = \sin(x)\) and \(f(x) = \sin(x + \sin(x + \sin(x)))\). For each, \((2,3)\) is a bracketing interval. Does bisection find the exact same value or a different value when used?
Consider the following plot of some special function
plot(besselj0, -5, 5)plot!(zero)
Which of the following intervals is a bracketing interval for besselj0?
Using the bracketing interval and fzero, find the zero.
Question
The functions \(f(x) = xe^{-x^2}\) and \(g(x) = x + 1\) over the interval \([-2,2]\) intersect just once. Find the \(x\) value of the point of intersection using fzero.
f(x) = x *exp(-x^2)g(x) = x +1plot(f, -2, 2)plot!(g)
Question
The function f(x) = airyai(x) and the function g(x) = x/4 intersect once in the interval \([0,5]\). Where? (Use fzero.)