Scalable Tissue Imaging and Modeling (STIM) Laboratory
Department of Electrical and Computer Engineering
Cullen College of Engineering
University of Houston
David Mayerich
STIM Laboratory, University of Houston
Maclaurin Series
Error Terms
Approximating Complex Functions
David Mayerich
STIM Laboratory, University of Houston
A special function has a standardized name and notation:
\(\quad \sin(x) \quad\quad e^x \quad\quad \tan^{-1}(x) \quad\quad \ln(x) \quad\quad \log_2(x) \quad\quad \text{erf}(x) \quad\quad J_n^{(1)}(x) \)
Digital processors perform basic numerical operations (ex. addition, multiplication)
Special functions require specific algorithms to evaluate
Start with one you probably know: Taylor expansions
David Mayerich
STIM Laboratory, University of Houston
But now we have infinite summations...
Consists of basic mathematical operations executed in a loop
Start with expansions about zero
Creating an n-order Maclaurin polynomial requires differentiating a function n times
David Mayerich
STIM Laboratory, University of Houston
David Mayerich
STIM Laboratory, University of Houston
The Taylor expansion for a degree d polynomial has at most d non-zero terms:
David Mayerich
STIM Laboratory, University of Houston
Many functions have infinite approximations:
Calculating these functions requires truncating to a finite number of terms:
we want this error to be small
The error term can be expressed analytically using the Lagrange remainder:
David Mayerich
STIM Laboratory, University of Houston
We approximate the function by taking k terms in the series:
where z is some value \(0\leq z \leq x\)
What can we know about this error?
How will this term behave as the number of terms increases?
Consider: factorial vs. exponential growth, numerator as derivative increases
How does this term change with \(x\) and \(k\)?
Consider the error with the following functions:
David Mayerich
STIM Laboratory, University of Houston
A Taylor series shifts the expansion away from zero
David Mayerich
STIM Laboratory, University of Houston
How can this benefit us?
Sets of Numbers
Cartesian Products
Tensors
David Mayerich
STIM Laboratory, University of Houston
Natural Numbers (can start from 0 or 1)
Integers (includes negative numbers)
Rational Numbers
fractions of integers
Real Numbers
Complex Numbers
David Mayerich
STIM Laboratory, University of Houston
Set Builder Notation
variable: potential member of a set
predicate: condition for membership
Common conditional operations:
Real numbers in the range
A domain is commonly specified with the variable:
Evaluate the following sets:
David Mayerich
STIM Laboratory, University of Houston
logical and
logical or
"there exists"
variable
predicate
David Mayerich
STIM Laboratory, University of Houston
2-tuple
3-tuple
The tensor product is a Cartesian product
that also satisfies the following distributive properties:
For sets of numbers these conditions lead to the "outer product" in linear algebra:
David Mayerich
STIM Laboratory, University of Houston
A set produced using tensor products is a tensor
The number of tensor products defines the order of the tensor
0-order tensors are scalar values:
1-order tensors are vectors
2-order tensors are matrices
Higher-order (3+) tensors exist
Mathematics is just extended
Machine learning, image processing, physics
David Mayerich
STIM Laboratory, University of Houston
Representing tensors in algorithms:
David Mayerich
STIM Laboratory, University of Houston
Use notation to constrain your requirements when designing algorithms:
what is the vector space of B and D?
We don't know the set of B, but we do know it's size.
We know the sum is at least
float a[5];
float* a = (float*) malloc(5 * sizeof(float));
float* a = new float[5];float B[3][4][2];
float* B = (float*) malloc(3 * 4 * 2 * sizeof(float));
std::complex<float>* = new std::complex<float>[3 * 4];a = numpy.zeros((5, 1))a = numpy.zeros((3, 4), dtype=numpy.complex64)C/C++
Python
Continuous Functions
Domain and Range Sets
Discrete Functions
David Mayerich
STIM Laboratory, University of Houston
David Mayerich
STIM Laboratory, University of Houston
David Mayerich
STIM Laboratory, University of Houston
Complete Sets
Inner Products
David Mayerich
STIM Laboratory, University of Houston
A set \(\mathbb{M}\) is incomplete if a series of elements in \(\mathbb{M}\) converges to a result outside of \(\mathbb{M}\)
David Mayerich
STIM Laboratory, University of Houston
or calculating the arc-tangent:
A complete space includes all points in a series and the values they converge to
(\(\mathbb{R}\) and \(\mathbb{C}\) are complete, \(\mathbb{Q}\) is not)
Consider the Lebniz formula for \(\pi\):
(if \(x \in \mathbb{Z}\))
An inner product \(\langle\mathbf{a} , \mathbf{b}\rangle\) is an operation across some set \(\mathbb{M}\) with the following properties:
David Mayerich
STIM Laboratory, University of Houston
The inner product in \(\mathbb{R}\) and \(\mathbb{C}\) is usually defined as the "dot product":
A Hilbert space is a set that is:
David Mayerich
STIM Laboratory, University of Houston
Real and complex vector spaces \(\mathbb{R}^n\) and \(\mathbb{C}^n\) are the most common examples.
Another example includes the set of all functions (ex. \(f(x)\in\mathbb{C}\)). The inner product between two functions \(f(x)\) and \(g(x)\) is:
which is a continuous extension of the vector dot product:
Does the set of all polynomials \(\mathbb{P} = \{x^0, x^1, x^2, \cdots \}\) form a Hilbert space?
David Mayerich
STIM Laboratory, University of Houston
\(\mathbf{r}\in \mathbb{R}^3\)
\(\mathbf{E}(\mathbf{r},t)\in \mathbb{R}^3\)
\(\mathbf{E}(\mathbf{r})\in \mathbb{C}^3\)
Lagrange remainder: