forked from IQSS/prefresher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-functions.Rmd
440 lines (290 loc) · 19.3 KB
/
02-functions.Rmd
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# Functions and Notation
__Topics__
Dimensionality;
Interval Notation for ${\bf R}^1$;
Neighborhoods: Intervals, Disks, and Balls; Introduction to Functions;
Domain and Range;
Some General Types of Functions;
$\log$, $\ln$, and $\exp$;
Other Useful Functions;
Graphing Functions;
Solving for Variables;
Finding Roots;
Limit of a Function;
Continuity; Sets, Sets, and More Sets.
Much of the material and examples for this lecture are taken from Simon \& Blume (1994) \emph{Mathematics for Economists}, Boyce \& Diprima (1988) \emph{Calculus}, and Protter \& Morrey (1991) \emph{A First Course in Real Analysis}
## Dimensionality
${\bf R}^1$ is the set of all real numbers extending from $-\infty$ to $+\infty$ --- i.e., the real number line. ${\bf R}^n$ is an $n$-dimensional space (often referred to as Euclidean space), where each of the $n$ axes extends from $-\infty$ to $+\infty$.
* ${\bf R}^1$ is a one dimensional line.
* ${\bf R}^2$ is a two dimensional plane.
* ${\bf R}^3$ is a three dimensional space.
* ${\bf R}^4$ could be 3-D plus time (or temperature, etc).
Points in ${\bf R}^n$ are ordered $n$-tuples, where each element of the $n$-tuple represents the coordinate along that dimension.
* ${\bf R}^1$: (3)
* ${\bf R}^2$: (-15, 5)
* ${\bf R}^3$: (86, 4, 0)
## Interval Notation for ${\bf R}^1$
Open interval: $$(a,b)\equiv \{ x\in{\bf R}^1: a<x<b\}$$
$x$ is a one-dimensional element in which x is greater than a and less than b
Closed interval: $$[a,b]\equiv \{ x\in{\bf R}^1: a\le x \le b\}$$
$x$ is a one-dimensional element in which x is greater or equal to than a and less than or equal to b
Half open, half closed: $$(a,b]\equiv \{ x\in{\bf R}^1: a<x\le b\}$$
$x$ is a one-dimensional element in which x is greater than a and less than or equal to b
## Neighborhoods: Intervals, Disks, and Balls
In many areas of math, we need a formal construct for what it means to be "near" a point $\bf c$ in ${\bf R}^n$. This is generally called the __neighborhood__ of $\bf c$. It's represented by an open interval, disk, or ball, depending on whether ${\bf R}^n$ is of one, two, or more dimensions, respectively.
Given the point $c$, these are defined as
* $\epsilon$-interval in ${\bf R}^1$: $\{x : |x-c|<\epsilon \}$. $x$ is in the neighborhood of {\bf c} if it is in the open interval $(c-\epsilon,c+\epsilon)$.
* $\epsilon$-disk in ${\bf R}^2$: $\{x : || x-c ||<\epsilon\}$. $x$ is in the neighborhood of {\bf c} if it is inside the circle or disc with center $\bf c$ and radius $\epsilon$.
* $\epsilon$-ball in ${\bf R}^n$: $\{x : || x-c ||<\epsilon\}$. $x$ is in the neighborhood of {\bf c} if it is inside the sphere or ball with center $\bf c$ and radius $\epsilon$.
## Introduction to Functions
A __function__ (in ${\bf R}^1$) is a mapping, or transformation, that relates members of one set to members of another set. For instance, if you have two sets: set $A$ and set $B$, a function from $A$ to $B$ maps every value $a$ in set $A$ such that $f(a) \in B$. Functions can be "many-to-one", where many values or combinations of values from set $A$ produce a single output in set $B$, or they can be "one-to-one", where each value in set $A$ corresponds to a single value in set $B$.
Examples: Mapping notation
* Function of one variable: $f:{\bf R}^1\to{\bf R}^1$\\
$f(x)=x+1$. For each $x$ in ${\bf R}^1$, $f(x)$ assigns the number $x+1$.
* Function of two variables: $f: {\bf R}^2\to{\bf R}^1$. $f(x,y)=x^2+y^2$. For each ordered pair $(x,y)$ in ${\bf R}^2$, $f(x,y)$ assigns the number $x^2+y^2$.
We often use variable $x$ as input and another $y$ as output, e.g. $y=x+1$
## Domain and Range/Image
Some functions are defined only on proper subsets of ${\bf R}^n$.
* __Domain__: the set of numbers in $X$ at which $f(x)$ is defined.
* __Range__: elements of $Y$ assigned by $f(x)$ to elements of $X$, or $$f(X)=\{ y : y=f(x), x\in X\}$$
Most often used when talking about a function $f:{\bf R}^1\to{\bf R}^1$.
* __Image__: same as range, but more often used when talking about a function $f:{\bf R}^n\to{\bf R}^1$.
<!-- \begin{samepage} -->
<!-- \begin{framed} -->
<!-- \item[] Examples: -->
<!-- \begin{enumerate} -->
<!-- \item \parbox[c]{3.75in}{$f(x)=\frac{3}{1+x^2}\quad$ \\[6pt] -->
<!-- % Domain $X={\bf R}^1$\\ -->
<!-- %Range $f(X)=(0,3]$ -->
<!-- } -->
<!-- \parbox{1in}{\, {\includegraphics[width=1in, angle = 270]{3ovr1x2.eps}}}\\[12pt] -->
<!-- \item $f(x)=\left\{ -->
<!-- \begin{array}{lcl} -->
<!-- x+1, &\quad & 1\le x\le 2\\ -->
<!-- 0, & & x=0\\ -->
<!-- 1-x, & & -2\le x\le -1 -->
<!-- \end{array} -->
<!-- \right.$\\[6pt] -->
<!-- %Domain $X=$ $[-2,-1]\cup\{0\}\cup[1,2] -->
<!-- %Range $f(X)=$ $[2,3]\cup\{0\}$\\ -->
<!-- \item \parbox[c]{3.75in}{$f(x)=1/x$\\[6pt] -->
<!-- %Domain $X=(-\infty, 0)\cup (0,\infty)$\\ -->
<!-- %Range $f(X)=(-\infty, 0)\cup (0,\infty)$ -->
<!-- } -->
<!-- <!-- \parbox{1in}{\, {\includegraphics[width=1in, angle = 270]{1ovrx.eps}}}\\ -->
<!-- \item \parbox[c]{3.75in}{$f(x,y)=x^2+y^2$\\[6pt] -->
<!-- %Domain $X,Y={\bf R}^2$\\ -->
<!-- %Image $f(X,Y)={\bf R}^1_+$ -->
<!-- } -->
<!-- \epsfxsize=2.5in -->
<!-- <!-- \parbox{1in}{\, {\includegraphics[width=1.5in, angle = 270]{x2y2.eps}}} -->
<!-- \end{enumerate} -->
<!-- \end{framed} -->
<!-- \end{samepage} -->
<!-- \item[] -->
<!-- \end{itemize} -->
## Some General Types of Functions
__Monomials__: $f(x)=a x^k$\\
$a$ is the coefficient. $k$ is the degree.\\
Examples: $y=x^2$, $y=-\frac{1}{2}x^3$
__Polynomials__: sum of monomials. Examples: $y=-\frac{1}{2}x^3+x^2$, $y=3x+5$
The degree of a polynomial is the highest degree of its monomial terms. Also, it's often a good idea to write polynomials with terms in decreasing degree.
__Rational Functions__: ratio of two polynomials.
Examples: $y=\frac{x}{2}$, $y=\frac{x^2+1}{x^2-2x+1}$
__Exponential Functions__: Example: $y=2^x$
__Trigonometric Functions__: Examples: $y=\cos(x)$, $y=3\sin(4x)$
\begin{comment}
\parbox[c]{4.75in}{{\bf Linear}: polynomial of degree 1.\\
Example: $y=m x + b$, where $m$ is the slope and $b$ is the $y$-intercept.}\epsfxsize=1in \parbox{1in}{\, {\includegraphics[width=.9in, angle = 270]{linear.eps}}}
\item \parbox[c]{4.75in}{{\bf Nonlinear}: anything that isn't constant or polynomial of degree 1.\\
Examples: $y=x^2+2x+1$, $y=\sin(x)$, $y=\ln(x)$, $y=e^x$}
\parbox{1in}{\, {\includegraphics[width=.9in, angle = 270]{nonlin.eps}}}
\end{comment}
## $\log$, $\ln$, and $\exp$
__Relationship of logarithmic and exponential functions__:
$$y=\log_a(x) \iff a^y=x$$
The log function can be thought of as an inverse for exponential functions. $a$ is referred to as the "base" of the logarithm.
__Common Bases__: The two most common logarithms are base 10 and base $e$.
1. Base 10: $\quad y=\log_{10}(x) \iff 10^y=x$. The base 10 logarithm is often simply written as "$\log(x)$" with no base denoted.
2. Base $e$: $\quad y=\log_e(x) \iff e^y=x$. The base $e$ logarithm is referred to as the "natural" logarithm and is written as ``$\ln(x)$".
\begin{comment}
{\includegraphics[width=1in, angle = 270]{ln.eps}} \, {\includegraphics[width=1in, angle = 270]{exp.eps}}
\end{comment}
__Properties of exponential functions:__
* $a^x a^y = a^{x+y}$
* $a^{-x} = 1/a^x$
* $a^x/a^y = a^{x-y}$
* $(a^x)^y = a^{x y}$
* $a^0 = 1$
__Properties of logarithmic functions__ (any base):
Generally, when statisticians or social scientists write $\log(x)$ they mean $\log_e(x)$. In other words: $\log_e(x) \equiv \ln(x) \equiv \log(x)$
$$\log_a(a^x)=x$$ and
$$a^{\log_a(x)}=x$$
* $\log(x y)=\log(x)+\log(y)$
* $\log(x^y)=y\log(x)$
* $\log(1/x)=\log(x^{-1})=-\log(x)$
* $\log(x/y)=\log(x\cdot y^{-1})=\log(x)+\log(y^{-1})=\log(x)-\log(y)$
* $\log(1)=\log(e^0)=0$
__Change of Base Formula__: Use the change of base formula to switch bases as necessary:
$$\log_b(x) = \frac{\log_a(x)}{\log_a(b)}$$
Example: $$\log_{10}(x) = \frac{\ln(x)}{\ln(10)}$$
\begin{itemize}
\item $\log_{10}(\sqrt{10})=\log_{10}(10^{1/2}) = $
\item $\log_{10}(1)=\log_{10}(10^{0}) = $
\item $\log_{10}(10)=\log_{10}(10^{1}) = $
\item $\log_{10}(100)=\log_{10}(10^{2}) = $
\item $\ln(1)=\ln(e^{0}) = $
\item $\ln(e)=\ln(e^{1}) = $
\end{itemize}
## Other Useful Functions
__Factorials!:__
$$x! = x\cdot (x-1) \cdot (x-2) \cdots (1)$$
__Modulo:__ Tells you the remainder when you divide one number by another. Can be extremely useful for programming: \texttt{x mod y} or \texttt{x \% y}
* $17 \mod 3 = 2$
* $100 \ \% \ 30 = 10$
__Summation:__
$$\sum\limits_{i=1}^n x_i = x_1+x_2+x_3+\cdots+x_n$$
\begin{itemize}
\item $\sum\limits_{i=1}^n c x_i = c \sum\limits_{i=1}^n x_i $
\item $\sum\limits_{i=1}^n (x_i + y_i) = \sum\limits_{i=1}^n x_i + \sum\limits_{i=1}^n y_i $
\item $\sum\limits_{i=1}^n c = n c $
\end{itemize}
__Product:__
$$\prod\limits_{i=1}^n x_i = x_1 x_2 x_3 \cdots x_n$$
Properties:
\begin{itemize}
\item $\prod\limits_{i=1}^n c x_i = c^n \prod\limits_{i=1}^n x_i $
\item $\prod\limits_{i=1}^n (x_i + y_i) =$ a total mess
\item $\prod\limits_{i=1}^n c = c^n $
\end{itemize}
You can use logs to go between sum and product notation. This will be particularly important when you're learning maximum likelihood estimation.
\begin{eqnarray*}
\log \bigg(\prod\limits_{i=1}^n x_i \bigg) &=& \log(x_1 \cdot x_2 \cdot x_3 \cdots \cdot x_n)\\
&=& \log(x_1) + \log(x_2) + \log(x_3) + \cdots + \log(x_n)\\
&=& \sum\limits_{i=1}^n \log (x_i)
\end{eqnarray*}
Therefore, you can see that the log of a product is equal to the sum of the logs. We can write this more generally by adding in a constant, $c$:
\begin{eqnarray*}
\log \bigg(\prod\limits_{i=1}^n c x_i\bigg) &=& \log(cx_1 \cdot cx_2 \cdots cx_n)\\
&=& \log(c^n \cdot x_1 \cdot x_2 \cdots x_n)\\
&=& \log(c^n) + \log(x_1) + \log(x_2) + \cdots + \log(x_n)\\\\
&=& n \log(c) + \sum\limits_{i=1}^n \log (x_i)\\
\end{eqnarray*}
## Graphing Functions
What can a graph tell you about a function?
* Is the function increasing or decreasing? Over what part of the domain?
* How ``fast" does it increase or decrease?
* Are there global or local maxima and minima? Where?
* Are there inflection points?
* Is the function continuous?
* Is the function differentiable?
* Does the function tend to some limit?
* Other questions related to the substance of the problem at hand.
## Solving for Variables and Finding Inverses
Sometimes we're given a function $y=f(x)$ and we want to find how $x$ varies as a function of $y$. If $f$ is a one-to-one mapping, then it has an inverse.
Use algebra to move $x$ to the left hand side (LHS) of the equation and so that the right hand side (RHS) is only a function of $y$.\\
Examples: (we want to solve for $x$)
$$y=3x+2 \quad\Longrightarrow\quad -3x=2-y \quad\Longrightarrow\quad 3x=y-2 \quad\Longrightarrow\quad x=\frac{1}{3}(y-2)$$
$$y=3x-4z+2 \quad \Longrightarrow\quad y+4z-2=3x \quad\Longrightarrow\quad x=\frac{1}{3}(y+4z-2)$$
\begin{align*}
y=e^x+4 &\Longrightarrow\quad y-4=e^x\\
&\Longrightarrow \ln(y-4) = \ln(e^x)\\
&\Longrightarrow\quad x=\ln(y-4)
\end{align*}
Sometimes (often?) the inverse does not exist. For example, we're given the function $y=x^2$ (a parabola). Solving for $x$, we get $x=\pm\sqrt{y}$. For each value of $y$, there are two values of $x$.
## Finding the Roots or Zeroes of a Function
Solving for variables is especially important when we want to find the __roots__ of an equation: those values of variables that cause an equation to equal zero. Especially important in finding equilibria and in doing maximum likelihood estimation.
Procedure: Given $y=f(x)$, set $f(x)=0$. Solve for $x$.
Multiple Roots:
$$f(x)=x^2 - 9 \quad\Longrightarrow\quad 0=x^2 - 9 \quad\Longrightarrow\quad 9=x^2 \quad\Longrightarrow\quad \pm \sqrt{9}=\sqrt{x^2} \quad\Longrightarrow\quad \pm 3=x$$
__Quadratic Formula:__ For quadratic equations $ax^2+bx+c=0$, use the quadratic formula: $$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$
Examples:
\begin{enumerate}
\item $f(x)=3x+2$ \\
% $\quad\Longrightarrow\quad 3x+2=0
% \quad\Longrightarrow\quad x=-\frac{2}{3}$\\
\item $f(x)=e^{-x}-10$ \\
%$\quad\Longrightarrow\quad e^{-x}-10=0
%\quad\Longrightarrow\quad e^{-x}=10 \quad\Longrightarrow\quad
%x=-\ln(10)$\\
\item $f(x)=x^2+3x-4=0$ \\
%$\quad\Longrightarrow\quad x=\{1,-4\}$\\
\end{enumerate}
## The Limit of a Function
We're often interested in determining if a function $f$ approaches some number $L$ as its independent variable $x$ moves to some number $c$ (usually 0 or $\pm\infty$). If it does, we say that the limit of $f(x)$, as $x$ approaches $c$, is $L$: $\lim\limits_{x \to c} f(x)=L$.
For a limit $L$ to exist, the function $f(x)$ must approach $L$ from both the left and right.
__Limit of a function__. Let $f(x)$ be defined at each point in some open interval containing the point $c$. Then $L$ equals $\lim\limits_{x \to c} f(x)$ if for any (small positive) number $\epsilon$, there exists a corresponding number $\delta>0$ such that if $0<|x-c|<\delta$, then $|f(x)-L|<\epsilon$.
Note: f(x) does not necessarily have to be defined at $c$ for $\lim\limits_{x \to c}$ to exist.
__Uniqueness__: $\lim\limits_{x \to c} f(x)=L$ and $\lim\limits_{x \to c} f(x)=M \Longrightarrow L=M$
Properties: Let $f$ and $g$ be functions with $\lim\limits_{x \to c} f(x)=A$ and $\lim\limits_{x \to c} g(x)=B$.
* $\lim\limits_{x \to c}[f(x)+g(x)]=\lim\limits_{x \to c} f(x)+ \lim\limits_{x \to c} g(x)$
* $\lim\limits_{x \to c} \alpha f(x) = \alpha \lim\limits_{x \to c} f(x)$
* $\lim\limits_{x \to c} f(x) g(x) = [\lim\limits_{x \to c} f(x)][\lim\limits_{x \to c} g(x)]$
* $\lim\limits_{x \to c} \frac{f(x)}{g(x)} = \frac{\lim\limits_{x \to c} f(x)}{\lim\limits_{x \to c} g(x)}$, provided $\lim\limits_{x \to c} g(x)\ne 0$.
Note: In a couple days we'll talk about L'H\^opital's Rule, which uses simple calculus to help find the limits of functions like this.
Examples:
\begin{align*}
& \lim_{x \to c} k = \\
& \lim_{x \to c} x = \\
& \lim_{x\to 2} (2x-3) =\\
& \lim_{x \to c} x^n =
\end{align*}
\begin{comment}
%= 2\lim\limits_{x\to 2} x- 3\lim\limits_{x\to 2} 1 = 2\times 2 - 3\times 1 = 1
%[\lim\limits_{x \to c} x]\cdots[\lim\limits_{x \to c} x] = c\cdots c =c^n
\end{comment}
\begin{comment}
\item \parbox[t]{3.75in}{$\lim\limits_{x\to 0} |x| =$} \parbox[t]{1in}{\,{\includegraphics[width=1in, angle = 270]{abs.eps}}} % = 0
\item \parbox[t]{3.75in}{$\lim\limits_{x\to 0} \left(1+\frac{1}{x^2}\right)=$} \parbox[t]{1in}{\, {\includegraphics[width=1in, angle = 270]{1p1ovrx2.eps}}} %\infty
\end{comment}
Types of limits:
1. Right-hand limit: The value approached by $f(x)$ when you move from right to left.
\begin{comment}
\parbox[t]{2in}{Example: $\lim\limits_{x\to 0^+} \sqrt{x} = 0$}\parbox[t]{1in}{\, {\includegraphics[width=1in, angle = 270]{sqrt.eps}}}
\end{comment}
2. Left-hand limit: The value approached by $f(x)$ when you move from left to right.
3. Infinity: The value approached by $f(x)$ as x grows infinitely large. Sometimes this may be a number; sometimes it might be $\infty$ or $-\infty$.
4. Negative infinity: The value approached by $f(x)$ as x grows infinitely negative. Sometimes this may be a number; sometimes it might be $\infty$ or $-\infty$.
\begin{comment}
\parbox[t]{2in}{Example: $\lim\limits_{x\to \infty} 1/x = \lim\limits_{x\to -\infty} 1/x= 0$}\parbox[t]{1in}{\, {\includegraphics[width=1in, angle = 270]{1ovrx.eps}}}\\
\end{comment}
## Continuity
__Continuity__: Suppose that the domain of the function $f$ includes an open interval containing the point $c$. Then $f$ is continuous at $c$ if $\lim\limits_{x \to c} f(x)$ exists and if $\lim\limits_{x \to c} f(x)=f(c)$. Further, $f$ is continuous on an open interval $(a,b)$ if it is continuous at each point in the interval.
Examples: Continuous functions.
\begin{comment}
\parbox[t]{1.5in}{\hfill$f(x)=\sqrt{x}\quad$}\parbox[t]{1in}{\, {\includegraphics[width=1in, angle = 270]{sqrt.eps}}}
\parbox[t]{1.5in}{\hfill$f(x)=e^x\quad$}\parbox[t]{1in}{\, {\includegraphics[width=1in, angle = 270]{exp.eps}}}
\item[] Examples: Discontinuous functions.\\
\parbox[t]{1.5in}{\hfill$f(x)=\mbox{floor}(x)\quad$}\parbox[t]{1in}{\, {\includegraphics[width=1in, angle = 270]{floor.eps}}}
\parbox[t]{1.5in}{\hfill$f(x)=1+\frac{1}{x^2}\quad$}\parbox[t]{1in}{\, {\includegraphics[width=1in, angle = 270]{1p1ovrx2.eps}}}
\end{comment}
Properties:
1. If $f$ and $g$ are continuous at point $c$, then $f+g$, $f-g$, $f \cdot g$, $|f|$, and $\alpha f$ are continuous at point $c$ also. $f/g$ is continuous, provided $g(c)\ne 0$.
2. Boundedness: If $f$ is continuous on the closed bounded interval $[a,b]$, then there is a number $K$ such that $|f(x)|\le K$ for each $x$ in $[a,b]$.
3. Max/Min: If $f$ is continuous on the closed bounded interval $[a,b]$, then $f$ has a maximum and a minimum on $[a,b]$. They may be located at the end points.
## Sets
__Interior Point__: The point $\bf x$ is an interior point of the set $S$ if $\bf x$ is in $S$ and if there is some $\epsilon$-ball around $\bf x$ that contains only points in $S$. The __interior__ of $S$ is the collection of all interior points in $S$. The interior can also be defined as the union of all open sets in $S$.
* If the set $S$ is circular, the interior points are everything inside of the circle, but not on the circle's rim.
* Example: The interior of the set $\{ (x,y) : x^2+y^2\le 4 \}$ is $\{ (x,y) : x^2+y^2< 4 \}$ .
__Boundary Point__: The point $\bf x$ is a boundary point of the set $S$ if every $\epsilon$-ball around $\bf x$ contains both points that are in $S$ and points that are outside $S$. The __boundary__ is the collection of all boundary points.
* If the set $S$ is circular, the boundary points are everything on the circle's rim.
* Example: The boundary of $\{ (x,y) : x^2+y^2\le 4 \}$ is $\{ (x,y) : x^2+y^2 = 4 \}$.
__Open__: A set $S$ is open if for each point $\bf x$ in $S$, there exists an open $\epsilon$-ball around $\bf x$ completely contained in $S$.
* If the set $S$ is circular and open, the points contained within the set get infinitely close to the circle's rim, but do not touch it.
* Example: $\{ (x,y) : x^2+y^2<4 \}$
__Closed__: A set $S$ is closed if it contains all of its boundary points.
* If the set $S$ is circular and closed, the set contains all points within the rim as well as the rim itself.
* Example: $\{ (x,y) : x^2+y^2\le 4 \}$
* Note: a set may be neither open nor closed. Example: $\{ (x,y) : 2 < x^2+y^2\le 4 \}$
__Complement__: The complement of set $S$ is everything outside of $S$.
* If the set $S$ is circular, the complement of $S$ is everything outside of the circle.
* Example: The complement of $\{ (x,y) : x^2+y^2\le 4 \}$ is $\{ (x,y) : x^2+y^2 > 4 \}$.
__Closure__: The closure of set $S$ is the smallest closed set that contains $S$.
* Example: The closure of $\{ (x,y) : x^2+y^2<4 \}$ is $\{ (x,y) : x^2+y^2\le 4 \}$
__Bounded__: A set $S$ is bounded if it can be contained within an $\epsilon$-ball.
* Examples: Bounded: any interval that doesn't have $\infty$ or $-\infty$ as endpoints; any disk in a plane with finite radius.
* Unbounded: the set of integers in ${\bf R}^1$; any ray.
__Compact__: A set is compact if and only if it is both closed and bounded.
__Empty__: The empty (or null) set is a unique set that has no elements, denoted by \{\} or $\o$.
* Examples: The set of squares with 5 sides; the set of countries south of the South Pole.
* The set, $S$, denoted by $\{\o\}$ is technically \emph{not} empty. That is because this set contains the empty set within it, so $S$ is not empty.