packages <- c('tidyverse', 'ggthemes', 'knitr', 'kableExtra', 'Matrix', 'reticulate',
              "plotly")
sapply(packages, require, character.only = TRUE, quietly = TRUE)
use_condaenv("r-reticulate")
theme_set(theme_tufte(base_size = 14) +
                theme(panel.border = element_rect(fill = NA),
                      panel.grid.major = element_line(color = "gray78"),
                      legend.background = element_rect(),
                      legend.position = "top",
                      axis.text.x = element_text(angle = 30, hjust = 1),
                      strip.background = element_rect(fill = "grey90", linetype = "blank")))

Problems

1

Let \(S \subset \mathbb R\) and denote by C the set of all Cauchy-sequences \((a_n)_{n\in\mathbb N} \in S\). Show that

\[ (a_n)_{n\in\mathbb N} \sim (b_n)_{n\in\mathbb N}, \text{ if and only if } (c_n)_{n\in\mathbb N} \in C \text{ for } c_n = \begin{cases} a_{n/2}, \text{ n even,} \\ b_{(n+1)/2}, \text{ n odd,} \end{cases} \]

defines an equivalence relation on C.


Solution: For this to be an equivalence relation it must satisfy three constraints.

1. \((a_n)_{n\in\mathbb N} \sim (a_n)_{n\in\mathbb N}\):

  • This is obvious since \((a_n)_{n\in\mathbb N} \in C\)

2. \((a_n)_{n\in\mathbb N} \sim (b_n)_{n\in\mathbb N} \rightarrow (b_n)_{n\in\mathbb N} \sim (a_n)_{n\in\mathbb N}\)

  • If \((a_n)_{n\in\mathbb N} \sim (b_n)_{n\in\mathbb N}\) then we can choose a Cauchy subsequence of \((c_n)_{n\in\mathbb N}\), \((d_{n})_{n\in\mathbb N} = (c_{n+1})_{n\in\mathbb N}\). We know that \((d_{n})_{n\in\mathbb N} \in C\) and satisfies \((b_n)_{n\in\mathbb N} \sim (a_n)_{n\in\mathbb N}\) so statement 2. is true.

3. \((a_n)_{n\in\mathbb N} \sim (b_n)_{n\in\mathbb N} \wedge (b_n)_{n\in\mathbb N} \sim (k_n)_{n\in\mathbb N} \rightarrow (a_n)_{n\in\mathbb N} \sim (k_n)_{n\in\mathbb N}\)

  • \((a_n)_{n\in\mathbb N} \sim (b_n)_{n\in\mathbb N}\) implies that for \(\epsilon > 0\) we can choose \(N \in \mathbb N\) such that \(||a_{n/2} - b_{(n+1)/2}|| < \frac12\epsilon\) for all \(n > N\), and do the same for \((b_n)_{n\in\mathbb N} \sim (k_n)_{n\in\mathbb N}\) and some \(M \in \mathbb N\). Thus we see that if we choose \(n > max(N, M)\) then \(||a_{n/2} - k_{(n+1)/2}|| \leq ||a_{n/2} - b_{(n+1)/2}|| + ||b_{n/2} - k_{(n+1)/2}|| < \frac12\epsilon + \frac12\epsilon = \epsilon\), which shows that 3. holds.

2

If you have an almost scalar-product on a vector-space X over \(\mathbb R\), the only property not being fulfilled being that \(\langle x, x \rangle\) might be 0, even though \(x \neq 0\), how could you construct a scalar-product from this and on which set? What is the equivalence relation?

Let \(\Omega\) be a non-empty set. A function \(K:\Omega \times \Omega \rightarrow \mathbb R\) is said to be symmetric if \(K(x,y) = K(y,x)\) for all \(x,y\in \Omega\). It is said to be positive semi-definite if for all \(\{x_1, x_2, ..., x_N\} \subset \Omega, x_i \neq x_j\) if \(i \neq j\) and all \(c_1, c_2, ..., c_N \in \mathbb R\) we have

\[ \sum_{i,j=1}^Nc_ic_jK(x_i,x_j) \geq 0. \tag{*} \]

It is said to be positive definite if additionally \((*) = 0\) implies \(c_1 = c_2 = ... = c_N = 0\)

Consider \(K: \mathbb R^n \times \mathbb R^n \rightarrow \mathbb R, K(x, y) := \Phi(x - y)\) for a continuous function \(\Phi: \mathbb R^n \rightarrow \mathbb R\).

Part 1

Show that if K is symmetric and positive semidefinite, then \(\Phi(0) \geq 0, \Phi(x) = \Phi(-x), |\Phi(x)| \leq \Phi(0), x \in \mathbb R^n\).


Solution: Let \(x \in \mathbb R^n\)

(1) \(\Phi(0) \geq 0\)

\[ \begin{aligned} \Phi(0) &= K(x, x) \geq 0 \end{aligned} \]

(2) \(\Phi(x) = \Phi(-x)\)

\[ \begin{aligned} \Phi(x) &= K(x, 0) \\ &= K(0, x) \\ &= \phi(-x) \end{aligned} \]

(3) \(|\Phi(x)| \leq \Phi(0)\)

\[ \begin{aligned} |\Phi(x)| &= |K(x, 0)| \\ &= |K(0, x)| \end{aligned} \]


Part 2

Show that if \(\Phi(x) = \Phi(-x)\) and

\[ \begin{align} \Phi(x) &= \frac{1}{(2\pi)^n}\int_{\mathbb R^n} \tilde \Phi(\omega)e^{i\omega\cdot x}d^n\omega, \text{ where } \\ \tilde \Phi(\omega) &= \int_{\mathbb R^n}\Phi(x)e^{-i\omega\cdot x}d^mx \end{align} \]

then \(\tilde\Phi(\omega) \geq 0\) for all \(\omega \in \mathbb R^n\) implies that K is symmetric and positive semidefinite.


Solution:


3

Write a program to approximate the function

\[ W(x, y) = \frac{1}{1+x^2+y^2}sin(x^2+y^2) \]

on \([-3,3]^2\) with

\[ I_s(x) = \sum_{k=1}^N\alpha_kK_s(x, x_k), \ s = 1,2,3. \]

You should choose an appropriate grid \(X = \{x_1, x_2, ..., x_n\} \subset \mathbb R^2\) and plot \(I_s\) using different points than the grid points. It might be useful to copy the plot commands from the Crank-Nicolson program.


Code

Press the Code tick to see the full code implemented with tensorflow. The others tabs contain plots of W(x, y), the radial basis approximation and the error at each (x, y) pair. To test the \(\alpha\) parameters I create a new grid and randomly perturb the coordinates with gaussian noise.

W(x, y)

\(\hat W(x, y)\)

Error