forked from kisonecat/ximeraWorkshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctionExample.tex
359 lines (322 loc) · 13 KB
/
functionExample.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
\documentclass{ximera}
\input{preamble.tex}
\outcome{Define the concept of a function.}
\outcome{Distinguish between functions by considering their domains.}
\outcome{Plot basic functions.}
\outcome{Recognize different representations of the same function.}
\title{For each input, exactly one output}
\begin{document}
\begin{abstract}
We define the concept of a function.
\end{abstract}
\maketitle
Life is complex. Part of this complexity stems from the fact that
there are many relationships between seemingly unrelated events. Armed
with mathematics, we seek to understand the world. To do this, we need
tools for talking about these relationships. Perhaps the most relevant
``real-world'' relation is
\begin{center}
\textbf{the position of an object with respect to time.}
\end{center}
Our observations seem to indicate that every instant in time is
associated to a unique positioning of the objects in the universe. You
may have heard the saying,
\begin{center}
\textbf{you cannot be two places at the same time,}
\end{center}
and it is this fact that motivates our definition for functions.
\begin{definition}\index{function}
A \dfn{function} is a relation between sets where for each input,
there is exactly one output.
\end{definition}
\begin{question}
If our function is the ``position with respect to time'' of some
object, then the input is
\begin{multipleChoice}
\choice{position}
\choice[correct]{time}
\choice{none of the above}
\end{multipleChoice}
and the output is
\begin{multipleChoice}
\choice[correct]{position}
\choice{time}
\choice{none of the above}
\end{multipleChoice}
\end{question}
Something as simple as a dictionary could be thought of as a relation,
as it connects \textit{words} to \textit{definitions}. However, a
dictionary is not a function, as there are words with multiple
definitions. On the other hand, if each word only had a single
definition, then a dictionary would be a function.
\begin{question}
Which of the following are functions?
\begin{selectAll}
\choice{Relating words to their definition in a dictionary.}
\choice[correct]{Relating social security numbers of living
people to actual living people.}
\choice[correct]{Relating people to their birth date.}
\choice{Relating mothers to their children.}
\end{selectAll}
\begin{feedback}\hfil
\begin{itemize}
\item Since words may have more than one definition, ``relating
words to their definition in a dictionary'' is not a function.
\item Since every social security number corresponds exactly to
one person, ``relating social security numbers of living people
to actual living people'' is a function.
\item Since every person only has one birth date, ``relating
people to their birth date'' is a function.
\item Since mothers can have more (or less) than one child,
``relating mothers to their children'' is not a function.
\end{itemize}
\end{feedback}
\end{question}
What we are hoping to convince you is that the following is true:
\begin{enumerate}
\item The definition of a function is well-grounded in a real context.
\item The definition of a function is flexible enough that it can be
used to model a wide range of phenomena.
\end{enumerate}
Whenever we talk about functions, we should explicitly state
what type of things the inputs are and what type of things the outputs
are. In calculus, functions often define a relation from (a subset
of) the real numbers (denoted by $\RR$) to (a subset of) the real
numbers. Just to remind you, we call the set from which we get the inputs
of a function the \dfn{domain}\index{domain}, and we call the set from which
we get the outputs of a function the \dfn{range}\index{range}.
\begin{example}
Consider the function $f$ that maps from the real numbers to the real
numbers by taking a number and mapping it to its cube:
\begin{align*}
1 &\mapsto 1\\
-2 &\mapsto -8\\
1.5 &\mapsto 3.375
\end{align*}
and so on. This function can be \textit{described} by the formula
$f(x)=x^3$ or by the graph shown in the plot below:
\begin{image}
\begin{tikzpicture}
\begin{axis}[
domain=-2:2,
axis lines =middle, xlabel=$x$, ylabel=$y$,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
]
\addplot [very thick, penColor, smooth] {x^3};
\end{axis}
\end{tikzpicture}
\end{image}
\end{example}
\begin{warning}
A function is a relation (such that for each input, there is exactly
one output) between sets. The formula and the graph are merely
descriptions of this relation.
\begin{itemize}
\item A formula \textbf{describes} the relation using symbols.
\item A graph \textbf{describes} the relation using pictures.
\end{itemize}
The \textbf{function is the relation itself}, and is independent of how
it is described.
\end{warning}
Our next example may be a function that is new to you. It is the
\textit{greatest integer function}.
\begin{example}
Consider the \dfn{greatest integer function}. This function maps
any real number $x$ to the greatest integer less than or equal to $x$.
People sometimes write this as $f(x) = \lfloor x\rfloor$, where those
funny symbols mean exactly the words above describing the
function. For your viewing pleasure, here is a graph of the greatest
integer function:
\begin{image}
\begin{tikzpicture}
\begin{axis}[
domain=-2:4,
axis lines =middle, xlabel=$x$, ylabel=$y$,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
clip=false,
%axis on top,
]
\addplot [textColor, very thin, domain=(0:2.3)] {0}; % puts the axis back, axis on top clobbers our open holes
\addplot [textColor, very thin] plot coordinates {(0,0) (0,2)}; % puts the axis back, axis on top clobbers our open holes
\addplot [very thick, penColor, domain=(-2:-1)] {-2};
\addplot [very thick, penColor, domain=(-1:0)] {-1};
\addplot [very thick, penColor, domain=(0:1)] {0};
\addplot [very thick, penColor, domain=(1:2)] {1};
\addplot [very thick, penColor, domain=(2:3)] {2};
\addplot [very thick, penColor, domain=(3:4)] {3};
\addplot[color=penColor,fill=penColor,only marks,mark=*] coordinates{(-2,-2)}; %% closed hole
\addplot[color=penColor,fill=penColor,only marks,mark=*] coordinates{(-1,-1)}; %% closed hole
\addplot[color=penColor,fill=penColor,only marks,mark=*] coordinates{(0,0)}; %% closed hole
\addplot[color=penColor,fill=penColor,only marks,mark=*] coordinates{(1,1)}; %% closed hole
\addplot[color=penColor,fill=penColor,only marks,mark=*] coordinates{(2,2)}; %% closed hole
\addplot[color=penColor,fill=penColor,only marks,mark=*] coordinates{(3,3)}; %% closed hole
\addplot[color=penColor,fill=background,only marks,mark=*] coordinates{(-1,-2)}; %% open hole
\addplot[color=penColor,fill=background,only marks,mark=*] coordinates{(0,-1)}; %% open hole
\addplot[color=penColor,fill=background,only marks,mark=*] coordinates{(1,0)}; %% open hole
\addplot[color=penColor,fill=background,only marks,mark=*] coordinates{(2,1)}; %% open hole
\addplot[color=penColor,fill=background,only marks,mark=*] coordinates{(3,2)}; %% open hole
\addplot[color=penColor,fill=background,only marks,mark=*] coordinates{(4,3)}; %% open hole
\end{axis}
\end{tikzpicture}
\end{image}
Observe that here we have multiple inputs that give
the same output. This is not a problem! To be a function, we
merely need to check that for each input, there is exactly one output,
and this condition is satisfied.
\end{example}
\begin{question}
Compute:
\[
\lfloor 2.4 \rfloor
\begin{prompt}
=\answer{2}
\end{prompt}
\]
\begin{question}
Compute:
\[
\lfloor -2.4 \rfloor
\begin{prompt}
=\answer{-3}
\end{prompt}
\]
\end{question}
\end{question}
Notice that both the functions described above pass the so-called
``vertical line test.'' This means that a vertical line can be drawn
through any part of the plot and the vertical line will intersect
the plot at most once. If a plot passes this vertical line test, we know that
we are looking at a representation of a function.
In our previous examples, the domain and range have both been the
\textit{entire} set of real numbers, denoted by $\RR$. In our next
examples we show that this is not always the case.
\begin{example}
Consider the function that maps non-negative real numbers to their
positive square root. This function can be described by the
formula
\[
f(x) = \sqrt{x}.
\]
The domain is $0\le x<\infty$, which we prefer to write as
$[0,\infty)$ in interval notation. The range is $[0,\infty)$. Here is
a graph of $y=f(x)$.
\begin{image}
\begin{tikzpicture}
\begin{axis}[
xmin=-8,xmax=8,
ymin=-5,ymax=5,
domain=0:8,
axis lines =middle, xlabel=$x$, ylabel=$y$,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
]
\addplot [very thick, penColor, smooth,samples=100] {sqrt(x)};
\end{axis}
\end{tikzpicture}
\end{image}
\end{example}
To really tease out the difference between a function and its
description, let's consider an example of a function with two
different descriptions.
\begin{example}
Explain why $\sqrt{x^2} = |x|$.
\begin{explanation}
Although $\sqrt{x^2}$ may appear to simplify to just $x$, let's see
what happens when we plug in some values.
\[
\begin{aligned}
\sqrt{3^2} &= \sqrt{9}\\
&=3,
\end{aligned}
\qquad\text{and}\qquad
\begin{aligned}
\sqrt{(-3)^2} &= \sqrt{9}\\
&=3.
\end{aligned}
\]
In an entirely similar way, we see that for any positive $x$, $f(-x)=\answer[given]{x}$. Hence
$\sqrt{x^2}\ne x$. Rather we see that $\sqrt{x^2} = |x|$. The
domain of $f(x)=\sqrt{x^2}$ is $(-\infty,\infty)$ and the range is
$[0,\infty)$. For your viewing pleasure we've included a graph of
$y=f(x)$.
\begin{image}
\begin{tikzpicture}
\begin{axis}[
domain=-3:3,
axis lines =middle, xlabel=$x$, ylabel=$y$,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
xtick={-3,...,3},
ytick={-3,...,3},
]
\addplot [very thick, penColor, domain=0:3] {x};
\addplot [very thick, penColor, domain=-3:0] {-x};
\end{axis}
\end{tikzpicture}
\end{image}
\end{explanation}
\end{example}
Finally, we will consider a function whose domain is all real numbers
except for a single point.
\begin{example}
Are
\[
f(x) = \frac{x^2 - 3x + 2}{x-2} = \frac{(x-2)(x-1)}{(x-2)}
\]
and
\[
g(x) = x-1
\]
the same function?
\begin{explanation}
Let's use a series of steps to think about this question.
First, what if we compare graphs? Here we see a graph of
$f$:
\begin{image}
\begin{tikzpicture}
\begin{axis}[
domain=-2:4,
axis lines =middle, xlabel=$x$, ylabel=$y$,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
xtick={-2,...,4},
ytick={-3,...,3},
]
\addplot [very thick, penColor, smooth] {x-1};
\addplot[color=penColor,fill=background,only marks,mark=*] coordinates{(2,1)}; %% open hole
\end{axis}
\end{tikzpicture}
\end{image}
On the other hand, here is a graph of $g$:
\begin{image}
\begin{tikzpicture}
\begin{axis}[
domain=-2:4,
axis lines =middle, xlabel=$x$, ylabel=$y$,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
xtick={-2,...,4},
ytick={-3,...,3},
]
\addplot [very thick, penColor, smooth] {x-1};
\end{axis}
\end{tikzpicture}
\end{image}
Second, what if we compare the domains? We cannot evaluate $f$ at
$x=\answer[given]{2}$. This is where $f$ is undefined. On the other
hand, there is no value of $x$ where we cannot evaluate $g$. In other
words, the domain of $g$ is $(-\infty, \infty)$.
Since these two functions do not have the same graph, and they do not
have the same domain, they must not be the same function.
However, if we look at the two functions everywhere except at $x = 2$,
we can say that $f(x)=g(x)$. In other words,
\[
f(x)=x-1\qquad\text{when}\qquad \text{$x \ne 2$}.
\]
From this example we see that it is critical to consider the domain and
range of a function.
\end{explanation}
\end{example}
\end{document}