问:
Find the density function of $Y = X^2 - 1$ for a piecewise-linear r.v. $X$
A density function $f$, of a continuous random variable $X$, is given by:

$$
f(x) = \left\{
        \begin{array}{lc}
            \frac{1}{2} & \quad 0 < x < 1 \\
            \frac{x}{3} & \quad 1 \leq x < 2 \\
            \ 0 & \text{else}
        \end{array}
    \right.
$$

Find the density function of the random variable $Y = X^2 - 1.$

I'm struggling with this problem can someone explain me how to proceed with this kind of problems?

答:
First note that Y can take values between -1 and 3.  If we find the cumulative probability for Y - let's call it $G(y) = p(Y \le y)$ - then its derivative will be the density function.

For $0 < x < 1$, $y = x^2 - 1$, so $-1 < y < 0$.  For $y$ in this range,

$p(Y \le y) = p(X^2 - 1 \le y) = p(X \le \sqrt{y+1}) = \frac12 \sqrt{y+1}$

The last step follows from the observation that $p(X<x) = \frac12x$ for $0 < x <1$

Now consider $1 \le x \lt 2$ where $0 \le y < 3$.

$p(Y \le y) = p(Y \le 0) + p(0 < Y < y)$

We know $p(Y \le 0)$ from the first part, ie $\frac12 \sqrt{0+1} = \frac12$

$p(0 < Y < y) = p(0 < X^2 - 1 < y) = p(1 < X < \sqrt{y+1})$

$$=\int_1^\sqrt{y+1}\frac{x}{3}dx$$

$$=\left[\frac{x^2}{6}\right]_1^\sqrt{y+1}$$

$$=\frac{y}6$$

So $G(y) = \frac12 + \frac{y}6 = \frac {y+3}{6}$

Putting it all together:

$$G(y) = \left\{
        \begin{array}{lc}
            \frac{1}{2}\sqrt{y+1} & \quad -1 < y < 0 \\
            \frac{y+3}{6} & \quad 0 \leq y < 3 \\
            \ 0 & \text{else}
        \end{array}
    \right.$$

If you find the derivative of this function with respect to y, you will have the density function required.


问:
Landmarks of subjects of mathematics
In order to have a good view of the whole mathematical landscape one might want to know a deep theorem from the main subjects (I think my view is too narrow so I want to extend it).

For example in natural number theory it is good to know quadratic reciprocity and in linear algebra it's good to know the Cayley-Hamilton theorem (to give two examples).

So, what is one (per post) deep and representative theorem of each subject that one can spend a couple of months or so to learn about? (In Combinatorics, Graph theory, Real Analysis, Logic, Differential Geometry, etc.)

答: In graph theory you have Konig's theorem.</p>

ContentLicense: CC BY-SA 3.0

Title: Landmarks of subjects of mathematics


问:
Exponential map on matrices
I was thinking about different definition of exponential:

Case 1:

Let $z=a+ib$ be a complex number so we have the exponential map $\exp(z)=\sum \frac{z^n}{n!}$.

But one can also view $z$ as a matrix (indeed $z$ is a special automorphism of $\mathbb{R}^2$) of the form $z_r:=Z:=\begin{pmatrix}a & -b \\ b & a \end{pmatrix}$ so one has the exponential matrix map defined by $\exp(Z)=\sum \frac{Z^n}{n!}$ it is not difficult to show that $\exp(z_r)=\exp(z)_r$ (I can give more details for this if it worth, the idea is to use the polar expression of $z$ and that write $Z=a\operatorname{Id}+bI$ and use the Taylor expansion of $\sin$ and $\cos$).

Case 2: (The question)

What about the more general case of the exp function on a linear operator $\phi:\mathbb{C}^n\longrightarrow\mathbb{C}^n$?

Indeed, let $X$ be a complex matrix of size $n$, and let $X_r$ the block-matrix obtained by replacing to each $x_{ij}$ the $2\times2$ matrix ${x{_{ij}}}_r$ is it true that $\exp(X_r)=\exp(X)_r$?

Is it a general thing?

My approach:

I've tried with a calculation like the Case 1 but it seems to be more difficult to calculate. Another approach I have in mind is to use the fact that $\mathbb{C}^n$ is a real smooth variety with standard complex structure and than use the flow theorem. This approach gives me a characterization for $\exp(X_r)$ but my problem is to prove that $\exp(X)_r$ is also a solution for the flow.

(Maybe if this is not very clear I would clarify)

Questions:

Is it possible to prove that $\exp(X_r)=\exp(X)_r$ by straightforward calculation?

Is it possible to prove that $\exp(X_r)=\exp(X)_r$ by using the flow theorem?

Any hint or suggestion would be great!

答:
To elaborate on my comment:

If $X,Y$ commute then $e^{X+Y}=e^X e^Y$. This in particular holds for $X=a\text{ Id}$ and $Y=bI$.

If $I^2=-\text{Id}$, then $\exp(b I)=(\cos b)\operatorname{Id}+(\sin b)I.$

Both of these may be shown by expanding out the appropriate Taylor series. Combining these, we indeed have
\begin{align}
\exp(z_r)
&=\exp(a\operatorname{Id}+bI)\\
&=\exp(a\operatorname{Id})\exp(bI)\\
&=[(e^a\cos b)\operatorname{Id}+(e^b \sin b)I]\\
&=(e^a\cos b+i e^a\sin b)_r \\
&= (e^{a+ib})_r\\
&= \exp(z)_r.
\end{align}
The limitation of this approach compared to Ben's is that theirs allows matrices $A,B$ whereas mine is specifically for scalar $a,b$.

ContentLicense: CC BY-SA 4.0

Title: Exponential map on matrices


问:
How does the definition of a type of algebraic structures in Stacks Projects differ to the usual definition in universal algebra?
the Stacks Project defines an algebraic structure (see tag 007L) as a category $\mathcal{C}$ together with a functor $F \colon \mathcal{C} \to \mathbf{Set}$ satisfying the following properties:

F is faithful.

$\mathcal{C}$ is complete and $F$ is continuous.

$\mathcal{C}$ admits filtered colimits and $F$ commutes with them.

$F$ reflects isomorphism.

How does this definition relates to the usual definition (see the end of the post) of the category of algebraic structures of a given type $\tau$ in universal algebra? To avoid confusion I will call them $\tau$-algebras from now on.

I know that the category of $\tau$-algebras for a given type $\tau$ satisfy all the properties above, but is the definition above equivalent? More precisly, given an algebraic structure $(\mathcal{C}, F)$ as above, is there a type $\tau$ such that the category of $\tau$-algebras is equivalent to $\mathcal{C}$ respecting $F$.

To avoid confusion I shortly recall the definition of a$\tau$-algebra I have in mind:

A type $(\Omega, E)$ consists of

a set $\Omega$ (whose elements are called operators),

a map $\nu \colon \Omega \to \mathbb{N}_0$ where the image of an operator is called the arity of it,

and set $E$ of equations,

where an equation is an ordered pair of terms in $X_1, \ldots, X_m$ and a term in $X_1, \ldots, X_m$ is a symbolic finite pattern build by the following rules:

$X_i$ for $1 \leq i \leq m$ is a term in $X_1, \ldots, X_m$.

If $\omega \in \Omega$ and $T_1, \ldots, T_{\nu(\omega)}$ are terms in $X_1, \ldots, X_m$, then $\omega(T_1, \ldots, T_{\nu(\omega)})$ is also a term in $X_1, \ldots, X_m$.

Those are the only possible ways to build a term in $X_1, \ldots, X_m$.

Now let $\tau = (\Omega, E)$ be a type. A $\tau$-algebra consists of a set $A$ and a family of maps
$$ (f_\omega \colon A^{\nu(\omega)} \to A)_{\omega \in \Omega} $$
satisfying the equations, i.e.:

Let $T$ be a term $X_1, \ldots, X_m$. Then for all $a \in A^m$ we can assign a value $|T|(x) \in X$ to $T$ recursively defined by

$|X_i|(a) = a_i$ and

$|\omega(T_1, \ldots, T_n)|(a) = f_\omega(|T_1|(a), \ldots, |T_n|(a))$

Let $(T,S)$ be an equation where $S,T$ are terms in $X_1, \ldots, X_m$ then we require
$$ |T|(a) = |S|(a) $$
for all $a \in A^m$.

答:
I'll rename $F$ to $U$ (for "underlying"). This definition is equivalent to the universal algebra definition if we require either that $C$ is locally presentable or that $U$ has a left adjoint (call this axiom 2'), and also replace filtered colimits in axiom 3 with sifted colimits (call this axiom 3'), as follows:

If $C$ is locally presentable then $C$ has limits, $U$ preserves them, and $U$ is accessible, so by the locally presentable adjoint functor theorem, $U$ has a left adjoint $F : \text{Set} \to C$ ($F$ for "free"). Alternatively we can just require that $U$ has a left adjoint in the axiomatization.

By the crude monadicity theorem, $U$ has a left adjoint, is conservative, and preserves reflexive coequalizers (using the fact that reflexive coequalizers are sifted), hence the adjunction $F \vdash U$ is monadic. So $C$ is the category of algebras of a monad $UF$ on $\text{Set}$.

Since $U$ preserves filtered colimits and $F$ is cocontinuous, $UF$ preserves filtered colimits and is therefore a finitary monad. Finitary monads on $\text{Set}$ are in turn equivalent to Lawvere theories, and categories of models of Lawvere theories are exactly universal algebraic structures in the sense you describe. Moreover finitary monads on $\text{Set}$ preserve sifted colimits and their categories of algebras are locally presentable, so this definition is equivalent to the modification with 2' and 3'.

Every example the Stacks project lists in tag 007L, and I bet every example they discuss anywhere, is the category of models of a Lawvere theory and so satisfies the stronger axioms 2' and 3'. Personally I find "category of models of a Lawvere theory" to be the cleanest way of describing algebraic structures and I don't understand why the Stacks project is using such a bizarre axiomatization. With the Stacks project's axiomatization you a priori need to verify all of these axioms by hand for each example, but instead you can just prove once and for all that

categories of models of Lawvere theories satisfy all of these axioms, and

categories of algebraic structures in the sense of universal algebra are categories of models of Lawvere theories.

This argument implies that the Stacks project's definition could be strictly more general than universal algebra in two different ways: $U$ could fail to have a left adjoint (which implies that $C$ is not locally presentable), or $U$ could have a left adjoint but the adjunction $F \vdash U$ could fail to be monadic (which implies that $U$ does not preserve reflexive coequalizers and so does not preserve sifted colimits).

An example of the first situation is the following: take $C$ to be the category of $M$-sets for $M$ a "large monoid" (a "monoid" whose underlying "set" is a proper class, say the free monoid on a proper class to be specific). Limits and colimits are computed as in $\text{Set}$, so the forgetful functor $U : C \to \text{Set}$ preserves them, and $U$ is also faithful and conservative. But $U$ does not have a left adjoint because $M$ is not a set, and $C$ is not locally presentable for the same reason.

I don't know an example of the second situation off the top of my head. It seems tricky to write down an example where $U$ preserves filtered colimits but not reflexive coequalizers. Maybe a finite limit sketch could be used here.

Edit: I think $C = \text{Cat}$ (the category of small categories) and $U : \text{Cat} \to \text{Set}$ the forgetful functor given by sending a small category to the disjoint union of its set of objects and its set of morphisms is an example but I am too lazy to check explicitly that $U$ preserves filtered colimits but not reflexive coequalizers; anyone else want to take a stab?


问:
Pushforward of vector field
There is something I am confused about. I am reading Loring An introduction to differential geometry. I am confused why if $F(p) = F(q) = z$, they then have the same push-forward of the vector field. Is it because we are dealing with the same target space. From first inspection:

For $F : N \rightarrow M \in C^{\infty}(M, N)$ map of manifolds we have:

$$F_{*}(X_p)f = X_p(f \circ F)$$
$$F_{*}(X_q)f = X_q(f \circ F)$$

Why are they the same ? I see the picture that Loring posted in his book and it makes sense to me. Though I don't see the rigor involved.

答:
They are not necessarily the same and that's exactly the problem. If you have a smooth map $F \in C^\infty(M, N)$ that is not injective, say $F(p) = F(q) = z$, there might not be a vector fields $Y$ on $N$ that is $F$-related to a vector fields $X$ on $M$, i.e.
$$F_{*s}(X_s) = Y_{F(s)}, \quad \forall s \in M.$$
Indeed $Y_{F(p)} = Y_{F(q)} = Y_z$ is not well-defined since $F_{*p}(X_p)$ and $F_{*q}(X_q)$ may not be the same tangent vector.

Title: Pushforward of vector field


问:
Expression for the sum of the roots of a polynomial of degree n to the power of k
I am trying to find a function f(m) that given a power m returns the sum of the roots to the power of m.
$$(x-a_1)(x-a_2)(x-a_3)...(x-a_n)=0$$
$$f(m)=\sum_{k=1}^n{(a_ k)^m}$$
I attempted doing it manually for small values of n however I wasn't able to spot a pattern after m=3. For m=2 using a quadratic in the form of $x^2+bx+c=0$ I got $b^2-2c$ but that was as far as I got.

Body:
I used Mathematica function:

SymmetricReduction[a_1^3+a_2^3+a_3^3,{a_1,a_2,a_3}]

$x^3+ax^2+bx+c=0$

If roots are $a_1,a_2,a_3$ then

$$a_1^3+a_2^3+a_3^3=\left(a_1+a_2+a_3\right)^3-3 \left(a_1 a_2+a_3 a_2+a_1 a_3\right) \left(a_1+a_2+a_3\right)+3 a_1 a_2 a_3$$

$$a_1^3+a_2^3+a_3^3=-(a^3+3ab+3c)$$

Fourth degree

$x^3+ax^3+bx^2+cx+d=0$

$$a_1^4+a_2^4+a_3^4+a_4^4=\left(a_1+a_2+a_3+a_4\right){}^4-4 \left(a_1 a_2+a_3 a_2+a_4 a_2+a_1 a_3+a_1 a_4+a_3 a_4\right) \left(a_1+a_2+a_3+a_4\right){}^2+4 \left(a_1 a_2 a_3+a_1 a_4 a_3+a_2 a_4 a_3+a_1 a_2 a_4\right) \left(a_1+a_2+a_3+a_4\right)+2 \left(a_1 a_2+a_3 a_2+a_4 a_2+a_1 a_3+a_1 a_4+a_3 a_4\right){}^2-4 a_1 a_2 a_3 a_4$$

$$a_1^4+a_2^4+a_3^4+a_4^4=a^4-4 a^2 b+4 a c+2 b^2-4 d$$

Fifth degree

$$a_1^5+a_2^5+a_3^5+a_4^5+a_5^5=5 a_1 a_2 a_3 a_4 a_5+\left(a_1+a_2+a_3+a_4+a_5\right)^5-5 \left(a_1+a_2+a_3+a_4+a_5\right){}^3 \left(a_1 a_2+a_3 a_2+a_4 a_2+a_5 a_2+a_1 a_3+a_1 a_4+a_3 a_4+a_1 a_5+a_3 a_5+a_4 a_5\right)+5 \left(a_1+a_2+a_3+a_4+a_5\right) \left(a_1 a_2+a_3 a_2+a_4 a_2+a_5 a_2+a_1 a_3+a_1 a_4+a_3 a_4+a_1 a_5+a_3 a_5+a_4 a_5\right)^2+5 \left(a_1+a_2+a_3+a_4+a_5\right){}^2 \left(a_1 a_2 a_3+a_1 a_4 a_3+a_2 a_4 a_3+a_1 a_5 a_3+a_2 a_5 a_3+a_4 a_5 a_3+a_1 a_2 a_4+a_1 a_2 a_5+a_1 a_4 a_5+a_2 a_4 a_5\right)-5 \left(a_1 a_2+a_3 a_2+a_4 a_2+a_5 a_2+a_1 a_3+a_1 a_4+a_3 a_4+a_1 a_5+a_3 a_5+a_4 a_5\right) \left(a_1 a_2 a_3+a_1 a_4 a_3+a_2 a_4 a_3+a_1 a_5 a_3+a_2 a_5 a_3+a_4 a_5 a_3+a_1 a_2 a_4+a_1 a_2 a_5+a_1 a_4 a_5+a_2 a_4 a_5\right)-5(a_1+a_2+a_3+a_4+a_5)\left(a_1 a_2 a_3 a_4+a_1 a_2 a_5 a_4+a_1 a_3 a_5 a_4+a_2 a_3 a_5 a_4+a_1 a_2 a_3 a_5\right.$$


问:
Projection matrix formula intuition
I completely understand how projection matrix formula: $$P = A(A^TA)^{-1}A^T$$is derived from: $$ A^T(b - A\hat{x} ) = 0$$ but what I don't understand is the "story proof" or the "intuition" of the first formula as a linear transformation to the column space of $A$, as it is supposed to be.

In fact I have three specific questions:

why would someone transform $b$ (as a vector to be projected onto $A$) into the "row space" of $A$ before it can be transformed into the column space of $A$?

what specific transformation does the matrix $A^TA$ encode?

why one should transform the vector to the "inverse of the tranformation $A^TA$" before it can be transformed to the column space of $A$?

答:
First note that the column space $R(A)$ is being mapped by $P$ identically to itself. Indeed, for a vector $x$ in the domain, we have
$\require{extpfeil}\Newextarrow{\xmapsto}{5,5}{0x27FC}$

$$Ax \,\xmapsto{A^T} A^TAx \,\xmapsto{(A^TA)^{-1}} x \,\xmapsto{A} Ax.$$

On the other hand, for a vector $y \in R(A)^\perp$ recall that $R(A)^\perp = N(A^T)$ so
$$y\,\xmapsto{A^T} 0 \,\xmapsto{A(A^TA)^{-1}} 0.$$
Finally, the domain can be decomposed as $R(A) \oplus R(A)^\perp$ so with respect to this decomposition we have $P = I \oplus 0$, which means precisely that $P$ is an orthogonal projection onto $R(A)$.

Title: Projection matrix formula intuition


问:
Jacobian Matrix and dot product question
I have a question on how the Jacobian matrix is used in a specific example from Wiki.  I present definitions first and then a question.

The Jacobian is defined as:

$J = \begin{bmatrix} \frac {\partial f}{\partial x_1} ... \frac {\partial f}{\partial x_n} \end{bmatrix} = \begin{bmatrix} \Delta^T f_1 \\ ... \\ \Delta^T f_m \end{bmatrix} = \begin{bmatrix} \frac {\partial f_1}{\partial x_1} ... \frac {\partial f_1}{\partial x_n} \\ ... \\ \frac {\partial f_m}{\partial x_1} ... \frac {\partial f_m}{\partial x_n} \end{bmatrix}$

Wiki then says:
$f(y) = f(x) + J(x) \cdot (y - x)$ is the best linear approximation for $f(y)$ for points close to $x$.

Questions

Does $J(x)$ represent scalar multiplication of the initial point $x$ with the $J$?  I.e. to get the PDs at a point.

If (1) above, how does one distinguish this operation from matrix multiplication?

For $J(x) \cdot (y - x)$ can the dot product, $\cdot$, be omitted as matrix multiplication will result in the same value?  The third form of $J$ is a matrix and dot product $\cdot$ is a vector operation, so this is confusing.

答: The Jacobian matrix $J$ contain partial derivatives $\frac{\partial f_i}{\partial x_j}$ which are themselves functions. The entries of $J(x)$ are these partial derivatives evaluated at $x$, i.e. $\frac{\partial f_i}{\partial x_j}(x)$.


问:
Find $p$ if $(x + 3)$ is a factor of $x^3 - x^2 + px + 15$.
I'm just making sure I answered this correctly.

If $(x+3)$ is a factor, then $P(-3)$ would equal $0$, correct?

Body:
Yes, that's correct. If $(x+3)$ is a factor, then $P(-3) = 0$ by the Factor Theorem. So

\[P(-3) = (-3)^3-(-3)^2-3p+15 = -27-9-3p+15 = -3p-21 = 0 ,\]
and so $p = -7$.


问:
Polynomials that do not exist

Prove that it is not possible to find 4 polynomials $a(x), b(x), c(x), d(x)$ with real coefficients such that $a(x)<b(x)<c(x)<d(x)$ for $0<x<1$ and $b(x)<d(x)<a(x)<c(x)$ for $-1<x<0$.

I have shown that $a[0]=b[0]=c[0]=d[0]$. Please give some hints from this.

答:
We may assume wlog that $a$ is the zero polynomial (namely, replace $b$ with $b-a$ etc.). Then $b,c,d$ are not the zero polynomial, but
with what you found, we have $b(0)=c(0)=d(0)=0$.
So we can write $b(x)=x^{k_b}\cdot \tilde b(x)$, $c(x)=x^{k_c}\cdot \tilde c(x)$, $d(x)=x^{k_d}\cdot \tilde d(x)$ where $\tilde b(0), \tilde c(0), \tilde d(0)$ are all non-zero and $k_b,k_c,k_d$ are positive integers.
Let $m=\min\{k_b,k_c,k_d\}$. Then
$\hat a(x):=\frac {a(x)}{x^m}=0$, $\hat b(x):=\frac {b(x)}{x^m}$, $\hat c(x):=\frac {c(x)}{x^m}$, $\hat d(x):=\frac {d(x)}{x^m}$ are polynomials with
$$\hat a(x)<\hat b(x)<\hat c(x)<\hat d(x) $$
for $0<x<1$ and (depending on parity of $m$) either
$$ \hat b(x)<\hat d(x)<\hat a(x)<\hat c(x)$$
or
$$ \hat b(x)>\hat d(x)>\hat a(x)>\hat c(x)$$
for $-1<x<0$.
In both cases, we can again show that $0=\hat a(0)=\hat b(0)=\hat c(0)=\hat d(0)$.
But $m$ equals one of $k_b,k_c,k_d$, so that the corresponding hatted polynomial is non-zero at $x=0$ -- contradiction!

Title: Polynomials that do not exist


问:
Sign of the eigenvalues of the sum of two matrices with positive eigenvalues
Let $A,B \in \mathcal M_n(\mathbb R^n)$ be two square real matrices of dimension $n$. Suppose that the eigenvalues of $A,B$ are real and strictly positive. Can $A+B$ have a strictly negative eigenvalue?

I know that if $A,B$ commute and are diagonalizable, then they are diagonalizable in a shared basis and therefore the answer to the question is negative.

However, I don’t see how to tackle the general case.

答:
it's worth noting that if this was true then every real Nilpotent matrix plus its transpose would have to be the zero matrix, i.e. every nilpotent matrix would be skew symmetric, hence normal, hence the zero matrix would be the only nilpotent matrix.

i.e. consider an arbitrary real nilpotent matrix as the limit of a sequence

$N_k:= N +\frac{1}{k}I$

so the symmetric matrix $N_k +N_k^T$ would have real non-negative eigenvalues for all $k$ which implies $N+N^T$ has no negative eigenvalues, but being symmetric and traceless $\implies N=-N^T$ for arbitrary nilpotent $N$ which is the contradiction.


问:
explicit formula for sequence with multiple rules? e.g.: $a_n=\{1,2,3, 5,10,15, 25,50,75, … 5^kn,5^k(n+1),5^k(n+2), 5^{k+1}n,..\}$
What is the formula for the sequence obeying that pattern? A base-10 analog could be $\{1,2,3,4,5,6,7,8,9, 10,20,30,.., … 10^kn,10^k(n+1),10^k(n+2),..10^{k+1}n, 10^{k+1}(n+1),10^{k+1}(n+2), . . .\}$, where k is an integer starting with 0 stepping by 1.

What if the sequence doesn't increase or decrease locally over the entire domain, such as with a subsequence of {4,5,3} or a rule using sign-flipping or periodicity (e.g. $(-k)^n$ for subsequences with both even and odd or non-integer or $(-k)^{n+1}$ for sequence otherwise without) and it could feature duplicate values; is there a way to apply a rule admitting only the first (or for that matter, only the second, third, or or any rank of choice, preculuding more and more) instances of a value? E.g.: $b_n$={4,5,3, <s>3,5,</s>1,-3,<s>1</s>} with a rule of |2n|-5 of $n_i$ and simply eliminating duplicate value then continuing to $n_{i+1}$ (instead of continuing to iterate until a valid value arises from operating on $n_i$. The possibility exists also to include omitted(duplicate/sub-duplicate) in the input sequence of (could call it) $n_j$. What is the mathematical or programming way to formulate this? What if you want to take a discrete sequence with rules such as these and regress it to a smooth curve, is that possible?

答:
Setup and Example

This question is a sort of generalization of Solving a recurrence with an alternating pattern e.g. do $\mathrm X$, then do $\mathrm Y$; repeat.

Notation

Note that I do not use curly braces like $\{1,2,...\}$ because those are generally used for sets where order and duplication doesn't matter, not sequences. The convention for this post I will follow is that the index for a sequence starts at $1$: We consider sequences like $(a_1,a_2,\ldots)$.

Analysis

A sequence like $(1,2,3,5,10,15,25,50,75,125,\ldots)$ has two main features: an exponentially growing staggered pattern $(1,1,1,5,5,5,25,25,25,125,\ldots)$ and a multiplying periodic pattern $(1,2,3,1,2,3,1,2,3,1,\ldots)$. If we can find formulas/programs for each of those, then we can just multiply them together to get a formula for the original sequence.

Example

Since "$(1,2,3)$" is a simple increasing sequence, it might obscure some of the general ideas if we use that as an example. For an example that may be more instructive, let's look at a periodic pattern of $(4,5,3,-2,3)$ repeating. And to make sure the staggered exponential pattern is clearly separate, we can use powers of $7$ instead, as in $(1,1,1,1,1,7,7,7,7,7,49,49,\ldots)$. Combined, we get a sequence like: $$\boxed{(4,5,3,-2,3,28,35,21,-14,21,196,245,147,-98,\ldots)}$$

Comment

If we use general methods to handle this sequence, that will basically show how to handle any sequence of this type. As I said in a comment, if you have more restrictions/significant modifications to this type, that would probably be worth asking as a new question with clear examples.

Periodic Sequences

In Math

Showing a pattern and/or using words is a mathematical way to express something. "The periodic sequence of period $5$: $(4,5,3,−2,3,4,5,3,-2,3,4,\ldots)$." is certainly clear enough. But there are other ways to express this, too, which would be more helpful for programming or graphing.

The main idea is that we need to build upon other things we know are periodic.

Remainders

One thing that is periodic are the remainders when dividing. If you divide each of $0,1,2,3,\ldots$ by $5$ and look at the remainders, you get $0,1,2,3,4,0,1,2,3,4,\ldots$. We can use these to distinguish cases.

For example, we could write:
$$a_{n}=\begin{cases}4 & \text{ if the remainder of }n\text{ divided by }5\text{ is }1\\5 & \text{ if the remainder of }n\text{ divided by }5\text{ is }2\\3 & \text{ if the remainder of }n\text{ divided by }5\text{ is }3\\-2 & \text{ if the remainder of }n\text{ divided by }5\text{ is }4\\3 & \text{ if the remainder of }n\text{ divided by }5\text{ is }0\end{cases}$$

If you are familiar with the notation of modular arithmetic, we can rewrite this as $$a_{n}=\begin{cases}
4 & \text{ if }n\equiv1\pmod5\\
5 & \text{ if }n\equiv2\pmod5\\
3 & \text{ if }n\equiv3\pmod5\\
-2 & \text{ if }n\equiv4\pmod5\\
3 & \text{ if }n\equiv0\pmod5
\end{cases}$$

This isn't too common in math outside of programming, but we can use these remainders more directly if we define a function $r$ to give the remainder ("the least nonnegative residue" in modular arithmetic terminology). Then we have:
$$a_{n}=\begin{cases}
4 & \text{ if }r(n)=1\\
5 & \text{ if }r(n)=2\\
3 & \text{ if }r(n)=3\\
-2 & \text{ if }r(n)=4\\
3 & \text{ if }r(n)=0
\end{cases}$$
We can exploit this to make a formula in terms of $r$ that does not use cases. For instance, by finding a degree $5-1$ polynomial to substitute $r$ into that works (this is polynomial interpolation). If $p(r)=ar^4+br^3+cr^2+dr+e$, then we can solve $p(1)=4,p(2)=5,\ldots,p(0)=3$ for $a,b,c,d,e$. Then it turns out that we have $a_n=\frac{1}{8}\left((r(n))^4-10(r(n))^3+23(r(n))^2-6r(n)+24\right)$.

Complex Numbers

Another approach is to generalize a trick used for alternating sequences. Note that $\dfrac{x+y}{2}+(-1)^n\dfrac{x-y}{2}$ is a formula for $(x,y,x,y,x,\ldots)$ that leverages the alternating nature of $(-1)^n$.

For periodic sequences of a longer period like $5$, we can use complex numbers whose powers repeat every $5$ instead. Essentially, we need numbers $z$ that satisfy $z^5=1$. These are 5th-roots of unity. By DeMoivre's Formula, these numbers are $\cos\left(\dfrac{2\pi k}{5}\right)+i\sin\left(\dfrac{2\pi k}{5}\right)$ for $k=0,1,2,3,4$. But if we take $\omega=\cos\left(\dfrac{2\pi}{5}\right)+i\sin\left(\dfrac{2\pi}{5}\right)$ (a primitive root of unity), then the numbers are just $z=\omega^1,\omega^2,\ldots,\omega^5$. (It is common to use Euler's Formula to write $\omega$ as $e^{2\pi i/5}$, etc.)

We can do algebra to find complex numbers $c_1,c_2,c_3,c_4,c_5$ so that $a_n=c_1\omega^n+c_2\omega^{2n}+c_3\omega^{3n}+c_4\omega^{4n}+c_5\omega^{5n}$. (Note that $\omega^{5n}=(\omega^5)^n=1^n=1$.) We just have to solve five equations in five variables for $n=1,2,3,4,5$. There is probably a more elegant way to write it, but in this example, we find that $a_n=\dfrac{1}{10}\left(\alpha_1\omega^n+\alpha_2\omega^{2n}+\alpha_3\omega^{3n}+\alpha_4\omega^{4n}+26\right)$ where $\alpha_1,\alpha_4=1-3\sqrt{5}\mp2i\sqrt{5(5+2\sqrt{5})}$ and $\alpha_2,\alpha_3=1+3\sqrt{5}\mp2i\sqrt{5(5-2\sqrt{5})}$.

This method always works in general, no matter the period $m$ of the sequence. This is because the finite sequences of the first $m^{\text{th}}$ powers of the $m^{\text{th}}$ roots of unity are linearly independent (this can be proven, say, by using the identity mentioned in an answer to "Creating a series that skips every $n^\text{th}$ term?" by Markus Scheuer).

Smooth Curve

Thanks to the complex number approach above, we almost have a formula suitable for making a smooth curve. However, the imaginary parts get in the way. Depending on your graphing device, you may just be able to tell it to ignore the imaginary parts. But instead you can use things like DeMoivre's Theorem to extract the real parts, since we know that the imaginary parts must cancel out anyway. Depending on how you do it, you may get a formula for $a_n$ like $$\dfrac{1}{5}\Bigg((-1)^n\bigg((1+3\sqrt{5})\cos\left(\dfrac{n\pi}{5}\right)+(1-3\sqrt{5})\cos\left(\dfrac{3n\pi}{5}\right)\\-2\sin\left(\dfrac{n\pi}{5}\right)\sqrt{25-10\sqrt5}-2\sin\left(\dfrac{3n\pi}{5}\right)\sqrt{25+10\sqrt5}\bigg)+13\Bigg)\text{.}$$ If any $(-1)^n$s crop up, we can just replace them with $\cos(n\pi)$. Then we can plot this for real values of $n$: Desmos plot

Mathematica produces:

In Programming

Recursively

Even without the analysis above, we could understand periodic sequences like $(4,5,3,−2,3,4,5,3,-2,3,4,\ldots)$ recursively. We could use $a_{n}=\begin{cases}
4 & \text{ if }n=1\\
5 & \text{ if }n=2\\
3 & \text{ if }n=3\\
-2 & \text{ if }n=4\\
3 & \text{ if }n=5\\
a_{n-5} & \text{ if }n>5
\end{cases}$.

In Python, this could look something like:

```<code>def a(n):
    if n==1:
        return 4
    elif n==2:
        return 5
    elif n==3:
        return 3
    elif n==4:
        return -2
    elif n==5:
        return 3
    else:
        return a(n-5)
</code>```

Modular Arithmetic

Most programming language have a "modulo" operator/function for finding the remainder that we denoted $r$ above. In many programming languages, at least if a is positive, a%b is "the remainder upon division of a by b". So we can use the cases or polynomial solutions from our work above. In Python, those ideas could be implemented as ((n%5)**4-10*(n%5)**3+23*(n%5)**2-6*(n%5)+24)//8 and

```<code>def a(n):
    if n%5==1:
        return 4
    elif n%5==2:
        return 5
    elif n%5==3:
        return 3
    elif n%5==4:
        return -2
    elif n%5==0:
        return 3
</code>```

Trigonometry

Of course, the trigonometry formula used for graphing a smooth curve could certainly be programmed in as well, though this will be far less efficient for calculating the integers in the sequence. Rounding to the nearest integer to produce the original sequence, the following works in Python (after import math): round((13+math.cos(n*math.pi)*((1+3*math.sqrt(5))*math.cos(n*math.pi/5)+(1-3*math.sqrt(5))*math.cos(3*n*math.pi/5)-2*(math.sqrt(25-10*math.sqrt(5)))*math.sin(n*math.pi/5)-2*(math.sqrt(25+10*math.sqrt(5)))*math.sin(3*n*math.pi/5)))/5)

Staggered Sequences

General Idea

In order to make a staggered pattern of any kind (exponential or not), we basically need to take a basic staggered sequence like $(0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,\ldots)$ and feed that as input into whatever function we want, like $7^x$.

In Math

"The sequence that goes up $1$ every $5$ terms: $(0,0,0,0,0,1,1,1,1,1,2,,\ldots)$." is certainly clear enough. But there are other ways to express this, too, which would be more helpful for programming or graphing.

In order to make a basic staggered sequence, you can use a function that outputs the greatest integer less than or equal to the input. This is sometimes called in math the "greatest integer function" and sometimes denoted $[x]$ or $[\!\!|x|\!\!]$. But it is also called "floor" and unambiguously denoted $\lfloor x\rfloor$ in math (and probably always called "floor" in programming).

For example, $\left\lfloor \frac{n}{5}\right\rfloor$ yields $(0,0,0,0,1,1,1,1,1,2,\ldots)$ (since our $n$ starts at $1$). So $\left\lfloor \frac{n-1}{5}\right\rfloor$ gives the basic sequence $(0,0,0,0,0,1,1,1,1,1,2,\ldots)$. And $7^{\left\lfloor (n-1)/5\right\rfloor}$ yields $(1,1,1,1,1,7,7,7,7,7,49,49,49,49,49,\ldots)$.

Smooth Curve

If we care about a basic staggered sequence in isolation, then we can use an algebraic trick to turn it into a periodic sequence. For nonnegative $m$ (e.g. $m=n-1$), $\left\lfloor\dfrac{m}{5}\right\rfloor=\dfrac{m-r_{m}}{5}$ where $r_{m}$ is the remainder upon division of $m$ by $5$. But the sequence of $r_{m}$ values is periodic. For $m=0,1,\ldots$, $r_m=0,1,2,3,4,0,1,2,3,4,0,\ldots$.

Then we can apply the tools above for handling periodic sequences to get a formula for $r_m$ and then for a basic staggered sequence like $(0,0,0,0,0,1,1,1,1,1,\ldots)$. We could substitute this into another function like $7^x$, as desired.

However, for the types of sequences we're focusing on, we don't need to go through this work, as we'll see later.

In Programming

Recursively

Even without the analysis above, we could understand staggered sequences like $(1,1,1,1,1,7,7,7,7,7,49,49,49,49,49,\ldots)$ recursively. We could use $a_{n}=\begin{cases}1 & \text{ if }n\le5\\7*a_{n-5} & \text{ otherwise}\end{cases}$. Or $b_n=\begin{cases}0 & \text{ if }n\le5\\1+b_{n-5} & \text{ otherwise}\end{cases}$ for the basic sequence $(0,0,0,0,0,1,1,1,1,1,2,\ldots)$.

In Python, this could look like:

```<code>def a(n):
    if n<=5:
        return 1
    else:
        return 7*a(n-5)
</code>```

Non-Recursively

However, pretty much every programming language has something like floor (at least in a math library/module), and some have "integer/floor division" since $\lfloor a/b\rfloor$ is so common. So we can write $a_n$ in Python as: (after import math) 7**(math.floor((n-1)/5)) or just 7**((n-1)//5).

Putting it Together

In Math

As always, we can just describe things in words:
"The sequence $(4,5,3,-2,3,28,35,21,-14,21,196,245,147,-98,\ldots)$ where each five entries we multiply the previous five by $7$." is probably clear enough.

As mentioned in the beginning, in order to produce the original sequence $(4,5,3,-2,3,28,35,21,-14,21,196,245,147,-98,\ldots)$, we can just multiply together something that produces $(4,5,3,-2,3,4,5,3,-2,3,\ldots)$ and something that produces $(1,1,1,1,1,7,7,7,7,7,49,49,49,49,49,243,\ldots)$.

For example:
$$a_{n}=\begin{cases}4*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }1\\5*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }2\\3*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }3\\-2*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }4\\3*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }0\end{cases}$$

To take advantage of the $(n-1)$ appearing in the floor function, we can rewrite this as $$a_{n}=\begin{cases}4*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }0\\5*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }1\\3*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }2\\-2*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }3\\3*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }4\end{cases}$$

Using the remainder observation about the floor function and the $r(n)$ notation for remainder upon division by $5$, we can rewrite this as $$a_{n}=7^{\left(\dfrac{n-1-r(n-1)}{5}\right)}*\begin{cases}
4 & \text{ if }r(n-1)=0\\
5 & \text{ if }r(n-1)=1\\
3 & \text{ if }r(n-1)=2\\
-2 & \text{ if }r(n-1)=3\\
3 & \text{ if }r(n-1)=4
\end{cases}$$

Using polynomial interpolation, and setting $m=n-1$ and $r=r(m)$, we can write $a_n=a_{m+1}=7^{\left(\dfrac{m-r}{5}\right)}*\dfrac{13r^4-78r^3+107r^2-18r+96}{24}$, for instance.

Smooth Curve

Since the powers of $\omega$ can be used to break up the fives cases of the remainder, and we know that the floor function is a function that breaks down into cases, we can start from the $7^{\left(\dfrac{n-1-r(n-1)}{5}\right)}*\cdots$ form above before doing the algebra with $\omega$, and don't need to handle the periodicity hidden inside of floor separately. In other words, write $$a_{n}=\begin{cases}
4*7^{\left(\dfrac{n-1}{5}\right)} & \text{ if }r(n)=1\\
5*7^{\left(\dfrac{n-2}{5}\right)} & \text{ if }r(n)=2\\
3*7^{\left(\dfrac{n-3}{5}\right)} & \text{ if }r(n)=3\\
-2*7^{\left(\dfrac{n-4}{5}\right)} & \text{ if }r(n)=4\\
3*7^{\left(\dfrac{n-5}{5}\right)} & \text{ if }r(n)=0
\end{cases}$$ and then factor out $7^{n/5}$ so that we are left with a (new) periodic sequence. Then we can find a trigonometric form for the periodic sequence. Then the $r$s can be replaced by $n$s because $r(n)$ and the $\omega$ business are periodic.

We obtain a huge formula for $a_n$:
$$\dfrac{7^{(n-5)/5}}{20 \sqrt{5+\sqrt{5}}} \left(\sqrt{2} \sqrt[5]{7} \left(2 \left(5+\sqrt{5}-3 \sqrt{5} \sqrt[5]{7}+5 \sqrt{5} 7^{2/5}+10\ 7^{3/5}+2
   \sqrt{5} 7^{3/5}\right) \sin \left(\frac{2 \pi  n}{5}\right)+\left(4 \sqrt{5}+15 \sqrt[5]{7}+3 \sqrt{5} \sqrt[5]{7}-25\ 7^{2/5}-5
   \sqrt{5} 7^{2/5}+8 \sqrt{5} 7^{3/5}\right) \sin \left(\frac{4 \pi  n}{5}\right)-\left(4 \sqrt{5}+15 \sqrt[5]{7}+3 \sqrt{5}
   \sqrt[5]{7}-25\ 7^{2/5}-5 \sqrt{5} 7^{2/5}+8 \sqrt{5} 7^{3/5}\right) \sin \left(\frac{6 \pi  n}{5}\right)-2 \left(5+\sqrt{5}-3
   \sqrt{5} \sqrt[5]{7}+5 \sqrt{5} 7^{2/5}+10\ 7^{3/5}+2 \sqrt{5} 7^{3/5}\right) \sin \left(\frac{8 \pi
   n}{5}\right)\right)+\sqrt{5+\sqrt{5}} \left(\left(12+2 \sqrt[5]{7}-2 \sqrt{5} \sqrt[5]{7}-3\ 7^{2/5}-3 \sqrt{5} 7^{2/5}-5\ 7^{3/5}-5
   \sqrt{5} 7^{3/5}-4\ 7^{4/5}+4 \sqrt{5} 7^{4/5}\right) \cos \left(\frac{2 \pi  n}{5}\right)-\left(-12-2 \sqrt[5]{7}-2 \sqrt{5}
   \sqrt[5]{7}+3\ 7^{2/5}-3 \sqrt{5} 7^{2/5}+5\ 7^{3/5}-5 \sqrt{5} 7^{3/5}+4\ 7^{4/5}+4 \sqrt{5} 7^{4/5}\right) \cos \left(\frac{4 \pi
   n}{5}\right)-\left(-12-2 \sqrt[5]{7}-2 \sqrt{5} \sqrt[5]{7}+3\ 7^{2/5}-3 \sqrt{5} 7^{2/5}+5\ 7^{3/5}-5 \sqrt{5} 7^{3/5}+4\ 7^{4/5}+4
   \sqrt{5} 7^{4/5}\right) \cos \left(\frac{6 \pi  n}{5}\right)+\left(12+2 \sqrt[5]{7}-2 \sqrt{5} \sqrt[5]{7}-3\ 7^{2/5}-3 \sqrt{5}
   7^{2/5}-5\ 7^{3/5}-5 \sqrt{5} 7^{3/5}-4\ 7^{4/5}+4 \sqrt{5} 7^{4/5}\right) \cos \left(\frac{8 \pi  n}{5}\right)+16\ 7^{4/5}+20\
   7^{3/5}+12\ 7^{2/5}-8 \sqrt[5]{7}+12\right)\right)$$

The graph looks like this:

In Programming

There are no new programming ideas/functions that are relevant here. Just combine the existing programs or write the above formulas as a program using the same sorts of functions/techniques that were used for simpler cases.

Body:
Setup and Example

This question is a sort of generalization of Solving a recurrence with an alternating pattern e.g. do $\mathrm X$, then do $\mathrm Y$; repeat.

Notation

Note that I do not use curly braces like $\{1,2,...\}$ because those are generally used for sets where order and duplication doesn't matter, not sequences. The convention for this post I will follow is that the index for a sequence starts at $1$: We consider sequences like $(a_1,a_2,\ldots)$.

Analysis

A sequence like $(1,2,3,5,10,15,25,50,75,125,\ldots)$ has two main features: an exponentially growing staggered pattern $(1,1,1,5,5,5,25,25,25,125,\ldots)$ and a multiplying periodic pattern $(1,2,3,1,2,3,1,2,3,1,\ldots)$. If we can find formulas/programs for each of those, then we can just multiply them together to get a formula for the original sequence.

Example

Since "$(1,2,3)$" is a simple increasing sequence, it might obscure some of the general ideas if we use that as an example. For an example that may be more instructive, let's look at a periodic pattern of $(4,5,3,-2,3)$ repeating. And to make sure the staggered exponential pattern is clearly separate, we can use powers of $7$ instead, as in $(1,1,1,1,1,7,7,7,7,7,49,49,\ldots)$. Combined, we get a sequence like: $$\boxed{(4,5,3,-2,3,28,35,21,-14,21,196,245,147,-98,\ldots)}$$

Comment

If we use general methods to handle this sequence, that will basically show how to handle any sequence of this type. As I said in a comment, if you have more restrictions/significant modifications to this type, that would probably be worth asking as a new question with clear examples.

Periodic Sequences

In Math

Showing a pattern and/or using words is a mathematical way to express something. "The periodic sequence of period $5$: $(4,5,3,−2,3,4,5,3,-2,3,4,\ldots)$." is certainly clear enough. But there are other ways to express this, too, which would be more helpful for programming or graphing.

The main idea is that we need to build upon other things we know are periodic.

Remainders

One thing that is periodic are the remainders when dividing. If you divide each of $0,1,2,3,\ldots$ by $5$ and look at the remainders, you get $0,1,2,3,4,0,1,2,3,4,\ldots$. We can use these to distinguish cases.

For example, we could write:
$$a_{n}=\begin{cases}4 & \text{ if the remainder of }n\text{ divided by }5\text{ is }1\\5 & \text{ if the remainder of }n\text{ divided by }5\text{ is }2\\3 & \text{ if the remainder of }n\text{ divided by }5\text{ is }3\\-2 & \text{ if the remainder of }n\text{ divided by }5\text{ is }4\\3 & \text{ if the remainder of }n\text{ divided by }5\text{ is }0\end{cases}$$

If you are familiar with the notation of modular arithmetic, we can rewrite this as $$a_{n}=\begin{cases}
4 & \text{ if }n\equiv1\pmod5\\
5 & \text{ if }n\equiv2\pmod5\\
3 & \text{ if }n\equiv3\pmod5\\
-2 & \text{ if }n\equiv4\pmod5\\
3 & \text{ if }n\equiv0\pmod5
\end{cases}$$

This isn't too common in math outside of programming, but we can use these remainders more directly if we define a function $r$ to give the remainder ("the least nonnegative residue" in modular arithmetic terminology). Then we have:
$$a_{n}=\begin{cases}
4 & \text{ if }r(n)=1\\
5 & \text{ if }r(n)=2\\
3 & \text{ if }r(n)=3\\
-2 & \text{ if }r(n)=4\\
3 & \text{ if }r(n)=0
\end{cases}$$
We can exploit this to make a formula in terms of $r$ that does not use cases. For instance, by finding a degree $5-1$ polynomial to substitute $r$ into that works (this is polynomial interpolation). If $p(r)=ar^4+br^3+cr^2+dr+e$, then we can solve $p(1)=4,p(2)=5,\ldots,p(0)=3$ for $a,b,c,d,e$. Then it turns out that we have $a_n=\frac{1}{8}\left((r(n))^4-10(r(n))^3+23(r(n))^2-6r(n)+24\right)$.

Complex Numbers

Another approach is to generalize a trick used for alternating sequences. Note that $\dfrac{x+y}{2}+(-1)^n\dfrac{x-y}{2}$ is a formula for $(x,y,x,y,x,\ldots)$ that leverages the alternating nature of $(-1)^n$.

For periodic sequences of a longer period like $5$, we can use complex numbers whose powers repeat every $5$ instead. Essentially, we need numbers $z$ that satisfy $z^5=1$. These are 5th-roots of unity. By DeMoivre's Formula, these numbers are $\cos\left(\dfrac{2\pi k}{5}\right)+i\sin\left(\dfrac{2\pi k}{5}\right)$ for $k=0,1,2,3,4$. But if we take $\omega=\cos\left(\dfrac{2\pi}{5}\right)+i\sin\left(\dfrac{2\pi}{5}\right)$ (a primitive root of unity), then the numbers are just $z=\omega^1,\omega^2,\ldots,\omega^5$. (It is common to use Euler's Formula to write $\omega$ as $e^{2\pi i/5}$, etc.)

We can do algebra to find complex numbers $c_1,c_2,c_3,c_4,c_5$ so that $a_n=c_1\omega^n+c_2\omega^{2n}+c_3\omega^{3n}+c_4\omega^{4n}+c_5\omega^{5n}$. (Note that $\omega^{5n}=(\omega^5)^n=1^n=1$.) We just have to solve five equations in five variables for $n=1,2,3,4,5$. There is probably a more elegant way to write it, but in this example, we find that $a_n=\dfrac{1}{10}\left(\alpha_1\omega^n+\alpha_2\omega^{2n}+\alpha_3\omega^{3n}+\alpha_4\omega^{4n}+26\right)$ where $\alpha_1,\alpha_4=1-3\sqrt{5}\mp2i\sqrt{5(5+2\sqrt{5})}$ and $\alpha_2,\alpha_3=1+3\sqrt{5}\mp2i\sqrt{5(5-2\sqrt{5})}$.

This method always works in general, no matter the period $m$ of the sequence. This is because the finite sequences of the first $m^{\text{th}}$ powers of the $m^{\text{th}}$ roots of unity are linearly independent (this can be proven, say, by using the identity mentioned in an answer to "Creating a series that skips every $n^\text{th}$ term?" by Markus Scheuer).

Smooth Curve

Thanks to the complex number approach above, we almost have a formula suitable for making a smooth curve. However, the imaginary parts get in the way. Depending on your graphing device, you may just be able to tell it to ignore the imaginary parts. But instead you can use things like DeMoivre's Theorem to extract the real parts, since we know that the imaginary parts must cancel out anyway. Depending on how you do it, you may get a formula for $a_n$ like $$\dfrac{1}{5}\Bigg((-1)^n\bigg((1+3\sqrt{5})\cos\left(\dfrac{n\pi}{5}\right)+(1-3\sqrt{5})\cos\left(\dfrac{3n\pi}{5}\right)\\-2\sin\left(\dfrac{n\pi}{5}\right)\sqrt{25-10\sqrt5}-2\sin\left(\dfrac{3n\pi}{5}\right)\sqrt{25+10\sqrt5}\bigg)+13\Bigg)\text{.}$$ If any $(-1)^n$s crop up, we can just replace them with $\cos(n\pi)$. Then we can plot this for real values of $n$: Desmos plot

Mathematica produces:

In Programming

Recursively

Even without the analysis above, we could understand periodic sequences like $(4,5,3,−2,3,4,5,3,-2,3,4,\ldots)$ recursively. We could use $a_{n}=\begin{cases}
4 & \text{ if }n=1\\
5 & \text{ if }n=2\\
3 & \text{ if }n=3\\
-2 & \text{ if }n=4\\
3 & \text{ if }n=5\\
a_{n-5} & \text{ if }n>5
\end{cases}$.

In Python, this could look something like:

def a(n):
    if n==1:
        return 4
    elif n==2:
        return 5
    elif n==3:
        return 3
    elif n==4:
        return -2
    elif n==5:
        return 3
    else:
        return a(n-5)

Modular Arithmetic

Most programming language have a "modulo" operator/function for finding the remainder that we denoted $r$ above. In many programming languages, at least if a is positive, a%b is "the remainder upon division of a by b". So we can use the cases or polynomial solutions from our work above. In Python, those ideas could be implemented as ((n%5)**4-10*(n%5)**3+23*(n%5)**2-6*(n%5)+24)//8 and

def a(n):
    if n%5==1:
        return 4
    elif n%5==2:
        return 5
    elif n%5==3:
        return 3
    elif n%5==4:
        return -2
    elif n%5==0:
        return 3

Trigonometry

Of course, the trigonometry formula used for graphing a smooth curve could certainly be programmed in as well, though this will be far less efficient for calculating the integers in the sequence. Rounding to the nearest integer to produce the original sequence, the following works in Python (after import math): round((13+math.cos(n*math.pi)*((1+3*math.sqrt(5))*math.cos(n*math.pi/5)+(1-3*math.sqrt(5))*math.cos(3*n*math.pi/5)-2*(math.sqrt(25-10*math.sqrt(5)))*math.sin(n*math.pi/5)-2*(math.sqrt(25+10*math.sqrt(5)))*math.sin(3*n*math.pi/5)))/5)

Staggered Sequences

General Idea

In order to make a staggered pattern of any kind (exponential or not), we basically need to take a basic staggered sequence like $(0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,\ldots)$ and feed that as input into whatever function we want, like $7^x$.

In Math

"The sequence that goes up $1$ every $5$ terms: $(0,0,0,0,0,1,1,1,1,1,2,,\ldots)$." is certainly clear enough. But there are other ways to express this, too, which would be more helpful for programming or graphing.

In order to make a basic staggered sequence, you can use a function that outputs the greatest integer less than or equal to the input. This is sometimes called in math the "greatest integer function" and sometimes denoted $[x]$ or $[\!\!|x|\!\!]$. But it is also called "floor" and unambiguously denoted $\lfloor x\rfloor$ in math (and probably always called "floor" in programming).

For example, $\left\lfloor \frac{n}{5}\right\rfloor$ yields $(0,0,0,0,1,1,1,1,1,2,\ldots)$ (since our $n$ starts at $1$). So $\left\lfloor \frac{n-1}{5}\right\rfloor$ gives the basic sequence $(0,0,0,0,0,1,1,1,1,1,2,\ldots)$. And $7^{\left\lfloor (n-1)/5\right\rfloor}$ yields $(1,1,1,1,1,7,7,7,7,7,49,49,49,49,49,\ldots)$.

Smooth Curve

If we care about a basic staggered sequence in isolation, then we can use an algebraic trick to turn it into a periodic sequence. For nonnegative $m$ (e.g. $m=n-1$), $\left\lfloor\dfrac{m}{5}\right\rfloor=\dfrac{m-r_{m}}{5}$ where $r_{m}$ is the remainder upon division of $m$ by $5$. But the sequence of $r_{m}$ values is periodic. For $m=0,1,\ldots$, $r_m=0,1,2,3,4,0,1,2,3,4,0,\ldots$.

Then we can apply the tools above for handling periodic sequences to get a formula for $r_m$ and then for a basic staggered sequence like $(0,0,0,0,0,1,1,1,1,1,\ldots)$. We could substitute this into another function like $7^x$, as desired.

However, for the types of sequences we're focusing on, we don't need to go through this work, as we'll see later.

In Programming

Recursively

Even without the analysis above, we could understand staggered sequences like $(1,1,1,1,1,7,7,7,7,7,49,49,49,49,49,\ldots)$ recursively. We could use $a_{n}=\begin{cases}1 & \text{ if }n\le5\\7*a_{n-5} & \text{ otherwise}\end{cases}$. Or $b_n=\begin{cases}0 & \text{ if }n\le5\\1+b_{n-5} & \text{ otherwise}\end{cases}$ for the basic sequence $(0,0,0,0,0,1,1,1,1,1,2,\ldots)$.

In Python, this could look like:

def a(n):
    if n<=5:
        return 1
    else:
        return 7*a(n-5)

Non-Recursively

However, pretty much every programming language has something like floor (at least in a math library/module), and some have "integer/floor division" since $\lfloor a/b\rfloor$ is so common. So we can write $a_n$ in Python as: (after import math) 7**(math.floor((n-1)/5)) or just 7**((n-1)//5).

Putting it Together

In Math

As always, we can just describe things in words:
"The sequence $(4,5,3,-2,3,28,35,21,-14,21,196,245,147,-98,\ldots)$ where each five entries we multiply the previous five by $7$." is probably clear enough.

As mentioned in the beginning, in order to produce the original sequence $(4,5,3,-2,3,28,35,21,-14,21,196,245,147,-98,\ldots)$, we can just multiply together something that produces $(4,5,3,-2,3,4,5,3,-2,3,\ldots)$ and something that produces $(1,1,1,1,1,7,7,7,7,7,49,49,49,49,49,243,\ldots)$.

For example:
$$a_{n}=\begin{cases}4*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }1\\5*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }2\\3*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }3\\-2*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }4\\3*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n\text{ divided by }5\text{ is }0\end{cases}$$

To take advantage of the $(n-1)$ appearing in the floor function, we can rewrite this as $$a_{n}=\begin{cases}4*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }0\\5*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }1\\3*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }2\\-2*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }3\\3*7^{\lfloor(n-1)/5\rfloor} & \text{ if the remainder of }n-1\text{ divided by }5\text{ is }4\end{cases}$$

Using the remainder observation about the floor function and the $r(n)$ notation for remainder upon division by $5$, we can rewrite this as $$a_{n}=7^{\left(\dfrac{n-1-r(n-1)}{5}\right)}*\begin{cases}
4 & \text{ if }r(n-1)=0\\
5 & \text{ if }r(n-1)=1\\
3 & \text{ if }r(n-1)=2\\
-2 & \text{ if }r(n-1)=3\\
3 & \text{ if }r(n-1)=4
\end{cases}$$

Using polynomial interpolation, and setting $m=n-1$ and $r=r(m)$, we can write $a_n=a_{m+1}=7^{\left(\dfrac{m-r}{5}\right)}*\dfrac{13r^4-78r^3+107r^2-18r+96}{24}$, for instance.

Smooth Curve

Since the powers of $\omega$ can be used to break up the fives cases of the remainder, and we know that the floor function is a function that breaks down into cases, we can start from the $7^{\left(\dfrac{n-1-r(n-1)}{5}\right)}*\cdots$ form above before doing the algebra with $\omega$, and don't need to handle the periodicity hidden inside of floor separately. In other words, write $$a_{n}=\begin{cases}
4*7^{\left(\dfrac{n-1}{5}\right)} & \text{ if }r(n)=1\\
5*7^{\left(\dfrac{n-2}{5}\right)} & \text{ if }r(n)=2\\
3*7^{\left(\dfrac{n-3}{5}\right)} & \text{ if }r(n)=3\\
-2*7^{\left(\dfrac{n-4}{5}\right)} & \text{ if }r(n)=4\\
3*7^{\left(\dfrac{n-5}{5}\right)} & \text{ if }r(n)=0
\end{cases}$$ and then factor out $7^{n/5}$ so that we are left with a (new) periodic sequence. Then we can find a trigonometric form for the periodic sequence. Then the $r$s can be replaced by $n$s because $r(n)$ and the $\omega$ business are periodic.

We obtain a huge formula for $a_n$:
$$\dfrac{7^{(n-5)/5}}{20 \sqrt{5+\sqrt{5}}} \left(\sqrt{2} \sqrt[5]{7} \left(2 \left(5+\sqrt{5}-3 \sqrt{5} \sqrt[5]{7}+5 \sqrt{5} 7^{2/5}+10\ 7^{3/5}+2
   \sqrt{5} 7^{3/5}\right) \sin \left(\frac{2 \pi  n}{5}\right)+\left(4 \sqrt{5}+15 \sqrt[5]{7}+3 \sqrt{5} \sqrt[5]{7}-25\ 7^{2/5}-5
   \sqrt{5} 7^{2/5}+8 \sqrt{5} 7^{3/5}\right) \sin \left(\frac{4 \pi  n}{5}\right)-\left(4 \sqrt{5}+15 \sqrt[5]{7}+3 \sqrt{5}
   \sqrt[5]{7}-25\ 7^{2/5}-5 \sqrt{5} 7^{2/5}+8 \sqrt{5} 7^{3/5}\right) \sin \left(\frac{6 \pi  n}{5}\right)-2 \left(5+\sqrt{5}-3
   \sqrt{5} \sqrt[5]{7}+5 \sqrt{5} 7^{2/5}+10\ 7^{3/5}+2 \sqrt{5} 7^{3/5}\right) \sin \left(\frac{8 \pi
   n}{5}\right)\right)+\sqrt{5+\sqrt{5}} \left(\left(12+2 \sqrt[5]{7}-2 \sqrt{5} \sqrt[5]{7}-3\ 7^{2/5}-3 \sqrt{5} 7^{2/5}-5\ 7^{3/5}-5
   \sqrt{5} 7^{3/5}-4\ 7^{4/5}+4 \sqrt{5} 7^{4/5}\right) \cos \left(\frac{2 \pi  n}{5}\right)-\left(-12-2 \sqrt[5]{7}-2 \sqrt{5}
   \sqrt[5]{7}+3\ 7^{2/5}-3 \sqrt{5} 7^{2/5}+5\ 7^{3/5}-5 \sqrt{5} 7^{3/5}+4\ 7^{4/5}+4 \sqrt{5} 7^{4/5}\right) \cos \left(\frac{4 \pi
   n}{5}\right)-\left(-12-2 \sqrt[5]{7}-2 \sqrt{5} \sqrt[5]{7}+3\ 7^{2/5}-3 \sqrt{5} 7^{2/5}+5\ 7^{3/5}-5 \sqrt{5} 7^{3/5}+4\ 7^{4/5}+4
   \sqrt{5} 7^{4/5}\right) \cos \left(\frac{6 \pi  n}{5}\right)+\left(12+2 \sqrt[5]{7}-2 \sqrt{5} \sqrt[5]{7}-3\ 7^{2/5}-3 \sqrt{5}
   7^{2/5}-5\ 7^{3/5}-5 \sqrt{5} 7^{3/5}-4\ 7^{4/5}+4 \sqrt{5} 7^{4/5}\right) \cos \left(\frac{8 \pi  n}{5}\right)+16\ 7^{4/5}+20\
   7^{3/5}+12\ 7^{2/5}-8 \sqrt[5]{7}+12\right)\right)$$

The graph looks like this:

In Programming

There are no new programming ideas/functions that are relevant here. Just combine the existing programs or write the above formulas as a program using the same sorts of functions/techniques that were used for simpler cases.


问:
Coupled Measures, conditional expectation condition interpretation
If we define two random variable by knowing their joint law ($ \Pi(\mu, \nu) $ is any measure on $\mathbb R^2$ with marginals $\mu,\nu$), with the additional property related to their conditional expectation :

$$ \pi = \text{Law} (X, Y) \in \Pi(\mu, \nu) : \forall x \in \mathbb R, \ \mathbb E ( Y | X = x) = x,  \mu-\text{almost surely.} $$

How one  interprets $\mathbb E ( Y | X = x) = x$ here? I struggle to understand what it means physically and geometrically, but also if it is related to some kind of projection? Any help is welcomed.

My idea si far is that the mean of the slice with $X=x$ equals $x$, but it seems to be an odd condition to set. The setting of work is optimal transport and curtains theory.

答:
The convincing answer I found after studying actively the topic, is that $X$ is actually the best knowledge we have of $Y$. This is exactly what appears in martingales, where $$\mathbb E [ X_{n+1} | X_n, X_{n-1}, \cdots ] =  X_n $$

in this case, we are looking at some kind of sequence of random variables through $\{X,Y\}$. Another important thing, is that it does not say anything to the rest of the marginals. If we would like to order them (convex order for example), we would need some other constrains. I am thinking for example of Strassen's theorem :

Defining for $\pi \in \mathcal M(\mathbb R^d)$, $C_{\pi} = \int (y - x )^+ d \pi ( y )$.
\begin{align}
& \mu   \preceq_C \nu \\
&\iff   \notag \\
&\mathbb E (\mu) = \mathbb E ( \nu ) \text{ and } \forall x \in \mathbb R, C_{\mu} (x) \leq C_{\nu} (x)
\end{align}


问:
Hitting time of simple random walk
Consider a random walk on $\mathbb{N}_0$, starting in $0$ with transition probabilities
$$p(0,1)=1 \ \text{ and }\  p(n,n-1)=p(n,n+1)=0.5 \ \text{ for }\  n>0.$$

What is the expected time $\mathbb{E}[T_{100}]$ before hitting the value $100$?

I have trouble solving this question. Other questions on this website cover e.g. the hitting times of hitting either boundary when starting in a point in the middle.. But the hard part here is that the left boundary bounces off but does not absorb. How to solve this problem?

答:
Let $c_i$ be the expected hitting time when starting in state $i$.
We have
\begin{align}
c_{100} &= 0
\\
c_i &= \frac{1}{2} (c_{i-1} + c_{i+1}) + 1 & 0 < i < 100
\\
c_0 &= c_1 + 1.
\end{align}

I think you can show that $c_i = c_{i+1} + 2i + 1$ (for $0 \le i \le 99$) by induction, which will then lead you to the answer.

Title: Hitting time of simple random walk


问:
Lines on a singular cubic surface
How many lines the cubic surfaces $xyz=w^3 \in \mathbb P^3$ has? I found only three: $x=w=0$, $y=w=0$ and $z=w=0$. How to prove that there are no other lines? Also, this surface is singular, is it possible to calculate these lines with some natural multiplicities, summing up to 27?</p>

答:
A line not in the plane at infinity has a parametric equation of the form
$$x= x_0 + a t\\
y = y_0+ b t\\
z = z_0 + c t$$
If it were contained in the (finite) part of this surface $x y z = 1$, then we would have
$$(x_0 + a t)(y_0 + b t)(z_0 + c t) = 1$$
for every $t$. Note that $a$, $b$,$c$ are not all $0$, so on the LHS we have a polynomial in $t$ of degree $\ge 1$. We get a contradiction.

Title: Lines on a singular cubic surface


Title: Hitting time of simple random walk

Body:
Consider a random walk on $\mathbb{N}_0$, starting in $0$ with transition probabilities
$$p(0,1)=1 \ \text{ and }\  p(n,n-1)=p(n,n+1)=0.5 \ \text{ for }\  n>0.$$

What is the expected time $\mathbb{E}[T_{100}]$ before hitting the value $100$?

I have trouble solving this question. Other questions on this website cover e.g. the hitting times of hitting either boundary when starting in a point in the middle.. But the hard part here is that the left boundary bounces off but does not absorb. How to solve this problem?

Body:
Let $\mathbb{E}[T_{100}(n)]$ be the expected time to hit $100$ starting from $n$

Then you have $$\mathbb{E}[T_{100}(100)]=0$$ $$\mathbb{E}[T_{100}(0)]=1+\mathbb{E}[T_{100}(1)]$$ $$\mathbb{E}[T_{100}(n)]=1+\tfrac12 \mathbb{E}[T_{100}(n-1)] + \tfrac12 \mathbb{E}[T_{100}(n+1)] $$ for $0 < n<100$, giving you $101$ equations in $101$ unknowns.  So solve it.

You get

$\mathbb{E}[T_{100}(0)]=1+\mathbb{E}[T_{100}(1)]$ and $\mathbb{E}[T_{100}(1)]=1+\tfrac12 \mathbb{E}[T_{100}(0)] + \tfrac12 \mathbb{E}[T_{100}(2)] $ implying $\mathbb{E}[T_{100}(1)]=3+\mathbb{E}[T_{100}(2)]$ and $\mathbb{E}[T_{100}(0)]=4+\mathbb{E}[T_{100}(2)]$.

Similarly the next step implies $\mathbb{E}[T_{100}(2)]=5+\mathbb{E}[T_{100}(3)]$ and $\mathbb{E}[T_{100}(0)]=9+\mathbb{E}[T_{100}(3)]$.

It then becomes an easy induction to show  $\mathbb{E}[T_{100}(n-1)]=(2n-1)+\mathbb{E}[T_{100}(n)]$ and $\mathbb{E}[T_{100}(0)]=n^2+\mathbb{E}[T_{100}(n)]$

and thus the result you want $\mathbb{E}[T_{100}(0)]=100^2+\mathbb{E}[T_{100}(100)]=10000$


问:
Is any relation that is reflexive also symmetric and also transitive?
For an example relation $R$ on $\{1,2\}$ of $\{(1,1), (2,2)\}$.

This relation is reflexive, but is it also symmetric and transitive?

It appears to be symmetric because $(1,1)$ is present as is $(1,1)$, and $(2,2)$ is present as is $(2,2)$, in other words, if $x = 1$ and $y = 1$, then $(x,y)$ is present and $(y,x)$ is present.

Following from that, it also appears to be transitive because for $x = 1, y = 1$ and $z = 1$, $(x,y)$ is present, $(y,z)$ is present, and so is $(x,z)$.

Is there some restriction on symmetric and transitive relations in that the elements of the ordered pair cannot be equal?

答: The diagonal of a Cartesian product is always an equivalence relation (trivially), and also an order(!) relation (also trivially). The mucky aspect that intervenes in the definition of equivalence and order relations is the conditional connective: as opposed to reflexivity, symmetry, anti-symmetry, and transitivity are stated in conditional terms. As such, unlike reflexivity, neither of the latter three forces an ontological commitment, hence any ties between the two sets (the source and the target of the Cartesian product) besides the diagonal are optional.


问:
Body Volume Rotation Of Shape Question
I want to know if I`m following the correct step to evaluate the body volume rotation of shape.

my function is : $$y=ln(x)$$ and I want to evaluate the body volume rotation of it between
$y=0$ and $x=\frac{1}{e}$ and $x=e$.

 to evaluate it I know that I need to do $$\pi\int f(x)^2dx$$
so this is what I get : $$\pi\int ln(x)^2dx $$ let $ln(x)^2$ to be $U$ then $U'$ is $\frac{2}{x}$ and $V'$ is 1 so $V'$ is $x$.

this is the correct way to evaluate it?

Thanks!

答:
You're on the right track. I'll assume that you are rotating the region bounded by $y=0$, $x=1/e$, and $x=e$ about the $x$-axis (the axis of rotation is important!). Then you need to evaluate the integral:
$$
\pi \int_a^b [f(x)]^2 dx = \pi \int_{1/e}^e [\ln(x)]^2 dx
$$

To do this, you will need to use integration by parts by choosing $u=[\ln(x)]^2$ and $dv=dx$ so that $du=2\ln(x)/x$ and $v=x$ (don't forget to use chain rule!). This yields:
$$
\pi \int_{1/e}^e [\ln(x)]^2 dx = \pi \left[\left[x [\ln(x)]^2\right]_{1/e}^e - \int_{1/e}^e x \left( \frac{2\ln(x)}{x} \right) dx \right]
$$

Can you take it from there? Hint: If you don't know how to evaluate $\int \ln(x)dx$, then you will need to use integration by parts a second time.

Title: Body Volume Rotation Of Shape Question


问:
Solve nonlinear simultaneous equations with 3 variables
How to solve this system?

$$
X + Y + Z = A
$$
$$
X Y Z = B
$$
$$
X^2 + Y^2 + Z^2 = C
$$

For example: $(A, B, C )= (1, 2, 3)$

答:
Hint:

The l.h.s. of these equations are symmetric functions of X, Y, Z, of which the first and last are the elementary symmetric functions $s_1$ and $s_3$. Determine the value of the second elementary symmetric function
$$s_2=XY+YZ+ZX.$$
Once this is solved, you know that $X,Y,Z,$ are the roots of the cubic equation
$$t^3-s_1t^2+s_2t-s_3=0.$$
For your example, you should find the real root $2$ and the two nonreal cubic roots of unity.


问:
Does Plancherel's theorem hold on the Euclidean sphere?
Plancherel's theorem states that if $f\in L^{1}(\mathbb{R}^{n})\cap L^{2}(\mathbb{R}^{n})$ and $\hat{f}$ is its Fourier transform, then
$$\|f\|_{L^{2}(\mathbb{R}^{n})}= \|\hat{f}\|_{L^{2}(\mathbb{R}^{n})}.$$

Is it true that

$$\|f\|_{L^{2}(\mathbb{S}^{n-1})}= \|\hat{f}\|_{L^{2}(\mathbb{S}^{n-1})}\qquad (1)$$

where  $\mathbb{S}^{n-1}$ is the Euclidean sphere in $\mathbb{R}^{n}$  ?

Plancherel's theorem is true on locally compact abelian groups in general. I don't know whether the  $\mathbb{S}^{n-1}$  is a locally compact abelian group.

I think that (1) is false. If we reiterate the proof, we get a kernel of the form
$$\int_{\mathbb{S}^{n-1}}\;e^{\dot{\imath}(x-y)\cdot \omega} d\sigma(\omega)$$

as opposed to

$$\int_{\mathbb{R}^{n}}\;e^{\dot{\imath}(x-y)\cdot \xi} d\xi$$
which is precisely $\delta(x-y)$.

答:
The only Euclidean spheres that have a Lie group structure are $\mathbb{S}^0$, $\mathbb{S}^1$, and $\mathbb{S}^3$. (See here and here.) So assuming you're not willing to mash a non-intuitive group structure onto $\mathbb{S}^{n-1}$, that narrows the field down quite a bit on what we can even talk about.

Further, the Lie group structure on $\mathbb{S}^3$ isn't abelian. So again, standard harmonic analysis (Pontryagin duality, etc.) doesn't apply.

With $\mathbb{S}^1$, the Fourier transform maps to function on $\mathbb{Z}$, rather than functions on $\mathbb{S}^1$. So the question doesn't really make sense in that context either.

Finally, with $\mathbb{S}^0$, the Fourier transform does map to functions on $\mathbb{S}^0$, and Plancherel holds. But it's a relatively trivial case, since we're talking about a group with two elements.

We could also think about the question a little differently. Let's say we take a measure $d\mu = f d\sigma$, where $d\sigma$ is surface measure on $\mathbb{S}^{n-1}$ and $f \in L^{2}(d\sigma)$. Then we can take the Euclidean Fourier transform of this measure, which gives a continuous function on $\mathbb{R}^n$, and we can restrict it to $\mathbb{S}^{n-1}$. In this interpretation, Plancherel also fails to hold. One way of seeing this is to look at the family of modulations of a single $f$. For $\eta \in \mathbb{R}^n$, the modulated function $e^{-i \eta \cdot x} f(x)$ has the same $L^2(d\sigma)$ norm as $f$, while the Fourier transform of the modulation is the shift of $(f d\sigma)^{\wedge}$ by $\eta$. Since we can therefore translate $(f d\sigma)^{\wedge}$ arbitrarily before restricting to $\mathbb{S}^{n-1}$, it's not too hard to see that the Fourier transform won't preserve $L^2(d\sigma)$ norms in this sense, either.


答:
Here's a nice method that doesn't require setting up $100$ equations.

Let $\mu_i$ be the mean number of steps to reach state $i+1$ after reaching state $i$ for the first time, so we want $\sum_{i=0}^{99}\mu_i$. By the Markov property,
$$\mu_i=1+\frac{1}{2}(\mu_{i-1}+\mu_i)\implies\mu_i=2+\mu_{i-1}.$$
Now $\mu_0=1$, so $\mu_i=2i+1$, hence the expected time to reach $100$ is $$\sum_{i=0}^{99}(2i+1)=100^2.$$

Title: Hitting time of simple random walk


答:
Yes, if $(x+3)$ is a factor of $x^3-x^2+px+15$, it means that you can write :

$$x^3-x^2+px+15 = Q(x)(x+3),\text{where } Q(x) \text{ is a polynomial of degree 2}$$

So when $x=-3$, we have $(-3)^3-(-3)^2+p(-3)+15 = Q(-3)(-3+3) = 0$

In order to find $p$, you have to do the euclidian division and see for what $p$ the remainder of this division equals $0$.

Title: Find $p$ if $(x + 3)$ is a factor of $x^3 - x^2 + px + 15$.

Body:
I'm just making sure I answered this correctly.

If $(x+3)$ is a factor, then $P(-3)$ would equal $0$, correct?


答:
You don't need to worry about defining Jacobian for this. This is simple Taylor's theorem:

$$
f_i\left(y\right)=f_i\left(x+(y-x)\right)=f_i\left(x\right)+\sum_j \partial_j f_i\left(x\right)\,\left(y_j-x_j\right)+\mathcal{O}\left(\left|y-x\right|^2\right)
$$

for all $i$

Title: Jacobian Matrix and dot product question

Body:
I have a question on how the Jacobian matrix is used in a specific example from Wiki.  I present definitions first and then a question.

The Jacobian is defined as:

$J = \begin{bmatrix} \frac {\partial f}{\partial x_1} ... \frac {\partial f}{\partial x_n} \end{bmatrix} = \begin{bmatrix} \Delta^T f_1 \\ ... \\ \Delta^T f_m \end{bmatrix} = \begin{bmatrix} \frac {\partial f_1}{\partial x_1} ... \frac {\partial f_1}{\partial x_n} \\ ... \\ \frac {\partial f_m}{\partial x_1} ... \frac {\partial f_m}{\partial x_n} \end{bmatrix}$

Wiki then says:
$f(y) = f(x) + J(x) \cdot (y - x)$ is the best linear approximation for $f(y)$ for points close to $x$.

Questions

Does $J(x)$ represent scalar multiplication of the initial point $x$ with the $J$?  I.e. to get the PDs at a point.

If (1) above, how does one distinguish this operation from matrix multiplication?

For $J(x) \cdot (y - x)$ can the dot product, $\cdot$, be omitted as matrix multiplication will result in the same value?  The third form of $J$ is a matrix and dot product $\cdot$ is a vector operation, so this is confusing.


问:
Why is it so difficult to find Skewes' number?
Warning: naïve question ahead!

Littlewood proved in 1914 that there exists a number $n\in\mathbb{N}$ (called Skewes' number) such that:

$$
\pi(n) > \operatorname{li}(n).
$$

It is conjectured that $n$ is a huge number, recent analysis suggests $n\approx e^{727.951}$. Since then, researchers have worked to find lower and upper bounds for $n$. Currently it is held that:

$$
10^{19}<n<e^{727.951}.
$$

Why is it that researchers are trying to improve these bounds instead of finding an exact value? Since $\pi(n) \sim \frac{n}{\ln(n)}$ for very large numbers (i.e. > $10^{19}$), we have:

$$
\frac{n}{\ln(n)} > \int_0^n \frac{\mathrm dt}{\ln t}.
$$

And with sufficiently big computing power this should not be too hard to solve. What am I missing?

答: A  practical answer is this.  The current best estimate of the first Skewes number is ${SK}_{1} = 1.397162914 \times 10^{316}$.  Now computing on Mathematica the logarithmic integral at this value takes a fraction of a second.  However the efforts in computing the exact value of the prime counting function at the value of $10^27$ results in a paper (2015 by David Baugh and Kim Walisch) Walisch, Kim (September 6, 2015). "New confirmed pi(10^27) prime counting function record". Mersenne Forum.  So at this point no one can compute the exact value of the prime counting function near the first Skewes number within a reasonable amount of time.  This is why say lets sprinkle random numbers near Skewes first number, compute the values and see if we 'hit" a point where the prime count is larger than the logarithmic integral has not occurred.


问:
Can different fractals have the same fractal dimensoins?
I first noticed that fractals can be defined by real numbers from this youtube video:
https://youtu.be/gB9n2gHsHN4

My question is that:

Are these fractal dimensions unique to the fractals, Can two different fractals have the same fractal dimensions?

$NOTICE:$

I am not using the word different based on translation, rotation and scaling of the fractal. I hope you understand that what I am trying to define when I use the word 'different' becuase I am not a mathematician and that's why I am struggling to define the word 'different'.

Since I am not a mathematician  I will request to not use very advance mathematics. Please use easy maths ('Easy' does not mean high school maths) and if it's possible then please make it a little bit intuitive.

答:
A bit of setup.

One way of talking about whether or not two things are "the same" is to ask if they are isomorphic objects in some category.  Broadly speaking, two objects are isomorphic if there is a bijection between them which preserves whatever structure is interesting about those objects.

Fractals are, perhaps, best understood as metric spaces.  The natural morphisms between metric spaces are isometries, which are functions which preserve distances.  Reflections, translations, and rotations are all isometries.  Scalings are not isometries, but it is certainly reasonable to consider two fractals to be the same if one is a scaled copy of the other, so perhaps the right morphisms are isometries with scalings.  To make this formal, I'll introduce some definitions:

Let $(X,d_X)$ and $(Y,d_Y)$ be metric spaces.  An isometry between $X$ and $Y$ is a bijective map $\varphi : X \to Y$ such that for all $x_1, x_2 \in X$,
$$ d_Y(\varphi(x_1), \varphi(x_2)) = d_X(x_1, x_2). $$
A isometric scaling[1] is a bijective map $\psi : X \to Y$ such that there is some $C > 0$  such that for all $x_1, x_2 \in X$,
$$ d_Y(\varphi(x_1), \varphi(x_2)) = C d_X(x_1, x_2). $$
$C$ is called the scaling ratio of the isometric scaling.  Note that the inverse of an isometry is an isometry, and that the inverse of a scaling isometry is a scaling isometry.

While the term "fractal" is not well-defined (there is no universally agreed upon notion in the mathematical community of what a fractal is), we can talk more broadly about metric spaces.  For the purposes of this discussion, two metric spaces are "the same" if there is an isometric scaling between them.  That is, we are working in a category where the objects are metric spaces, and the morphisms are scaling isometries.[2]

A very common question in this kind of setting is "Are there any ways of distinguishing objects in a category without actually checking to make sure that they are not isomorphic?"  For example, in topology, if two spaces have different fundamental groups, then they are not homeomorphic.  The fundamental group is thus an invariant in the category of topological spaces.  Similarly, the Hausdorff dimension is an invariant in the category of metric spaces with scaling isometries---if two spaces are scaling isometric to each other, then they must have the same Hausdorff dimension.  The original question is, then, how strong an invariant is the Hausdorff dimension?

A question and answer.

Question:  Suppose that $(X,d_X)$ and $(Y,d_Y)$ are metric spaces.  Further suppose that
$$ \operatorname{dim}_{H}(X) = \operatorname{dim}_H(Y), $$
where $\operatorname{dim}_H(X)$ denotes the Hausdorff dimension of $(X,d_X)$.  Must it be true that $(X,d_X)$ and $(Y,d_Y)$ are scaling isometric?

The answer to the question is "no"; two spaces may have the same Hausdorff dimension and, nevertheless, be distinct (i.e. not scaling isometric).

Examples.

A simple example. The simplest example I can think of is to take $X = \{a\}$ (i.e. a singleton set) and $Y = \{\alpha, \beta\}$, each with the trivial metric ($d(x,y)= 1$ if $x\ne y$).  These two spaces both have Hausdorff dimension zero, but there is no scaling isometry between them (a scaling isometry is, by definition, bijective, and there cannot be a bijective map between a singleton set and a set with two elements.

Intervals.  If $a < b$, then the open interval $(a,b)$ and the closed interval $[a,b]$ each have Hausdorff dimension $1$.  However, these two spaces are not scaling isometric: because one interval is open and the other is closed, you cannot find a scaling isometry between them.

Self-similar sets.  Let $\{\varphi_j : X \to X \}_{j=1}^{N}$ be a collection of scaling isometries, where $\varphi_j$ has scaling ratio $C_j < 1$.  Such a collection of maps is called an iterated function system.  Define the map $\Phi : \mathscr{P}(X) \to \mathscr{P}(X)$ defined by
$$ \Phi(E) = \bigcup_{j=1}^{N} \varphi_j(E). $$
There exists a unique nonempty compact set $\mathscr{A}$ such that
$$ \mathscr{A} = \Phi(\mathscr{A}), $$
called the attractor of $\Phi$.  Under relatively mild conditions, the Hausdorff dimension of $\mathscr{A}$ is the unique real solution $s$ to the Moran equation
$$ \sum_{j=1}^{n} C_j^s = 1. $$
For example, the usual ternary Cantor set is the attractor of the system $\{\varphi_1, \varphi_2\}$ given by
$$ \varphi_1(x) = \frac{1}{3}x, \qquad \varphi_2(x) = \frac{1}{3} x + \frac{2}{3}. $$
Both maps have contraction ration $1/3$, and so the Hausdorff dimension of the Cantor set is $s$, where
$$ 1 = \sum_{j=1}^{2} C_j^s = 2\left( \frac{1}{3} \right)^s
\implies \left( \frac{1}{3} \right)^s = \frac{1}{2}
\implies s \log(3) = \log(2)
\implies s = \frac{\log(2)}{\log(3)} = \log_3(2).
$$

The von Koch curve[3] can be realized as the attractor of an iterated function system consisting of four maps, each with ratio $1/3$.  There is a nice writeup of the procedure on Larry Riddle's website.
The two-dimensional Cantor dust can also be realized as the attractor of an iterated function system consisting of four maps, each with ratio $1/3$.

Both of these spaces, with the induced metric from $\mathbb{R}^2$, have Hausdorff dimension $\log_3(4)$.  However, they are not scaling isometric.  The most straight-forward argument is topological:  the von Koch curve is connected, while the Cantor dust is totally disconnected.  Scaling isometries are homeomorphisms, and homeomorphism preserve connectedness, hence no scaling isometry can be found between these spaces.

Some further discussion.

In a comment Dave L. Renfro suggests that the dimension of a set is something like the "weight" or "mass" of that set.  I think that this is a good start at an analogy for the meaning of dimension, but (for me) it is not quite right.

In mathematics, a measure is a tool which is used determining some generalized notion of mass—the measure of a set is analogous to the mass of that set.  If we assume that sets come from spaces of uniform density, then a one-dimensional set's mass is proportional to its length, while a two-dimensional set's mass is proportional to its area.  Unfortunately for the analogy, the dimension of a set doesn't say much about the measure (mass or weight) of that set.  For example, the interval $[0,1]$ and the real line are both one-dimensional, but the interval has finite one-dimensional measure (i.e. finite mass), while the real line has infinite one-dimensional measure.

Rather, the dimension indicates which tool is appropriate for determining the measure of that set.  For example, a set with Hausdorff dimension $1$ is naturally measured in terms of a linear measure like inches, kilometers, or light-years, while a set with Hausdorff dimension $2$ is naturally measured in terms of areas, such as square meters or acres.  The fact that both the real line and the interval $[0,1]$ are one-dimensional tells us that both can be measured with the same tool (length), even though their actual measures are quite different.

In short, the dimension of a space tells us which tool to use if we want to measure the space.

[1] I'll note that the term "isometric scaling" is not one that I know to be standard—I just made it up.  A quick Googling shows that this term does appear, but it seems to be mostly related to descriptions of biological systems.  If you used the term "isometric scaling" in a mathematical context, it is likely that you would be understood, but it is also possible that, without clarification, you would cause confusion.

[2] There is actually some work which needs to be done in order to show that this really is a category, but it should all work out in the end.  Also, this is probably a bit more abstract than is really necessary to ask-and-answer this question.

[3] Often, the von Koch curve refers to the object created by replacing each side of an equilateral triangle of side length $1$ with four segments of length $1/3$.  In this discussion, I mean the curve obtained by applying this same procedure to a single segment.


答: As has been said before, $J(x)$ is the Jacobian matrix at the point $x$, as all the functions depend on $x$. The dot does not below there, as we do not take the dot product of a matrix and a vector. Just delete the dot and multiply the Jacobian matrix by the (column) vector $y-x$.


问:
Find all ordered pairs $(a,b)$ such that $1/a + 1/b = 3/2018$ and $a,b$ are positive integers
I gave this problem my best attempt and am now trying to understand the solution for it. This is problem #1 to the 79th William Lowell Putnam Math Competition. This is the given solution by Kiran Kedlaya and Lenny Ng:

By clearing denominators and regrouping, we see that the given equation is equivalent to $(3a−2018)(3b−2018) = 2018^2$. Each of the factors is congruent to $1 \text{ (mod } 3)$. There are $6$ positive factors of $2018^2 = 2^2 · 1009^2$ that are congruent to $1\text{ (mod } 3)$: $1$, $2^2$ , $1009$, $2^2 · 1009$, $1009^2$, $2^2 · 1009^2$. These lead to the 6 possible pairs: $(a,b)$
$= (673,1358114)$, $(674,340033)$, $(1009,2018)$, $(2018,1009)$, $(340033,674)$, and $(1358114,673)$. As for negative factors, the ones that are congruent to $1\text{ (mod }3)$ are $−2$, $−2 · 1009$,$−2 · 1009^2$. However, all of these lead to pairs where $a ≤ 0$ or $b ≤ 0$.

I don't fully understand these things:

Each of the factors is congruent to $1\text{ (mod }3)$: I think congruence means the ability to translate into something else using some rules, so it seems like they are saying that $(3a-2018) = 1$ and $(3b-2018) = 1$. I'm also not sure why they wrote $1\text{ (mod }3)$ because 1 % 3 = 1, so why not just say $1$?

There are $6$ positive factors of $2018^2 = 2^2·1009^2$ that are congruent to $1\text{ (mod }3)$: $1$, $2^2$, $1009$, $2^2·1009$, $1009^2$, $2^2·1009^2$: Here it seems like they are listing all of the ways to make $2018^2$, but if they are saying that $1$ is a possible factor then wouldn't $2018^2$ be its pair and therefore must be in this list? Why wouldn't they put it into this list?

These lead to the 6 possible pairs:$(a,b) = (673,1358114)$, $(674,340033)$, $(1009,2018)$,$(2018,1009)$, $(340033,674)$, and $(1358114,673)$: How did they get these pairs?

答:
$$\frac{1}{a} + \frac{1}{b} = \frac{3}{2018} \implies 2018a +2018b -3ab = 0$$

$$\implies b = \frac{2018 a}{3 a - 2018} \land 3 a\ne 2018\quad\lor\quad
a = \frac{2018 b}{3 b - 2018} \land 3 b\ne 2018 $$

Since $\quad 2018/3\not\in\mathbb{N}\quad$ we need not worry about the restrictions above. A spreadsheet or a simple program reveals the following (a,b) pairs.

$$
(-678048,672)\quad
(0,0)\quad
(672,-678048)\quad
(673,1358114)\quad
(674,340033)\\
(1009,2018)\quad
(2018,1009)\quad
(340033,674)\quad
(1358114,673)\quad
$$
These are the only pairs found for $-10^9 \le a \le 10^9$ and, based on the ascending-a and descending-b pattern in the pairs, it appears that these are the only solutions to the equation. Also, since $3$ of them are non-positive, only the $6$ you found meet the criteria.


问:
What is the probability of getting 3 heads in 4 coin tosses, given you get at least 2 heads?
I came across this question while doing conditional probability questions and while I can get the answer by counting outcomes, I'm getting a different answers using Bayes' theorem. $\ P(2T)\ $ is the probability of getting at least 2 tails. $\ P(3T)\ $ is the probability of exactly 3 tails. We flip a fair coin 4 times and are looking for the probability of getting 3 heads given we get at least 2 heads.
$$P(3T|2T) = \frac{P(2T|3T)P(3T)}{P(2T)}$$
$$P(2T|3T) = 1$$
$$P(2T) = \frac{1}{4}$$
$$P(3T) = \frac{3}{8}$$
$$P(3T|2T) = \frac{2}{3} $$

The answer is supposed to be $P(3T|2T) = \frac{4}{11}$ which is easy enough to see when the outcomes are counted but there's clearly a problem with the above method I'm using.

答: In my opinion, the tree diagram is the easiest way to tackle those problems (I wish I had learned it sooner)</p>


问:
Representation of Church numerals
In the $\lambda$-calculus, is the family of $\lambda$-terms $(N_i)_{i \in \mathbb{N}}$, defined below, a representation of Church numerals? I think it is, but how do I (sufficiently) show it? If not, what is it?

The terms $N_i$ and $N'_i$ for each natural number $i$ are defined as follows. ($x$ and $c$ are variables while $i$ stands for a number.)
\begin{align}
          N'_0 &= x
\\
          N'_i &= c \,i\, N'_{i−1} &&\text{for } i > 0
\\
          N_i &= \lambda c. \lambda x. N'_i &&\text{for any }i \in \mathbb{N}
\end{align}

答:
Disclaimer. I assume that the inductive definition of the $\lambda$-terms $(N_n')_{n \in \mathbb{N}}$ given in the original question, i.e.,
\begin{align}
N_0' &= x
\\
N_n' &= f \, n \, N_{n-1}' &\text{if } n > 0
\end{align}

contains a typo: $N_n'$ should be defined as $f \, N_{n-1}'$ when $n > 0$, because $n$ is a natural number and not a $\lambda$-term, so the expression$f \, n \, N_{n-1}'$ does not make any sense in the $\lambda$-calculus. My answer below considers the amended version of that definition.

Church numerals are the $\lambda$-terms used to encode natural numbers in the $\lambda$-calculus.

Usually, for every natural number $n$, the Church numeral $\underline{n}$ representing $n$ is defined as the $\lambda$-term
$$\tag{1}
\underline{n} = \lambda f. \lambda x. f^n x = \lambda f. \lambda x. \overbrace{f(f( \cdots (f}^{n \text{ times }}x)\cdots))
$$
($f^n x$ is just a shorthand for $\overbrace{f(f( \cdots (f}^{n \text{ times }}x)\cdots))$, for any $n \in \mathbb{N}$).

This definition is slightly informal because it uses dots, which$-$strictly speaking$-$are not in the syntax of the $\lambda$-calculus.
How can we define Church numerals in a more rigorous way?

As human beings, we are perfectly able to understand what dots mean. If we fix $n \in \mathbb{N}$, from $(1)$ we are able to write the concrete Church numeral for $n$. For instance:
\begin{align}
\underline{0} &= \lambda f. \lambda x. x
&
\underline{1} &= \lambda f. \lambda x. fx
&
\underline{4} &= \lambda f. \lambda x. f(f(f(fx)))
\end{align}
So, for the usual practice, definition $(1)$ is perfect.
But if we want to write a very rigorous proof of a property of the $\lambda$-calculus involving all Church numerals, what do we do? Are we sure that dots cannot hide some pathological and unexpected behavior of Church numerals?

This search for a more rigorous definition is not only a pedantic issue, but it is of practical interest.
Suppose that  we want to implement the $\lambda$-calculus in a computer, for instance to use automated theorem provers to verify some property of the $\lambda$-calculus involving Church numerals.
How can a computer understand dots?

In mathematics, when you use dots to define an object, it usually means that the object is defined by induction.
In the case of Church numerals, we proceed by induction on $n \in \mathbb{N}$.
Actually, in $(1)$ dots appear only in the $f^n x$ part, so the inductive definition is required only for a rigorous definition of
$$\tag{2}
f^n x = \overbrace{f(f( \cdots (f}^{n \text{ times }}x)\cdots))
$$
Formally, for every $n \in \mathbb{N}$ we define the $\lambda$-term $N_n'$ by induction on $n$ as follows:
\begin{align}
N_0' &= x &&\text{(base case)}
\\
N_{n}' &= f \, N_{n-1}' &&\text{(inductive step, for $n > 0$)}
\end{align}

What is the relation between this inductive definition and $(2)$?

Property. For every $n \in \mathbb{N}$, we have
$$\tag{3}
f^n x = N_n'.
$$

Proof. By induction on $n \in \mathbb{N}$.

Base case ($n = 0$):
$$
f^0 x = \overbrace{f(f( \cdots (f}^{0 \text{ times }}x)\cdots)) = x = N_0'.
$$

Inductive step: We suppose that property $(3)$ holds for some $n \in \mathbb{N}$ (induction hypothesis, IH) and we show that it holds for $n+1$.

$$
f^{n+1} x = \overbrace{f(f( \cdots (f}^{n+1 \text{ times }}x)\cdots)) = f \,(\overbrace{f(f( \cdots (f}^{n \text{ times }}x)\cdots))) = f (f^n x)  \overset{\text{IH}}{=} f \, N_{n}' = N_{n+1}'. \quad \square
$$

We have just proved $(3)$, that is, that for every $n \in \mathbb{N}$ the $\lambda$-term $f^nx$ defined via dots in $(2)$ is the same as the $\lambda$-term $N_n'$ defined inductively.
From $(3)$ it follows that Church numerals defined in $(1)$ are exactly the same as the $\lambda$-terms $(N_n)_{n \in \mathbb{N}}$ defined as follows:

\begin{align}
N_n &= \lambda f. \lambda x. N_n' &\text{for every } n \in \mathbb{N}.
\end{align}

Indeed, for every $n \in \mathbb{N}$, we have
$$\underline{n} = \lambda f. \lambda x. f^n x \overset{(3)}{=} \lambda f. \lambda x. N_n' = N_n.
$$

Title: Representation of Church numerals


问:
Show that $\frac{a_1}{b_1}+\frac{a_2}{b_2}+...+\frac{a_n}{b_n} \geq n$

Let $a_1$, $a_2$,..., $a_n$ be the sequence of positive numbers, and
  let $b_1$, $b_2$,..., $b_n$ be any permutation of the first sequence.
  Show that $$\frac{a_1}{b_1}+\frac{a_2}{b_2}+...+\frac{a_n}{b_n} \geq
n$$

This is a preparation Question PUTNAM contest. The theme of the section is "inequality". I can not make the problem from inequality. Is anyone is able give me a hint (using inequalities)?

答:
It's quite simple, but just to clarify even more:

$\dfrac{\dfrac{a_1}{b_1} + \dfrac{a_2}{b_2} + ... + \dfrac{a_n}{b_n}}{n} \geq \sqrt[n]{\dfrac{a_1}{b_1}\dfrac{a_2}{b_2} ... \dfrac{a_n}{b_n}}$

But $\dfrac{a_1}{b_1}\dfrac{a_2}{b_2} ... \dfrac{a_n}{b_n} = 1$

Then,

$\dfrac{\dfrac{a_1}{b_1} + \dfrac{a_2}{b_2} + ... + \dfrac{a_n}{b_n}}{n}\geq 1$

Then it follows that,

$\dfrac{a_1}{b_1} + \dfrac{a_2}{b_2} + ... + \dfrac{a_n}{b_n}\geq n$

I hoped to have made it better understood, and just to let the Geometric-Arithmetic inequality for general use, this is, Geometric Mean is always smaller equal than arithmetic mean.


问:
Order of growth of a function involving the square root of the logarithm
I am trying to show that for $a \sqrt{\frac{\pi }{k}}>1$, and $k \geq 1$, $$\sqrt{k (k-1)} \sqrt{\log \left(a \sqrt{\frac{\pi }{k}}\right)} = O(k)$$
using the standard big O notation. I can see that the function is beneath a straight line of a gradient of my choice, but how can I prove this? I cannot seem to conclude without getting rid of the $\log(\sqrt{1/k})$.

答:
Considering $a$ as function $a(k)>\sqrt{\frac{k }{\pi}}$ and taking $a(k)\to C>1,k\to \infty$ we obtain estimation $O(k)$.

For example $a(k)=\sqrt{\frac{k }{\pi}}\left(C+\frac{1 }{k}\right)$ for $C>1$.


问:
Generalised solution for Amoeba's survival problem
A population starts with a single amoeba. For this one and for the generations thereafter, there is a probability of $p$ that an individual amoeba will split to create two amoebas, and a $(1-p)$ probability that it will die out without producing offspring. Now, can we find a probability function at $n_{th}$ generation, which will let me know how many members will we find at that generation? For example, that at $2nd$ generation no member will survive has cumulative probability of $(1-p)+p(1-p)^2$. Also, what distribution will this follow?

答:
There is only two choices, the offspring number is either $0$ or $2$. So we model the problems as such: for non negative integers $n,k$ with $k\le 2^n$ and where $2^n-k$ is even, let $f(n,k)$ be the probability that the $n$-th generation yields an amoeba population of size $k$.

Then $f$ can be computed recursively as in the Maple code shown below.

Applying the recursion, here are the results for $0\le n\le 3$:
\begin{array}{|c|c|c|}
\hline
n&k&f(n,k)\\
\hline
0&1&1\\
\hline
1&0&1-p\\
&2&p\\
\hline
2&0&1-2p^2+p^3\\
&2&2p^2-2p^3\\
&4&p^3\\
\hline
3&0&1-4p^3+2p^4+4p^5-4p^6+p^7\\
&2&4p^3-4p^4-8p^5+12p^6-4p^7\\
&4&2p^4+4p^5-12p^6+6p^7\\
&6&4p^6-4p^7\\
&8&p^7\\
\hline
\end{array}


问:
How to integrate $\frac{\cos(x)}{e^x}$?
Surprisingly I haven't found such integral in the web, so I may ask this here bluntly.

A solution that Matlab suggest sounds like $\frac{{\mathrm{e}}^{-x}\,\left(\cos\left(x\right)-\sin\left(x\right)\right)}{2}$

答:
$$I=\int\frac{\cos x}{e^x}dx=\int e^{-x}\cos(x)dx=\Re\int e^{-(1-i)x}dx=\Re\left(-\frac{e^{-(1-i)x}}{(1-i)}\right)=\Re\left(-\frac{(1+i)}{2}e^{-x}(\cos x+i\sin x)\right)$$
$$=-\frac{e^{-x}}2\Re\left[\cos x-\sin x+i\cos x+i\sin x\right]=\frac{e^{-x}\left(\sin x-\cos x\right)}{2}+C$$

Title: How to integrate $\frac{\cos(x)}{e^x}$?


问:
Help with a probability homework problem
I'm trying to solve the problem in the image but having trouble formulating the problem mathematically:

There are $20$ identical laptops on a trolley, out of which $12$ have
a hard disk with capacity $160$ GB and $8$ with a capacity of $320$
GB. A teacher randomly takes two laptops from the trolley. A student
then takes a laptop from the trolley to complete a project. Given that
the student took a laptop with $160$ GB, find the probability that the
teacher took both laptops with $320$ GB.

so any help will be appreciated.

I've tried the following: let $A$ denote the event of choosing a 160GB laptop, and $B$ denote the event of choosing a 320GB laptop. Then $P(A)= 12/20, P(B)=8/20.$ Next, let $C$ denote the event of choosing 2 laptops, regardless of their memory (160GB or 320GB). Then $P(C)=2/20$ (right?) Then $B \cap C$ will denote the event of choosing two 320GB laptops (right?). But then how do I calculate $P(B \cap C)?$

Also, how do I calculate the probability of $D:=$  choosing two 160GB laptops and $P(A|D)$? I understand that at the end we'll need to calculate $P(D|A)$, and hence we'll need to use the formula $P(D|A)= \frac{P(D \cap A)}{P(A)}= 20/12 * P(D \cap A)=20/12 * P(A|D) P(D).$ Here's where I'm confused: how to I calculate $ P(A|D), P(D)?$

答:
Let the variable $L_1$ be $0$ or $1$ depending on whether the first laptop taken is small or big.

Let the variable $L_2$ be $0$ or $1$ depending on whether the second laptop taken is small or big.

Let the variable $L_3$ be $0$ or $1$ depending on whether the third laptop taken small or big.

The question is to compute $P(L_1 = 1, \, L_2 = 1 \,|\, L_3 = 0)$.

$$P(L_1 = 1, \, L_2 = 1 \,|\, L_3 = 0) = P(L_1 = 1, \, L_2 = 1, \, L_3 = 0) / P(L_3 = 0) $$

You can probably figure out how to compute the numerator of the right hand side. To compute the denominator, note that the three laptops chosen are a uniform random trio. Therefore each laptop in the chosen trio has the same claim to be small or big as the other two in the trio. Therefore $P(L_3 = 0) = P(L_1 = 0) = 12/20$.

That the three laptops chosen are a random trio arises from a more general phenomenon. If you consider all size $N$ subsets of a set, and choose one of those subsets uniformly at random, it's the same as if you chose $N$ elements one a time uniformly. You can show this using induction.


问:
How to find how many integer values does it exit in a segment in a triangle?
The problem is as follows:

The alternatives given in my book are as follows:

$\begin{array}{ll}
1.&\textrm{7}\\
2.&\textrm{6}\\
3.&\textrm{5}\\
4.&\textrm{4}\\
\end{array}$

I'm totally clueless here. But from looking at the way how this question is presented. I'm feeling that it will require the use of triangle inequality. And it seems as well if the approach of euclidean geometry is intended then the answer will use triangle congruence however the given clue of $\angle \alpha < \angle \beta$ is somewhat confusing.

Can someone help me here?.

So far I have ran out of ideas. Please include a drawing in your answer. Can this be solved relying only in euclidean geomtry?

答: Since $AM=MC$ but $\angle\alpha< \angle\beta$, then $AH>HC$ independent of the length of $HM$. If the integers in the choices are the only possible answers, then the correct lengths are $6$ or $7$.


问:
Prove by induction for $F(2n) = F(n)[F(n-1) + F(n+1)]$ for all $n\ge 1$
I am totally stumped by this question. I have proved the base case. Then for $k$ is $1$ assume the relation to be true. When I try to prove for $k+1$, the terms just do not simplify to what I want. Is there something missing in the question or is it that I am just not being able to solve the question?</p>

Body:
Assume that $F_{2n} = F_n[F_{n-1}+F_{n+1}]$ and use this (the n case) to show that the n+1 case, i.e. $F_{2(n+1)} = F_{2n+2} = F_{n+1}[F_n+F_{n+2}]$, is true

We have $F^2_{n+1}-F_nF_{n+2} = (-1)^n$

$F_{n+1}[F_n+F_{n+2}]$

= $F_{n+1}F_n+F_{n+1}F_{n+2}$

= $F_{n+1}F_n+F^2_{n+1} + F_{n+1}F_n$ since $F_{n+2} = F_{n+1}+ F_n$ for fibonacci numbers

= $(-1)^n + F_nF_{n+2} + 2F_nF_{n+1}$

= $(-1)^n + F_nF_{n+1} + F^2_n + 2F_nF_{n+1}$

= $(-1)^n + F_nF_{n+1} + F_{n-1}F_{n+1} + (-1)^{n-1} + 2F_nF_{n+1}$

= $F_nF_{n+1} + F^2_{n-1} + F_{n-1}F_n + 2F_nF_{n+1}$

= $F_nF_{n+1} + F_{n-2}F_n + (-1)^{n-2}+ F_{n-1}F_n + 2F_nF_{n+1}$

= $3F_nF_{n+1} + F_{n-2}F_n + (-1)^{n-2}+ F_{n-1}F_n$

= $3F_nF_{n+1} + F_{n-2}F_{n+1} - F_{n-2}F_{n-1} + (-1)^{n-2}+ F_{n-1}F_n$ since $F_n = F_{n+1}-F_{n-1}$

= $3F_nF_{n+1} + F_nF_{n+1} - F_{n-1}F_{n+1} - F_{n-2}F_{n-1} + (-1)^{n-2}+ F_{n-1}F_n$

= $3F_nF_{n+1} + F^2_n + F_nF_{n-1}- F_{n-2}F_{n-1} + (-1)^{n-2}+ F_{n-1}F_n$ since $F_n = F_{n+1}-F_{n-1}$

= $3F_nF_{n+1} + 2F_nF_{n-1} - F_{n-1}F_{n-2} + F_{n-1}F_{n+1} -F_{n-1}F_{n+1} + (-1)^{n-1} + (-1)^{n-2}$

= $3F_nF_{n+1} + 2F_nF_{n-1} - F_{n-1}F_{n-2}$

= $3F_nF_{n+1}+ 3F_nF_{n-1} - F_nF_{n-1}- F_{n-1}F_{n-2}$

= $3F_n(F_{n+1}+F_{n-1})- F_nF_{n-1}- F_{n-1}F_{n-2}$

= $3F_{2n} - F_{n-1}[F_n+ F_{n-2}]$ using our induction hypothesis

= $3F_{2n} - F_{2(n-1)}$

= $2F_{2n} + F_{2n-1}$ since $F_{2n}-F_{2(n-1)} = F_{2n-1} (F_{2(n-1)}=F_{2n-2)}$

= $F_{2n} + F_{2n+1}$ since $F_{2n+1} = F_{2n} + F_{2n-1}$

= $F_{2n+2} = F_2{n+1}$

Since we have shown that $F_n+1[F_(n)+F_(n+2)] = F_2(n+1)$ (the n+1 case) is true from assuming the n case $F_2n = F_n[F_(n-1)+F_(n+1)]$ to be true and we know that the base case n=1 is true, we have proven $F_2n = F_n[F_(n-1)+F_(n+1)]$ inductively.

$F^2_n+1-F_nF_n+2 = (-1)^n$ can be proven pretty quickly by induction. I could not solve this problem either without the above identity.


问:
Prove $f^\ {''}(c)=0$

Let $f:\mathbb{R} \rightarrow\mathbb{R}$ be twice differentiable and bounded, and suppose $f$ gets minimum at $x_0$. Prove there exists $c\in\mathbb{R}$ such that $f^\ {''}(c)=0$.

$f$ is bounded $\Rightarrow \exists M>0 \ s.t \ |f(x)|\leq M, \forall x\in\mathbb{R}$

So by MVT I got that the derivative is positive for all $x>x_0$ and negative for all $x<x_0$, and from that I concluded that $f(x)\rightarrow M$ when $x\rightarrow\pm\infty$.

Not sure how to continue from here.

Any help appreciated.

答:
Let us take the case when listed conditions are satisfied

$f'(x)\gt 0,\space \forall x \in (x_0,\infty)$

$f(x_n)\gt \cdots \gt f(x_2) \gt f(x_1), \space \forall x_1,x_2,\cdots,x_n \in (x_0,\infty), \space \exists f(x_k)\gt f(x_n) \space \forall k\gt n$

$f'(x)\lt 0, \space \forall x \in (-\infty,x_0)$

$f(x_n)\lt \cdots \lt f(x_2) \lt f(x_1), \space \forall x_1, x_2, \cdots,x_n \in (-\infty,x_0),\space \exists f(x_k)\lt f(x_n) \space \forall k\gt n$

These conditions indicate that the function is not bounded. Since we are said to take the function to be bounded, this situation is a contradiction. We can modify the conditions for the function to be bounded. If we say $f'(x)\gt 0, \space \forall x \in (x_0,x_1)$, we obtain a bounded function (we should set the similar conditions for $x\lt x_0$).$$f(x_0)=0, \space f(x_1)=0\Rightarrow \frac{f(x_1)-f(x_0)}{x_1-x_0}=f''(c)=0 $$

We can also assert that $f'(x)\gt 0,\space \forall x\in (x_0,\infty),\space \lim_{x\to \infty} f'(x)=0$. Since we know the function is concave up for $x \gt x_0$ and it has a horizontal asymptote, we can assert that the function is concave down for some interval $(c,\infty)$. Using intermediate value theorem we can deduce there is an inflection point at $c$, which means $f''(c)=0$.

Title: Prove $f^\ {''}(c)=0$


问:
Solution check: Uniform continuity
While reading Bartle's book, i came across the following:

Problem:

Prove that if $f$ is uniformly continuous on a bounded subset $A$ of $\mathbb{R},$ then $f$ is bounded on $A$.

Attempt:

Given $A \subset \mathbb{R}$ such that $A$ is bounded and $f: A \rightarrow \mathbb{R}$ an uniformly continuous function, we will prove that $f$ is bounded.

Given $(x_{n})$ a sequence of points in $A$ one can obtain a convergent subsequence $(x_{nk})$, by using the Bolzano-Weierstrass theorem. Since $f$ is uniformly continuous and $(x_{nk})$ is a Cauchy sequence (since it is convergent), $(f(x_{nk}))$ is also Cauchy.

Finally, since every Cauchy sequence is bounded, there exists $a$ and $b$ in $\mathbb{R}$ such that: $$a \leqslant f\left(x_{n k}\right) \leqslant b$$

Therefore, $f$ is bounded.

Questions:

1. Is the solution correct?

2. If the solution is indeed correct, is it well written?

3. If the solution is incorrect, can someone gently me explain why and provide a solution?

Thanks in advance, Lucas!

答:
It seems that you have the main idea but I disagree with your conclusion, you cannot conclude that $|f(x)| \le a$ for all $x \in A$ with what you wrote. Let us try by contradiction: suppose that $f$ is not bounded, $i.e.$ it exists $(x_n)_n \subset A$ such that
$$\forall K > 0, \exists N_K \in \mathbb N~\text{ s.t. }~ \forall n \ge N_K: |f(x_n)| \ge K.$$
As you wrote above we can find a subsequence $(x_{n_k})_k$ such that $(|f(x_{n_k})|)_k$ converges to a certain $L \in \mathbb R^+$. Since the function $\mathbb N \to \mathbb N: k \mapsto n_k$ is strictly increasing, we find that $k \le n_k$ (it is a well known result about strictly increasing function from $\mathbb N$ to $\mathbb N$, try to show it). Moreover, for $K = L + 1$ (for example), there is $N_K$ such that for all $k \ge N_K$, $|f(x_{n_k})| > K$ which contradicts the fact that $(|f(x_{n_k})|)_k$ converges to $L$.

Title: Solution check: Uniform continuity


问:
Use Fubini's Theorem to verify the integration by parts formula, and justify that the hypotheses of Fubini's Theorem are satisfied.
Let $f$ and $g$ be Lebesgue integrable real-valued functions on $[0,1]$, and define

$$F(x) = \int_0^x f(t)dt, \quad \text{and} \quad G(x) = \int_0^x g(t) dt.$$

Use Fubini's Theorem to verify the integration by parts formula

$$\int_0^1 F(x)g(x)dx = F(1)G(1) - \int_0^1 f(x)G(x)dx.$$

Justify that the hypotheses of Fubini's Theorem are satisfied.

This one seems straightforward to us, but for some reason we can't get anything nice to appear.

Here are our attempts for the left-hand side and the right-hand side respectively after the hint:

$$\begin{aligned} \int_0^1 F(x)g(x)dx &= \int_0^1 \int_0^x f(t)dtg(x)dx\\
&= \int_0^1\int_0^1 1_{[0,x]}f(t)g(x)dtdx\\
&= \int_0^1 f(t) \int_0^1 1_{[0,x]}g(x)dxdt. \end{aligned}$$

$$\begin{aligned} F(1)G(1) - \int_0^1 f(x)G(x)dx &= F(1)G(1) - \int_0^1 f(x)\int_0^x g(t)dtdx\\
&= F(1)G(1) - \int_0^1\int_0^1 1_{[0,x]}f(x)g(t)dtdx\\
&= F(1)G(1) - \int_0^1g(t)\int_0^1 1_{[0,x]}f(x)dxdt.\end{aligned}$$

答:
$$f(x)=u(x)v(x)$$
$$\frac{df}{dx}=\frac{du}{dx}v+\frac{dv}{dx}u$$
$$df=v.du+u.dv$$
$$\int df=\int v.du+\int u.dv$$
$$\int u.dv=f-\int v.du$$
$$\int u.dv=uv-\int v.du$$
If you don't have to use Fubini's theorem