text:
# Partial Differential Equations/Distributions

To get solutions to the first more difficult partial differential equations (like, for example, Poisson's equation, the heat equation and Helmholtz' equation), we will now take a look at distributions. Distributions are continuous and linear functions which map a test function to a real number.

## Definition and characterisationEdit

For each topological vector space, we can define a dual space.

Definition 4.1:

Let $\mathcal X$ be a topological vector space. The set

$\mathcal X^* := \{\mathcal T: \mathcal X \to \mathbb R : \mathcal T \text{ linear and continuous} \}$

is called the dual space of $\mathcal X$.

Having defined the dual space of a topological vector space, we can define distributions as follows:

Definition 4.2:

Let $O \subseteq \mathbb R^d$ be open. We call the elements of $\mathcal D(O)^*$ distributions.

Furthermore, we also give a name to the elements of the dual space of the Schwartz space, but we give a slightly different name:

Definition 4.3:

We call the elements of $\mathcal S(\mathbb R^d)^*$ tempered distributions.

We will now show that distributions are exactly the linear and sequentially continuous functions from $\mathcal D(\Omega)$ to $\mathbb R$ for a domain $\Omega \subseteq \mathbb R^d$.

Theorem 4.4:

Let $O \subseteq \mathbb R^d$ be open and let $\mathcal T: \mathcal D(O) \to \mathbb R$ be a function. Then the following two properties are equivalent:

1. $\mathcal T$ is continuous
2. $\mathcal T$ is sequentially continuous ($\varphi_l \to \varphi \Rightarrow \mathcal T(\varphi_l) \to \mathcal T(\varphi)$)

The same holds true for tempered distributions:

Theorem 4.5:

Let $\mathcal T: \mathcal S(\mathbb R^d) \to \mathbb R$ be a function. Then the following two properties are equivalent:

1. $\mathcal T$ is continuous
2. $\mathcal T$ is sequentially continuous ($\varphi_l \to \varphi \Rightarrow \mathcal T(\varphi_l) \to \mathcal T(\varphi)$)

Proof of theorems 4.4 and 4.5:

1. $\Rightarrow$:

Let $\mathcal T$ be continuous, and let $(\varphi_l)_{l \in \mathbb N}$ be a sequence such that $\varphi_l \to \varphi, l \to \infty$. We choose

$U = (\mathcal T(\varphi) - \epsilon, \mathcal T(\varphi + \epsilon)) \in \mathbb R$

for an arbitrary $\epsilon \in \mathbb R_{>0}$. As $\mathcal T$ is continuous, $\mathcal T^{-1}(U)$ is open. Therefore, $\mathcal X \setminus \mathcal T^{-1}(U)$ is closed. Assume by contradiction that infinitely many elements of the sequence $(\varphi_l)_{l \in \mathbb N}$ are not contained in $\mathcal T^{-1}(U)$. We choose $(\varphi_{l_m})_{m \in \mathbb N}$ as the subsequence of $(\varphi_l)_{l \in \mathbb N}$ not contained in $\mathcal T^{-1}(U)$. Then by the second property of the notion of convergence, $\varphi_{l_m} \to \varphi, m \to \infty$, and since $\mathcal X \setminus \mathcal T^{-1}(U)$ is closed, $\varphi \notin \mathcal T^{-1}(U)$ which contradicts $\mathcal T(\varphi) \in U$. Thus, for large enough $l$, we have $\varphi_l \in \mathcal T^{-1}(U)$ and therefore $\mathcal T(\varphi_l) \in U$. Since $\epsilon \in \mathbb R_{>0}$ was arbitrary, this shows that $\mathcal T(\varphi_l) \to \mathcal T(\varphi)$ and thus $\mathcal T$ is sequentially continuous.

2. $\Leftarrow$:

Let $\mathcal T$ be sequentially continuous. Let $F \subseteq \mathbb R$ be a closed set. We show that $\mathcal T^{-1}(F)$ is closed, thereby showing continuity (due to Lemma 3.13, which showed that in the definition of continuity, we may replace open with closed sets). Let $(\varphi_l)_{l \in \mathbb N}$ be a sequence such that $\forall l \in \mathbb N : \varphi_l \in \mathcal T^{-1}(F)$ and $\varphi_l \to \varphi, l \to \infty$. We have

$\forall l \in \mathbb N : \mathcal T(\varphi_l) \in F$

, because else $\varphi_l$ would by definition of the preimage not be in $\mathcal T^{-1}(F)$. Since $\mathcal T$ is sequentially continuous, we have

$\lim_{l \to \infty} \mathcal T(\varphi_l) = \mathcal T(\varphi)$

Due to the closedness of $F$ it further follows (see exercise 1) that

$\mathcal T(\varphi) \in F$

and thus, again by definition of the preimage,

$\varphi \in \mathcal T^{-1}(F)$

By the definitions of closed sets in $\mathcal D(\Omega)$ and $\mathcal S(\mathbb R^d)$, which were given in the last chapter to be exactly the sets which are closed with respect to convergence, $\mathcal T^{-1}(F)$ is closed.

$////$

Next, we will show that every tempered distribution is a distribution. But to do so, we need the following lemma:

Lemma 4.6:

Let $(\varphi_i)_{i \in \N}$ be an arbitrary sequence of bump functions. If $\varphi_i \to \varphi$ with respect to the notion of convergence for bump functions, then also $\varphi_i \to \varphi$ with respect to the notion of convergence for Schwartz functions.

Proof:

Let $(\varphi_l)_{l \in \mathbb N}$ be a sequence in $\mathcal D(\Omega)$ such that $\varphi_l \to \varphi \in \mathcal D(\Omega)$ with respect to the notion of convergence of $\mathcal D(\Omega)$. Let thus $K \subset \mathbb R^d$ be the compact set in which all the $\text{supp } \varphi_l$ are contained. From this also follows that $\text{supp } \varphi \subseteq K$, since otherwise $\|\varphi_l - \varphi\|_\infty \ge |c|$, where $c \in \mathbb R$ is any nonzero value $\varphi$ takes outside $K$; this would contradict $\varphi_l \to \varphi$ with respect to our notion of convergence.

In $\mathbb R^d$, ‘compact’ is equivalent to ‘bounded and closed’. Therefore, $K \subset B_R(0)$ for an $R > 0$. Therefore, we have for all multiindices $\alpha, \beta \in \N_0^d$:

\begin{align} \|x^\alpha \partial_\beta \varphi_l - x^\alpha \partial_\beta \varphi\|_\infty &= \sup_{x \in \mathbb R^d} \left| x^\alpha \partial_\beta \varphi_l(x) - x^\alpha \partial_\beta \varphi(x) \right| & \text{ definition of the supremum norm} \\ &= \sup_{x \in B_R(0)} \left| x^\alpha \partial_\beta \varphi_l(x) - x^\alpha \partial_\beta \varphi(x) \right| & \text{ as } \text{supp } \varphi_l, \text{supp } \varphi \subseteq K \subset B_R(0) \\ &\le R^{|\alpha|} \sup_{x \in B_R(0)} \left| \partial_\beta \varphi_l(x) - \partial_\beta \varphi(x) \right| & \forall i \in \{1, \ldots, d\}, (x_1, \ldots, x_d) \in \overline{B_R(0)} : |x_i| \le R \\ &= R^{|\alpha|} \sup_{x \in \mathbb R^d} \left| \partial_\beta \varphi_l(x) - \partial_\beta \varphi(x) \right| & \text{ as } \text{supp } \varphi_l, \text{supp } \varphi \subseteq K \subset B_R(0) \\ &= R^{|\alpha|} \left\| \partial_\beta \varphi_l(x) - \partial_\beta \varphi(x) \right\|_\infty & \text{ definition of the supremum norm} \\ & \to 0, l \to \infty & \text{ since } \varphi_l \to \varphi \text{ in } \mathcal D(\Omega) \end{align}

Therefore the sequence converges with respect to the notion of convergence for Schwartz functions.

$////$

Corollary 4.7:

Every tempered distribution is contained in every $\mathcal D(\Omega)^*$, where $\Omega \subseteq \mathbb R^d$ is an arbitrary domain.

Or to be more precise, the restriction of every tempered distribution to $\mathcal D(\Omega)$ is contained in $\mathcal D(\Omega)^*$ for every domain $\Omega$.

Proof:

Let $\mathcal T$ be a tempered distribution, and let $\Omega \subseteq \mathbb R^d$ be an arbitrary domain.

1.

We show that $\mathcal T(\varphi)$ has a well-defined value for $\varphi \in \mathcal D(\Omega)$.

Due to theorem 3.9, every bump function is a Schwartz function, which is why the expression

$\mathcal T (\varphi)$

makes sense for every $\varphi \in \mathcal D(\Omega)$.

2.

We show that the restriction is linear.

Let $a, b \in \mathbb R$ and $\varphi, \vartheta \in \mathcal D(\Omega)$. Since due to theorem 3.9 $\varphi$ and $\vartheta$ are Schwartz functions as well, we have

$\forall a, b \in \mathbb R, \varphi, \vartheta \in \mathcal D(\Omega) : \mathcal T (a \varphi + b \vartheta) = a \mathcal T (\varphi) + b \mathcal T (\vartheta)$

due to the linearity of $\mathcal T$ for all Schwartz functions. Thus $\mathcal T$ is also linear for bump functions.

3.

We show that the restriction of $\mathcal T$ to $\mathcal D(\Omega)$ is sequentially continuous.

Let $\varphi_l \to \varphi, l \to \infty$ with respect to the notion convergence of $\mathcal D(\Omega)$. Due to lemma 4.6, we have that $\varphi_l \to \varphi, l \to \infty$ with respect to the notion convergence of $\mathcal S(\mathbb R^d)$ and therefore, since $\mathcal T$ is sequentially continuous with respect to the notion convergence of $\mathcal S(\mathbb R^d)$ (by theorem 4.5), $\mathcal T(\varphi_l) \to \mathcal T(\varphi)$. This shows sequential continuity and thus continuity (by theorem 4.4).

$////$

## Regular distributionsEdit

In this section, we shortly study a class of distributions which we call regular distributions. In particular, we will see that for certain kinds of functions there exist corresponding regular distributions. But let's first define what regular distributions are.

Definition 4.8:

Let $\Omega \subseteq \mathbb R^d$ be a domain and let $\mathcal T \in \mathcal D(\Omega)^*$. If for all $\varphi \in \mathcal D(\Omega)$ $\mathcal T(\varphi)$ can be written as

$\mathcal T(\varphi) = \int_\Omega f(x) \varphi(x) dx$

for a function $f: \mathbb R^d \to \mathbb R$ which is independent of $\varphi$, then we call $\mathcal T$ a regular distribution.

Definition 4.9:

Let $\mathcal T \in \mathcal S(\mathbb R^d)^*$. If for all $\phi \in \mathcal S(\mathbb R^d)$ $\mathcal T(\phi)$ can be written as

$\mathcal T(\phi) = \int_{\mathbb R^d} f(x) \phi(x) dx$

for a function $f: \mathbb R^d \to \mathbb R$ which is independent of $\phi$, then we call $\mathcal T$ a regular tempered distribution.

Two questions related to this definition could be asked: Given a function $f: \mathbb R^d \to \mathbb R$, is $\mathcal T_f$ given by

$\mathcal T_f(\varphi) := \int_\Omega f(x) \varphi(x) dx$

a distribution? Or is $\mathcal T_f$ given by

$\mathcal T_f(\phi) := \int_{\mathbb R^d} f(x) \phi(x) dx$

a tempered distribution? In general, the answer to these two questions is no, but both questions can be answered with yes if the respective function $f$ has the respectively right properties, as the following two theorems show. But before we state the first theorem, we have to define what local integrability means, because in the case of bump functions, local integrability will be exactly the property which $f$ needs in order to define a corresponding regular distribution:

Definition 4.10:

Let $f: \mathbb R^d \to \mathbb R$ be a function. We say that $f$ is locally integrable iff for all compact subsets $K$ of $\mathbb R^d$

$-\infty < \int_K f(x) dx < \infty$

Now we are ready to give some sufficient conditions on $f$ to define a corresponding regular distribution or regular tempered distribution by the way of

$\mathcal T_f(\varphi) := \int_{\Omega} f(x) \varphi(x) dx$

or

$\mathcal T_f(\phi) := \int_{\mathbb R^d} f(x) \phi(x) dx$

Theorem 4.11:

Let $f: \mathbb R^d \to \mathbb R$ be a locally integrable function, and let $\Omega \subseteq \mathbb R^d$ be a domain. Then

$\mathcal T_f : \mathcal D(\Omega) \to \mathbb R, \mathcal T_f(\varphi) := \int_{\Omega} f(x) \varphi(x) dx$

is a regular distribution.

Proof:

Well-definedness follows from the monotony of the integral:

$\int_{\Omega} |\varphi(x) f(x)| dx \le \int_{\Omega} \|\varphi\|_\infty |f(x)| dx = \|\varphi\|_\infty \int_{\Omega} |f(x)| dx < \infty$

In order to be less or equal than something, the first integral must have a well-defined value in the first place. Since we excluded infinity among the possible values, $\mathcal T_f$ really maps to $\mathbb R$ and well-definedness is proven.

Continuity follows similarly due to

$|T_f \varphi_l - T_f \varphi| = \left| \int_\Omega (\varphi_l - \varphi)(x) f(x) dx \right| \le \|\varphi_l - \varphi\|_\infty \underbrace{\int_\Omega |f(x)| dx}_{\text{independent of } l} \to 0, l \to \infty$

Linearity follows due to the linearity of the integral.

$////$

Theorem 4.12:

Let $f \in L^2(\mathbb R^d)$, i. e.

$\int_{\mathbb R^d} |f(x)|^2 dx < \infty$

Then

$\mathcal T_f : \mathcal S(\mathbb R^d) \to \mathbb R, \mathcal T_f(\phi) := \int_{\mathbb R^d} f(x) \phi(x) dx$

is a regular tempered distribution

Proof:

Well-definedness follows from Hölder's inequality:

$\int_{\R^d} |\phi(x)| |f(x)| dx \le \|\phi\|_{L^2} \|f\|_{L^2} < \infty$

Due to the triangle inequality for integrals and Hölder's inequality, we have

$|T_f(\phi_i) - T_f(\phi)| \le \int_{\R^d} |(\phi_i - \phi)(x)| |f(x)| dx \le \|\phi_i - \phi\|_{L^2} \|f\|_{L^2}$

Furthermore

\begin{align} \|\phi_i - \phi\|_{L^2}^2 & \le \|\phi_i - \phi\|_{L^\infty} \int_{\R^d} |(\phi_i - \phi)(x)| dx \\ & = \|\phi_i - \phi\|_{L^\infty} \int_{\R^d} \prod_{j=1}^d (1 + x_j^2) |(\phi_i - \phi)(x)| \frac{1}{\prod_{j=1}^d (1 + x_j^2)} dx \\ & \le \|\phi_i - \phi\|_{L^\infty} \|\prod_{j=1}^d (1 + x_j^2) (\phi_i - \phi)\|_{L^\infty} \underbrace{\int_{\R^d} \frac{1}{\prod_{j=1}^d (1 + x_j^2)} dx}_{= \pi^d} \end{align}

If $\phi_i \to \phi$ in the notion of convergence of the Schwartz function space, then this expression goes to zero. Therefore, continuity is verified.

Linearity follows from the linearity of the integral.

## Operations on DistributionsEdit

For $\varphi, \vartheta \in \mathcal D(\mathbb R^d)$ there are operations such as the differentiation of $\varphi$, the convolution of $\varphi$ and $\vartheta$ and the multiplication of $\varphi$ and $\vartheta$. In the following section, we want to define these three operations (differentiation, convolution with $\vartheta$ and multiplication with $\vartheta$) for a distribution $\mathcal T$ instead of $\varphi$.

Lemma 4.13:

Let $O, U \subseteq \mathbb R^d$ be open sets and let $L : \mathcal D(O) \to \mathcal D(U)$ be a linear function. If there is a linear and continuous function $\mathcal L : \mathcal D(U) \to \mathcal D(O)$ such that

$\forall \varphi \in \mathcal D(O), \vartheta \in \mathcal D(U) : \int_O \varphi(x) \mathcal L(\vartheta)(x) dx = \int_U L(\varphi)(x) \vartheta(x) dx$

, then for every distribution $\mathcal T \in \mathcal D(O)^*$, the function $\varphi \mapsto \mathcal T(\mathcal L(\varphi))$ is a distribution. Therefore, we may define a function

$\Lambda : \mathcal D(O)^* \to \mathcal D(U)^*, \Lambda(\mathcal T) := \mathcal T \circ \mathcal L$

This function has the property

$\forall \varphi \in \mathcal D(O) : \Lambda(\mathcal T_\varphi) = \mathcal T_{L \varphi}$

Noticing that differentiation, convolution and multiplication are linear, we will define these operations for distributions by taking $L$ as the respective of these three operations.

Proof:

We have to prove two claims: First, that the function $\varphi \mapsto \mathcal T(\mathcal L(\varphi))$ is a distribution, and second that $\Lambda$ as defined above has the property

$\forall \varphi \in \mathcal D(O) : \Lambda(\mathcal T_\varphi) = \mathcal T_{L \varphi}$

1.

We show that the function $\varphi \mapsto \mathcal T(\mathcal L(\varphi))$ is a distribution.

$\mathcal T(\mathcal L(\varphi))$ has a well-defined value in $\mathbb R$ as $\mathcal L$ maps to $\mathcal D(O)$, which is exactly the preimage of $\mathcal T$. The function $\varphi \mapsto \mathcal T(\mathcal L(\varphi))$ is continuous since it is the composition of two continuous functions, and it is linear for the same reason (see exercise 2).

2.

We show that $\Lambda$ has the property

$\forall \varphi \in \mathcal D(O) : \Lambda(\mathcal T_\varphi) = \mathcal T_{L \varphi}$

For every $\vartheta \in \mathcal D(U)$, we have

$\Lambda(\mathcal T_\varphi)(\vartheta) := (\mathcal T_\varphi \circ \mathcal L)(\vartheta) := \int_O \varphi(x) \mathcal L(\vartheta)(x) dx \overset{\text{by assumption}}{=} \int_U L(\varphi)(x) \vartheta(x) dx =: \mathcal T_{L \varphi}(\vartheta)$

Since equality of two functions is equivalent to equality of these two functions evaluated at every point, this shows the desired property.

$////$

Using the last lemma 4.13, we define operations like multiplication with a smooth function, differentiation and convolution with a smooth function for distributions.

Definition 4.14:

### DifferentiationEdit

For the bump functions and the Schwartz functions, we also may define the differentiation of distributions. Let $k \in \N$ and $L = \sum_{|\alpha| \le k} a_\alpha (x) \frac{\partial^\alpha}{\partial x^\alpha}$. Let's now define

$L^*(\phi) := \sum_{|\alpha| \le k} (-1)^{|\alpha|}\frac{\partial^\alpha}{\partial x^\alpha} (a_\alpha (x) \phi (x))$.

Then, for the spaces $\mathcal A (\Omega_1) = \mathcal A (\Omega_2) = \mathcal D(\Omega)$ or $\mathcal S(\R^d)$, the requirements for the above lemma 1.4 are met and we may define the differentiation of distribution in the following way:

$L T(\varphi) := T(L^* \varphi)$

This definition also satisfies $LT_f = T_{Lf}$.

Proof: By integration by parts, we obtain:

$\int_\Omega \phi(x) \alpha(x) \frac{\partial}{\partial x_i} \psi(x) dx = -\int_\Omega \frac{\partial}{\partial x_i} (\phi(x) \alpha(x)) \psi(x) dx + \int_{\partial \Omega} \alpha(x) \phi(x) \psi(x) \nu_i(x) dx$

, where $\nu_i$ is the i-th component of the outward normal vector and $\partial \Omega$ is the boundary of $\Omega$. For bump functions, the boundary integral $\int_{\partial \Omega} \alpha(x) \phi(x) \psi(x) \nu_i(x) dx$ vanishes anyway, because the functions in $\mathcal D (\Omega)$ are zero there. For Schwartz functions, we may use the identity

$\int_{\R^d} \phi(x) \alpha(x) \frac{\partial}{\partial x_i} \psi(x) dx = \lim_{r \to \infty} \int_{B_r(0)} \phi(x) \alpha(x) \frac{\partial}{\partial x_i} \psi(x) dx$

and the decreasing property of the Schwartz functions to see that the boundary integral goes to zero and therefore

$\int_{\R^d} \phi(x) \alpha(x) \frac{\partial}{\partial x_i} \psi(x) dx = -\int_{\R^d} \frac{\partial}{\partial x_i} (\phi(x) \alpha(x)) \psi(x) dx$

To derive the equation

$\int\limits_{\Omega} \varphi(x) (L^*\psi)(x) dx = \int\limits_{\Omega} (L \varphi)(x) \psi(x) dx$

, we may apply the formula from above several times. This finishes the proof, because this equation was the only non-trivial property of $L^*$, which we need for applying lemma 1.5.

### ConvolutionEdit

Let $\vartheta \in \mathcal D(B_r(0)$, and let $\Omega_1 \supseteq \Omega_2 + B_r(0)$. Let's define

$L: \mathcal D(\Omega_1) \to C^\infty(\Omega_2), (L \varphi)(y) = (\varphi * \vartheta)(y) := \int_{\Omega} \varphi(x) \vartheta(y - x) dx$.

This function ($L$) is linear, because the integral is linear. It is called the convolution of $\vartheta$ and $\varphi$.

We can also define: $\tilde \vartheta(x) = \vartheta(-x)$, and:

$L^* \varphi := \tilde \vartheta * \varphi$

By the theorem of Fubini, we can calculate as follows:

$\int_{\Omega_2} (L \varphi)(x) \psi(x) dx = \int_{\Omega_2} \int_{\Omega_1} \vartheta(x - y) \varphi(y) \psi(x) dy dx$
$= \int_{\Omega_1} \int_{\Omega_2} \vartheta(x - y) \varphi(y) \psi(x) dx dy = \int_{\Omega_1} \varphi(y) (L^*\psi)(y) dy$

Therefore, the first assumption for Lemma 1.5 holds.

Due to the Leibniz integral rule, we obtain that for $f \in L^1$ (i. e. $f$ is integrable) and $g \in C^k (\R^d)$ (i. e. the partial derivatives of $g$ exist up to order $k$ and are also continuous):

$\frac{\partial^\alpha}{\partial x^\alpha} (f * g) = f * \left( \frac{\partial^\alpha}{\partial x^\alpha} g \right)$, $|\alpha| \le k$

With this formula, we can see (due to the monotony of the integral) that

$\sup_{x \in \R^d} \left|\frac{\partial^\alpha}{\partial x^\alpha} (f * g)(x)\right| = \sup_{x \in \R^d} \left| \int_{\R^d} f(y) \frac{\partial^\alpha}{\partial x^\alpha} g(x-y)dy \right| \le \overbrace{\sup_{x \in \R^d} \left| \int_{\R^d} f(y) dy \right|}^{\text{constant}} \cdot \sup_{x \in \R^d} \left| \frac{\partial^\alpha}{\partial x^\alpha} g(x) \right|$

From this follows sequential continuity for Schwartz and bump functions by defining $f = \vartheta$ and $g = \phi_i - \phi$. Thus, with the help of lemma 1.5, we can define the convolution with a distribution of $\mathcal D'(\Omega)$ or $\mathcal S'(\R^d)$ as follows:

$(\vartheta * T)(\varphi) := T(\tilde \vartheta * \varphi)$

## ExercisesEdit

1. Show that $R^d$ endowed with the usual topology is a topological vector space.


text:
# Can four consecutive numbers all be powers of whole numbers?

I need a direction, I was given a hint: the claim is somehow how related to another claim, for 2 consecutive even numbers one is divisible by 4 the other isn't.

• Can three?????? – barak manos Oct 29 '15 at 7:36
• @barakmanos: the hint cannot be used for three numbers. – Yves Daoust Oct 29 '15 at 7:37
• If they are first powers you can have as many as you like. – Mark Bennet Oct 29 '15 at 7:49
• Even two consecutive numbers can't be powers, except for $8,9$. This is because of Mihăilescu's theorem. – user236182 Oct 29 '15 at 9:41
• $2 = 2^1 , 3=3^1, 4=2^2, 5=5^1$ – Michael Stocker Oct 29 '15 at 10:55

Among the four consecutive numbers, one must be of the form $4n+2=2(2n+1)$. As the multiplicity of $2$ in its prime decomposition is $1$, this number cannot be a power.
• However, $2,3,4,5$ works if you count primes as powers of primes. – John Dvorak Oct 29 '15 at 13:17
• I know Mihăilescu's theorem, but this thread makes me wonder if there is an elementary way to see that the three consecutive integers $4n-1$, $4n$ and $4n+1$ can never be simultaneously perfect powers. Becuase four consecutive are very easy to rule out, and two consecutive were a tough problem for a long time. – Jeppe Stig Nielsen Oct 29 '15 at 14:33

format: plain


text:
# Rhyming is the key

To people I'm cold
I'm a huge fan of magic
I'm a huge fan of exotic pets
But I need to catch up on sleep

Key:

Hint for the word I'm looking for.

Hint for two DIFFERENT words that rhyme with the word I'm looking for

• @Rubio Wow, I totally forgot I didn't accept an answer yet. >.< Sorry. – noClue Jul 17 '17 at 8:30

## 1 Answer

Solution:

I think it is

Blizzard

Explanation:

To people I'm cold

Blizzards are cold

I'm a huge fan of magic

Rhymes with wizard

I'm a huge fan of exotic pets

Lizards are exotic pets

But I need to catch up on sleep

The middle letters of the word are 'zz', which is associated to sleeping

• A guess for the last clue: the middle letters of your word mean sleep. – TwoBitOperation Jul 5 '17 at 16:38
• @archaephyrryx You were almost right with the last clue: Lizard and Wizard are both missing an additional "z" for Blizzard, therefore you need to "catch some z's", specifically an additional one. – noClue Jul 17 '17 at 8:30


text:
# How do I place two tables with different numbers of rows at the same height?

I want to start two tables with different number of rows at the same height.

Basically, I want the horizontal lines to be at the same height.

This is the current code I have:

\adjustbox{valign=h}{
\begin{tabular}{ c | c c }
NFA & 0 & 1 \\
\hline
$q_0$ & $[q_0q_1]$ & $q_0$ \\
$q_1$ & $\varnothing$ & $q_2$ \\
$q_2$ & $q_3$ & $q_3$ \\
$q_3$ & $\varnothing$ & $\varnothing$ \\
\end{tabular}
\begin{tabular}{ c | c c }
DFA & 0 & 1 \\
\hline
$q_0$ & $[q_0q_1]$ & $q_0$ \\
$[q_0q_1]$ & $[q_0q_1]$ & $[q_0q_2]$ \\
$[q_0q_2]$ & $[q_0q_1q_3]$ & $[q_0q_3]$ \\
$[q_0q_1q_3]$ & $[q_0q_1]$ & $[q_0q_2]$ \\
$[q_0q_3]$ & $[q_0q_1]$ & $[q_0q_1]$ \\
\end{tabular}
}

• What's \adjustbox supposed to do? And valign=h is not a valid option. Oct 31 '15 at 21:42

If you add the optional argument [t] to each tabular they will be vertically aligned by the first line.

As egreg mentions in a comment, the \adjustbox likely doesn't have any effect, and valign=h is not a valid option for it anyway, so I removed it.

\documentclass{article}
\usepackage{amssymb}
\begin{document}
\begin{tabular}[t]{ c | c c }
NFA & 0 & 1 \\
\hline
$q_0$ & $[q_0q_1]$ & $q_0$ \\
$q_1$ & $\varnothing$ & $q_2$ \\
$q_2$ & $q_3$ & $q_3$ \\
$q_3$ & $\varnothing$ & $\varnothing$ \\
\end{tabular}%
\begin{tabular}[t]{ c | c c }
DFA & 0 & 1 \\
\hline
$q_0$ & $[q_0q_1]$ & $q_0$ \\
$[q_0q_1]$ & $[q_0q_1]$ & $[q_0q_2]$ \\
$[q_0q_2]$ & $[q_0q_1q_3]$ & $[q_0q_3]$ \\
$[q_0q_1q_3]$ & $[q_0q_1]$ & $[q_0q_2]$ \\
$[q_0q_3]$ & $[q_0q_1]$ & $[q_0q_1]$ \\
\end{tabular}
\end{document}

• I'm not sure \adjustbox has any influence on the output (apart adding unwanted spaces at either end, because of missing %). By the way, valign=h doesn't seem to be a valid option. Oct 31 '15 at 21:40
• @egreg I considered removing it, but I didn't know the context, so I left it. You are of course correct about h, so that's another argument for removing it altogether. Will edit, thanks. Oct 31 '15 at 21:54
• You could also add a % in the line before \quad. ;-) Oct 31 '15 at 22:11


text:
# Measurement of the beam asymmetry Σ for π0 and η photoproduction on the proton at Eγ=9 GeV

@article{Ghoul2017MeasurementOT,
title={Measurement of the beam asymmetry $\Sigma$ for $\pi$0 and $\eta$ photoproduction on the proton at E$\gamma$=9 GeV},
author={GlueX Collaboration H. Al Ghoul and E. G. Anassontzis and Alexander Austregesilo and F. Barbosa and A. Barnes and Tegan Beattie and D. W. Bennett and V. Berdnikov and Timothy Charles Black and Werner U. Boeglin and William J. Briscoe and William Brooks and Bradford E. Cannon and O. A. Chernyshov and Eugene Chudakov and Volker Crede and Mark Macrae Dalton and Alexandre Deur and Sean A Dobbs and A. Dolgolenko and Michael Dugger and Roman Dzhygadlo and Hovanes Egiyan and Paul Michael Eugenio and C. Fanelli and Ahmed Foda and John Frye and Sergey Furletov and Liping Gan and A. Gasparian and Arsenii Gerasimov and Nerses Gevorgyan and Klaus Goetzen and V. S. Goryachev and L . B. Guo and Hayk Hakobyan and John Hardin and A. Henderson and G M Huber and David Ireland and M. M. Ito and Naomi Jarvis and R. T. Jones and Vanik Kakoyan and Mahmoud Kamel and F. Klein and Ralf Kliemt and C. Kourkoumeli and Sergey Kuleshov and Ilya I. Kuznetsov and Manuel Lara and I. Larin and David Lawrence and William Levine and Kenneth Livingston and G. J. Lolos and Valery E. Lyubovitskij and David Mack and P. T. Mattione and V. Matveev and Michael Mccaughan and M. E. Mccracken and William M. Mcginley and Justin McIntyre and R. Mendez and Christopher Meyer and Rory Allen Miskimen and Ross E. Mitchell and Fridah Mokaya and Keiichi Moriya and F. Nerling and Grigory Nigmatkulov and N. Ochoa and Alexander Ostrovidov and Zisis Papandreou and Maria Patsyuk and R. Pedroni and Michael R. Pennington and Lubomir Pentchev and Krisztian Peters and Eric Pooser and B. Pratt and Yi Qiang and Joerg Reinhold and Barry Ritchie and Luke Robison and D. Romanov and Claudio Guedes Salgado and Reinhard A Schumacher and Cornelius Schwarz and Jochen Schwiening and A. Yu. Semenov and Irina A. Semenova and Kamal K. Seth and Matthew R. Shepherd and E. S. Smith and Daniel I. Sober and Alexander Y. Somov and S. V. Somov and O. Soto and Nathan Andrew Sparks and Michael Staib and J. Stevens and Igor I. Strakovsky and Adesh Subedi and V. V. Tarasov and S. Taylor and Aram Teymurazyan and I. A. Tolstukhin and Amiran Tomaradze and Alam Toro and Aristeidis Tsaris and Georgios I. Vasileiadis and I. Vega and Natalie Kathleen Walford and Dominik Werthmuller and Timothy Whitlatch and M. Williams and Elliott Wolin and T. Xiao and Jonathan Zarling and Z. Y. Zhang and B. Zihlmann and V. Mathieu and J. Nys},
journal={Physical Review C},
year={2017},
volume={95},
pages={042201}
}
• Published 27 January 2017
• Physics
• Physical Review C
We report measurements of the photon beam asymmetry Σ for the reactions γp→pπ 0 and γp→pη from the GlueX experiment using a 9 GeV linearly polarized, tagged photon beam incident on a liquid hydrogen target in Jefferson Lab's Hall D. The asymmetries, measured as a function of the proton momentum transfer, possess greater precision than previous π 0 measurements and are the first η measurements in this energy regime. The results are compared with theoretical predictions based on t -channel…

## Figures from this paper

Measurement of the photon beam asymmetry Σ for γ + p → K+Σ0 at Eγ = 8.5 GeV in GlueX
• Physics
PROCEEDINGS OF THE 15TH INTERNATIONAL CONFERENCE ON MESON-NUCLEON PHYSICS AND THE STRUCTURE OF THE NUCLEON
• 2020
We present measurements of the photon beam asymmetry Σ for the reaction γp → K+Σ0(1193) using the GlueX experiment in Jefferson Lab's Hall D. Data were collected using a linearly polarized photon
Measurement of the photon beam asymmetry in γ⃗p→K+Σ0 at Eγ=8.5 GeV
• Physics
• 2020
We report measurements of the photon beam asymmetry Σ for the reaction γp→K+Σ0 (1193) using the GlueX spectrometer in Hall D at Jefferson Lab. Data were collected by using a linearly polarized
Measurement of the helicity asymmetry E in ω → π+π−π0 photoproduction
• Physics
• 2017
The double-polarization observable E was studied for the reaction γp → pω using the CEBAF Large Acceptance Spectrometer (CLAS) in Hall B at the Thomas Jefferson National Accelerator Facility and the
η′ and η mesons with connection to anomalous glue
• Physics
Reviews of Modern Physics
• 2019
We review the present understanding of etaprime and eta meson physics and these mesons as a probe of gluon dynamics in low-energy QCD. Recent highlights include the production mechanism of eta and
Vector Meson Photoproduction with a Linearly Polarized Beam
• Physics
• 2018
We propose a model based on Reggae theory to describe photoproduction of light vector mesons. We fit the SLAC data and make predictions for the energy and momentum-transfer dependence of the
Light-Meson Spectroscopy at GlueX
GlueX at Jefferson Lab aims to study the light meson spectrum with an emphasis on the search for light hybrid mesons. To this end, a linearly-polarized $9\,$GeV photon beam impinges on a hydrogen
Resonances in forward π+π− photoproduction on hydrogen
• Physics
EPJ Web of Conferences
• 2019
We show that the cross section of the Δ(1230) production in the γp → pπ+ π− reaction at forward angles and with unpolarized photons can be described in terms of gauge invariant one pion t-channel
Exclusive photoproduction of π0 up to large values of Mandelstam variables s,t, and u with CLAS
• Physics
Physical Review C
• 2018
Exclusive photoproduction cross sections have been measured for the process γ p → p π 0 [ e + e − ( γ ) ] with the Dalitz decay final state using tagged photon energies in the range

## References

SHOWING 1-10 OF 16 REFERENCES
АСПАПТАР МЕН ЭКСПЕРИМЕНТ ТЕХНИКАСЫ ПРИБОРЫ И ТЕХНИКА ЭКСПЕРИМЕНТА INSTRUMENTS AND EXPERIMENTAL TECHNIQUES
• Computer Science
• 2018
The main aim is to design schemes for automated control system and management for technological process for providing of safety and effective functioning of enterprise and describe the mathematical model of the regulatory object, as well as investigate the system of automatic regulation for stability.
Phys
• Rev. C72, 022202
• 2005
Phys
• Rev. D4, 1937
• 1971
Phys
• Rept. 34, 117
• 1977
Phys
• Rev. D92, 074004
• 2015
Nucl
• Instrum. Meth. A795, 376
• 2015
GlueX Collaboration)
• AIP Conf. Proc. 1735,
• 2016
Instrum
• Exp. Tech. 58, 25
• 2015
Phys
• Rev. D1, 27
• 1970


text:
# A Graphical Depiction of Linear Response

Most of the theory of linear response derives from the following equation:

$y(t) = \int_{-\infty}^{\infty} \chi(t-t')h(t') dt'$

I remember quite vividly first seeing an equation like this in Ashcroft and Mermin in the context of electric fields (i.e. $\textbf{D}(\textbf{r}) = \int_{-\infty}^{\infty} \epsilon(\textbf{r}-\textbf{r}')\textbf{E}(\textbf{r}') d\textbf{r}'$) and wondering what it meant.

One way to think about $\chi(t-t')$ in the equation above is as an impulse response function. What I mean by this is that if I were to apply a Dirac delta-function perturbation to my system, I would expect it to respond in some way, characteristic of the system, like so:

Mathematically, this can be expressed as:

$y(t) = \int_{-\infty}^{\infty} \chi(t-t')h(t') dt'= \int_{-\infty}^{\infty} \chi(t-t')\delta(t') dt'=\chi(t)$

This seems reasonable enough. Now, though this is going to sound like tautology, what one means by “linear” in linear response theory is that the system responds linearly to the input. Most of us are familiar with the idea of linearity but in this context, it helps to understand it through two properties. First, the strength of the input delta-function determines the strength of the output, and secondly, the response functions combine additively. This means that if we apply a perturbation of the form:

$h(t')=k_1\delta(t'-t_1) + k_2\delta(t'-t_2) +k_3\delta(t'-t_3)$

We expect a response of the form:

$y(t)=k_1\chi(t-t_1) + k_2\chi(t-t_2) +k_3\chi(t-t_3)$

This is most easily grasped (at least for me!) graphically in the following way:

One can see here that the response to the three impulses just add to give the total response. Finally, let’s consider what happens when the input is some sort of continuous function. One can imagine a continuous function as being composed of an infinite number of discrete points like so:

Now, the output of the discretized input function can be expressed as so:

$y(t) = \sum_{n=-\infty}^{\infty} [\chi(t-n\epsilon_{t'})][h(n\epsilon_{t'}][\epsilon_{t'}]$

This basically amounts to saying that we can treat each point on the function as a delta-function or impulse function. The strength of each “impulse” in this scenario is quantified by the area under the curve. Each one of these areal slivers gives rise to an output function. We then add up the outputs from each of the input points, and this gives us the total response $y(t)$ (which I haven’t plotted here). If we take the limit $n \rightarrow \infty$, we get back the following equation:

$y(t) = \int_{-\infty}^{\infty} \chi(t-t')h(t') dt'$

This kind of picture is helpful in thinking about the convolution integral in general, not just in the context of linear response theory.

Many experiments, especially scattering experiments, measure a quantity related to the imaginary part of the  Fourier-transformed response function, $\chi''(\omega)$. One can then use a Kramers-Kronig transform to obtain the real part and reconstruct the temporal response function $\chi(t-t')$. An analogous procedure can be done to obtain the real-space response function from the momentum-space one.

Note: I will be taking some vacation time for a couple weeks following this post and will not be blogging during that period.


text:
# Tag Info

2

The special state of motion you're talking about is often called the Hubble flow. (edit: oops, Ben Crowell already mentioned this.) I think that in modern slow-roll inflation the source of this asymmetry is an asymmetry in the tiny (Planck-scale?) seed of inflation, whatever it was, inflated by a factor of $e^{60}$ or more. The inflaton potential has to be ...

1

The structure of general relativity does not allow the theory itself to be classified in terms of global, discrete symmetries such as time-reversal. The Einstein field equations don't refer to a time coordinate; they're expressed tensorially, which means that they are completely independent of what coordinates you choose. Since there is no guarantee that you ...

4

Nice question. First off, there's a definitional problem because we can't apply a Lorentz boost to the universe as a whole. Lorentz symmetry is a local thing. So when we talk about "Lorentz symmetry" for the universe as a whole, I think we have to keep in mind that we mean something a little different. Basically if the "Lorentz symmetry" has already been ...

1

A pretty exhaustive summary in the context of Standard Model already exists in the following source: ''Dynamics of the Standard Model'' - Donoghue, Golowich, Holstein, Chapter 3 - Symmetries and Anomalies A limited preview can be found here. (Embarrassingly though, the very first page of the chapter is excluded from Google's preview!) But here's the ...

0

Noether's theorem in its usual form assumes that the system (in this case a fluid) is governed by an action principle. We assume for simplicity that the fluid consists of just one type of fluid particles. I) In the Lagrangian fluid picture, the (local) conservation of fluid particles is manifest from the onset, since the dynamical variables are the labels ...

3

I'd say that there is not a systematic summary of the status of symmetries on particle physics, but if any, it should be spread all over the PDG review. However, I'd like to comment on a few points. So far Lorentz symmetry is exact on all sectors.${}^\dagger$ Scaling (part of the conformal transformations) is broken once an energy scale is introduced in ...

6

The inertia ellipsoid is computed from an integral about an axis - in other words you rotate the object. This will "smooth out" any symmetries and typically increase the symmetry. Sorry this is a "early morning" intuitive explanation - maybe someone else will give you a more formal answer.

1

In the region between two spherical plates, we have, $$\begin{array}{l} \nabla \times E = 0\,\,\, (1)\\ \nabla .\left( {\varepsilon \left( \theta \right)E} \right) = 0\,\,\, (2) \end{array}$$ The first equation leads to the definition of scalar potential $\Phi$, i.e. $E = - \nabla \Phi$. Therefore, from Eq. (2) we have, \nabla .\left( {\varepsilon ...

4

Congratulations, you made me look into this for the last hour! And, unfortunately, I believe the answer is: Nope We are looking for a Ricci-flat Riemannian symmetric space, since your isometry group is a Lie group. I spent some time trying to construct the Ricci-flat manifold from the irreducible symmetric spaces given there, but couldn't figure out a good ...

2

In a comment you write space time symmetries don't fit into the framework of the action since the action is a functional on the fields only not also on space time (space time here appears merely as a dummy variable This isn't quite right. A given spacetime transformation often induces a transformation on fields themselves, and in this way, spacetime ...

-1

The first half of this theorem is: you can substitute the total mass in the centre to get the net gravity. It probably don't stays, although it needs a little bit of integration. The second (there is no net gravity inside the shell), I think it passes, if the shell is convex. The proof is exactly the same as you can see in the wiki page.

3

You can easily convince yourself that this is not true. Just imagine a test particle on one side of a spherical shell. If the density is uniform, the theorem will apply. Now, however, decrease the density of that half of the shell until it's 0. Obviously this other half would attract the test particle. Alternatively, if changing density is not an option and ...

1

There are 5 standard model (SM) multiplets per generation of fermions. The SM gauge group is $\mathcal{G}_\text{SM} = SU(3)_C \times SU(2)_L \times U(1)_Y$. Various multiplets can then be written as $\mathcal{G}_\text{SM} \ni x = (C,T)_{(Y)}$, where $C$ denotes colour multiplet, $T$ weak isospin multiplet and $Y$ hypercharge value. Multiplets (1st ...

1

Yes! In fact, one of my (few) own research experiences was closely connected to random matrix theory! I did a small project under supervision of Enrico Pajer from Princeton University last January. The work I did was based on earlier work of his, which used random matrix theory in the context of inflationary theory, using a model where many fields ...

1

About the supposed paradox: $u$ and $\bar d$ have the same isospin quantum numbers, but not all the other properties. If you restrict your problem to only study the isospin space, you will not see that they have different charge and other different quantum numbers. About the charge: I don't know where your equation comes from, but it seems close to the ...

3

Group actions in classical field theory. Let a classical theory of fields $\Phi:M\to V$ be given, where $M$ is a base" manifold and $V$ is some target space, which, for the sake of simplicity and pedagogical clarity, we take to be a vector space. Let $\mathscr F$ denote the set of admissible field configurations, namely the set of admissible functions ...

1

Emmy Noether proved both the theorem and its converse. Look for the book "The Noether Theorems" for a precise and discussed formulation of her statements, as well as a translation of the original paper. It seems there is a link to the pdf in the princeton math website (I don't know about copyright issues, however).

1

Pick a point above the plane. From a point in the plane directly under the point above, draw a circle of some radius. Consider the contribution of the charge elements along the circle to the electric field at the point above the plane. Since the charge density is uniform, the horizontal components of the electric field from charge elements on opposite ...

1

An answer connected to Gauss law (I hope everything is correct, since it's long ago for me ... so no warranty): An infinite plane of uniform charge for example in the z-plane has the charge distribution: $\rho=q\,\delta(z)$ Thus, the electrostatic potential should be $\Phi=\frac{q\,|z|}{2\pi}$. Hence, the electric vectorfield is: ...

8

The answer by @NowIGetToLearnWhatAHeadIs is correct. It's worth learning the language used therein to help with your future studies. But as a primer, here's a simplified explanation. Start with your charge distribution and a "guess" for the direction of the electric field. As you can see, I made the guess have a component upward. We'll see shortly why ...

0

With respect to your test charge, there will always be an equal number of charges on your plane in all directions because the plane is infinite. So for every charge "in front" of your test charge there will be a charge "behind" your test charge. And for every charge to the left of your test charge will be a charge to the right. What this means is that no ...

8

You have to realize that the system is invariant under rotations about the normal to the plane. Then then electric field must also be invariant under these rotations. An electric field component in the plane does change under such a rotation, so such a component must not exist if we have this invariance. Thus the electric field is purely along the normal to ...

Top 50 recent answers are included


text:
# Logarithm relation

Algebra Level 4

$\large{\begin{cases} x = \log_{2k}(k) \\ y = \log_{3k}(2k) \\ z = \log_{4k}(3k) \end{cases}}$

Establish a relation between $$x , y , z$$, such that the above system of equations satisfies

×


text:
Multi-class classification with imbalanced classes

I have a data from 5 classes and I would like to build a classifier. However the number of feature vectors in each class is very different. One has about 5000, one about 200,000, one about 1,000,000, one about 10,000,000 and one about 1,000,000,000.

As the largest class is too large to build a classifier with I will have to down sample it in any case.

I am currently using scikit learn and Random Forests although I can use another tool if that would be better. IF it were a binary classification problem I could have trained with balanced classes and computed the ROC curve to get the false positive rate I can tolerate. However I have no idea what the right thing to do in this multiclass case is.

Are there best practice recommendations for what to do in practice in this situation? I don't want the classifier to simply ignore one of the classes for example.

As your class sizes are so big. I would perform a pre-downsampling to something like 5000+10000+10000+10000+10000. Do you really need more samples? Then downsample again and model independently and aggregate multiple forests afterwards. That will save time and memory. During modeling you may even only bootstrap ~5000 samples for each tree to speedup process. For each tree the bootstrap can be stratified, such that 1000 samples from each class are selected.

Here's a thread on how to train a balanced multi class forest with down sampling and 1-vs-rest ROC plot.

And here's a R-code example on 1-vs-rest roc plots:

library(AUC)
#simulated probabilistic prediction(yhat) vs true class (y)
obs=500
nClass=5
y = sample(1:nClass,obs,rep=T)
yhat = sapply(y,function(y) {
pred.prob = rep(0,nClass)
pred.prob[y] = 0.2
pred.prob = pred.prob + runif(nClass)
pred.prob = pred.prob / sum(pred.prob)
})

#plot 1-vs-all, one curve for each class
for(i in 1:nClass) plot(roc(predictions = yhat[i,],
labels = as.factor(y==i)),


text:
# Guinier Porod

## Description:

Calculates the scattering for a generalized Guinier/power law object. This is an empirical model that can be used to determine the size and dimensionality of scattering objects, including asymmetric objects such as rods or platelets, and shapes intermediate between spheres and rods or between rods and platelets, and overcomes some of the deficiencies of the (Beaucage) `unified-power-rg` model (see Hammouda, 2010).

Definition

The following functional form is used

$$I(q) = \begin{cases} \frac{G}{Q^s}\ \exp{\left[\frac{-Q^2R_g^2}{3-s} \right]} & Q \leq Q_1 \\ D / Q^m & Q \geq Q_1 \end{cases}$$
This is based on the generalized Guinier law for such elongated objects (see the Glatter reference below). For 3D globular objects (such as spheres), $s = 0$ and one recovers the standard Guinier formula. For 2D symmetry (such as for rods) $s = 1$, and for 1D symmetry (such as for lamellae or platelets) $s = 2$. A dimensionality parameter ($3-s$) is thus defined, and is 3 for spherical objects, 2 for rods, and 1 for plates.

Enforcing the continuity of the Guinier and Porod functions and their derivatives yields

$$Q_1 = \frac{1}{R_g} \sqrt{(m-s)(3-s)/2}$$
and

$$D = G \ \exp{ \left[ \frac{-Q_1^2 R_g^2}{3-s} \right]} \ Q_1^{m-s}$$
&= \frac{G}{R_g^{m-s}} \exp \left[ -\frac{m-s}{2} \right] \left( \frac{(m-s)(3-s)}{2} \right)^{\frac{m-s}{2}}

Note that the radius of gyration for a sphere of radius $R$ is given by $R_g = R \sqrt{3/5}$. For a cylinder of radius $R$ and length $L$, $R_g^2 = \frac{L^2}{12} + \frac{R^2}{2}$ from which the cross-sectional radius of gyration for a randomly oriented thin cylinder is $R_g = R/\sqrt{2}$ and the cross-sectional radius of gyration of a randomly oriented lamella of thickness $T$ is given by $R_g = T / \sqrt{12}$.

For 2D data: The 2D scattering intensity is calculated in the same way as 1D, where the q vector is defined as

$$q = \sqrt{q_x^2+q_y^2}$$

Reference

B Hammouda, *A new Guinier-Porod model, J. Appl. Cryst.*, (2010), 43, 716-719
B Hammouda, *Analysis of the Beaucage model, J. Appl. Cryst.*, (2010), 43, 1474-1478

Authorship and Verification

**Author:**


text:
# Ulps Plots Reveal Math Function Accuracy

"ULP" stands for "unit in the last place." An ulps plot samples a fundamental math function such as $\sin{x}$, or a more esoteric function like a Bessel function. The samples are compared with more accurate values obtained from a higher precision computation. A plot of the accuracy, measured in ulps, reveals valuable information about the underlying algorithms.

### Contents

#### fdlibm

libm is the library of elementary math functions that supports the C compiler. fdlibm is "freely distributable" source for libm developed and put into the public domain over 25 years ago by K. C. Ng and perhaps a few others at Sun Microsystems. I wrote about fdlibm in our newsletter in 2002, The Tetragamma Function and Numerical Craftsmanship.

Mathematically fdlibm shows immaculate craftsmanship. We still use it today for our elementary transcendental functions. And I suspect all other mathematical software projects do as well. If they don't, they should.

#### ulps plots

ulps(x) is the distance from x to the next larger floating point number. It's the same as eps(x).

To assess the accuracy of a computed value

y = f(x)

compare it with the more accurate value obtained from the Symbolic Math Toolbox

Y = f(sym(x,'f'))

The 'f' flag says to convert x to a sym exactly, without trying to guess that it is an inverse power of 10 or the sqrt of something. The relative error in y, measured in units in the last place, is then

u = (y - Y)/eps(abs(Y))

Since this is relative error, it is a stringent measure near the zeros of f(x).

If y is the floating point number obtained by correctly rounding Y to double precision, then

-0.5 <= u <= 0.5

This is the best that can be hoped for. Compute the exact mathematical value of f(x) and make a single rounding error to obtain the final result. Half-ulp accuracy is difficult to obtain algorithmically, and too expensive in execution time. All of the functions in MATLAB that are derived from fdlibm have better than one-ulp accuracy.

-1.0 < u < 1.0

Each of the following plots involves 100,000 random arguments x, uniformly distributed in an appropriate interval.

#### sin

We see about 0.8 ulp accuracy from this sample. That's typical.

Argument reduction is the first step in computing $\sin{x}$. An integer multiple $n$ of $\pi/2$ is subtracted from the argument to bring it into the interval

$$-\frac{\pi}{4} \le x - n \frac{\pi}{2} \le \frac{\pi}{4}$$

Then, depending upon whether $n$ is odd or even, a polynomial approximation of degree 13 to either $\sin$ or $\cos$ gives the nearly correctly rounded result for the reduced argument, and hence for the original argument. The ulps plot shows a slight degradation in accuracy at odd multiples of $\pi/4$, which are the extreme points for the polynomial approximations.

It is important to note that the accuracy is better than one ulp even near the end-points of the sample interval, $0$ and $2\pi$. This is where $\sin{x}$ approaches $0$ and the approximation must follow carefully so that the relative error remains bounded.

#### tan

Again, roughly 0.8 ulp accuracy.

Similar argument reduction results in similar behavior near odd multiples of $\pi/4$. In between these points, at $\pi/2$ and $3\pi/2$, $\tan{x}$ has a pole and the approximation must follow suit. The algorithm uses a reciprocal and the identity

$$\tan x = -1/\tan{(x+\frac{\pi}{2})}$$

This comes close to dividing by zero as you approach a pole, but the resulting approximation remains better than one ulp.

#### atan

Good to within slightly more than 0.8 ulp. The underlying approximation is a piecewise polynomial with breakpoints at a few multiples of 1/16 that are evident in the plot and marked on the axis.

#### exp

About the same accuracy as the previous plots.

The argument reduction involves the key value

$$r = \ln{2} \approx 0.6931$$

and the identity

$$\exp{x} = 2^n \exp{(x-n r)}$$

The resulting ulps plot shows the extremes of the error at odd multiples of $r/2$.

#### Lambert W

Now for two functions that are not in fdlibm. If you follow this blog, you might have noticed that I am a big fan of the Lambert W function. I blogged about it a couple of years ago, The Lambert W Function. The Wikipedia article is excellent, Lambert W Function. And, you cn just Google "lambert w function" for many more interesting links.

The Lambert W function is not available in MATLAB itself. The Symbolic Math Toolbox has an @double method that accesses the symbolic code for type double arguments. Or, my blog post mentioned above has some simple (but elegant, if I do say so myself) code.

Neither code is one-ulp accurate. The primary branch of the function has a zero at the origin. As we get near that zero, the relative error measured in ulps is unbounded. The absolute accuracy is OK, but the relative accuracy is not. In fact, you might see a billion ulps error. That's a gigaulp, or gulp for short.

As lambertw(x) crosses a power of two, the unit in the last place, eps(lambertw(x)), jumps by a factor of two. Three of these points are marked by ticks on the x-axis in the ulps plot.

   for a = [1/8 1/4 1/2]
z = fzero(@(x) lambertw(x)-a,.5)
end

z =
0.1416
z =
0.3210
z =
0.8244

#### Bessel functions

Our codes for Bessel functions have fairly good, although not one-ulp, absolute accuracy. But they do not have high relative accuracy near the zeros. Here are the first five zeros, and an ulps plot covering the first two, for $J_0(x)$, the zero-th order Bessel function of the first kind.

   for a = (1:5)*pi
z = fzero(@(x) besselj(0,x), a)
end

z =
2.4048
z =
5.5201
z =
8.6537
z =
11.7915
z =
14.9309

#### erfinv

Here is the inverse of the error function. It looks very interesting, but I haven't investigated it yet.

#### Code

I have recently updated Cleve's Laboratory in the MATLAB Central file exchange. The latest version includes ulpsapp.m, which generates the ulps plots in this blog.

Published with MATLAB® R2017a

|


text:
How do you find the Vertical, Horizontal, and Oblique Asymptote given f(x)=(x^3-x)/(x^3-4x)?

Nov 4, 2016

The vertical asymptotes are $x = 2$ and $x = - 2$
The horizontal asymptote is $y = 1$

Explanation:

Let's do some simplification
$f \left(x\right) = \frac{{x}^{3} - x}{{x}^{3} - 4 x} = \frac{x \left({x}^{2} - 1\right)}{x \left({x}^{2} - 4\right)} = \frac{\left(x + 1\right) \left(x - 1\right)}{\left(x + 2\right) \left(x - 2\right)}$

As we cannot divide by $0$,

The degree of the numerator is identical to the degree of the denominator, so there are no oblique asymptotes.
Limit $f \left(x\right) = {x}^{2} / {x}^{2} = 1$
$x \to \pm \infty$

So a horizontal asymptote is $y = 1$
graph{(x^2-1)/(x^2-4) [-10, 10, -5, 5]}


text:
**This is an old revision of the document!**

# Bayes Nets

## Objectives

This assignment is designed to:

• give you practice thinking about probabilistic models in the form of Bayes Nets (directed graphical models)
• help you become more fluent with the terminology and the techniques of the course
• prepare you to work with interesting graphical models of natural phenomena!

## Exercises

Show your work. Be clear and concise. This assignment should be typed.

### Bayes Net

Consider the graphical model (shown above) over five binary random variables:

1. [20 points] List the independence assumptions captured in the model between the following pairs of random variables. Be sure to consider all of the cases in which the other variables in the model have known values and when they do not.
• $L$ and $R$
• $T$ and $R$
2. [20 points] More independence:
• Assuming that the value of $L$ is known, list all independence relations between $T$ and other variables. Be sure to consider all of the cases in which the other variables in the model have known values and when they do not.
• Assuming that the value of $S$ is known, list all independence relations between $T$ and other variables. Be sure to consider all of the cases in which the other variables in the model have known values and when they do not.
3. [10 points] Factor the joint distribution represented by the entire model shown in the figure according to the explicit independence assumptions represented in the model.
4. [10 points] Write the four entries and their values in the conditional distribution for $P(L=0 | M=m,S=s)$ (for $m \in \{0,1\}$ and $s \in \{0,1\}$).
5. [10 points] (a) Write an expression for the joint probability $P(T=1, R=0, L=0, M=0, S=1)$ in terms of the probabilities given in the model (use the symbolic forms). (b) Then compute the actual probability.
6. [10 points] Compute $P(T=1, R=0, L=0)$. Show your work.
7. [10 points] Compute $P(T=1 | R=0, L=0)$. Show your work.
8. [10 points] Prove that the relationship we call conditional independence is symmetric. In other words, Prove either (a) or (b) (since they are equivalent), and apply the same standard of proof as in assignment 1:
• (a) $P(X | Y, Z) = P(X | Z)$ if and only if $P(Y | X, Z) = P(Y | Z)$
• (b) $P(X, Y | Z) = P(X | Z) \cdot P(Y|Z)$ if and only if $P(Y, X | Z) = P(Y | Z) \cdot P(X | Z)$
• (in other words, the “given $Z$” stays the same, while $X$ and $Y$ trade places).


text:
LOG#159. Polylogia flashes (I).

In the next series of post, I am going to define (again) and write some cool identities of several objects that mathematicians and physicists know as zeta functions and polylogarithms. I have talked about them already here http://www.thespectrumofriemannium.com/2012/11/07/log051-zeta-zoology/

1. We define the Hurwitz zeta function as:

(1)

2. k-th derivative for Hurwitz zeta function , , , is:

(2)

3. Dirichlet L-series or alternate zeta series:

(3)

with and

4. Dirichlet L-function, with being a periodic sequence of length q or a Dirichlet character:

(4)

More interestingly, there are some interesting constants worth studying. They are called Stieltjes constants. (Stieltjes constants) are the n-th coefficients in the Laurent series expansion of the Riemann zeta function at (the pole!). That is:

(5)

and where

Indeed, the 0-th Stieltjes constant is usually called the Euler-Mascheroni constant . More generally, we can even define the Stieltjes constants for the Hurwitz zeta function, and we will denote it by . Thus, we have:

(6)

or

(7)

(8)

and

(9)

They satisfy as well

(10)

for and

5. Siegel zeta function. It is defined as follows

(11)

where is the Riemann-Siegel theta function. It is defined as

(12)

The Riemann-Stieltjes theta function gives the phase factor for Z(t).

6. Lerch trascendent.

(13)

(14)

(15)

The Lerch trascendent generalizes the Hurwitz zeta function and the polylogarithm. What is a polylogarithm? You will see it now…

7. The polylogarithm.

(16)

8. Clausen functions. They are defined as

(17)

Clausen functions are classically defined as , but is much more general. It is defined for general s and z, both complex numbers and even if the series itself does not converge! The Clausen sine functions (Clausen cosine functions can also be defined) are related to the polylogarithm:

(18)

so

or by analytic continuation.  Moreover, we have the Kummer’s relation

and

where G is the Catalan’s constant. The Clausen sine function (clsin(z)) and the Clausen cosine function (clcos(z)) satisfy a complementarity relationship:

(19)

(20)

and

For Clausen cosine functions we have

(21)

(22)

9. Polyexponential.

(23)

where and , are the Bell polymials and is the circular sine function.

10. Prime zeta and second zeta.

(24)

(25)

where are the imaginary part of the non-trivial zeroes for the Riemann zeta function.

11. Polygamma function (or log-derivative of the gamma function )

(26)

If m=1, we have the digamma function. For m>1, we have polygammas.

(27)

12. Gamma function-Legendre function.

Legendre gives

(28)

and Gauss

(29)

Finally, in connection with all this stuff, there are some additional polynomials. The Bernoulli polynomials are defined as

and the Euler polynomials are given by

for k=1,2,… and

for k=2,4,…

I will see you in my next blog post!!!

View ratings
Rate this article

This site uses Akismet to reduce spam. Learn how your comment data is processed.


text:
# Direct variation

• January 6th 2009, 05:55 PM
tupac
Direct variation
y varies directly as (x+5) and f(2)=3. Set up the Equation
• January 6th 2009, 06:18 PM
skeeter
Quote:

y varies directly as (x+5)
translates to the equation $y = k(x+5)$ , where $k$ is the constant of proportionality

use $f(2) = 3$ to find $k$ ...

$3 = k(2+5)$

$k = \frac{3}{7}$

so, the function is $y = \frac{3}{7}(x+5)$


text:
# How to know chern number of Massive Dirac Hamiltonian

I consider this Hamiltonian

$H=v(\xi k_y \sigma_x+k_x\sigma_y)+m\sigma_z$

$\xi$ is valley index. It is +1 (at K' valley) or -1 (at K valley ). I want to know Chern number of this massive Dirac Hamiltonian. So I calculated Eigen values and Eigen vectors.

$E_\pm=\pm\sqrt{v^2(k_x^2+k_y^2)+m^2}=\pm|E|$

$|\phi_+> = \frac{1}{\sqrt{2E(E-m)}}(\matrix{v(\xi k_y-ik_x) \\ E-m})$

$|\phi_-> = \frac{1}{\sqrt{2E(E-m)}}(\matrix{-E+m \\ -v(\xi k_y+i k_x)})$

And I calculated Berry connection $\vec{A_\pm}=i<\phi_\pm|\nabla_k|\phi_\pm>$ and curvature $\vec{B}=\nabla \times \vec{A_\pm}$.

$A_{\pm x}=\pm \frac{\xi k_y v^2}{2E(E-m)}$

$A_{\pm y}=\mp \frac{\xi k_x v^2}{2E(E-m)}$

$A_{\pm z}= 0$

$\vec{B}_{\pm}=(0,0,\mp \frac{\xi v^2}{2E^3})$

I think these calculations are correct. But I don't know how to calculate Chern number.

$v_{\pm} = \int_{BZ}\frac{d^2\vec{k}}{2\pi}\vec{B}_{\pm}$

I think I should use stokes theorem. BZ means Brillouin Zone.

$v_{\pm} = \int_{BZ}\frac{d^2\vec{k}}{2\pi}\cdot \nabla \times \vec{A_\pm}$

$=\int_{\partial(BZ)} \frac{d\vec{k}}{2\pi}\cdot \vec{A_\pm}$

My question:

1. What should I do next to know Chern number? I think the singularity of the wave functions at $\vec{k}=(0,0)$ is important.

2. And I know the Chern number should be Integer, but I heard the answer is 1/2. Why??

• The answer is $1/2$ since the Hamiltonian you are using is a low energy approximation and not the full lattice Hamiltonian. Notice that the Hamiltonian doesn't have the periodicity of a lattice. Although calculating the Berry phase in this way doesn't give you the Chern number, you can actually use it to see how the Chern number changes after a top. phase transition. – honey.mustard May 5 '17 at 17:17


text:
You are here: Start » Filter Groups » RegionMassCenter

# RegionMassCenter

### Description

Computes a point with coordinates equal to the average coordinates of the region's pixels.

### Filters in this group

Icon Name Description
RegionMassCenter Computes a point with coordinates equal to the average coordinates of the region's pixels.
RegionMassCenter_OrNil Computes a point with coordinates equal to the average coordinates of the region's pixels; returns NIL if the region is empty.


text:
Simply, radianpersecond doesn't work; all other units does.

\documentclass[twoside]{article}
\usepackage{amsmath}
\usepackage{commath}
\usepackage{siunitx}
\begin{document}
\begin{align}
a&=\SI{1}{cm}\\
\end{align}
\end{document}

The error:

Undefined control sequence. \end{align}

I don't understand why only this unit doesn't work!

• This means that \radianpersecond is not defined! Shouldn't it be \radian\per\second? – egreg Nov 13 '14 at 17:42
• OK Thanks that works, the thing is that TeXStudio gave me that option: \radianpersecond so I thought that's the one! – student1 Nov 13 '14 at 17:51
• Well, that's TeXStudio's fault. – egreg Nov 13 '14 at 17:53

The package doesn't define \radianpersecond. Either you type

\SI{1}{\radian\per\second}

\DeclareSIUnit\radianpersecond{\radian\per\second}

and then you'll be allowed to type also

\SI{1}{\radianpersecond}

Note: it seems a bug in TeXStudio if its palettes suggest \radianpersecond as an existing unit.

• Even though you could, I would recommend not creating a macro for that (not saying that you are). You save two backslash keystrokes and you make your code less portable. – Matthew Leingang Nov 13 '14 at 18:42


text:
×

# Important Equations

Main post link -> http://youtu.be/KGpb3_XkEvg

What are some important math equations that you know of?

The video link has several high-level equations and concepts. What have you seen thus far that you consider important?

Note by Calvin Lin
4 years, 9 months ago

## Comments

Sort by:

Top Newest

I'm surprised that Euler's Formula, $$e^{\pi i}+1=0$$, isn't mentioned in the video. It might not necessarily be the most useful formula around, but it sure can be beautiful.

- 4 years, 9 months ago

Log in to reply

That isn't a formula, is an identity.

- 4 years, 9 months ago

Log in to reply

Then take $$e^{ix} = \cos x + i\sin x$$

- 4 years, 8 months ago

Log in to reply

^ That's a formula, but what he posted, not.

- 4 years, 8 months ago

Log in to reply

Ah, true, pardon my mistake.

- 4 years, 9 months ago

Log in to reply

|adj [ adj { . . . ( adj A )] | where A is of nth order and adjoint is for x times = |A| ^ [ (n-1)^x ]

- 4 years, 9 months ago

Log in to reply

I should point out that it listed the definition of the derivative when it mentioned the fundamental theorem of calculus... oops? It appears it also confused topology with topography when mentioning Euler's formula for polyhedra (i.e. the Euler characteristic for planar graphs).

- 4 years, 9 months ago

Log in to reply

E = mc^2 fail
Real thing E^2 = (mc^2)^2 + (pc)^2, with p momentum
More info

So.... Yeah
Funny how they get the most important equation wrong XD

- 4 years, 9 months ago

Log in to reply

Well, we start off with knowing the basic formula, then extend it to a more general case as we become familiar with the subject. For example, when you started learning about force and acceleration, you learn that $$F = ma$$. However, that only holds when the mass is a constant. In fact, $$F = \frac {d}{dt} mv$$, which is the rate of change of momentum. When $$m$$ is a constant, then $$\frac {dm}{dt} = 0$$, so the chain rule gives us $$F = \frac {dm}{dt} \cdot v + m \frac {dv}{dt} = ma$$.

Likewise, we can consider the Pythagorean theorem a specialized case of the Cosine rule. However, I don't think you will say that Pythagorean theorem is wrong.

Minute physics rocks though!

Staff - 4 years, 9 months ago

Log in to reply

Absolutely to the point !!!! The Pythagoras theorem however famous is a special case of the cosine rule which accounts for all angles of a triangle .... also i found that the special relativity formula was given for a special case where the object in question is at rest !!!! Still a valiant and daring attempt to select only 10 knowing that they'll be tons of detractors !!!

- 4 years, 8 months ago

Log in to reply

And, employing a mathematician's faithful penchant for generalization...

When we get into something called differential geometry, we encounter things called "Riemannian manifolds," which are, essentially, manifolds with a metric tensor. The metric tensor for $$\mathbb{R}^n$$ (where $$n$$ is a positive integer) is simply the identity matrix of order $$n$$, so the "cosine rule" and Pythagorean Theorem reduce to their familiar forms. The more general rule is given by the metric tensor if we want to talk about noneuclidean spaces.

Wolfram's "Mathworld" gives a decent introduction, though it is not in any way rigorous.

While I'm on the topic of differential geometry, where is the generalized Stokes' Theorem in that video?

- 3 years, 10 months ago

Log in to reply

But in the video it directly puts that it "explains behavior of objects at very high speeds" which makes p definitely not 0, so it contradicts itself. :D

- 4 years, 9 months ago

Log in to reply

×

Problem Loading...

Note Loading...

Set Loading...


text:
# Switching terms in a series - theorem

Suppose a_n defined in the following way:
$$b_{2n}=a_{2n-1}$$
$$b_{2n-1}=a_{2n}$$
I know that $$\sum a_n$$ is convergent.

This how I proved that $$\sum b_n$$ is also convergent.

$$S_k=\sum_{n=1}^k b_n = \sum_{n=1}^k b_{2n} + \sum_{n=1}^k b_{2n-1} = \sum_{n=1}^k a_{2n-1} + \sum_{n=1}^k a_{2n} = \sum_{n=1}^k a_n \leq M$$

Am I right?

HallsofIvy
Homework Helper
So you are saying that $a_1+ a_2+ a_3+ a_4+ a_5+ a_6+ ...$ becomes $a_2+ a_1+ a_4+ a_3+ a_6+ a_5+ ...$?

What you have proved is that the sequence of partial sums is bounded above. If those partial sums are not increasing (if the $a_n$ are not all non-negative) that does not prove convergence.

Thanks, I now understand my mistake, but I can't find contra-example for this theorem.
My intuition locks me into thinking that switching 2 closest terms won't change convergence.
How should I approach such problems?
I will try thinking about Cauchy Criterion.

$$\sum a_n \rightarrow L\ \Rightarrow\ a_n\rightarrow0\ \Rightarrow\ \forall\ n>N_1\ a_n<\epsilon/4$$
$$\sum a_n \rightarrow L\ \Rightarrow\ \forall\ m,n>N_2 |\\ \sum_{n+1}^m a_n|\leq \epsilon/4$$

So for all n>max{N_1+1,N_2+1}
$$|\sum_{k=n+1}^m b_k| \leq |a_n + \sum_{k=n+1}^m a_k + a_{m+1}| \leq \epsilon$$

Is this idea right?

Last edited:
I also try to explain in words my idea as I getting hard time with latex:

Because $$\sum a_n$$ is convergent and thanks to Cauchy Criterion we know that after some n I can sum a_n as many times as I want while keep the sum small as I want.
So I took little more terms to express $$\sum b_n$$ and to meet the Cauchy Criterion again.
I hope I expressed myself clearly


text:
Help with CustomFactor: Counting Number of 'Up' Days

Hi - I'm new to Quantopian and trying to write a pipeline to filter companies in QTradableStocksUS universe where the last close > 50 day SMA for X number of days consecutively.

I tried this for Apple stock and based it off this post which was useful
https://www.quantopian.com/posts/how-to-calculate-current-number-of-down-days

It builds but it gives unexpected results. For example for Apple specifically, the factor 'bad_days_count' (which counts the number of days since the close last < the 50 day SMA) should either be 0 or increasing.

However in my results for some dates it doesn't change
eg. (20 -> 20)
2020-01-14 -> 2020-01-15

For some dates it jumps in the opposite direction
eg.(23 -> 19)
2020-01-21 -> 2020-01-22

For most of the other days though, it works fine so not sure what is causing discrepancies around these dates. I think it should work in principle, does anyone have any ideas on where this may be going wrong?

2
5 responses

I've not worked out what it is but I have a feeling its something to do with this line:

I've done a few tests to check the outputs on each iteration and they seem to be as expected, however I think there is something funky with numpy operations on the above line. I have attached the same notebook except this time I replaced np.argmax() with np.sum() and I narrowed down the time range period_start = '2020-02-04'
period_end = '2020-02-07'

On the output I can see from 2020-02-04 ->2020-02-05 it goes up by 1, however the only possible addition to the array would have to be for the new date ie. 2020-02-05 and if this were the case then bad_days should be true and argmax() should go down to 0.

Not sure if the numpy operations are working as expected for this?

1

I believe your SMA calculation isn't doing what you wish it to do. You are looking ahead in time.

       # This takes the mean of the price 50 days ago through the current price (so far so good)
sma50cf = np.nanmean(last_close_price[0:-1], axis=0)

# However, then it checks for any prices greater than the mean
# As an example, when looking at the close 50 days ago
# it compares the close to the mean of the future 50 days prices
# Probably not what we want

One needs to use a rolling mean and not the total mean. When doing this, one would need a window length of 100 days and then start checking 50 days ago.

This could be done, however, I'd separate the problem in two. First, create a factor which calculates the amount above (or below) the 50 day SMA the current price is. Second, create a factor which counts the number of consecutive positive values. This avoids messing around with the rolling function. Something like this for the first factor.

 class Amount_Above_SMA(CustomFactor):
inputs = [USEquityPricing.close]
window_length = 50
# Set window_safe to True so it can be used as an input to another factor
window_safe = True

def compute(self, today, assets, out, close_prices):
sma_close_prices = np.nanmean(close_prices, axis=0)
out[:] = close_prices[-1] - sma_close_prices

Then, the second factor to count consecutive positive values.

 class Consecutive_Days_Above_Zero(CustomFactor):
"""
Returns the number previous days where the input is above zero
"""
# No defaults. Must be set when instantiated.
# Takes a single input
def compute(self, today, assets, out, values):
# The the first row (0) in values is the earliest day
# The last row (-1) is the latest
# We want to use the numpy 'argmax' method to count from the latest day.
# So, flip the values so it's in reverse order
values_latest_to_earliest = np.flipud(values)

# Now, a little trick, if 'argmax' doesn't find a value it returns 0
# However, we want it to return the max if all are above zero
# So, append a row to the end with zeros so it will find the max length
asset_count = values_latest_to_earliest.shape[1]
zeros = np.zeros(asset_count)
zero_array_row = zeros.reshape(1,-1)
values_latest_to_earliest = np.append(values_latest_to_earliest, zero_array_row, axis=0)

# Finally, use 'argmax' to find the first value less than zero
out[:] = np.argmax(values_latest_to_earliest<=0, axis=0)

Attached is a notebook showing this. I believe this is what you were looking for?

2
Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Thanks Dan, just have 2 questions:

1) Why did you choose window_length 200 in the second custom factor 'Consecutive_Days_Above_Zero' - is that just an arbitrary max length if its all above 0?
2) I see how your solution works, however part of me still doesn't totally understand why the original method failed.

From https://www.quantopian.com/help#pipeline-title
A Pipeline is an object that represents computation we would like to perform every day.
window_length : An integer describing how many rows of historical data the Factor needs to be provided each day.

Therefore, I was under the impression that

sma50cf = np.nanmean(last_close_price[0:-1], axis=0)

would get run everyday, I would get an SMA_50 for each day between the start/end_periods specified? (as each day the custom factor was run it would take a window_length=50 from the evaluation date?)

However (if I understand correctly) your comment it seems to suggest sma50cf is a static mean from the (end period - 50 days?)

Therefore, when I do
 bad_day = last_close_price < sma50cf  it compares the close price of each day within (end date - 50 days) to an SMA calculated from future prices?

In your solution, you seem to specify a 50 day window in 'Amount_Above_SMA' but then only take the last row and then put it into a custom factor with a much longer window_length (200 days?)

Please let me know if I am misunderstanding anything?

First you asked "Why did you choose window_length 200 in the second custom factor 'Consecutive_Days_Above_Zero' - is that just an arbitrary max length if its all above 0?" Yes, that was just an arbitrary look back length. If the max days above zero you ever wanted to consider is less, then you could shorten that.

The second question "why the original method failed" is a little more involved.

It is correct that the compute function in a custom factor is executed each day. Let's take an example how that works.

# Assume the pipeline is run from 2020-02-04 thru 2020-02-07
# The following code would be executed 4 times with new data each day
sma50cf = np.nanmean(last_close_price[0:-1], axis=0)

# sma50cf would have the following values (using pseudocode) each day pipeline is run
2020-02-04  mean(2020-2-3 - 50 days : 2020-2-3)
2020-02-05  mean(2020-2-4 - 50 days : 2020-2-4)
2020-02-06  mean(2020-2-5 - 50 days : 2020-2-5)
2020-02-06  mean(2020-2-6 - 50 days : 2020-2-6)

Every day the pipeline is run and fetches a new window of data. Also note the pipeline runs before the market opens each day so it fetches the previous days data. That is why the dates above are shifted by 1 day. For each day the value of 'sma50cf' is static. It's the mean of the last 50 days, from the pipeline date, of close prices. Then, the next day, it will be the mean of the last 50 days from the next pipeline date.

Now, let's look at the code for comparing if a day is above the 50 day SMA.

# Again, use the dates above. Let's look at the results of the following code

# The 'last_close_price' is a 2D numpy array.
# The number of rows is specified by window_length (50) in this case
# The number of columns is equal to the number of assets
# 'sma50cf' is 1D numpy array.
# It has one row with the mean value of the 50 days of prices.
# There is one value for each asset
# 'bad_day' will also be a 2D numpy array like 'last_close_price'
# What do the rows of 'bad_day' look like?
bad_day[2020-2-3] = last_close_price[2020-2-3] < mean(2020-2-3 - 50 days : 2020-2-3)
bad_day[2020-1-31] = last_close_price[2020-1-31] < mean(2020-2-3 - 50 days : 2020-2-3)
bad_day[2020-1-30] = last_close_price[2020-1-30] < mean(2020-2-3 - 50 days : 2020-2-3)
bad_day[2020-1-29] = last_close_price[2020-1-29] < mean(2020-2-3 - 50 days : 2020-2-3)
etc...

Note the above dates represent the pipeline being executed on 2020-2-4. The above dates are what the compute function sees on 2020-2-4. The first comparison makes sense. It compares the close on 2020-2-3 to the mean(2020-2-3 - 50 days : 2020-2-3). However, the other comparisons do not. They compare a previous close with the entire mean. Now, this can be done but I am assuming it's not what is intended. I am assuming what is intended is the following

#  'bad_day' should look like this
bad_day[2020-2-3] = last_close_price[2020-2-3] < mean(2020-2-3 - 50 days : 2020-2-3)
bad_day[2020-1-31] = last_close_price[2020-1-31] < mean(2020-1-31 - 50 days : 2020-1-31)
bad_day[2020-1-30] = last_close_price[2020-1-30] < mean(2020-1-30 - 50 days : 2020-1-30)
bad_day[2020-1-29] = last_close_price[2020-1-29] < mean(2020-1-29 - 50 days : 2020-1-29)
etc...

Notice the mean values 'roll' depending upon which row in 'bad_day' is being evaluated. Each iteration of the pipeline does pass a new window of data to the compute function. However, as that function is being executed, the data is fixed for that day.

There isn't a good 'roll' function in numpy which is why I didn't pursue an approach trying to implement the above 'roll' inside of the compute method. However, there is no need to 'roll' the data explicitly. The approach I suggested get's around that. It uses the fact that the pipeline effectively 'rolls' a new window of data and presents it to the compute function each day. The approach creates a factor which outputs the last (most recent) value each day. Then, by passing that factor to a second 'Consecutive_Days_Above_Zero' factor, the pipeline mechanism does the 'roll' work for us. Pipeline calculates the value of the our factor for each day and present these 'rolled' means to the 'Consecutive_Days_Above_Zero' factor.

Hope that makes sense?

Ah when you put the dates like that then it makes sense. Thankyou!


text:
4.4k views
If the characteristic polynomial of a 3 $\times$ 3 matrix $M$ over $\mathbb{R}$ (the set of real numbers) is $\lambda^3 – 4 \lambda^2 + a \lambda +30, \quad a \in \mathbb{R}$, and one eigenvalue of $M$ is 2, then the largest among the absolute values of the eigenvalues of $M$ is _______

retagged | 4.4k views
+5
i got 5 as answer. someone confirm?

Given that $\lambda = 2$ is an eigen value. So, it must satisfy characterstic equation.

$2^3 - 4*2^2 + 2a + 30 = 0 \Rightarrow \color{green}{a = -11}$

Characterstic eq : $\lambda^3 -4\lambda^2 - 11\lambda + 30$

$\Rightarrow (\lambda - 2)(\lambda - 5)(\lambda + 3) = 0$

$\lambda_1 = 2, \lambda_2 = 5$ and $\lambda_3 = -3$

Max Eigen Value $= 5$
by Boss (28.8k points)
selected by
+4
How to solve cubic equation quickly?
+38

......

+5

..

0
Nice and simple cubic explanation kajal
0

could you please explain what's going on in the image you uploaded?

$a\lambda^3 – b \lambda^2 + c \lambda +d = \lambda^3 – 4 \lambda^2 + x \lambda +30$
(Using $x$ in place of $a$ on question to preserve the convention)

$\implies a = 1, b = -4, c = x, d = 30$

Sum of eigen values  $= (-b/a)= 4.$

So,  $x_1 + x_2 + x_3 = 4$

Given $x_1 = 2$
So, $x_2 + x_3 = 4 - 2 = 2 \quad \to (1)$

Product of eigen values   $= (-d/a) = -30.$

So,  $x_1 . x_2 . x_3 = -30$
$\implies x_2 . x_3 = -15 \quad \to (2)$

Solving $(1)$ and $(2)$, we get

$x_2 = -3 , x_3 = 5$

Hence, the absolute value of largest of 3 eigen values  =  5.

by Veteran (102k points)
edited by
0

Sum of eigen values   = sum of diagonal element
Sum of eigen values    =   (-b/a)
What is b ?

+7
$ax^3\ +\ bx^2\ +\ cx + d = 0\\ Let\ the\ roots\ be\ l,m,n\\l+m+n\ =\ -b/a\\l*m*n\ =\ -d/a$
$\lambda^3-4\lambda^2+a\lambda+30$

Given $\lambda-2=0$

$\therefore a=-11$

Complete Equation : $\lambda^3-4\lambda^2-11\lambda+30$

To find other $2$ roots just divide the equation with $\lambda-2$ which is root itself :

$\lambda -2\Large)$ $\lambda^3-4\lambda^2-11\lambda+30\Large ($$\lambda^2-2\lambda-15$

$-\lambda^3+2\lambda^2$

--------------------

$-2\lambda^2-11\lambda$

$2\lambda^2-4\lambda$

--------------------

$-15\lambda+30$

$15\lambda-30$

$\therefore$ $Eq^n=$ $(\lambda-2)( \lambda+3) (\lambda-5)$

Hence : Max $\{2,-3,5\}=\color{Red}5$
by Boss (11.9k points)
0
I followed this technique to find the answer in cube root
Given that λ=2λ=2 is an eigen value. So, it must satisfy characterstic equation.

23−4∗22+2a+30=0⇒a=−1123−4∗22+2a+30=0⇒a=−11

Characterstic eq : λ3−4λ2−11λ+30λ3−4λ2−11λ+30

⇒(λ−2)(λ−5)(λ+3)=0⇒(λ−2)(λ−5)(λ+3)=0

λ1=2,λ2=5λ1=2,λ2=5 and λ3=−3λ3=−3

Max Eigen Value =5
by Boss (18.1k points)

so ans is 5

by Loyal (6.8k points)
+1 vote
The characteristic polynomial $\lambda^3-4\lambda^2+a\lambda+30$ is three dimensional. So there will be 3 roots of this polynomial equation i.e. $\lambda^3-4\lambda^2+a\lambda+30=0 \tag{i}$

Putting $\lambda=2$ (as given in the question) to no$\mathrm{(i)}$, we get

$2^3-4\times2^2+2a+30=0\Rightarrow a=-11$.

So the characteristic polynomial equation is now $\lambda^3-4\lambda^2-11\lambda+30=0$. Since one of its roots is $2$, hence $(\lambda -2)$ will divide the polynomial.

So

\begin{align}\lambda^3-4\lambda^2-11\lambda+30&=0\\\Rightarrow \lambda^2(\lambda-2)-2\lambda^2-11\lambda+30&=0\\\Rightarrow \lambda^2(\lambda-2)-2\lambda(\lambda-2)-15\lambda+30&=0\\\Rightarrow \lambda^2(\lambda-2)-2\lambda(\lambda-2)-15(\lambda-2)&=0\\\Rightarrow (\lambda-2)(\lambda^2-2\lambda-15)&=0\\ \therefore \lambda^2-2\lambda-15&=0\\\Rightarrow \lambda &= \frac{2\pm\sqrt{2^2+4\times15}}{2}\\ &=1\pm4 \\ &=5,-3 \end{align}

$\therefore$ The Eigenvalues $\lambda=-3,2,5$.

So the largest absolute of $\lambda$ i.e. the maximum absolute Eigenvalue is $5$.
by Active (3.6k points)


text:
## Internet Mathematics

### The Structure of Geographical Threshold Graphs

#### Abstract

We analyze the structure of random graphs generated by the geographical threshold model. The model is a generalization of random geometric graphs. Nodes are distributed in space, and edges are assigned according to a threshold function involving the distance between nodes as well as randomly chosen node weights. We show how the degree distribution, percolation and connectivity transitions, clustering coefficient, and diameter relate to the threshold value and weight distribution. We give bounds on the threshold value guaranteeing the presence or absence of a giant component, connectivity and disconnectivity of the graph, and small diameter. Finally, we consider the clustering coefficient for nodes with a given degree $l$, finding that its scaling is very close to $1/l$ when the node weights are exponentially distributed.

#### Article information

Source
Internet Math., Volume 5, Number 1-2 (2008), 113-140.

Dates
First available in Project Euclid: 25 November 2009


text:
# George Lusztig

### Quick Info

Born
20 May 1946
Timişoara, Romania

### Biography

George Lusztig's name, in Romanian, was Gheorghe Lusztig. He was born into a Jewish family and brought up in Timișoara, a city in Romania where Hungarian and Romanian are both spoken. He said [5]:-
I'm not religious but being Jewish played a role in my choice of mathematics, which seemed beyond the reach of politics, as well as the fact that it was an area where I had the best possible chance to be judged objectively.
He attended High School in Timișoara and represented Romania in the International Mathematical Olympiad in 1962 and 1963, being awarded a Silver Medal on both occasions. In fact it was mathematics competitions at school which made him realise that he was talented in mathematics and gave him confidence in himself. He studied mathematics at the University of Bucharest and, while still an undergraduate, he began publishing papers. His first two papers were A model of plane affine geometry over a finite field (Romanian) (1965) and Construction of a universal bundle over arbitrary polyhedra (Romanian) (1966). In the latter paper he extended the construction of a universal bundle over denumerable polyhedra given by John Milnor in 1956 to the case of arbitrary polyhedra. His method used the Kelley topologies. He graduated with a Licenta in Matematica in 1968, and three more of his papers (one written jointly with Henri Moscovici) were published in that year; they were all written in French.

In 1969 he went to the Bonn conference but, after the conference ended, did not return to Romania as he was supposed to do. Instead he went to the Institute for Advanced Study in Princeton where he studied with Michael Atiyah for two years. He was also registered as a Ph.D. student at Princeton University where he worked for his Ph.D. advised by William Browder. He was awarded a doctorate by Princeton in May 1971 for his thesis Novikov's Higher Signature and Families of Elliptic Operators. The thesis was published under the same title in the Journal of Differential Equations in 1972. After the award of his doctorate, Lusztig was appointed as a Research Fellow at Warwick University in England. After spending the academic year 1971-72 as a Research Fellow he was appointed as a Lecturer in Mathematics and, two years later in 1974 as Professor of Mathematics at Warwick University. Roger Carter writes [1]:-
Lusztig's exceptional mathematical ability became evident at an early stage of his career at Warwick. He gave a remarkable 30 lecture M.Sc. course on the modular representation theory of the general linear group in which, during the second half, he was working out the theory while giving the course. There were a few occasions when he was apologetic that the lecture lasted only 40 rather than 50 minutes because he had not made sufficient progress since the previous lecture! His early experience as a mathematician was not without certain difficulties. There was a period during which, for financial reasons, he preferred to live in a tent outside the Mathematics Research Centre houses at Warwick University rather than in the houses themselves. He also experienced problems with the passport authorities in a number of countries so that, for a brief period, he had no entitlement to live in any country. However these difficulties did not prevent him from developing rapidly as a mathematician.
In his response to receiving the Steele Prize in 2008, Lusztig spoke of the change in his research interests around the time he took up his Research Fellowship at Warwick [4]:-
Around the time of my Ph.D., I switched from being a topologist with a strong interest in Lie theory to being a representation theorist with a strong interest in topology. (The switch happened with some coaching by Michael Atiyah and later by Roger Carter.) After that most of my research was concerned with the study of representations of Chevalley groups over a finite field or used the experience I gained from groups over a finite field to explore neighbouring areas such as p-adic groups (which can be viewed as groups over a finite field that are infinite dimensional) or quantum groups (which can be viewed as analogues of the Iwahori-Hecke algebras, familiar from the finite group case).
In 1972 he married Michal-Nina Abraham; they had two daughters. This marriage
ended in 2000 and he married Gongqin Li in 2003. The year 1974 was an important one for Lusztig from a mathematical perspective. In that year his major paper On the modular representations of the general linear and symmetric groups written jointly with Roger Carter was published. In the spring of that year he spent time in France at the Institut des Hautes Études Scientifiques during which time he worked with Pierre Deligne. He reported on this work in the lecture On the discrete series representations of the classical groups over a finite field which he gave to the Algebraic Groups section at the International Congress of Mathematicians held in Vancouver in August 1974. He had originally been invited to address the Algebraic Topology section but had requested the change to the Algebraic Groups section. While at the Institut des Hautes Études Scientifiques in the spring of 1974 he wrote the paper Divisibility of projective modules of finite Chevalley groups by the Steinberg module (1976) and returned to IHES for further visits in December 1974 and December 1975. Out of these visits came the paper On the finiteness of the number of unipotent classes (1976) and his joint paper with Pierre Deligne Representations of reductive groups over finite fields. Also in 1976 he published another major work with Roger Carter, continuing the work they had begun in the 1974 paper mentioned above, namely Modular representations of finite groups of Lie type.

In the first half of 1978 I [EFR] spent five months at the Warwick Symposium on Infinite Groups and Group Rings at Warwick University. I was there with my family and we rented a house in Kenilworth owned by George Lusztig who, at that time, was visiting the Massachusetts Institute of Technology. While we were there Lusztig made the decision to accept the offer of a professorship at MIT and I was asked to show perspective buyers round his Kenilworth house. Lusztig has remained as a professor at MIT being Norbert Wiener Professor from 1999 to 2009 and is now Abdun Nur Professor.

An excellent overview to Lusztig's contributions are given in the citation for the award of the American Mathematical Society's Leroy P Steele Prize for Lifetime Achievement (2008).

Let us look briefly at the books that Lusztig has published. In 1974 he published the monograph The discrete series of $GL_{n}$ over a finite field. As the title indicates this deals with the general linear group but it raises the problem of treating other classical groups. In fact by the time the monograph was published, Lusztig had solved these too and described them in the invited lecture he gave at the International Congress of Mathematicians in Vancouver in 1974 (mentioned above). The lectures he gave on Representations of finite Chevalley groups at the CBMS Regional Conference held at Madison, Wisconsin in August 1974 were published by the American Mathematical Society in the following year. In 1984 he published Characters of reductive groups over a finite field. Bhama Srinivasan writes in a review:-
This book is a major piece of work in the theory of representations of finite groups of Lie type. ... Considering the complexity of the subject matter, this book has been written carefully and with regard to details. However, by its very nature, since it draws from various deep and rich theories such as algebraic geometry, intersection cohomology and enveloping algebras, it requires a great deal of effort and commitment on the part of the reader. The reader who perseveres with the book will be richly rewarded at seeing the unexpected connections of these branches of mathematics with the representation theory of finite groups, which had hitherto been regarded as a somewhat isolated field.
His next major book was Introduction to quantum groups (1993). Jie Du writes:-
The book under review summarizes and updates the author's main contributions to quantum group theory over the last 5 or 6 years. Quantum groups came up originally in physics, but soon became a new and very rapidly developing field in mathematics. Extensive connections have already been found between quantum groups and various mathematical areas such as Lie theory, low-dimensional topology, group theory, noncommutative geometry and so on. ... the book presents many topics, together with detailed arguments for most of them, in quantum group theory. It is written to a very high standard and perhaps is an introductory book for experienced researchers and experts.
In 2003 Lusztig published Hecke algebras with unequal parameters. Götz Pfeiffer writes in a review:-
An introduction to Coxeter groups and their associated Iwahori-Hecke algebras need not be long to be comprehensive. In this book the theory is developed from scratch, in a purely combinatorial setup, through a sequence of 13 short chapters over 58 pages, complete with proofs and examples, from basic properties of Coxeter groups to Kazhdan-Lusztig cells and the definition of the so-called a-function. ... This book leads its reader through a carefully chosen sequence of short pieces, which are more or less easy to digest, from the definitions of the basic concepts right into the middle of an important part of the theory of algebraic groups and their representations. It summarizes much of the current knowledge and adds many new results. It sets the stage for a field of research where many questions are waiting to be answered, in the form of general theorems as well as by concrete calculations for specific cases; the book contains examples of both. The second half of the book is a major research article which assumes some acquaintance with the representation theory of finite or p-adic groups. In its first half the book presents an accessible self-contained introduction to the theory of cells and Kazhdan-Lusztig polynomials.
Lusztig has received major honours for his outstanding contributions. In addition to the invitation to address the International Congress of Mathematicians in Vancouver in 1974, he was invited to give a plenary address at the International Congress of Mathematicians held in Kyoto, August 1990. He gave the address Intersection cohomology methods in representation theory and the American Mathematical Society produced a video of his lecture. Bhama Srinivasan writes:-
The speaker covers a lot of ground in this one-hour talk. He manages to convey the flavour of the deep results that he describes, by giving concrete examples. In many cases he describes the results for special linear or general linear groups in concrete geometric terms. The viewer will benefit from reading the speaker's published paper cited above, which gives more details than the talk as well as references to the cited results. The videotape and the paper complement each other, and give a fine exposition of some of the important developments in representation theory that have occurred in the last decade.
The prizes he had been awarded include the London Mathematical Society's Berwick Prize (1977), the American Mathematical Society's Cole Prize in Algebra (1985), the Dutch Mathematical Society's Brouwer Medal (1999), the Romanian Academy's Diploma of Academic Merit (2007), and the American Mathematical Society's Leroy P Steele Prize for Lifetime Achievement (2008). The citation begins [4]:-
The work of George Lusztig has entirely reshaped representation theory and in the process changed much of mathematics.
The full citation is at THIS LINK

He was elected a fellow of the Royal Society (1983), a fellow of the American Academy of Arts and Sciences (1991), and a member of the National Academy of Sciences (1992).

We should note Lusztig's interest in yoga. He said [5]:-
I am interested in yoga. I began to practise in 1994 to relax (in the previous year I had been working too hard - with serious consequences for my health). I did very well and I decided to study yoga seriously. In the summer of 1995 I took a course from which I received a yoga instructor license. For me, yoga is not related to mathematics, rather it is complementary to it.
We end this biography by quoting Roger Carter [1]:-
Lusztig's work is characterized by a very high degree of originality, an enormous breadth of subject matter, remarkable technical virtuosity, and great profundity in getting to the heart of the problems involved. It can be no exaggeration to say that George Lusztig is one of the great mathematicians of our time.

### References (show)

1. R W Carter, A survey of the work of George Lusztig, Nagoya Math. J. 182 (2006), 1-45.
2. A note on the paper: 'A survey of the work of George Lusztig' by R W Carter, Nagoya Math. J. 183 (2006), i-ii.
3. George Lusztig awarded 1985 Cole prize, Notices Amer. Math. Soc. 32 (2) (1985), 159.
4. Leroy P Steele Prize for Lifetime Achievement, 2008 Steele Prizes, Notices Amer. Math. Soc. 55 (4) (2008), 486-490.
5. L Ornea, An interview with George Lustig (28 January 2011). http://atelier.liternet.ro/articol.php?art=4767
6. Publications of George Lusztig, Nagoya Math. J. 182 (2006), i-xi.