问:
Finding a specific member of an ascending list of whole number powers sequence.
I've been tasked with writing a program to find a $a_k$ member of a sequence:

$
a_0=4=2^2, a_1=8=2^3, a_2=9=3^2, a_3=16=4^2=2^4, a_4=25=5^2, a_5=27=3^3, a_6=32=2^5
$

and so on. I've coded up a brute-force solution, which takes advantage of $m^n$s logarithmic contours for $m>2$ and $n>2$:

The checking for each following member goes right-to-left through the table below, checking max $m$ for every $n$ and filtering out the repeated values (i.e. $64=8^2=4^3=2^6$). However, the method is too slow for me and I was wondering if there was a way to get to that $a_k$ element ($1<=k<=10^6$) by expressing this sequence as a formula? Thanks in advance.

答:
I figured out an algorithm to determine ak for a given k.

It works in roughly log(k) time.

First I figured out an approach to calculate k for a given a where ak < a <  ak+1.

The approach is to add in all the values for each power where that number is less than a. Each step adds in trunc(a^1/p) - 1.

Start with the squares, that also adds in all the 4th, 6th, 8th, 10th powers etc. that are also within the range.

Then add in the cubes - that also adds in 6th, 9th, 12th, 15. etc. Note especially that the 6th powers have been added in twice.

We get to the 4ths - and note they have already been added once - so they don't need to be added agan.

power 5 is then added which also adds in 10, 15, 20, etc. Note especially that power 10 has been added in twice from 2 and 5. and power 30 has been added in 3 times.

power 6 - has been added in twice so we need to subtract this number.

and so on.

I created a small program that tells you which powers needed to be added or subtracted through power 80 which should handle k up to a trillion. Here's the result of that program - a 1 next to a power means add in (trunc(a^1/power) - 1) - a negative 1 means to subtract it; a 0 means it neither needs to be added or subtracted.

2 1;
3 1;
4 0;
5 1;
6 -1;
7 1;
8 0;
9 0;
10 -1;
11 1;
12 0;
13 1;
14 -1;
15 -1;
16 0;
17 1;
18 0;
19 1;
20 0;
21 -1;
22 -1;
23 1;
24 0;
25 0;
26 -1;
27 0;
28 0;
29 1;
30 1;
31 1;
32 0;
33 -1;
34 -1;
35 -1;
36 0;
37 1;
38 -1;
39 -1;
40 0;
41 1;
42 1;
43 1;
44 0;
45 0;
46 -1;
47 1;
48 0;
49 0;
50 0;
51 -1;
52 0;
53 1;
54 0;
55 -1;
56 0;
57 -1;
58 -1;
59 1;
60 0;
61 1;
62 -1;
63 0;
64 0;
65 -1;
66 1;
67 1;
68 0;
69 -1;
70 1;
71 1;
72 0;
73 1;
74 -1;
75 0;
76 0;
77 -1;
78 1;
79 1;
80 0;

I coded that up as a small spread sheet and tested it against the OEIS sequence shown within https://oeis.org/A001597 - especially https://oeis.org/A001597/b001597.txt and it seems to work fine.

So now that we can calculate k from a, we now go the other way. We can get a first estimate of ak from k^2. We plug that back into the formula in 1) above and see how far off k is. We make our new a = (the desired k adjusted by the difference in the formula from 1) ^ 2. Then keep iterating until we find an a that generates the desired k.

That a might not be the exact ak. It's an a that is somewhere in the range ak < a <  ak+1.

Probably quickest way to determine the exact ak is to take the root of each power - truncate it, then raise it back to the power. The maximum of those values is the ak that you desire.

I didn't code up steps 2 and 3 - but the approach above should work. The spreadsheet in step 1 works pretty instantaneously.


问:
For a symmetric matrix $A$ and positive diagonal matrix $U$, is $U A + A U$ positive definite?
Let $A \in \mathbb{R^{n\times n}}$ be a positive definite matrix and $U \in \mathbb{R^{n\times n}}$ a diagonal matrix with positive entries,

$A=A^\top  \succ 0 $, $\:\:U=\textrm{diag}(u_1, \cdots, u_n) \quad(\forall i, \:u_i >0).$

I'm curious to see if the following is true.

$B:=U A + A U \succ 0$

So far, I found these

$UA +AU$ is symmetric

For any $x\in\mathbb{R}^n, \:\:x^\top UA x = x^\top AU x$

$B_{ij}=(u_i + u_j)A_{ij}$

Any advice would be appreciated!!!!!!

答:
Try $$A = \pmatrix{1 & 1\cr 1 & 2\cr},\ U = \pmatrix{1 & 0\cr 0 & t}$$
for small positive $t$.

ContentLicense: CC BY-SA 4.0


问:
Wiener Process. Where can I find proof.
I looking for proof, that $P({W_s >0,W_t >0})=\frac{1}{4}+\frac{1}{2\pi}\arcsin{\sqrt\frac{s}{t}}$, where $W_k$ is a wiener process and $t>s>0$.
Do you know where I can find it?

答:
By scaling, $P({W_s >0,W_t >0})=P({W_{s/t} >0,W_1 >0})$ so it suffices to consider the case $t=1$. Let $\theta=\arcsin(\sqrt{s})$. Since $W_s$ is independent of $W_1-W_s$, we can write
$W_s= X \sin{\theta}$ and $W_1=X \sin{\theta}+Y \cos{\theta}$, where $X,Y$ are independent standard normal variables and $\theta \in (0, \pi/2)$. Therefore,
$$ P({W_s >0,\, W_1 >0})= P(X>0,\, Y+X\tan{\theta}>0)=P(X>0,\,  Y>0)+P(X>0, \,\, 0>Y>-X\tan{\theta})=\frac{1}{4}+\frac{\theta}{2\pi} \,,$$
since the joint distribution of $(X,Y)$ is rotation invariant.

This formula goes back to [1], see also [2].

[1] Sheppard, W. F. (1899). III. On the application of the theory of error to cases of normal distribution and normal correlation. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, (192), 101-167.

[2] Kendall, M.G., Stuart, A. and Ord, J.K., 1979. The advanced theory of statistics (Vol. 2, 4th edn). Griffin, London.

Title: Wiener Process. Where can I find proof.


问:
Proof by induction with an nxn-matrix
The matrix A $ \in \mathbb{R}^{n\times n}$ is of the form
\begin{equation*}
A = \begin{pmatrix}
0 & 1 & 0 & \cdots & 0 \\
\vdots & \ddots & \ddots & \ddots & \vdots \\
 &  & \ddots & \ddots & 0  \\
\vdots &  &  & \ddots & 1  \\
0 & \cdots &  & \cdots & 0  \\
\end{pmatrix}
\end{equation*}

Now I want to compute $e^{tA}$ and $e^{tA} = \sum_{k=0}^{\infty} \frac{1}{k!}\cdot (tA)^{k}$.

I observed that $A^{2}$ is equal to the matrix A only with de "diagonal" of ones moved 1 up.

\begin{equation*}
A^{2} = \begin{pmatrix}
0 & 0 & 1 & \cdots & 0 \\
\vdots & \ddots & \ddots & \ddots & \vdots \\
 &  & \ddots & \ddots & 1  \\
\vdots &  &  & \ddots & 0  \\
0 & \cdots &  & \cdots & 0  \\
\end{pmatrix}
\end{equation*}

And $A^{3}$ is equal to the matrix A with the "diagonal" of ones moved 2 up.
So to compute $e^{tA}$ I want to proof that $A^{n}$ is equal to the matrix A with the "diagonal" of ones moved up n-1 times, which results in $A^{n} = 0$. I have tried to proof it with induction.

So claim: If A $ \in \mathbb{R}^{n\times n}$ is of the above form, then $A^{n} = 0$.

For n = 2, the 2 x 2 matrix is equal to:
\begin{equation*}
A =
\begin{pmatrix}
0 & 1 \\
0 & 0
\end{pmatrix}
\end{equation*}
And $A^{2} = 0$.
So the claim holds for n = 2.
But I don't know how to do the induction step in this case.

Other ways to compute $e^{tA}$ with this matrix A are also welcome.

答:
If you just want to prove that $A^2$ is the matrix $A$ with the diagonal "moved up", you actually don't need to do it by induction, you can calculate it directly. What can be proven by induction however is the following stronger statement that multiplying $A$ by itself $p$ times yields the matrix $A$ with the diagonal "shifted up" $p$ times. Formally this can be written as :

Lemma : $$\forall p \in \{1, 2, \ldots\}, \forall (i,j) \in \{1,\ldots,n\},  (A^p)_{i,j} = \delta_{i,j+p+1}$$
Where A is assumed to be an $n\times n$ matrix defined by $ A_{i,j} = \delta_{i,j+1} $ where $\delta$ is the Kronecker delta

(Check that it is consistent with what you are trying to prove)

Proof (by induction) :

Base case : The statement is true by definition for $p=1$, so the base case is done. Let's prove it for $p=2$ anyway just for reference :
Given that $A_{i,j} = \delta_{i,j+1}$, let's prove that $(A^2)_{i,j} = \delta_{i,j+2}$

$$\forall (i,j) \in \{1,\ldots,n\}, (A^2)_{i,j} = (A \times A)_{i,j} := \sum_{k=1}^n A_{i,k}A_{k,j} $$

Replacing with the expression of A, this gives

$$(A^2)_{i,j} = \sum_{k=1}^n \delta_{i,k+1} \delta_{k,j+1}$$

Now the only non-zero terms in the above sum are the ones such that $i=k+1$ and $k = j+1$ simultaneously. This means that the only non-zero term in that sum is the one corresponding to index $k$ satisfying $k = i-1 = j+1$.
In other words, if $i$ and $j$ are such that $i = j+2$, there is only one non-zero term in the above sum, and that term is equal to $1$ by definition of Kronecker delta. Therefore

$$ (A^2)_{i,j} = \delta_{i,j+2} $$

Induction step : Now consider an integer $p\ge 1$ such that $(A^p)_{i,j} = \delta_{i,j+p+1}$ (which exists thanks to the previous step), we want to prove that $(A^{p+1})_{i,j} = \delta_{i,j+p+2}$. Just as before :

$$\forall (i,j) \in \{1,\ldots,n\}, (A^{p+1})_{i,j} = (A^p \times A)_{i,j} := \sum_{k=1}^n A^p_{i,k}A_{k,j} $$

Using our induction hypothesis, we get

$$(A^{p+1})_{i,j} = \sum_{k=1}^n \delta_{i,k+p+1} \delta_{k,j+1}$$

A reasoning similar to the previous one yields that there can only be at most one non-zero term in that sum, which will exist if $i$ and $j$ are such that $i = j + p+ 2$, which gives that

$$(A^{p+1})_{i,j} = \delta_{i,j+p+2}$$

Which is what we wanted to prove and completes the proof by induction.

Title: Proof by induction with an nxn-matrix


问:
Introductory/Intuitive Functional Analysis Book
Can you recommend a gentle introduction to the abstract thinking and motivation of functional analysis? I'm looking for a book that holds you by the hand and shows the details of exercises, etc.

Thanks.

答: Of the well written books on Functional analysis that I've seen, Kreyszig is the most elementary. The Amazon reviews seem to agree with me.</p>

ContentLicense: CC BY-SA 3.0


问:
Show the hermitian of two operators is...
Show that $(\hat Q \hat R)^\dagger = (\hat R)^\dagger(\hat Q)^\dagger$

It is necessary to show this equality using Dirac notation, but i am a little confused:

Attemp 1 (Wrong):

$\langle f|QR|g \rangle = (\langle f|QR\rangle)|g \rangle =\langle Q^\dagger|fR|g\rangle = \langle Q^\dagger(\langle fR|g\rangle) = \langle Q^\dagger R^\dagger|f|g\rangle$

Attempt 2 (Right):

$\langle f|QR|g \rangle = (\langle f|QR\rangle)|g \rangle = \langle Q^\dagger|fR|g\rangle = \langle (Q^\dagger|f)R|g\rangle = \langle R^\dagger Q^\dagger |f|g\rangle$

My question is why is the first attempt wrong, can't we say that $\langle f|z|g \rangle = \langle f| ( \langle z|g \rangle) = (\langle f|z \rangle)|g \rangle $ ? So where did i make the mistake?

答:
What does work is this:
By definition, $A^\dagger$ is the linear operator such that for all kets $|f\rangle, |g\rangle$, $$\langle g|A^\dagger|f\rangle = \overline{\langle f|A|g\rangle}$$

(the complex conjugate - generally Dirac notation is used for complex Hilbert spaces, as those are necessary for Quantum theory). Therefore, for each $g$, $\langle g|A^\dagger$ is the bra associated with the ket $A|g\rangle$. And for each $f$, $\langle f|A$ is the bra associated with the ket $A^\dagger|f\rangle$.

Now, recalling that $\langle u|v\rangle = \overline{\langle v|u\rangle}$ and that the bra $\langle u|A^\dagger$ and ket $ A|u\rangle$ are associates,

$$\langle f|QR|g\rangle = (\langle f|Q)\,(R|g\rangle) = \overline{(\langle g|R^\dagger)\,(Q^\dagger|f\rangle)}=\overline{\langle g|R^\dagger Q^\dagger|f\rangle}$$
which by the definition means $$(QR)^\dagger = R^\dagger Q^\dagger$$

Now it is possible that given an operator $A$, someone may choose to use "$\langle uA|$" to represent the bra $\langle u|A$, and use "$|Au\rangle$" to represent the ket $A|u\rangle$. This is because what is inside the bra and ket notations is merely a label. As long as the interpretation of the label is understood so that one can determine the particular bra or ket it means, this is acceptable. And that is the case with $\langle uA| \equiv \langle u|A$ and $|Au\rangle\equiv A|u\rangle$.

Using this notational shorthand, the calculation above becomes

$$\langle f|QR|g\rangle = \langle fQ|Rg\rangle = \overline{\langle gR^\dagger|Q^\dagger f\rangle}=\overline{\langle g|R^\dagger Q^\dagger|f\rangle}$$

which is close to what you wrote. But note the difference. This uses the notations $\langle fQ|, |Rg\rangle, \langle gR^\dagger|, |Q^\dagger f\rangle$, each of which has been defined to represent a particular bra or ket. Your version uses notations $|QR\rangle, \langle Q^\dagger|, \langle R^\dagger Q^\dagger|$ which lack any means of tying them to particular bras or kets.

I have to assume that $\langle(Q^\dagger|f)R|g\rangle$ should have been $(\langle Q^\dagger|f)R|g\rangle$, but even with that correction you use $f$ outside of the bra. What does that mean? $f$ is merely a label used to identify the particular bra and ket pair $\langle f|$ and $|f\rangle$. It is not an operator that can act on bras or kets.


问:
Find the Eigenvalues and Eigenfunctions for the Boundary problem
I recently found this answer to a similar problem I'm currently working on.
The problem is the following...

Find the eigenvalues and eigenfunctions for

$y^{\prime \prime}+\lambda y=0$

with the boundary conditions

$y^{\prime} (0)=0$ , $y^{\prime} (1)=0$

In the answer linked above, the Ansatz for

$\lambda <0$ is $y(x)=C_1e^{\sqrt{\lambda} x}+C_2e^{-\sqrt{\lambda} x}$

$\lambda >0$ is $y(x)=C_1\cos(\sqrt{\lambda}x)+C_2\sin(\sqrt{\lambda}x)$

But I don't really get why. Has someone got some background information/explanation why $y(x)$ must be of this form?

The case for $\lambda =0$ is clear to me.

Thanks in advance.

答:
$$y^{\prime \prime}+\lambda y=0$$
We suppose that the solution is on the form $y=e^{rx}$ then you get:
$$r^2e^{rx}++\lambda e^{rx}=0$$
$$e^{rx}(r^2+\lambda)=0$$
$$\implies r^2+ \lambda=0$$
Solve the characteristic polynomial. You have three cases: $\lambda >0, \lambda =0, \lambda<0$. Then the solution is:
$$ \lambda <0 \implies y=c_1e^{r_1x}+c_2e^{r_2x}$$
$$ \lambda >0 \implies y=c_1 \cos ({r_1x)}+c_2\sin (r_2x)$$
Where $r_1,r_2$ are solution of the polynomial characteristic. Apply the initial conditions you'll find the value of the constants $c_1,c_2$.


问:
Find the limit of $\lim\limits_{x \to 1/2}\frac{\tan(\pi x)}{2x - 1}+\frac{2}{\pi(2x - 1)^2}$
Find the following limit:

$$\lim_{x \to 1/2}\frac{\tan(\pi x)}{2x - 1}+\frac{2}{\pi(2x - 1)^2}$$

Using a calculator, I know the function is divergent, but I don't know how to show that it is divergent. I tried to simplify it first, but that just made the function more complicated.

答:
It seems that the limit exists at $x\to\frac{1}{2}$.
Lets' take $x=\frac{1}{2} -\epsilon$; we will set $\epsilon\to0$.

Let's consider
$f(x)=\frac{\tan(\pi x)}{2x - 1}+\frac{2}{\pi(2x - 1)^2}$

$$f(\frac{1}{2}-\epsilon)=\frac{\sin(\frac{\pi}{2}-\pi{\epsilon})}{\cos(\frac{\pi}{2}-\pi\epsilon)(-2\epsilon)}+\frac{2}{\pi(2\epsilon)^2}=$$$$\frac{\cos\pi\epsilon}{\sin(\pi\epsilon)(-2\epsilon)}+\frac{1}{2\pi(\epsilon)^2}=\frac{1}{2\pi(\epsilon)^2}-\frac{1-\frac{(\pi\epsilon)^2}{2!}+...}{2\epsilon(\pi\epsilon-\frac{(\pi\epsilon)^3}{3!}+...)}=\frac{1}{2\pi(\epsilon)^2}\left(1-\frac{1-\frac{(\pi\epsilon)^2}{2!}+...}{1-\frac{(\pi\epsilon)^2}{3!}+...}\right)$$

$$\lim_{\epsilon\to0}f(\frac{1}{2}-\epsilon)=\frac{\pi}{6}$$
The same story if we set $x=\frac{1}{2}+\epsilon$ - we get the same limit. So, it seams that both side limits exist.


答:
Prove the following by induction on $n$:

Lemma: Let $A$ be an $m \times m$  matrix of any size such that
$$A_{ij}= \left\{
\begin{array}{lc}
1 &\mbox{ if } j-i=1 \\
0 & \mbox{ otherwise}
\end{array}
\right.
$$

Then, for all $n$ we have
$$(A)^n_{ij}= \left\{
\begin{array}{lc}
1 &\mbox{ if } j-i=n \leq m \\
0 & \mbox{ otherwise}
\end{array}
\right.
$$

The inductive step is immediate
$$
(A)^{n+1}_{ij}=(A)^n_{i1}A_{1j}+(A)^n_{i2}A_{2j}+...+(A)^n_{im}(A)^n_{mj}
$$
Just note here that
$$
(A)^n_{ik}A_{kj}=0
$$
unless $k-i=n$ and $j-k=1$.

Alternate proof

Just observe that $A$ is the matrix corresponding to the Linear Transformation $T: \mathbb R^m \to \mathbb R^m$.
$$
T(e_k)=\left\{
\begin{array}{lc}
e_{k+1} &\mbox{ if } k<m \\
0 & \mbox{ if } k=m
\end{array}
\right.
$$

Prove by induction on $n$ that
$$
T^n(e_k)=\left\{
\begin{array}{lc}
e_{k+n} &\mbox{ if } k+n \leq m \\
0 & \mbox{ if } k+n>m
\end{array}
\right.
$$

Title: Proof by induction with an nxn-matrix

Body:
The matrix A $ \in \mathbb{R}^{n\times n}$ is of the form
\begin{equation*}
A = \begin{pmatrix}
0 & 1 & 0 & \cdots & 0 \\
\vdots & \ddots & \ddots & \ddots & \vdots \\
 &  & \ddots & \ddots & 0  \\
\vdots &  &  & \ddots & 1  \\
0 & \cdots &  & \cdots & 0  \\
\end{pmatrix}
\end{equation*}

Now I want to compute $e^{tA}$ and $e^{tA} = \sum_{k=0}^{\infty} \frac{1}{k!}\cdot (tA)^{k}$.

I observed that $A^{2}$ is equal to the matrix A only with de "diagonal" of ones moved 1 up.

\begin{equation*}
A^{2} = \begin{pmatrix}
0 & 0 & 1 & \cdots & 0 \\
\vdots & \ddots & \ddots & \ddots & \vdots \\
 &  & \ddots & \ddots & 1  \\
\vdots &  &  & \ddots & 0  \\
0 & \cdots &  & \cdots & 0  \\
\end{pmatrix}
\end{equation*}

And $A^{3}$ is equal to the matrix A with the "diagonal" of ones moved 2 up.
So to compute $e^{tA}$ I want to proof that $A^{n}$ is equal to the matrix A with the "diagonal" of ones moved up n-1 times, which results in $A^{n} = 0$. I have tried to proof it with induction.

So claim: If A $ \in \mathbb{R}^{n\times n}$ is of the above form, then $A^{n} = 0$.

For n = 2, the 2 x 2 matrix is equal to:
\begin{equation*}
A =
\begin{pmatrix}
0 & 1 \\
0 & 0
\end{pmatrix}
\end{equation*}
And $A^{2} = 0$.
So the claim holds for n = 2.
But I don't know how to do the induction step in this case.

Other ways to compute $e^{tA}$ with this matrix A are also welcome.


问:
Find a SVD of $A=u_1v_1^\intercal +2u_2v_2^\intercal +3u_3v_3^\intercal$
Find a SVD of $A=u_1v_1^\intercal +2u_2v_2^\intercal +3u_3v_3^\intercal$ where $\{u_1,u_2,u_3\}\subset\mathbb R^M$ and $\{v_1,v_2,v_3\}\subset\mathbb R^N$ are orthonormal sets.

The SVD is $A=U\Sigma T^\intercal$, so I begin by finding $AA^\intercal=u_1u_1^\intercal+4u_2u_2^\intercal+9u_3u_3^\intercal\in\mathbb R^{M\times M}$. I now need to find the eigenvalues and eigenvectors, what could they be?

$(u_1u_1^\intercal+4u_2u_2^\intercal+9u_3u_3^\intercal)v=\lambda v\implies (u_1^\intercal v)u_1+4(u_2^\intercal v)u_2+9(u_3^\intercal v)u_3=\lambda v\implies...what?$

Likewise, $AA^\intercal=v_1v_1^\intercal+2v_2v_2^\intercal+3v_3v_3^\intercal\in\mathbb R^{N\times N}$, and what are the eigenvalues? Just need the eigenvalues for this one.

Any help is appreciated.

答:
Since you already computed $AA^T=u_1u_1^T+4u_2u_2^T+9u_3u_3^T$, let us write its matrix representation $[AA^T]_\beta$ with respect to orthonormal basis $\beta=\{u_1,u_2,u_3\}$. The first column is $[AA^Tu_1]_\beta = [(u_1u_1^T+4u_2u_2^T+9u_3u_3^T)u_1]_\beta = [u_1]_\beta=\begin{pmatrix}
    1 \\
    0\\
    0
   \end{pmatrix}$; the second column is $[AA^Tu_2]_\beta = [4u_2]_\beta=\begin{pmatrix}
    0 \\
    4\\
    0
   \end{pmatrix}$; and the third column is $[AA^Tu_3]_\beta = [9u_3]_\beta=\begin{pmatrix}
    0 \\
    0\\
    9
   \end{pmatrix}$. This gives $[AA^T]_\beta=\begin{pmatrix}
    1 & 0 & 0 \\
    0 & 4 & 0\\
    0& 0 &9
   \end{pmatrix}$, which I think you can see what its eigenvalues are.

Also, from here, can you see what the eigenvectors of $AA^T$ are? Now make a guess of what the eigenvalues and eigenvectors are for an expression like $a_1 u_1 u_1^T + a_2 u_2 u_2^T +\cdots + a_n u_n u_n^T$ where $\{u_1,\ldots,u_n\}$ forms an orthonormal basis.


问:
$\lim b_n-b=0$ is it correct to write down this?
$\lim b_n-b=0$ Let $b_n$ be a convergent seq, converging to $b$. Now I am asking myself whether it would be correct to write down this, since $\lim b_n=b |-b\Leftrightarrow \lim b_n-b=0$ The questions occured since we technically dont say that $|b_n-b|=0$ but rather $|b_n-b|<\epsilon$ for all $n>N$ Thanks in advance.

Because I believe that this is only notation to say that $b_n$ is convergent.

答:
Let $(b_n)$ a sequence that converges to $b$. So, it means that, for all $\varepsilon >0$ there is $N_\varepsilon \in \mathbb{N}$ such that
$$|b_n - b| < \varepsilon, \forall n \ge N.$$
But it means that, given $\varepsilon > 0$, $|(b_n - b) - 0| < \varepsilon$, for all $n \ge N_\varepsilon$. So, by definition of limit of a sequence, we can say that
$$\lim_{n \to \infty}(b_n - b) = 0.$$


问:
Showing that $(\mathbb{C}^{*}/\mathbb{R}^{*},\cdot)\cong (U/U_2,\cdot)$
I want to show that $(\mathbb{C}^{*}/\mathbb{R}^{*},\cdot)\cong (U/U_2,\cdot)$, where $U$ is the unit circle and $U_2=\{-1,1\}$.

I considered the function $f:\mathbb{C}^{*}\to (U/U_2,\cdot)$, $f(z)=\hat{\frac{z}{|z|}}$.

Then $f$ is well defined and it is a surjective homomorphism.

Let $z\in \ker(f)$. Then $f(z)=\hat{1}\iff \hat{\frac{z}{|z|}}=\hat{1}\iff\frac{z}{|z|}\in U_2\iff z\in \mathbb{R}^{*}$. So $\ker(f)=\mathbb{R}^{*}$ and now we are done by the fundamental isomorphism theorem.

I think that this proof should work, but I want to ask a further question. If I considered $g:\mathbb{C}^{*}\to U$, $g(z)=\frac{z}{|z|}$, I think that I would have got in the same manner that  $(\mathbb{C}^{*}/\mathbb{R}^{*},\cdot)\cong (U,\cdot)$. This together with the other isomorphism implies that $(U/U_2,\cdot) \cong (U,\cdot)$.

So, could I say that factoring by $U_2$ is basically pointless?

答:
Yes, modding out by $U_2$ is "trivial".

Note that if $G \leq S^1$is a finite subgroup, then it consists of roots of unity. One can actually show that $G = G_n$ consists of all the $n$-th roots of unity for some $n \geq 1$.

But $z \mapsto z^n$ is a surjective endomorphism of the sphere, and thus $S^1/G_n \simeq S^1$.

Edit: your second map has kernel $z \in \Bbb C^\times$ such that $z = |z|$. That's not $\Bbb R^\times$ but rather $\Bbb R_{> 0}$.

Here's another way to see your first construction: you first map gives an iso

$$
\tau \colon \Bbb C^\times/\Bbb R_{>0} \to S^1.
$$

The preimage of $G_2$ are precisely the classes $[z]$ for which $z/|z| = \pm 1$, so $z = \pm|z|$ i.e. $z \in \mathbb{R}^\times$. Inside the quotient $\Bbb C^\times /\mathbb{R}_{>0}$ that's just $[-1]$ and $[1]$, but we can also think of it as $\Bbb R^\times /\Bbb R_{>0}$, hence
since $\tau(\Bbb R^\times / \Bbb R_{>0}) = G_2$ we get

$$
\Bbb C^\times / \Bbb R^\times  \simeq (\Bbb C^\times/ \Bbb R_{>0}) / (\Bbb R^\times / \Bbb R_{>0}) \simeq S^1/G_2.
$$

This is still $S^1$, though. An explicit map $\Bbb C^\times / \Bbb R^\times \to S^1$ would be induced by $z \mapsto z^2/|z|^2$.


问:
Insurance Base Rate question
There is an FKK Indemnity that insures automobile liability risk for data scientists. There are two rating classes, Honda and Toyota. The Base Rate for Honda is 300 for 6 months at basic limit of 25,000. And for Toyota the Base Rate is 500. In addition there is a policy fee of 50 for agent's commission. Most data scientists buy up the limit of liability to 1,000,000. The increased limit factor for this is 4.00.

Question is asking how much more does Toyota owner pay compared to Honda for this $1,000,000 policy?

I currently assumed to multiply (Base Rate * Limit Factor) + Fees, to find each owners cost. Was not sure how the limit of the liability is utilized in the equation that insurance companies use. The difference I got was $800. But I'm not confident, because I feel the liability limit needs to be considered.

答:
The fees are the same regardless of the rating class, so the premium difference between the two rating classes does not depend on the policy fee.

The rating factor is the adjustment for the increase in liability limit.  In other words, the base rate is multiplied by the rating factor corresponding to the limit of liability that is desired by the policyholder.  The resulting premium does not depend on the actual amount of the liability limit in any other way; this is how basic ratemaking works.  For instance, a rating plan might have a table of rating factors like this:

$$\begin{array}{c|c}
\text{Liability Limit (thousands)} & \text{Rating Factor} \\
\hline
5 & 0.75 \\
10 & 0.85 \\
25 & 1.00 \\
50 & 1.25 \\
100 & 1.50 \\
250 & 2.50 \\
500 & 3.00 \\
750 & 3.50 \\
1000 & 4.00 \\
2000 & 5.00 \\
\end{array}$$
where each rating factor is calculated from historical adjusted loss expenses in such a way that the expected value of premiums minus losses is positive (so the book of business should remain solvent unless future losses are in excess of historical ones).  So if a policyholder wants to reduce their coverage below the base rate of $25000$, they get a premium discount determined by how much reduction in coverage is applied; and if they want to increase their coverage, the premium is correspondingly increased by a factor that is determined by historical exposure to loss.

Therefore, all you need to do is compare the base rates for each rating class multiplied by the rating factor for the corresponding selected liability limit.  Since the difference in base rates is $200$, the difference at a rating factor of $4.00$ for a limit of $1$ million is simply $4(200) = 800$.

Title: Insurance Base Rate question


问:
For $0<p<1$ showing $\Big(\int_\Omega |f|^pd\mu\Big)^{1/p}\leq \frac{1}{R_0} + \Big(\int_\Omega |f_{R_0}|^p\Big)^{1/p} $
In this problem Limit of $L^p$ norm when $p\to0$, the writer states that for $0<p<1$ we have that
$$\Big(\int_\Omega |f|^pd\mu\Big)^{1/p}\leq \frac{1}{R_0} + \Big(\int_\Omega |f_{R_0}|^p\Big)^{1/p} $$
where $\mu$ is a positive measure such that $\mu(\Omega)=1$ and $f_{R_0}=|f|1_A$ where $A={\{x: |f(x)|\geq \frac{1}{R_0}\}}$. I see that
$$\int_\Omega |f|^pd\mu = \int_A |f|^pd\mu + \int_{A^c}|f|^pd\mu \leq \int_\Omega |f_{R_0}|^pd\mu + \frac{1}{R_0^p}$$
But I know that $a^{1/p} + b^{1/p}\leq (a+b)^{1/p}$ where $a,b\geq0$. So I am not sure how to distribute the the $1/p$ power.

答:
It seems to me that the solution for the case $\int_\Omega\log|f|\,d\mu=-\infty$ quoted by the OP is incorrect. For example,  the responder defines $f_R=|f|\mathbb{1}(|f|\geq 1/R)$ and claims that
$$-\log f_R \leq \log(R)$$
This is valid on $\{|f|\geq1/R\}$ but false on $\{|f|<1/R\}$ for there
$$-\log f_R =\infty$$
Also the use of Minkowski's inequality for $0<p<1$ is not valid.

Anyway, if the OP is primarily interested in original problem, i.e. show that
$$\lim_{p\rightarrow0}\Big(\int_\Omega|f|^p\,d\mu\Big)^{1/p}=\exp\Big(\int_\Omega\log|f|\,d\mu\Big)$$
then one may proceed as follows:

For any $a>0$, the function $p\mapsto a^p$ is convex and so the map $\phi_a(p)=\frac{a^p-1}{p}$ is monotone nondecreasing on $(0,\infty)$, and
$\lim_{p\rightarrow0+}\phi(p)=\log(a)$. It follows that if
$$g_p(\omega):=\Big(|f(\omega)|-1\Big) -  \frac{|f(\omega)|^p -1}{p},$$
then $0\leq g_{p'}\leq g_p$ for all $0<p<p'\leq1$, and $g_p\xrightarrow{p\rightarrow0+}|f|-1-\log(|f|)$. An application of  monotone convergence gives
\begin{align}
\lim_{p\rightarrow0+}\Big(\int_\Omega(|f|-1)\,d\mu-\int_\Omega\frac{|f|^p-1}{p}\,d\mu\Big)&=\lim_{p\rightarrow0+}\int_\Omega g_p\,d\mu\\
&=\int_\Omega\lim_{p\rightarrow0+}g_p\,d\mu=\int_\Omega(|f|-1)-\log|f|\,d\mu
\end{align}
whence we conclude that
$$\lim_{p\rightarrow0+}\int_\Omega\frac{|f|^p-1}{p}\,d\mu=\int_\Omega\log|f|\,d\mu$$
regardless of whether $\int_\Omega\log|f|\,d\mu=-\infty$ or $\log|f|\in\mathcal{L}_1(\mu)$.

The conclusion follows from this along with the  inequalities
\begin{align}
\int_\Omega\log|f|\,d\mu&= \frac{1}{p}\int_\Omega\log(|f|^p)\,d\mu\leq \frac{1}{p}\log\Big(\int_\Omega|f|^p\,d\,\mu\Big)=\log\|f\|_p\\
&\leq \frac{\|f\|^p_p-1}{p}=\frac{\int_\Omega|f|^p\,d\mu -1}{p}\xrightarrow{p\rightarrow0+}\int_\Omega\log|f|\,d\mu
\end{align}

A short proof that $\phi_a(p)=\frac{a^p-1}{p}$ is monotone nondecreasing in $(0,\infty)$

Claim: If $\phi$ is convex in $(a,b)$, then for any $a<x<u<y<b$
\begin{align}
\frac{\phi(u)-\phi(x)}{u-x}\leq \frac{\phi(y)-\phi(x)}{y-x}\leq \frac{\phi(y)-\phi(u)}{y-u}\tag{1}\label{one}
\end{align}

Indeed, if $u=(1-\lambda)x+\lambda y$, then $\lambda=\frac{u-x}{y-x}$ and from
$$\phi((1-\lambda)x+\lambda y)\leq (1-\lambda)\phi(x)+\lambda\phi(x)$$
we get
$$
\frac{\phi(u)-\phi(x)}{u-x}\leq \frac{\phi(y)-\phi(x)}{y-x}
$$
A similar argument gives the second inequality in \eqref{one}. The converse holds to, that is if \eqref{one} holds for any $a<x<u<y<b$, then $\phi$ is convex in $(a,b)$.

In our case, let $\phi(p)=a^p$ ($a>0$). This is a convex function and
with $x=0$ and $0<u<y$
$$
\frac{\phi(u)-\phi(0)}{u-0}=\frac{a^u-1}{u}\leq \frac{\phi(y)-\phi(0)}{y-0}=\frac{a^y-1}{y}
$$


问:
Motivating the terminology of weaker vs stronger topology
Let $X$ be a set, $\tau_1,\tau_2$ two topologies on $X$, and consider the following statements

$\tau_1\subseteq \tau_2$ (i.e $\tau_1$ is coarser/weaker than $\tau_2$, or that $\tau_2$ is finer/stronger than $\tau_1$)

For every net $\langle x_i\rangle_{i\in I}$ in $X$ and $x\in X$, if $x_i\to x$ relative to the topology $\tau_2$ then $x_i\to x$ relative to the topology $\tau_1$.

It is clear to me that $(1)$ implies $(2)$. My question is whether the converse is also true, because then this would seem like a nice justification for the terminology "weak/strong" topology in the context of topological vector spaces.

答: The converse is true: let´s prove $\neg1\implies\neg2$. If you have a set $U$ in $\tau_1$ but not in $\tau_2$, you can pick a point $x\in U$ which isn´t in the interior of $U$ respect to the topology of $\tau_2$. Thus, if $(B_i)_{i\in I}$ is a base of nhoods of $x$ in $\tau_2$ ordered by reverse inclusion, for each $i$ you can pick a point $x_i\in B_i\setminus U$. So the net $(x_i)_{i\in I}$ converges to $x$ in $\tau_2$ but it doesn´t in $\tau_1$, because no point of the net is in $U$.


问:
Nonlinear Binary Programming
I am trying to understand what is the best approach to solve this binary programming problem

$$ \max_{X\in \left\{0,1 \right\}^{N}} \left(\sum_{i=1}^{N} a_{i}X_{i}\right)^{\beta} - \sum_{i=1}^{N}c_{i}X_{i} $$

with $X\in \left\{0,1 \right\}^{N}, a_{i}>0, c_{i} >0 $ and $\beta>0$. Would linearization techniques be useful in this case? I think relaxation will not work given that the function is not concave.  Can it be formulated as a more specific well-known problem? Are there any optimized algorithms known for it?

Thanks so much in advance

答: You could perform no-frills branch-and-bound on the problem. Let level 0 contain just the root node. At each node in level $i$, you create one child node with $X_{i+1} = 1$ and one with $X_{i+1} = 0$. Suppose you are at a node in level $L>0$, meaning you have values for $X_1, \dots, X_L$. Set $A_L=\sum_{i=1}^L a_i X_i$ and $C_L=\sum_{i=1}^L c_iX_i$. Since there are no constraints, you have a candidate solution with objective value $A_L^\beta - C_L$ by setting the remaining variables zero, which may or may not be a new incumbent. The child with $X_{L+1}=0$ has a valid upper bound of $(A_L + \sum_{i=L+2}^N a_i)^\beta - C_L$ and the child with $X_{L+1}=1$ has a valid upper bound of $(A_L + a_{L+1} + \sum_{i=L+2}^N a_i)^\beta - C_{L+1}$. Whether those bounds are good enough to save you from essentially full enumeration is an empirical question.

Title: Nonlinear Binary Programming


问:
Find the value of $\iint_R(f(x,y) + 2) \,dx\,dy$ over area $[0,2] \times [0,2]$
So I'm taking a calculus course and I admit I don't quite understand this topic in my course.

Given that the integral of the function $f(x,y)$ over the area $[0,2] \times [0,2]$ equals $4$ , how can we compute the value of the integral
$$\iint_R(f(x,y) + 2) \,dx\,dy\,\,?$$

So
$$\iint_R(f(x,y) + 2) \,dx\,dy = \iint_R f(x,y) \,dx\,dy + 2\iint_R \,dx\,dy$$

Then $4  + 2\iint_R \,dx\,dy$? But I'm not sure how to proceed from here.

I'm guessing the bound $R$ is equivalent to writing $\int_0^2\int_0^2(f(x,y) + 2) \,dx\,dy$?
I would really appreciate some help as I'm super confused (as mentioned, new topic for me). Thanks in advance!

答:
If $f=4$ over $[0,2] \times [0,2]$, then
$$\int_0^2\int_0^2(f(x,y) + 2) dxdy= \int_0^2\int_0^2f(x,y) dxdy+8=4\cdot 4+8=24$$

Addition.

Of course, if $\int_0^2\int_0^2f(x,y) dxdy = 4$, then answer will be $12$:
$$\int\limits_0^2\int_\limits0^2(f(x,y) + 2) dxdy= \int_\limits0^2\int_\limits0^2f(x,y) dxdy+2\int_\limits0^2\int_\limits0^2dxdy =\\
= 4+2\cdot \int\limits_{0}^{2}dx \cdot \int\limits_{0}^{2}dy =12$$


问:
how to understand the (f+g)(x) and (αf)(x) notation
In the following notations:
$$ (f+g)(x)=f(x)+g(x) $$
$$ (αf+βg)(x)=αf(x)+βg(x) $$

can anyone help to understand:

$$(f+g)(x) $$
$$ (αf+βg)(x) $$

?

It's no problem if $f$ and $g$ are linear transformation matrices $A$ and $B$ and $x$ is a vector variable $X$ because I can compute and compare $(A+B)X$ and $AX+BX$.

Otherwise, when it's non-linear, the notation is hard to understand.

for example,

$$ f(x)=\cos x+1 $$
$$ g(x)=e^x-2 $$

I can write:
$$ f(x)+g(x)=\cos x+1 + e^x-2 $$
$$ αf(x)+βg(x) = α\cdot \cos x+α + β\cdot e^x -2β$$

In this case, what are the definition of (and how to evaluate):

$$(f+g)(x) $$
$$ (αf+βg)(x) $$

?

I'm asking this in order to understand the definition of dual space (en.wikipedia.org/wiki/Dual_space) which suggests $(f+g)(x)=f(x)+g(x)$ and $(αf+βg)(x)=αf(x)+βg(x)$ are to be proved/verified (note the word "satisfying" the conditions)

答:
This is a typical way to define an operation on a space of functions "point-wise". A function $f:X\to Y$ between two sets $X$ and $Y$ is given by $\{ (x,f(x)) : x\in X \}$; i.e. by giving its values at every point $x$. Now given two functions $f:X\to Y$ and $g:X\to Y$, you may define
$$
(\alpha\cdot f + \beta\cdot g) :=\{ (x, \alpha\cdot f(x) + \beta\cdot g(x)):x\in X\}
$$
which is precisely what is meant by saying that $\alpha\cdot f + \beta\cdot g$ is defined as
$$
(\alpha\cdot f + \beta\cdot g)(x) := \alpha\cdot f(x) + \beta\cdot g(x).
$$
The above notation is slightly abusive because the quantifier is left out; it is implicit. The definition intends to say that you make this definition for every $x\in X$, thereby defining the whole function.

More generally, if you have any $k$-ary operation $\omega: Y^k\to Y$ on a set $Y$, you can extend this operation to the space of maps $Y^X$ for any set $X$. Indeed, for $f_1,\ldots,f_k\in Y^X$ you define
$$
\omega(f_1,\ldots,f_k) := \{ (x, \omega(f_1(x),\ldots,f_k(x)) : x\in X \}
$$
This is referred to as defining $\omega$ point-wise on $Y^X$.


答:
After you get $x_{n+1} - 6x_n + x_{n-1}=0$ as in the other two answers, a conceptually  easy way to establish the relationship between $x_n$ and $x_{n-3}+x_{n+3}$ is as follows:

Rewrite the recurrence equation as
$$(\mathbb E^2-6\mathbb E+1)x_n=0$$
where $\mathbb E$ is the forward shift operator $\mathbb E^{i} x_n = x_{n+i}, \forall i \in \mathbb N$. Then the characteristic equation is $$\lambda^2 - 6\lambda + 1 =0$$ with two roots $a, b$ such that $a+b=6, ab=1$. Now
$$a^3\cdot b^3 =1, a^3+b^3 = (a+b)((a+b)^2-3ab)=6\cdot (6^2-3)=198$$

Therefore $$\lambda^6 - 198 \lambda^3+1=(\lambda^3-a^3)(\lambda^3-b^3)=g(\lambda)(\lambda-a)(\lambda-b)=g(\lambda)(\lambda^2-6\lambda+1)$$
where $g(\lambda)=(\lambda^2 + a\lambda +a^2)(\lambda^2 + b\lambda +b^2)$ (we don't need to know the coefficients, we only need the fact that $g$ is a polynomial)

Then
$$(\mathbb E^6 - 198 \mathbb E^3 + 1) x_n = g(\mathbb E)(\mathbb E^2 - 6\mathbb E+1)x_n = 0\\
\implies x_{n+6} - 198 x_{n+3} + x_n=0 \implies x_{2020} = 990/198=5.$$

Title: A sequence $x_{n+1} = 3x_n + \sqrt{8x^2_n + 2}$ and find $x_{2020}$

Body:
The sequence is given by the formula $x_{n+1} = 3x_n + \sqrt{8x^2_n + 2}$ and it is known that  $x_{2017} + x_{2023} = 990$, then what is $x_{2020}$ = ?

My little approch:

It is given that  $x_{2017} + x_{2023} = 990$ ----- (1)  and $x_{n+1} = 3x_n + \sqrt{8x^2_n + 2}$

So,

$x_{2017} = x_{2016+1} = 3 x_{2016} + \sqrt{8x^2_{2016} + 2}$ -------(2)

$x_{2023} = x_{2022+1} = 3 x_{2022} + \sqrt{8x^2_{2022} + 2}$ -------(3)

Then from (1),(2),(3) =>

$3 x_{2016} + \sqrt{8x^2_{2016} + 2} + 3 x_{2022} + \sqrt{8x^2_{2022} + 2} = 990$

$3 (x_{2016}+x_{2022} ) + \sqrt{8x^2_{2016} + 2}  + \sqrt{8x^2_{2022} + 2} = 990$

$3 (x_{2016}+x_{2020} + x_{2021}) + \sqrt{8x^2_{2016} + 2}  + \sqrt{8x^2_{2020} + 2}+ \sqrt{8x^2_{2021} + 2}+ \sqrt{8x^2_{2022} + 2} = 990$

I stuck here and can't go further. Please help me with it.


问:
Proof regarding limits of a function $ f(x) = \begin{cases} x, & \text{if $x$ rational} \\ 0, & \text{if $x$ irrational} \end{cases}$
I'm trying to prove that

$ f(x) =
\begin{cases}
x,  & \text{if $x$ rational} \\
0, & \text{if $x$ irrational}
\end{cases}$

does not approach any limit near $a$ if $a\neq0$.

I noted this means that for any $a$ and for any $m$, $\lim \limits_{x \to a} f(x)\neq m$. Hence, I assumed $\lim \limits_{x \to a} f(x)=m$ and tried to find a contradiction, using proof by cases.

Firstly, for any interval around $a$, there is an $x_1$ for which $f(x_1)=x_1\neq0$ and an $x_2$ for which $f(x_2)=0$.

If $m\neq0$, then $\lvert f(x_2)-m\rvert=\lvert m\rvert\lt\epsilon$ is false if we let $\epsilon=\lvert \frac m2\rvert$

Now, the problem happens when $m=0$, since I don't know how to prove that $\lvert f(x_1)-m\rvert=\lvert x_1\rvert\lt\epsilon$ is false for some $\epsilon$.

Intuitively, I understand that if $x$ is very close to $a$ and $a\neq0$, then letting $\epsilon=\lvert \frac a2\rvert$ should lead to a contradiction, but I can't express this formally.

If possible, I'd prefer a simple proof, since the only calculus concepts I currently understand are limits and continuity.

答:
A simple way to prove that there isn´t a limit is using that if there was $m$ such that $\lim \limits_{x \to a} f(x)=m$, then for any sequence $a_n$ convergent to $a$ (with $a_n\neq a$ for all $n$) we would have that $f(a_n)\to m$.

However, given $a\neq0$, you can pick a sequence $q_n$ of rationals that converges to $a$, and a sequence $i_n$ of irrationals that converges to $a$. And then, $f(q_n)\to a$ and $f(i_n)\to0$. As you have two sequences $q_n$ and $i_n$ converging to $a$ such that the sequences $f(q_n)$ and $f(i_n)$ have different limits, there can´t exist $m$ such that $f(a_n)\to m$ for every sequence $a_n$ converging to $a$. So $f$ can´t be continuous at $a$.


问:
Relation between second order partial derivative and gradient
Suppose that $h \in C^2(V)$ ($h$ is two times continuously differentiable in the set $V$), where $V \subset \mathbb{R}^n$ is an open subset. So, if $p \in V$, and $v \in \mathbb{R}^n$ is a non-zero vector, we can prove that
$$\frac{\partial h(p)}{\partial v} = \langle \nabla h(p),v \rangle.$$
Now, can I relate $\frac{\partial^2h}{\partial v^2}$ to $\nabla h(p)$? How?

答:
If you mean $d^2/dt^2(f(P+vt))$ then it equals
$$
v^TH(P)v
$$
Where $H(P)$ is the Hessian matrix of second derivatives.


问:
Solving Differential Equations w/ polynomials
I'm new to solving differential equations.

How would we go about solving a differential equation like

$y'=-4+5y-y^2$   ?

答:
$$\frac{dy}{dt} = -4+5y-y^2$$

$$\frac{dy}{-4+5y-y^2}=dt$$

$$\int \frac{dy}{4+5y-y^2} = \int dt$$

$$\frac{1}{3}\text{ln}(|\frac{y-1}{y-4}|)=t+c_1$$

$$\text{ln}(|\frac{3}{y-4} + 1|)=3t+c_2$$

From here just you can isolate for y, or just leave it implicit.


问:
If $|A|\leq|B|$, then $|\mathscr{P}(A)|\leq|\mathscr{P}(B)|$
I'm trying to prove that if $|A|\leq|B|$, then $|\mathscr{P}(A)|\leq|\mathscr{P}(B)|$.

I know that $|A|\leq|B|$ implies that there is an injection $f:A\to B$. I also know that for any set $S$, $|S|<|\mathscr{P}(S)|$.

Clearly I need to show that there is also an injection from $\mathscr{P}(A)$ to $\mathscr{P}(B)$ but I'm really struggling to think of a way to get there.

I'm not asking for a solution but if anybody has a small hint to point me in the right direction I would really appreciate it. Thank you!

答:
It is enough to Know that $|\mathscr{P}(A)|=2^{|A|}$ so $$ |\mathscr{P}(A)|=2^{|A|}\leq 2^{|B|}=|\mathscr{P}(B)|$$ It remains to show  $$ |\mathscr{P}(A)|=2^{|A|}$$
define a bijection function $$f\colon \mathscr{P}(A)\to 2^{A}$$ by $f(C)=\chi_{C}$ where $\chi$ is the characteristic function of $C$, that is , $\chi_{C} (x)=1$ for $x\in C$ and $\chi_{C} (x)=0$   for $x\in A\setminus C.$ I hope it is clear now


问:
How to show nonassociativity of the positive rationals under a binary operation defined in terms of max and min?
Consider $\mathbb{Q}^+$ with the usual $\leq$ relation and the binary operation $\circ$ defined as:

$$p \circ q = max(p,q) + \frac{1}{2} min(p,q)$$

A book that I'm reading states that the operation $\circ$ is not associative with respect to $\mathbb{Q}^+$, with verification left to the reader. I have tried to verify this by picking random triples $(p,q,r)$ of positive rational numbers as examples, but in each case I end up with the result that $p \circ (q \circ r) = (p \circ q) \circ r$.

For example, take $p=4.5, q=18.1, r=7$:

\begin{align}
4.5 \circ (18.1 \circ 7) &= 4.5 \circ (max(18.1,7) + \frac{1}{2} min(18.1,7))\\
&= 4.5 \circ (18.1 + 3.5)\\
&= 4.5 \circ 21.6\\
&= max(4.5,21.6) + \frac{1}{2} min(4.5,21.6)\\
&= 21.6 + \frac{1}{2} 4.5\\
&= 23.85
\end{align}

and then:
\begin{align}
(4.5 \circ 18.1) \circ 7 &= (max(4.5,18.1) + \frac{1}{2} min(4.5,18.1)) \circ 7\\
&= (18.1 + \frac{1}{2} 4.5) \circ 7\\
&= 20.35 \circ 7\\
&= max(20.35,7) + \frac{1}{2} min(20.35,7)\\
&= 20.35 + \frac{1}{2}7\\
&= 23.85
\end{align}

Am I not picking the right triples of positive rationals for a counterexample, or am I misunderstanding somehow?

答:
Select $q<p<p+q/2<r$, for example, $q=2,p=3,r=5$.

We get $(p\circ q)\circ r=r+p/2+q/4$ and $p\circ(q\circ r)=r+p/2+q/2$.


问:
"Spread-Out" Partitions
Firstly, the given definition of spread-out is

"A partition is said to be 'spread-out' if all the parts are distinct and no two parts are consecutive numbers."

I am trying to work out how many spread-out partitions of 21 are there into 4 parts? I believe the answer is 7, but I only achieved this by brute force, and hence wondering if there is a easier way and more general formula of working this out.

答:
Wanted to add some to the answers of Reidel and Pratt from 18 January.  These spread-out partitions are sometimes called 2-distinct partitions (where $d$-distinct means distinct parts with differences at least $d$).  2-distinct partitions are part of the first Rogers--Ramanujan identity (Schur also proved it independently): writing # for "number of,"
$$ \#\text{(2-distinct partitions of $n$)} = \#\text{(partitions of $n$ with all parts congruent to 1 or 4 modulo 5)}.$$
In terms of generating functions, this is
$$ 1 + \sum_{m=1}^\infty \frac{q^{m^2}}{(1-q)(1-q^2)\cdots(1-q^m)} =
\prod_{n=1}^\infty \frac{1}{(1-q^{5n-4})(1-q^{5n-1})}.$$
A great exposition on this is in the book Integer Partitions by George Andrews and Kimmo Eriksson (Cambridge, 2004), section 3.4, chapter 4, and section 5.6.

Your question of counting 2-distinct partitions of $n$ by number of parts leads to the triangle of numbers in the On-line Encyclopedia of Integer Sequences entry A268187.  The description of partitions there is different, but connects to 2-distinct partitions in a way that preserves the number of parts.  The row for $n=21$ is $1, 9, 19, 6$.

Title: "Spread-Out" Partitions


问:
Do I have to show that elements of $L$ commutes with elements of $N$ (like in case of direct product) and if so, why?
I want to prove the following $a \Longleftrightarrow d$ in the following questoin:

Let $R$ be a commutative ring. For $R-$modules $L,M,N$ show that the following conditions are equivalent.(all functions are $R-$ module homomorphisms.)

a- $M \cong_{R} L \oplus N.$

b- There exists a left-split short exact sequence $0 \rightarrow{L} \rightarrow{M} \rightarrow{N} \rightarrow{0.}$ (i.e., $\exists$ a retraction )

c- There exists a right-split short exact sequence $0 \rightarrow{L} \rightarrow{M} \rightarrow{N} \rightarrow{0.}$ (i.e., $\exists$ a section )

d- $L$ and $N$ are $R-$submodules of $M,$ $L + N = M$ and $L \cap N = \{0\}. $

My trial is:

$a \implies d$

This follows directly from the definition of direct sum.

$d \implies a$

We will prove this in the following $2$ steps:

1-$d \implies b.$

Proof:

Assume that  $L$ and $N$ are $R-$submodules of $M,$ $L + N = M$ and $L \cap N = \{0\},$ and we want to show that there exists a left-split short exact sequence $0 \rightarrow{L} \rightarrow{M} \rightarrow{N} \rightarrow{0.}$ (i.e., $\exists$ a retraction )

Given $m \in M,$ by hypothesis there exist $l \in L$ and $n \in N$ with $m = l + n$ and $L \cap N = \{0\}.$

If also $m = a + b$ for $a \in L$ and $b \in N,$ then $l + n = a +b,$and so $a - l = n - b$ where $(a - l) \in L$ and $(n - b) \in  N$ because $L$ and $N$ are modules. But then $(a-l), (n-b) \in L \cap N = \{0\}.$ Which means that $a - l = 0$ and $n - b = 0,$ hence $l = a$ and $n = b.$ Therefore, $l$ and $n$ are uniquely determined by the choice of $m.$

Let $i: L \rightarrow M $ be the inclusion homomorphism. Define $r: M \rightarrow L$ and $p: M \rightarrow N$ by $r(l + n) = l$ and $p(l+n) = n.$

Proving that $r$ and $p$ are homomorphisms.

First.

a- Given $a,l \in L$ and $b,,n \in N,$ we have:

$r((l + n) + (a + b)) = r((l + a) + (n + b)) = (l + a) = r(l + n) + r(a + b)$

b- Given $r' \in R$ and $m\in M,$ then we have:

$r(r'm) = r(r'(l+n)) = r((r'l + r'n)) = r'l = r'r((l + n)).$

Second.

a- Given $a,l \in L$ and $b,,n \in N,$ we have:

$p((l + n) + (a + b)) = p((l + a) + (n + b)) = (n + b) = p((l + n)) + p((a + b))$

b- Given $r' \in R$ and $m\in M,$ then we have:

$p(r'm) = p(r'(l+n)) = p((r'l + r'n)) = r'n = r'p((l + n)).$

So, $r$ and $p$ are $R-$module homomorphisms.

Proving that $\operatorname{ker} p = \operatorname{im} i.$

$p(m) = p((l+n)) = n = 0_{N}$ iff $m = l \in L.$ So, $\operatorname{ker} p = L + 0_N = i(L).$ Therefore the sequence $$0 \longrightarrow L \stackrel{i}{\longrightarrow} M \stackrel{p}{\longrightarrow} N \longrightarrow 0$$ is exact.

Moreover, $r$ is a retraction because $(r \circ i)(l) = r(i(l)) = r((l + 0_N)) = l$ i.e.$(r \circ i) = id_L$ as required.

2-$b \Longleftrightarrow a.$  (proved previously)

Then from $1$ and $2$ the required is proved.

My questions are:

1- Is my proof correct?

2- Do I have to show that elements of $L$ commutes with elements of $N$ (like in case of direct product) and if so, why?

3- When should I take the element of $M$ as an ordered pair and when should I take it as addition of two elements in $L$ and $N$?

Could anyone help me answer these questions please?

EDIT

My answers to my questions:

1- I guess yes.

2- I guess no because addition is commutative.

3- I do not know the answer to this.

Are my answers to myself correct?

答:
It is not true that $M \cong L \oplus N$ implies that $L$ and $N$ are submodules of $M$. I suggest you to change $(d)$'s statement to something like:

$(d)$ There exists submodules $L' \cong L$ and $N' \cong N$ of $M$ such that $M = L'+N'$ and $L' \cap N' = 0$.

Now, to prove $(a) \!\!\implies\!\! (d)$, consider an isomorphism $\phi : L \oplus N \to M$ and take $L' = \{\phi(l,0) : l \in L\}$ and $N' = \{\phi(0,n) : n \in N\}$. On the other hand, to prove $(d) \!\!\implies\!\! (a)$ consider the map $\phi : L' \oplus N' \to M$ given by $\phi(l,n) = l+n$, and conclude that $M \cong L' \oplus N' \cong L \oplus N$.

So, since you already done $(a) \!\!\iff\!\! (b)$ and $(a) \!\!\iff\!\! (c)$, you already have the difficult (and interesting) parts.


答:
You are struggling to show that for $a\neq0$, it is not true that $\displaystyle\lim_{x\to a} f(x)=0$.

Let $\epsilon=\left|{a\over2}\right|$.

Now, in any interval $\left(a-\delta,a+\delta\right)$ around $a$, there is a rational number $x_1\neq a$ as close to $a$ as you want. Choose $x_1\in\mathbb Q$ that is closer to $a$ than it is to $0$. That is, choose $x_1$ for which $|x_1-a|<\left|{a\over2}\right|$. If $x_1$ is closer to $a$ than it is to $0$, then $x_1$ is at least $\left|{a\over2}\right|$ away from $0$.

But $f(x_1)=x_1$, so $f(x_1)$ is also at least $\left|{a\over2}\right|$ away from $0$, or equivalently, $\left|f(x_1)-0\right| \not\lt\left|{a\over2}\right|=\epsilon$.

So you can’t guarantee $f(x)$ is within $\epsilon=\left|{a\over2}\right|$ units of $0$ just by constraining $x$ to be close to $a$. No matter how close to $a$ you constrain $x$ to be, you can find $x=x_1$ that is that close, but where $f(x_1)$ is not within $\epsilon$ of zero.

Don’t try to choose $x_1$ before $\epsilon$ is specified and expect it to work for any $\epsilon$. That’s kind of what you’re doing that makes it hard to complete the proof.

Title: Proof regarding limits of a function $ f(x) = \begin{cases} x, & \text{if $x$ rational} \\ 0, & \text{if $x$ irrational} \end{cases}$

Body:
I'm trying to prove that

$ f(x) =
\begin{cases}
x,  & \text{if $x$ rational} \\
0, & \text{if $x$ irrational}
\end{cases}$

does not approach any limit near $a$ if $a\neq0$.

I noted this means that for any $a$ and for any $m$, $\lim \limits_{x \to a} f(x)\neq m$. Hence, I assumed $\lim \limits_{x \to a} f(x)=m$ and tried to find a contradiction, using proof by cases.

Firstly, for any interval around $a$, there is an $x_1$ for which $f(x_1)=x_1\neq0$ and an $x_2$ for which $f(x_2)=0$.

If $m\neq0$, then $\lvert f(x_2)-m\rvert=\lvert m\rvert\lt\epsilon$ is false if we let $\epsilon=\lvert \frac m2\rvert$

Now, the problem happens when $m=0$, since I don't know how to prove that $\lvert f(x_1)-m\rvert=\lvert x_1\rvert\lt\epsilon$ is false for some $\epsilon$.

Intuitively, I understand that if $x$ is very close to $a$ and $a\neq0$, then letting $\epsilon=\lvert \frac a2\rvert$ should lead to a contradiction, but I can't express this formally.

If possible, I'd prefer a simple proof, since the only calculus concepts I currently understand are limits and continuity.


问:
Probability Joint PDF
Every night Joe goes to the casino and takes with him an amount of money in dollars, X, that is distributed according to the pdf:

f(x) = Ax^2 for 0 < x < 10

where A is a constant that you need to determine. He returns with an amount of money Y that is uniformly distributed between 0 and 3X. Find

E[Y] w/out finding the distribution for Y (i.e. using E[E(Y|X)])

The pdf for Y

E[Y] using the distribution for Y. Compare with your result of part
a.

The prob he returns w/ at least 5 dollars

If he returns w/ 5 dollars, what is the prob he left with at least 7
dollars

If he return w/ 5 dollars, what is the expected value of the amount
of money with which he left?

I am having a hard time finding the joint pdf for this situation. I know f(x) = 3x^2/1000 for 0 < x < 10, but I keep getting 1/3X for the distribution of Y, which doesn't seem right. Any hints on how to form the joint pdf here?

答: The conditional density of Y given X=x is 1/(3x). You need to find the unconditional distribution by integrating over f(x).</p>

Title: Probability Joint PDF


答:
The negation of the definition of $\lim_{x\to a}f(x)=L$ says the following:

there exists $\epsilon>0$ such that for every $\delta>0$ there exists $x$ with $x\in(a-\delta,a+\delta)\setminus\{a\}$ and $|f(x)-L|>\epsilon$.

If $L\ne 0$, set $\epsilon=\frac{|L|}{2}$. Then by the density of irrational numbers in $\mathbb{R}$, for every $\delta>0$, there exists an irrational number $x_0\in(a-\delta,a+\delta)\setminus\{a\}$ so that
$$
|f(x_0)-L|=|L|>\epsilon.
$$

If $L=0$ and $a> 0$, set $\epsilon=\frac{a}{2}$. Then by the density of rational numbers, for every $\delta>0$, there exists a rational number $r\in (a+\delta/2,a+\delta)\subset(a-\delta,a+\delta)\setminus\{a\}$ so that
$$
|f(r)-L|=|r|>a>\epsilon.
$$

If $L=0$ and $a< 0$, set $\epsilon=\frac{|a|}{2}$. Then by the density of rational numbers, for every $\delta>0$, there exists a rational number $r\in (a-\delta,a-\delta/2)\subset(a-\delta,a+\delta)\setminus\{a\}$ so that
$$
|f(r)-L|=|r|>|a|>\epsilon.
$$


问:
Computing the gradient of Cross Entropy Loss
The categorical cross entropy loss is expressed as:

$$L(y,t) = -\sum_{k=1}^{K}t_k\ln{y_k}$$

where $t$ is a one-hot encoded vector. $y_k$ is the softmax function defined as:

$$y_k = \frac{e^{z_k}}{\sum_{j=1}^{K}e^{z_j}}$$

I want to compute the gradient, $\nabla_z$, of the loss function with respect to the input of the output node. What I know: I understand how to compute the partial derivative of L with respect to a selected node (say, $z_k$). This yields the following expression:

$$\frac{\partial L}{\partial z_k} = y_k - t_k$$

But I am not sure how to generalize this to the entire vector, $z$. In essence, I know how to compute $\frac{\partial L}{\partial z_k}$ when $k = j$ and $k \neq j$, but I don't know how to calculate the gradient, $\nabla_z$.

答:
Assume the basis at $z_k$ direction are denoted as $\hat {z_k}$.

In order to generalize it to the entire vector, let's first compute $\frac{\partial {z_k}}{\partial z}$.

We hope to get $$\frac{\partial {z_k}}{\partial {z}}\cdot\hat{z_j}=\left\{\begin{matrix}
1 \ \ \  if \ \ \  k=j\\
0 \ \ \  if \ \ \  k\neq j
\end{matrix}\right.$$
since $z_k$ only change if we are changing in the $\hat{z_k}$ direction.
$$\frac{\partial {z_k}}{\partial z}=\hat{z_k}$$
can satisfy our want quite well.

After getting this, we can apply the equation $$\frac{\partial f(x_1(t),x_2(t),...,x_n(t))}{\partial t}=\sum_{i=1}^n{\frac{\partial {f}}{\partial x_i}\frac{\partial {x_i}}{\partial t}}$$
of total differential to your problem.


问:
How do I pick the right "u" for u substitution and when do I know I need to use it?
This is the problem I'm working with:

$$\int_{-\infty}^{\infty} \frac{4}{16+x^2}dx$$

So when integrating $4/(16+x^2)$ I know it has to be $\arctan$ something because of the $1/(1+x^2)$ format but how do I exactly know what it is? Like this one guy solved it where he did this:

Let $u=x/4 \Rightarrow 4du=dx$ so the integrand becomes $16/(16+16u^2) = 1/(1+u^2)$ and then it fits right in the $\arctan$ format.

My questions are:

What to pick $u$ when it isn’t as clear? (e.g. How do I come up with the $x/4$?)

Are there any tricks to spot it at first glance?

Are there practice problems to help me gain these skills?

When do I need to use $u$-sub?

答:
Unfortunately for everyone there's no general way of doing this. You have to "see it". For most of us which haven't been integrating since kindergarten, a way to "see it" is to do plenty of exercises. That's how you just "know" $\mathbf{arctan}$ is involved (edit: OP said so in the original version post).

Note that the $4$ in the numerator isn't really an issue, you can take that "outside the integral", informally speaking. So essentially we would like to transform $16+x^2$ into something of the sort of $1+u^2$. One could try to first get rid of that $16$. Again, multiplying or dividing by constants isn't an issue because if we know how to integrate $f$ we know how to integrate $16 \cdot f$.

Well, we might then just deal with $(16+x^2)/16 = 1+x^2/16$. This is not quite right, but then we "know" (as in, we've exposed ourselves to this a billion times already) that $16 = 4^2$, so this is in fact $1+(x/4)^2$. Thus taking $u = x/4$ will help, we just have to deal with the constants we set aside along the way.

I don't know how enlightening this is - and I suspect not very much - but I don't know if there's really much more to this than "guessing".


问:
If $f$ is holomorphic on $U\setminus D$ and $D$ consists of poles isolated singularities, is there any isolated singularity outside $D$?
Let $X$ be a normed vector space.

1.: If $\Omega\subseteq\mathbb C$ is open and $f:\Omega\to X$ is holomorphic, then $z_0\in\mathbb C\setminus\Omega$ is called an isolated singularity of $f$ if there is a neighborhood $N$ of $z_0$ with $N\setminus\{z_0\}\subseteq\Omega$.

2.: If $U\subseteq\mathbb C$ is open, then $g$ is called a $X$-valued holomorphic function on $U$ up to isolated singularity if there is a $D\subseteq U$ with

$U\setminus D$ is open;

$g:U\setminus D\to X$ is holomorphic;

Every point in $D$ is an isolated singularity of $g$.

Let $\Omega:=U\setminus D$ and $$S:=\{z_0\in\mathbb C\setminus\Omega:z_0\text{ is an isolated singularity of }f\}.$$ By assumption, $D\subseteq S$. But does it necessary hold $D=S$?

If $z_0\in S$, then clearly $$z_0\in\mathbb C\setminus\Omega=(\mathbb C\setminus U)\cup D\tag1.$$ On the other hand, since $z_0$ is an isolated singularity of $f$, there is a neighborhood $N$ of $z_0$ with $$N\setminus\{z_0\}\subseteq\Omega=U\setminus D\tag2.$$ However, that doesn't necessary yield $z_0\in D$ ...

I first thought that a construction of the following kind could yield a counterexample: Let

$z_1\in\mathbb C$;

$\varepsilon_1>0$ and $U:=B_{\varepsilon_1}(z_1)$;

$D:=\{z_1\}$;

$z_2\in\mathbb C\setminus U$ and $\varepsilon_2>0$ with $$U\cap B_{\varepsilon_2}(z_2)=\emptyset$$ and $$f:U\setminus D\to\mathbb C\;,\;\;\;z\mapsto\frac1{z-z_1}+\frac1{z-z_2}.$$

$f$ does clearly satisfy the definition above. But while I first thought that $z_2\in S\setminus D$, it does not satisfy the definition of being an isolated singularity of $f$ above, since there is no neighborhood $N$ of $z_2$ with $N\setminus\{z_2\}\subseteq\Omega=B_{\varepsilon_1}(z_1)\setminus\{z_1\}$.

答:
There is no normed space, $U$ is a connected open subset of $\Bbb{C}$,

$f$ is complex-valued holomorphic (complex differentiable at every point, thus analytic) on $U-D$ where $D$ is a discrete subset of $U$ (ie. locally $D$ is finitely many points). Nothing complicated here, everything is crystal clear, the isolated singularities of $f$ are at each point of $D$ and $f$ is not defined outside of $U$.

Some points of $D$ can be "removable singularities" (try with $\sin(z)/z$ which is entire, no singularity at $0$), some may be poles (ie. $(z-a)^k f$ is analytic at $a$), the others are essential singularities.

Next we can consider the analytic continuations of $f$, if $f$ extends to an analytic function on some larger connected open then this continuation is unique and is defined uniquely by the restriction of $f$ to any neighborhood.

Sometimes an analytic continuation exists, sometime not, of course the continuation may have some isolated singularities outside of $U$.

Sometimes the set of analytic continuations is complicated, try with $\log z,|z-1|<1$, the continuation to $arg(z)\in (-\pi/2,3\pi/2)$  is not the same as the continuation to $arg(z)\in (-3\pi/2,\pi/2)$ (there is a $2i\pi$ difference at the negative reals).

$\sum_{k\ge 0} z^{2^k},|z|<1$ has a natural boundary on $|z|=1$, no continuation exists.

Hope you realize there is nothing abstract in those things.


问:
Historical context of the quadruple $(x,y,z,t)$ where $x^2+y^2=z^2+t^2$
Recently my study is related to an equation $x^2+y^2=z^2+t^2$. I have learned that Euler studied about numbers which can be represented as a sum of two squares in two different way. But I do not know if there is anyone who studied this equation before him.

So I would like to ask if there is a name and the historical context of the quadruple $(x,y,z,t)$ so that $x^2+y^2=z^2+t^2$.

答:
It is well known since longtime ago that the complete solutions of the equation $x^2+y^2=z^2+t^2$ is given by the following identity in four parameters $r,s,X,Y$

$$(rX+sY)^2+(rY-sX)^2=(rX-sY)^2+(rY+sX)^2$$


问:
You know the probability that an object is dirty. An unreliable sensor tells you its true state. What is the new probability that the object is dirty?
I have encountered a statistics related problem for an AI project that I don't know how to solve, but I'm also nearly statistically illiterate so I'm not sure where to look. Hoping I can get a tip here.

I'll also explain things mostly as a programmer, since if I try to use statistical terms and notation I will likely offend someone.

Problem

Suppose you know the probability that an object is dirty: pDirty

Then use a dirt sensor which tells you if the object is actually dirty or not dirty.

However, the sensor has a chance to be wrong. You know the probability that the sensor will fail:  pSensorFail

With an initial pDirty, a sensor value sensor (0 or 1), and pSensorFail, how should you update pDirty given this new information?

Scenarios

If pDirty is 1 or 0, we already know the dirty state. So we ignore the sensor.

If pSensorFail is 0 then the sensor is perfect, and you should set pDirty = sensor

If pSensorFail is 1 then the sensor is still perfect, its just always wrong. You should set pDirty = 1 - sensor

If pSensorFail is 0.5, then the sensor is basically random and useless, and you should ignore it.

I'm wondering how to handle all other cases?

I assume there is some statistics formula that is correct 8for any pDirty, sensor, pSensorFail

Experiments

One strategy to reduce the cases a bit is

if pSensorFail > 0.5, set pSensorFail = 1 - pSensorFail, sensor = 1 - sensor.

Then from this point you can assume 0 <= pSensorFail < 0.5

I thought of a measure of how much the sensor is "trusted":

sensorTrust = 2 * abs(pSensorFail - 0.5)

i.e if sensorTrust is 1 then the sensor is always correct, if sensorTrust is 0 then it is always wrong

Then I linearly interpolate pDirty to sensor by sensorTrust:

pDirty = Lerp(pDirty, sensor, sensorTrust)

This is working okay, but I feel like it doesn't respect the current pDirty enough.

For example if pDirty is 0 or 1 then we should actually ignore the sensor,

since we are already certain about the dirtiness.

Also, if pDirty is 0.5 then maybe the sensor should have an even greater effect?

Any help or tips would be very appreciated.

Thanks

答:
It seems to me that what you want is the usual Bayesian update: you have $P(D),P(D^c),P(S \mid D),P(S \mid D^c)$ where $D$ is "the object is dirty" and $S$ is "the sensor says that the object is dirty". Then if you get a dirty sensor result, you update your probability that the object is dirty according to

$$P(D \mid S)=\frac{P(S \mid D)P(D)}{P(S \mid D) P(D) + P(S \mid D^c) P(D^c)}.$$

If instead you get a clean sensor result:

$$P(D \mid S^c)=\frac{P(S^c \mid D)P(D)}{P(S^c \mid D)P(D) + P(S^c \mid D^c) P(D^c)}.$$

In your notation, $P(D)$ is pDirty, $P(D^c)$ is 1-pDirty, $P(S \mid D)$ and $P(S^c \mid D^c)$ are both 1-pSensorFail and while $P(S \mid D^c)$ and $P(S^c \mid D)$ are pSensorFail. These formulas correctly manage all the case work you mentioned, including the case when the sensor always gives the wrong answer.


答:
$u$-sub is basically anti-chain rule.

If you can do lots of chain rule differentiations in your head, you will be able to spot the analogous $u$-sub when it arises. For example, if you can easily differentiate $(2x^3+5)^4$, then next time you see “integrate $x(6x^2+1)^7$” you’ll see how it goes.

Of course, that was an easy example. However, this does suggest that a strategy to get better at solving these problems is to do both complicated derivatives (including various combinations of trig, log, exponential, inverse etc) and complicated integrals. The first will give you inspiration on how to do the second.

I’m sure if you’ve ever differentiated $\arctan 4x$ or anything similar (e.g. any inverse trig with some $cx$ input), you’ll be able to see the $u$-sub in your question straight away.

Title: How do I pick the right "u" for u substitution and when do I know I need to use it?

Body:
This is the problem I'm working with:

$$\int_{-\infty}^{\infty} \frac{4}{16+x^2}dx$$

So when integrating $4/(16+x^2)$ I know it has to be $\arctan$ something because of the $1/(1+x^2)$ format but how do I exactly know what it is? Like this one guy solved it where he did this:

Let $u=x/4 \Rightarrow 4du=dx$ so the integrand becomes $16/(16+16u^2) = 1/(1+u^2)$ and then it fits right in the $\arctan$ format.

My questions are:

What to pick $u$ when it isn’t as clear? (e.g. How do I come up with the $x/4$?)

Are there any tricks to spot it at first glance?

Are there practice problems to help me gain these skills?

When do I need to use $u$-sub?


问:
how to solve this multivariate quadratic equation?
Any hope to acquire an analytic solution to such equations:

Solve:
$$\sum_{j=1}^n a_{ij} x_i x_j = b_i$$

for $i=1,\ldots,n$, where $a_{ij}$'s and $b_i$'s are known constants and $x_i$'s are unknowns to be solved.

Thanks a lot!

P.S. Thanks for alex.jordan's interesting comment! Let's consider this problem in a positive setting, i.e. let's require all coefficients($a_{ij}$'s and $b_i$'s) to be positive so that the solution seems to exist. Also $a$ is symmetric, i.e. $a_{ij}=a_{ji}$. If there could be any fast numerical solution it's also useful.

P.S. Just for the information of all readers: the original form of this problem is formulated as:
$$ x_i\cdot\left(\sum_{j=1}^n a_{ij}x_j\right) = \sum_{j=1}^n a_{ij}q_{ij} $$ where $q_{ij}\in(0, 1)$. I simplified the RHS into $b_{ij}$ but now it seems better not to do so(sorry for that!) to at least give the existence of real solutions a better chance.

答:
I couldn't fit this into a comment - it's not an answer. Each equation has a different quadratic form on its left. With $n=3$, here is what the system can be made to look like, just for example:

$$
\begin{align}
\vec{x}^T\begin{bmatrix}a_{11}&a_{12}/2&a_{13}/2\\a_{12}/2&0&0\\a_{13}/2&0&0\end{bmatrix}\vec{x}&=b_1\\
\vec{x}^T\begin{bmatrix}0&a_{21}/2&0\\a_{21}/2&a_{22}&a_{23}/2\\0&a_{23}/2&0\end{bmatrix}\vec{x}&=b_2\\
\vec{x}^T\begin{bmatrix}0&0&a_{31}/2\\0&0&a_{32}/2\\a_{31}/2&a_{32}/2&a_{33}\end{bmatrix}\vec{x}&=b_3\\
\end{align}
$$

In each case because the matrices are symmetric, the matrix is (orthogonally) diagonalizable. And generally they have rank $2$ with a null-space of dimension $n-2$. Maybe this can be exploited. It looks like in general, there will be $2^n$ solutions counting multiplicity, but they may be complex solutions.


答:
Generally the more integrals you do the faster you will recognise a particular style that fits a given method, so for example:
$$\int\frac{dx}{x^2+a^2}\tag{1}$$
you would use the substitution $x=a\tan t$ because we know we want an equation of the form $\tan^2u+1\equiv\sec^2 u$ there are also several others. I will leave a list below of some of my general rules that help a lot.

$$\int f'(x)e^{f(x)}dx=e^{f(x)}+C$$
$$\int f(x)f'(x)dx=\frac12f^2(x)+C$$
$$\int\frac{f'(x)}{f(x)}dx=\ln|f(x)|+C$$
$$\int_0^\infty t^{x-1}e^{-t}dt=\Gamma(x)$$
$$\int_0^1t^{x-1}(1-t)^{y-1}dt=B(x,y)$$
etc. these are not the same form but they all come from the idea of recognising a style of integral and using a general rule


Title: Solving Differential Equations w/ polynomials

Body:
I'm new to solving differential equations.

How would we go about solving a differential equation like

$y'=-4+5y-y^2$   ?

Body:
One more way, use $y=u'/u$, then
$$y'=-4+5y-y^2 \implies \frac{u u''-u'^2}{u^2}=-4+5\frac{u'}{u}-\frac{u'^2}{u^2} $$
$$\implies u''-5u'+4=0$$ Let $u=e^{mx}$, then
$m^2-5m+2=0 \implies m=2,3$.
So $u(x)=C_1e^{2x}+C_2 e^{3x}$, which gives
$$y(x)=\frac{2C_1 e^{2x}+ 3 C_2 e^{3x}}{C_1 e^{2x}+ C_2 e^{3x}}
=\frac{2+3Ce^{x}}{1+Ce^{x}}$$


问:
Proving the existence of a sequence of polynomials that converges to a resolvent
For my homework assignment i have to proof the following assertion:

For a $A \in \mathcal{L}(\mathcal{H})$ a bounded self-adjoint operator on a Hilbert space $\mathcal{H}$ and for any $z \in \mathbb{C} \setminus \mathbb{R}$ there exists a sequence of polynomials $p_n \colon \mathbb{R} \to \mathbb{C}$ such that $\lim\lim\limits_{n\to \infty}p_n(A)=(A-z)^{-1}$.

To do so I thought it might be necessary to distinguish the cases $|z|>||A||$ and $|z|\leq ||A||$ and then to use the Neumann series, but I don't really know how to start. I really want to try this on my own, but I would be really greatful for any tips!

答:
You idea is good. If $z\in\mathbb{C}\setminus\mathbb{R},$ then $z$ is in the resolvent set of $A$ (since $A$ is self-adjoint). Then,

$$(z-A)^{-1}=\frac{1}{z}\left(I-\frac{1}{z}A\right)^{-1}=\sum\limits_{n=0}^\infty \frac{A^n}{z^{n+1}}.$$ The partial sums are a sequence of polynomials in $A$, and they converge to the resolvent.


答:
$u$-substitution is appropriate when you see a function and its derivative within the integrand, like in the following examples:

$$\int{\color{blue}{2x}e^{\color{blue}{x^2}}\,dx}$$

$$\int{3\color{blue}{\sin{x}\cos{x}}\,dx}$$

(Since $(\sin{x})'=\cos{x}$ and $(\cos{x})'=\mbox{-}\sin{x}$, you have two choices for this one.)

Some integrals require some manipulation in order to find a good $u$-substitution:

$$\int{\frac{\ln{x}}{x}\,dx} \Rightarrow \int{\color{blue}{\frac{1}{x}\ln{x}}\,dx}$$

As others have mentioned, LOTS of practice is required to determine the best substitution. Since you asked for some more practice, I recommend working on the practice problems here and here.


问:
Proving that $M$ is a simple $R-$module.
Here is the question I want to answer:

A module is simple if it is not the zero module and it has no proper nonzero submodule.

$(a)$ Let $M$ be an $R-$module. Show that the following conditions are equivalent.

$M$ is a simple $R-$module.

There exists a maximal ideal $\mathfrak{m} \in R$ such that $M \cong_R R/ \mathfrak{m}.$

for any nonzero $x,y \in M$ there exists $r \in R$ such that $rx = y$ (i.e. the action of $R$ on $M$ is transitive).

My trial is:

$1 \implies 2$

Let $M$ be a simple $R-$module. We want to show that there exists a maximal ideal $\mathfrak{m} \in R$ such that $M \cong_R R/ \mathfrak{m}.$

If $M$ is simple, then $0 \neq M$, so we can pick $x \in M, x \neq 0$. Then $Rx$ is a non-zero submodule of $M.$ Since $M$ is simple, we have $Rx=M$ as a simple module has no proper nonzero submodule   .

If we define $f: R \to M$ as $f(r)=rx$ then  clearly it is surjective (is this correct in general or just because my $M$ is cyclic in that case)and it is an $R-$module homomorphism because:

Let $r,s,r' \in R.$

$1- f(r + s) = (r + s)x = rx + sx = f(r) + f(s).$

$2- f(r'r) = (r'r)x = r'(rx) = r'f(r).$

Now, by the first isomorphism theorem, we have $R/\operatorname{Ker}(f) \cong \operatorname{im}(f)= M$.

Since we assumed that $R-$ module means left and right $R-$module i.e. $R$ is commutative, then we can prove the maximality of the ideal  $\mathfrak{m} = \operatorname{Ker}(f)$ as follows:

Since $R/\mathfrak{m}  \cong  M$ then it is simple, hence the only submodules (ideals) of $R/ \mathfrak{m}$ is $0$ and itself. This show that $R/ \mathfrak{m}$ is a field, so $\mathfrak{m}$ is maximal by a theorem.

$2 \implies 3$

Assume that there exists a maximal ideal $\mathfrak{m} \in R$ such that $M \cong_R R/ \mathfrak{m}$ and we want to show that for any nonzero $x,y \in M$ there exists $r \in R$ such that $rx = y$ (i.e. the action of $R$ on $M$ is transitive)

Take the action of $R$ on $M$ as $f_x(r) = rx$ in the previous proof we said that $f_x$ is surjective and  hence for any nonzero $x,y \in M$ there exists $r \in R$ such that $rx = y.$

My questions are:

1- what is the precise reason for surjectivity of $f$?

2- Is my proof of $2 \implies 3$ correct?

3- how can I prove $3 \implies 1$?

4- Is there is a better way of proving that question?

Could anyone help me in answering those questions please?

答:
If $f$ is not surjective, then $Rx$ is a proper nonzero submodule of $M$, contrary to our assumption that $M$ is simple.

It could be better - it seems like you're using $1$ here instead of $2$. I think I'd go with the following: let $f:R\to R/\mathfrak{m}\cong M$ be the natural projection, and consider $Rx\subset M$ for some nonzero $x\in M$. Then $I=f^{-1}(Rx)$ is an $R$-submodule of $R$ (or, an ideal) which contains $\mathfrak{m}$. As $x\neq 0$, we must have that $I\neq \mathfrak{m}$: if $I=\mathfrak{m}$, then $f(I)=0$, but $x\neq 0$ is in $f(I)$. So $I=R$, and $f^{-1}(Rx)=R$, therefore $Rx=f(R)=M$ and there is some $r\in R$ with $rx=y$ for any $0\neq y\in M$.

Suppose $S\subset M$ is a nonzero submodule. We need to show that it's all of $M$. If it's not, then there's an $m\in M\setminus S$. Do you see where to go from here?

 Pick $s\in S$ and $r\in R$ so that $rs=m$. Thus $m\in S$, so $S=M$.


问:
Is it possible to make integers a field?
Is it possible to define addition and/or multiplication on the set of

a) natural numbers (including $0$: $0,1,2,3,...$)

b) integers $(..., -2, -1, 0, 1, 2, ...)$

in such way that they will become fields?

Thanks in advance.

答:
Hint: index a countably infinite field $\,F\,$ by any bijection $\,f\,:\,\Bbb N\to F.\,$ To perform a field operation on the indices, dereference them to obtain the corresponding field elements, then perform the field operation, then index the result, e.g. $\: n +  m =  f^{-1}\,(f(n) + f(m)),\:$ and similarly for other operations.
This "pulled back" field structure on $\,\Bbb N\,$ is isomorphic to the field $\,F\,$ since, by design, the map $\,f\,$ is a ring hom:  $\,f(n+m) = f(n)+f(m), \,$ and similarly for all other operations. This is how many algebraic structures are represented in computers, where the indices are addresses of the elements in memory or an array.

The same idea works to pull back (along a bijection) the operations of any algebraic structure, inducing an isomorphic algebraic structure on any set of the same cardinality. This is a trivial special case of  transport of structure.

Here are some more interesting examples.  This answer contains an instructive easily-grasped finite example, where $\, n\ {\rm mod}\ 7\:$ is labeled/indexed by $\, n - 3.$

See also this answer, where the reason behind a trick boils down to the fact that an operation on rationals is associative and commutative, simply because it is addition or multiplication transported to rationals labeled by inverses or increments.

A beautiful and important example is transporting the class group structure of quadratic fields from ideals to primitive binary quadratic forms - which greatly simplifies Gauss's presentation of composition of forms. For example, Gauss's proof in Disq. Arith. of the associativity of composition of forms involved many pages of abstruse calculations. But nowadays we deduce it immediately since it is simply transported ideal multiplication, which is clearly associative.


问:
How to calculate the variance of the error term in least squares method for simple linear regression?
We have

$$y_i  = \beta_0 + \beta_1x_i + \epsilon_i$$ and $$ \hat{y_i} = \hat{\beta_0} + \hat{\beta_1}x_i $$

where $\epsilon_i \sim N(0, \sigma^2)$.

Let $$e_i = y_i -  \hat{y_i} $$

I showed that

$$E(e_i) = E(\beta_0 + \beta_1x_i + \epsilon_i - \hat{\beta_0} - \hat{\beta_1}x_i) = \beta_0 + \beta_1x_i - \beta_0 - \beta_1x_i = 0$$

I want to show further that $V(e_i) = \sigma^2$ but I am facing problem in proving this

\begin{align}
E(e_i^2) &= E((y_i - \hat{y_i})^2 )= E(y_i^2) + E(\hat{y_i}^2) - 2E(y_i\hat{y_i}) \\&= V(y_i) + E(y_i)^2 + V(\hat{y_i}) + E(\hat{y_i})^2 - 2E((\beta_0 + \beta_1x_i + \epsilon_i)(\hat{\beta_0} + \hat{\beta_1}x_i))
\end{align}

I can see from here that I will get stuck calculating $E(\epsilon_i \hat{\beta_0})$ or $E(\epsilon_i \hat{\beta_1})$.

答:
From your third line, you have assumed that $\epsilon_i \sim N(0, \sigma^2)$.
We can see that the distribution of $\epsilon_i$ do not depend on what sample you get and also whatever estimator you come up with. With the independency, check related theorem and I think you can proceed easily.


问:
In how many ways can a number be decomposed in a sum of distinct perfect squares
Is there a formula for how many ways can a number be decomposed in sum of distinct perfect squares.

Example: $$50 = 49 + 1 = 1 + 4 + 9 + 36 = 9 + 16 + 25$$

The number 50 can be decomposed in 3 different ways.

答:
(Edit: Added a plot of $a_n$ and its asymptotics, corrected numerics. Also, a
short answer: There's not really a formula, but people can work out its growth.)

Denote $a_n = $ number of ways to write $n$ as a sum of distinct squares.

Here we demonstrate, though not quite a formula (as you might expect), how we can compute $a_n$ by using the generating function for $a_n $. Indeed, we have
$$
A =\sum_{n=0}^{\infty} a_n q^n = \prod_{k=1}^\infty(1+q^{k^2})=(1+q)(1+q^4)(1+q^9)(1+q^{16})\cdots \qquad(\dagger)
$$
(Why does this work? Pretend you are expanding this product and keep track of the powers of $q$ that you collected.)

You can play around to see what these values are (choose a large enough $N$) with SageMath (https://sagecell.sagemath.org/):

```
var('q')
N = 10
A = 1
for k in range(1,N):
    A = A*(1+q^(k^2))
A.expand()
```

This computes the first $N=10$ product in $(\dagger)$, and gives

```
 ...+ 4*q^65 + q^64 + q^63 + 3*q^62 + 2*q^61 + q^59 + q^58 + q^57 + q^56 + q^55 + 2*q^54 + 2*q^53 + q^52 + q^51 + 3*q^50 + 2*q^49 + 2*q^46 + 2*q^45 + q^42 + 2*q^41 + q^40 + q^39 + q^38 + q^37 + q^36 + q^35 + q^34 + 2*q^30 + 2*q^29 + 2*q^26 + 2*q^25 + q^21 + q^20 + q^17 + q^16 + q^14 + q^13 + q^10 + q^9 + q^5 + q^4 + q + 1
```

(truncated)

Note the coefficient in front of $q^{50}$ is $3$, so there are three such decompositions for 50. As another example, the coefficient of $q^{65}$ is 4, so we have four such decompositions for 65. The term $q^{60}$ is missing, this means there is no such decomposition for 60.

In any case, you can compute $a_n$ by using its generating function $A$ and look at the coefficients of $q^n$ in $A$. (And Use a suitably large $N>\sqrt n$, computationally, so you don't miss any decompositions. See update edit below for a SageMath implementation of this.)

Some observation is that it seems quite "sparse", these decompositions are rare as the power of $q$ in the factor $(1+q^{k^2})$ grows quite quickly. However this does not imply every integer $n$ has small $a_n$. Indeed, as $n$ increases so will $a_n$. For instance $a_{1000} = 1269,a_{10000} = 3296089777$, and $a_{100000} = 2759256389896728737285379 $. Here is a plot of $a_n$ (in $\color{purple} {\rm purple}$) for $n\le 1000$ using SageMath (code to plot this at the end):

Now, with these several terms of $a_n$, we can search on OEIS which gives this reference here: http://oeis.org/A033461 . There doesn't seem to have a nice closed formula for $a_n$, but people have estimated its asymptotic growth (Vaclav Kotesovec, Dec 09 2016):

$$
a_n \sim \exp(3 * 2^{-5/3}  \pi^{1/3}  ((\sqrt{2}-1)\zeta(3/2))^{2/3}  n^{1/3}) \frac{(\sqrt{2}-1)\zeta(3/2))^{1/3} }{ 2^{4/3} \sqrt{3} \pi^{1/3} n^{5/6}},
$$
where $\zeta(3/2)\approx 2.612375$ is the Zeta function at $3/2$ . This asymptotic is ploted in $\color{yellow} {\rm yellow}$ above. Such an asymptotic estimate is often found by doing some (complex) analysis on the generating function $A(q)$ mentioned above (a typical method is called saddle-point method. A great reference is
Analytic Combinatorics by Philippe Flajolet and Robert Sedgewick). I do not know the exact detail of this particular asymptotic, however.

An simple question to ask is: Is $a_n\neq 0 $ for all sufficiently large $n$? Or are there "gaps", that $a_n = 0$ infinitely often? One would guess it is the former by looking at the plot above, and indeed it is true:

Theorem. The number $128$ is the largest integer that cannot be written as a sum of distinct squares. And a complete list of positive integers $n$ that cannot be written as a sum of distinct squares are:
$$2,
 3,
 6,
 7,
 8,
 11,
 12,
 15,
 18,
 19,
 22,
 23,
 24,
 27,
 28,
 31,
 32,
 33,\\
 43,
 44,
 47,
 48,
 60,
 67,
 72,
 76,
 92,
 96,
 108,
 112,
 128.$$

Proofs and references of this can be found here: https://proofwiki.org/wiki/Numbers_not_Sum_of_Distinct_Squares#:~:text=Then%20k%20can%20be%20expressed,distinct%20squares%20by%20Induction%20Hypothesis and here: Numbers which are not the sum of distinct squares .

Postscript. Even though we didn't get a "formula" as you might traditionally expect, this generating function $A$ encodes all the information of these distinct square decompositions, to which we can extract the appropriate coefficient. In fact, we do have (formally)
$$
a_n = \frac{A^{(n)}(0)}{n!},
$$
where $A^{(n)}(0)$ is the $n$-th derivative of $A(q)$ evaluated at $q=0$.
In this vein we have to ask, "what is an answer" and "what is formula"...

Update. One can easily fashion this SageMath code to compute $a_n$ (though not the most efficient):

```
var('q')
n = 1000 # choose your value n to output a_n = number of decomp of n into distinct squares.
N = 1+ceil(sqrt(n))
A = 1
for k in range(1,N):
    A = A*(1+q^(k^2))
A.coefficients(sparse=False)[n]

---
output:
1269
```

Here $n=1000$, and we get $a_{1000} = 1269$. Also for reference $a_{10000} = 3296089777$ and $a_{128} = 0$. For a more efficient algorithm you can search for subset sum algorithms (say https://stackoverflow.com/questions/18305843/find-all-subsets-that-sum-to-a-particular-value).

Added. SageMath to plot the first few $a_n$ values and its asymptotic estimate:

```
var('q')
n = 1000 # choose your value n to output a_n = number of decomp of n into distinct squares.
N = 1+ceil(sqrt(n))
A = 1
for k in range(1,N):
    A = A*(1+q^(k^2))
w = A.coefficients(sparse=False)
z = 2.6123753486854883433485675679240716305708006524000634075733282488149277676882728609962438681263119523829763587721497556981576329
h = list_plot([w[i] for i in range(1,n)],plotjoined=True, color='purple')+list_plot([exp(3 * 2^(-5/3) * pi^(1/3) * ((sqrt(2)-1)*z)^(2/3) * x^(1/3)) * ((sqrt(2)-1)*z)^(1/3) / (2^(4/3) * sqrt(3) * pi^(1/3) * x^(5/6)) for x in range(1,n)],plotjoined=True, color='yellow')
show(h)
```

Body:
(Edit: Added a plot of $a_n$ and its asymptotics, corrected numerics. Also, a
short answer: There's not really a formula, but people can work out its growth.)

Denote $a_n = $ number of ways to write $n$ as a sum of distinct squares.

Here we demonstrate, though not quite a formula (as you might expect), how we can compute $a_n$ by using the generating function for $a_n $. Indeed, we have
$$
A =\sum_{n=0}^{\infty} a_n q^n = \prod_{k=1}^\infty(1+q^{k^2})=(1+q)(1+q^4)(1+q^9)(1+q^{16})\cdots \qquad(\dagger)
$$
(Why does this work? Pretend you are expanding this product and keep track of the powers of $q$ that you collected.)

You can play around to see what these values are (choose a large enough $N$) with SageMath (https://sagecell.sagemath.org/):

var('q')
N = 10
A = 1
for k in range(1,N):
    A = A*(1+q^(k^2))
A.expand()

This computes the first $N=10$ product in $(\dagger)$, and gives

 ...+ 4*q^65 + q^64 + q^63 + 3*q^62 + 2*q^61 + q^59 + q^58 + q^57 + q^56 + q^55 + 2*q^54 + 2*q^53 + q^52 + q^51 + 3*q^50 + 2*q^49 + 2*q^46 + 2*q^45 + q^42 + 2*q^41 + q^40 + q^39 + q^38 + q^37 + q^36 + q^35 + q^34 + 2*q^30 + 2*q^29 + 2*q^26 + 2*q^25 + q^21 + q^20 + q^17 + q^16 + q^14 + q^13 + q^10 + q^9 + q^5 + q^4 + q + 1

(truncated)

Note the coefficient in front of $q^{50}$ is $3$, so there are three such decompositions for 50. As another example, the coefficient of $q^{65}$ is 4, so we have four such decompositions for 65. The term $q^{60}$ is missing, this means there is no such decomposition for 60.

In any case, you can compute $a_n$ by using its generating function $A$ and look at the coefficients of $q^n$ in $A$. (And Use a suitably large $N>\sqrt n$, computationally, so you don't miss any decompositions. See update edit below for a SageMath implementation of this.)

Some observation is that it seems quite "sparse", these decompositions are rare as the power of $q$ in the factor $(1+q^{k^2})$ grows quite quickly. However this does not imply every integer $n$ has small $a_n$. Indeed, as $n$ increases so will $a_n$. For instance $a_{1000} = 1269,a_{10000} = 3296089777$, and $a_{100000} = 2759256389896728737285379 $. Here is a plot of $a_n$ (in $\color{purple} {\rm purple}$) for $n\le 1000$ using SageMath (code to plot this at the end):

Now, with these several terms of $a_n$, we can search on OEIS which gives this reference here: http://oeis.org/A033461 . There doesn't seem to have a nice closed formula for $a_n$, but people have estimated its asymptotic growth (Vaclav Kotesovec, Dec 09 2016):

$$
a_n \sim \exp(3 * 2^{-5/3}  \pi^{1/3}  ((\sqrt{2}-1)\zeta(3/2))^{2/3}  n^{1/3}) \frac{(\sqrt{2}-1)\zeta(3/2))^{1/3} }{ 2^{4/3} \sqrt{3} \pi^{1/3} n^{5/6}},
$$
where $\zeta(3/2)\approx 2.612375$ is the Zeta function at $3/2$ . This asymptotic is ploted in $\color{yellow} {\rm yellow}$ above. Such an asymptotic estimate is often found by doing some (complex) analysis on the generating function $A(q)$ mentioned above (a typical method is called saddle-point method. A great reference is
Analytic Combinatorics by Philippe Flajolet and Robert Sedgewick). I do not know the exact detail of this particular asymptotic, however.

An simple question to ask is: Is $a_n\neq 0 $ for all sufficiently large $n$? Or are there "gaps", that $a_n = 0$ infinitely often? One would guess it is the former by looking at the plot above, and indeed it is true:

Theorem. The number $128$ is the largest integer that cannot be written as a sum of distinct squares. And a complete list of positive integers $n$ that cannot be written as a sum of distinct squares are:
$$2,
 3,
 6,
 7,
 8,
 11,
 12,
 15,
 18,
 19,
 22,
 23,
 24,
 27,
 28,
 31,
 32,
 33,\\
 43,
 44,
 47,
 48,
 60,
 67,
 72,
 76,
 92,
 96,
 108,
 112,
 128.$$

Proofs and references of this can be found here: https://proofwiki.org/wiki/Numbers_not_Sum_of_Distinct_Squares#:~:text=Then%20k%20can%20be%20expressed,distinct%20squares%20by%20Induction%20Hypothesis and here: Numbers which are not the sum of distinct squares .

Postscript. Even though we didn't get a "formula" as you might traditionally expect, this generating function $A$ encodes all the information of these distinct square decompositions, to which we can extract the appropriate coefficient. In fact, we do have (formally)
$$
a_n = \frac{A^{(n)}(0)}{n!},
$$
where $A^{(n)}(0)$ is the $n$-th derivative of $A(q)$ evaluated at $q=0$.
In this vein we have to ask, "what is an answer" and "what is formula"...

Update. One can easily fashion this SageMath code to compute $a_n$ (though not the most efficient):

var('q')
n = 1000 # choose your value n to output a_n = number of decomp of n into distinct squares.
N = 1+ceil(sqrt(n))
A = 1
for k in range(1,N):
    A = A*(1+q^(k^2))
A.coefficients(sparse=False)[n]

---
output:
1269

Here $n=1000$, and we get $a_{1000} = 1269$. Also for reference $a_{10000} = 3296089777$ and $a_{128} = 0$. For a more efficient algorithm you can search for subset sum algorithms (say https://stackoverflow.com/questions/18305843/find-all-subsets-that-sum-to-a-particular-value).

Added. SageMath to plot the first few $a_n$ values and its asymptotic estimate:

var('q')
n = 1000 # choose your value n to output a_n = number of decomp of n into distinct squares.
N = 1+ceil(sqrt(n))
A = 1
for k in range(1,N):
    A = A*(1+q^(k^2))
w = A.coefficients(sparse=False)
z = 2.6123753486854883433485675679240716305708006524000634075733282488149277676882728609962438681263119523829763587721497556981576329
h = list_plot([w[i] for i in range(1,n)],plotjoined=True, color='purple')+list_plot([exp(3 * 2^(-5/3) * pi^(1/3) * ((sqrt(2)-1)*z)^(2/3) * x^(1/3)) * ((sqrt(2)-1)*z)^(1/3) / (2^(4/3) * sqrt(3) * pi^(1/3) * x^(5/6)) for x in range(1,n)],plotjoined=True, color='yellow')
show(h)


问:
Embedding $G$ into $G/N \times A$ for some small group $A$
Let $G$ be a finite group and let $N \unlhd G$ be a normal subgroup of $G$.
I would like to embed $G$ in $(G/N) \times A$ for some small group $A$.
I require the embedding to map $g \in G$ to $(gN, a_g)$ for some $a_g \in A$.
What is the smallest $A$ I can take?</p>

答:
You can always take A = G, and often you cannot do better. If G is cyclic of order 4 and N is the normal subgroup of index 2, then the smallest A that works is of course G, since G/N × A must at the very least have an element of order 4.

Another silly case:

When N = 1, you can always take A = 1.

When N = G, the minimal choice is A = G.

Consider the homomorphism φ from G to G/N × A given by g → ( gN, f(g) ).  Notice that f must be a homomorphism from G to A. What is the kernel of φ? It is just the intersection of the kernel of f with N.  Hence we take A to be minimal amongst all G/M where M ∩ N = 1.

For instance, if G is a p-group with a cyclic center and N ≠ 1, then A = G is minimal.  If G is dihedral of order 2p and N ≠ 1, then A = G is minimal.  If G is dihedral of order 2pq and N has order p, then one can take A to be dihedral of order 2p, that is M has order q.  Here p ≠ q are distinct odd primes.

In particular, if N contains the socle of G, then A = G is minimal. The converse also holds, since otherwise M being a minimal normal subgroup not contained in N will work for A = G/M.


问:
How to find all polynomials that follows the equation $P(P'(x)) = P'(P(x))$
I want to find all polynomials that has the following property

$$P(P'(x)) = P'(P(x))$$

where P(x) is a polynomial.

Can you please tell me a way to solve this problem?

答:
Let $ax^{n}$ be the leading coefficient, then the leading coefficient of both sides of the equation are equal giving:

$a(anx^{n-1})^{n} = an(ax^{n})^{n-1}$

So $a^{n+1}n^{n} = a^{n}n$

So $a= \frac{1}{n^{n-1}}$

So one such family is $\frac{x^{n}}{n^{n-1}}$

Now consider the constant coefficient K and the linear coefficient L:

$P'(K) = P(L)$

So if $P(x) = Lx+K$ is linear then, LK=K

So linear functions of the form

$P(x) = x+k$

Work.

$P(x) = ax^{2}+Lx+K$

Has $a=\frac{1}{2}$ and $\frac{L^{2}}{2}+L^{2} + K = K + L$

So K is free, and Either L=0 or $L = \frac{2}{3}$.

$L = \frac{2}{3}$ doesn't work when plugging back into $P'(P(x)) = P(P'(x))$

So we get $\frac{x^{2}}{2}+k$.

At third order and higher P and P' are both non-linear which forces K to be a solution of a polynomial of order higher than 2 and so K can only take on so many values. It is likely that the first family given will describe all of the remaining polynomials. We will demonstrate for the third order polynomials.

$\frac{x^{3}}{9} + bx^{2} + Lx + K$

Looking at 5th order terms:

$\frac{b}{27} = \frac{2b}{81}$

Which forces $b=0$.

Then looking at second order terms:

$\frac{L^{2}}{3} = 0$

which forces $L=0$.

$$\frac{K^{2}}{3} + 2bK + L = \frac{L^{3}}{9} + bL^{2} + L^{2} + K$$

So $\frac{K^{2}}{3} - K = 0$.

So K=3 or K=0.

$\frac{1}{3}(\frac{x^{3}}{9} + K )^2 = \frac{1}{9}(\frac{x^{2}}{3})^3 + K$

Looking at the 3rd order term forces K=0.

So $\frac{x^{3}}{9}$ is the only 3rd order solution.


答:
The answer is
$$
\operatorname{Var}(e_i) = \sigma^2\left(1-\frac1n-\frac{(x_i-\bar x)^2}{\text{SSX}}\right),
$$ where SSX is shorthand for $\sum(x_i-\bar x)^2$.

The derivation is quite involved. Here is one approach. We require the formula for the variance of the difference of two random variables:
$$
\operatorname{Var}(A-B)=\operatorname{Var}(A) + \operatorname{Var}(B) - 2\operatorname{Cov}(A,B).\tag{*}
$$

Write the $i$th residual in the form
$$ e_i:= y_i-\hat y_i = (\epsilon_i-\bar\epsilon)-(\hat\beta_1-\beta_1)(x_i-\bar x)\tag1$$
by plugging in the definitions for $y_i$ and $\hat y_i$ into $y_i-\hat y_i$, and then substituting $\hat \beta_0:=\bar y - \hat\beta_1 \bar x$.

Applying (*) to (1), the desired variance is
$$\operatorname{Var}(e_i) = \operatorname{Var}(\epsilon_i-\bar \epsilon) + (x_i-\bar x)^2\operatorname{Var}(\hat\beta_1-\beta_1)-2(x_i-\bar x)\operatorname{Cov}(\epsilon_i-\bar\epsilon, \hat\beta_1-\beta_1).\tag2$$

Using (*), calculate
$$\operatorname{Var}(\epsilon_i-\bar\epsilon)=\operatorname{Var}(\epsilon_i) + \operatorname{Var}(\bar\epsilon) - 2\operatorname{Cov}(\epsilon_i,\bar\epsilon)=\sigma^2\left(1-\frac1n\right).\tag3$$ The tricky calculation is $\operatorname{Cov}(\epsilon_i,\bar\epsilon)$, which requires you to observe that $\epsilon_i$ is independent of $\epsilon_k$ when $k\ne i$.

The variance of $\hat\beta_1-\beta_1$ is well known to be
$$\operatorname{Var}(\hat\beta_1-\beta_1)=\frac{\sigma^2}{\text{SSX}}.\tag4$$

The covariance in (2) reduces to $E(\epsilon_i-\bar\epsilon)(\hat\beta_1-\beta_1)$, since $E(\hat\beta_1)=\beta_1$. Substitute the formula
$$\hat\beta_1-\beta_1=\frac{\sum_k(x_k-\bar x)(\epsilon_k-\bar\epsilon)}{\text{SSX}}\tag 5$$ to obtain
$$(\epsilon_i-\bar\epsilon)(\hat\beta_1-\beta_1)=\frac{\sum_k(x_k-\bar x)(\epsilon_i-\bar\epsilon)(\epsilon_k-\bar\epsilon)}{\text{SSX}}.\tag6
$$
Break up the sum in (6) into $\sum_{k=i} + \sum_{k\ne i}$ and take expectations. The answer will be
$$\operatorname{Cov}(\epsilon_i-\bar\epsilon, \hat\beta_1-\beta_1)=E(\epsilon_i-\bar\epsilon)(\hat\beta_1-\beta_1)=\frac{(x_i-\bar x)\sigma^2}{\text{SSX}}.\tag 7$$

Title: How to calculate the variance of the error term in least squares method for simple linear regression?

Body:
We have

$$y_i  = \beta_0 + \beta_1x_i + \epsilon_i$$ and $$ \hat{y_i} = \hat{\beta_0} + \hat{\beta_1}x_i $$

where $\epsilon_i \sim N(0, \sigma^2)$.

Let $$e_i = y_i -  \hat{y_i} $$

I showed that

$$E(e_i) = E(\beta_0 + \beta_1x_i + \epsilon_i - \hat{\beta_0} - \hat{\beta_1}x_i) = \beta_0 + \beta_1x_i - \beta_0 - \beta_1x_i = 0$$

I want to show further that $V(e_i) = \sigma^2$ but I am facing problem in proving this

\begin{align}
E(e_i^2) &= E((y_i - \hat{y_i})^2 )= E(y_i^2) + E(\hat{y_i}^2) - 2E(y_i\hat{y_i}) \\&= V(y_i) + E(y_i)^2 + V(\hat{y_i}) + E(\hat{y_i})^2 - 2E((\beta_0 + \beta_1x_i + \epsilon_i)(\hat{\beta_0} + \hat{\beta_1}x_i))
\end{align}

I can see from here that I will get stuck calculating $E(\epsilon_i \hat{\beta_0})$ or $E(\epsilon_i \hat{\beta_1})$.


问:
$\cos^2(x)+\cos(x)\sqrt{\cos^2(x)+3}+\sin(x)\cos(x)+\sin(x)\sqrt{\cos^2(x)+3}=\frac98$
So this equation: $$\cos^2(x)+\cos(x)\sqrt{\cos^2(x)+3}+\sin(x)\cos(x)+\sin(x)\sqrt{\cos^2(x)+3}=\frac98$$ is kind of like the final part of a very much bigger geometry problem, what I mean is that the equation was originally this big of mess

$\frac{(4\cos(x)+\sqrt{16\cos^2(x)+48})^2-84+8\sin(x)(4\cos(x)+\sqrt{16\cos^2(x)+48})}{4}=0$

so uh yeah I got there after simplifying. And I've also tried factoring but ended up with $$(\cos(x)+\sin(x))(\cos(x)+\sqrt{\cos^2(x)+3})-\frac98=0$$ and I'm kind of stuck, I was just wondering if it exists a way of doing this algebraically and not graphically. And yes, I know there will be a better method to the geometry problem and I know, but I'm interested in solving the equation, not about the geometry problem.

答:
Hint:

As $\sqrt{\cos^2x+3}-\cos x=\dfrac3{\sqrt{\cos^2x+3}+\cos x}$

$$8(\cos x+\sin x)=3(\sqrt{\cos^2x+3}-\cos x)$$

$$\iff8\sin x+11\cos x=3\sqrt{\cos^2x+3}$$

As $\cos x\ne0,$ divide both sides by $\cos x$

$$8\tan x+11=3\sqrt{3+1+\tan^2x}$$

Now take square both sides to form a quadratic equation in $\tan x$ and check for When do we get extraneous roots?


问:
Are there any random variable $X$ and measurable function $g$ such that $\mathbb{E} [g(X)]=\mathbb{E}[Xg(X)]=0$ while $g(X)\ne 0$?
As titled. I was going through some problems related to the relation between uncorrelatedness and indepedence, and reached a situation where the existence of such RV and function would be nice</p>

答:
Definitely. If $X$ is uniform in $[0,1]$, we have
$$\mathbb E[X^n]=\frac{1}{n+1},$$
so
$$\mathbb E[aX^3+bX^2+cX]=\frac{a}{4}+\frac{b}{3}+\frac{c}{2}+d.$$
Let's try to find $(a,b)$ for which $g(X)=aX^2+bX+c$ works. We want
$$0=\mathbb E[g(X)]=\frac{a}{3}+\frac{b}{2}+c$$
and
$$0=\mathbb E[Xg(X)]=\frac{a}{4}+\frac{b}{3}+\frac{c}{2}.$$
These are three equations in two unknowns, so they have a nontrivial solution.


问:
Prove: minimal origin-to-ellipse $|z+a|+|z-a|=2r$ lies on minor axis, using complex numbers
Let $|z+a|+|z-a|=2r$ where $a,z\in\mathbb{C}$ and $r>|a|$.

Prove the minimum of $|z|$ is $\sqrt{r^2-|a|^2}$

The equation describes an ellipse, and it's clear from drawing a picture that the minimal $|z|$ are the two vertices of the ellipse on the minor axis. How can we prove this claim analytically using complex numbers?

Thank you in advance!

答: Turns out the example I made up is correct: all the important points have integer real and imaginary parts. Draw $a = 20 + 15i$  and $r=65$


问:
For $(x+\sqrt{x^2+3})(y+\sqrt{y^2+3})=3$, compute $x+y$ .
I am trying to find $x+y$ given that

$$(x+\sqrt{x^2+3})(y+\sqrt{y^2+3})=3.$$

It is the radicals in $\sqrt{x^2 +3}, \sqrt{y^2+3}$ that is bugging me. I tried to expand the left hand side

$$ xy + y\sqrt{x^2+3} + x\sqrt{y^2 +3} + \sqrt{(x^2+3)(y^2+3)}$$

and see if a term $x+y$ comes out, but it looks hopeless at this point.

答:
I want to explain why this is actually a remarkable problem.

The question is to show that an algebraic curve, of degree that could potentially be as high as 8 (it is a product of two terms with square roots) defines a straight line -- at least for its real solutions.

The usual ways in which such a thing happens, and are represented fairly often in competition problems and book exercises, are:

the equation represents the equality condition in an inequality of real numbers (for example, arithmetic mean equals geometric mean for some suitably constructed set of variables), or

the equation defining the curve factorizes, with some of the factors having no real solutions (for example, our degree 8 curve might be $(x+y)^4$ multiplied by a degree $4$ polynomial that is positive for all real coordinates $(x,y)$).

Neither of these is the case here.  Algebraic calculation, separating $x$ and $y$ to different sides of the equation, shows that we have $f(x) = f(-y)$ for the increasing function $f(x) = x + \sqrt{x^2+3}$, so that for real solutions $x = -y$.  This is a nice argument, and it generalizes to $F(x) = x + \sqrt{x^2 + a^2}$ and the equation $F(x)F(y)=a^2$, but does it fit into some algebraic framework?  The issue is what happens with the complex solutions, or when the equation is handled purely algebraically.

Introducing variables $X$ and $Y$ with $X^2 - x^2=3$ and $Y^2 - y^2=3$, there is a system of 3 quadratic equations in 4 unknowns. The surprise here is that purely algebraic calculations on the system in the polynomial ring $\mathbb{Z}[x,y,X,Y]$, lead to $3(x+y)=0$.  This illustrates some of the complexities around Bezout's theorem; for affine and singular varieties you cannot naively determine the degree of an intersection by degree counting alone.  The algebra is not hard in this case, but it is well worth going through the geometric, projective and scheme-theoretic descriptions of what is happening in this deceptively simple exercise.

I will edit the question to see if any of the 10 downvoters would like to change their minds in light of this information (assuming a non OP edit allows that).


问:
Derivative of the Determinant of a Matrix
I want to compute the derivative of the determinant of a matrix. This seems to be relatively straightforward for the first derivative using e.g., Jacobi's formula.

$$\frac{d}{dt}\det A(t)=\mathrm{tr}\, \left(\mathrm{adj}(A(t)) \frac{dA(t)}{dt} \right)$$

Let us assume we have the following matrix $A(t)$:

$$A(t) = \begin{bmatrix}
-8 \cdot t^3 - 3 \cdot t^2 & 2 \cdot t^3 + 4 \cdot t^2  \\
6 \cdot t^3 + 4 \cdot t^2 & -8 \cdot t^3 \\
\end{bmatrix}$$

Thus, if I have applied Jacobi's formula correctly, the result of the first derivative should be as follows:

$$\frac{d}{dt}\det  A(t) = 312 \cdot t^5 - 40 \cdot t^4 - 64 \cdot t^3 $$

In a related post, there was an attempt to use Jacobi's formula for the second derivative. This is an interesting case in itself.

My results for the second derivative are as follows:

$$\frac{d^2}{dt^2}det\ A(t)= 1560 \cdot t^4 - 160 \cdot t^3 - 192 \cdot t^2$$

I am not overly confident with the matrix calculus and the correct application of Jacobi's formula. Hence, I would be grateful if someone could check if my obtained results are correct? Thanks!

答: While using Jacobi's formula may be useful as an exercise, I don't see that in this case it is the simplest method. The determinant can be easily calculated in terms of $t$ as $52t^6-8t^5-16t^4$, giving the second derivative as $1560t^4-160t^3-192t^2$.