-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathunit3.tex
46 lines (36 loc) · 908 Bytes
/
unit3.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
\documentclass{ximera}
%% handout
%% nohints
\title{Unit 3 includes coding}
\begin{document}
\begin{abstract}
The point here is to include some programming exercises.
\end{abstract}
\begin{exercise}
Given that $s(k)=-k^2-4 k+2$, evaluate $s(4.5)$. Express your answer in decimal notation.
\begin{solution}
\begin{hint}
$s(4.5)=-(4.5)^2-4 (4.5)+2$.
\end{hint}
\begin{hint}
$s(4.5)=-36.25$.
\end{hint}
The value of the function $s(k)=-k^2-4 k+2$, evaluated at $k=4.5$, is \answer{-36.25}.
\end{solution}
Here is some text after the first problem.
\end{exercise}
\begin{exercise}
Write a function $f$ so that $f(2) = 4$.
\begin{solution}
\begin{python}
def f(x):
# this is where you should include your code
return x
def validator():
return (f(2) == 4)
\end{python}
\end{solution}
So you did it. Great!
\end{exercise}
This is at the bottom of the page, outside of an exercise.
\end{document}