问:
Context-free grammar (CFG)
How do I generate a context free grammar for a language
$$\Sigma = \{0, 1\},\ L = \{1^i0^j1^k \mid i, j, k \geq 0\}$$
Thanks already

答:
Denote our context free grammar by $G=(V, \Sigma, R, S)$ whereby $V=\{S,S_1, S_2, S_3\}$ is our set of variables, $S$ denotes the start variable and $\Sigma=\{0,1\}$ is our set of terminals. Then our rules $R$ are given by
\begin{alignat}{1}S &\to 1S_1\\\
S_1 &\to 1S_1\ |\ S_2\ \\
S_2 &\to 0S_2\ |\ S_3\ \\
S_3 &\to 1S_3\ |\ \epsilon
\end{alignat}

We can generate the following words:

$101$

$1\cdots 01$

$101\cdots$

$10\cdots 1$

$10 \cdots 1 \cdots$

$1 \cdots 0 \cdots 1$

$1 \cdots 0 \cdots 1 \cdots$

EDIT

The above grammar is only valid for the given language for $i,j,k >0$ as @rici correctly pointed out in the comments.

Here is the set of rules for $i,j,k \geq 0$ for the grammar $G=(V, \Sigma, R, S)$ with $V=\{S,S_1,S_2, S_3\}$.

\begin{alignat}{1}S &\to S_1\ |\ S_2\\\
S_1 &\to 0S_1\ |\ S_3\ |\ \epsilon\ \\
S_2 &\to 1S_2\ |\ S_1\ |\ \epsilon \\
S_3 &\to 1S_3\ |\ \epsilon
\end{alignat}

This can generate the following words:

$\epsilon$ (if $i=j=k=0$)

$1$

$0$

$1\cdots$

$0\cdots$

$0\cdots 1 \cdots$

$1\cdots 0 \cdots$

$1\cdots 0 \cdots 1 \cdots$

Note: with $\cdots$ I mean zero or more repitions.

Title: Context-free grammar (CFG)


问:
Quaternions as rotations: Notation
I am reading through this notes on quaternions. I am trying to understand how they work as rotations as long as their norm is always 1.

First, in page 4 above the figure, the quaternion rotation operator is defined as follows

$$q = \cos(\theta) + u\sin(\theta)$$

But later, in equation 4 it is defined with half the angle:
$$q = \cos(\frac{\theta}{2}) + u\sin(\frac{\theta}{2})$$
Is this a mistake or are they telling the same?

答:
In addition to @rschwieb's explanation, there is always the possibility that two different actions of quaternions (on themselves...) are in play. One is simply by multiplication, the other by conjugation. The latter "doubles" a natural angular parameter...

In summary, one has to figure this out from context... and allow for typos.

ContentLicense: CC BY-SA 4.0

Title: Quaternions as rotations: Notation


问:
How to find all elements of $\mathbb{Z}_{4} \times\mathbb{Z}_{4}/\langle(1,1)\rangle$?
I am studying factor groups, and I saw an example that says

Find all the elements of the factor group $\mathbb{Z}_{4}   \times \mathbb{Z}_{4}/\langle(1,1)\rangle$.

I know that the order of  $\mathbb{Z}_{4}  \times \mathbb{Z}_{4}$  is $16$, and the order of $\langle(1,1)\rangle$ is $4$, so we must have $4$ elements, but how can I find them?

Edit: Actually, this is not a homework, I have the answer saying that those elements are  $\{(1,1),(2,2),(3,3),(0,0)\} , \{(1,2),(2,3),(3,0),(0,1)\} , \{(2,1),(3,2),(0,3),(1,0)\},\{(1,3),(2,0),(3,1),(0,2)\}$.

But I did not understand how they are found, can anyone please explain the steps to find them?

Thanks.

答:
In general, if $H$ is a normal subgroup of $G$, the elements of the quotient group $G/H$ are by definition the cosets $gH$ for $g\in G$. Here, $H = \langle(1,1)\rangle$.

To find the cosets $gH$, write them one at a time. First, we know we have $$H = \{(1,1),(2,2),(3,3),(0,0)\}$$ Now take an element in $\mathbb Z_4 \times \mathbb Z_4$ but not in $H$. Let's say $(0,1)$. This gives us the coset $$(0, 1) + H = \{(1,2),(2,3),(3,0),(0,1)\}$$ Again, we pick a new element, this time one that is in none of the cosets we currently have. Let's take $(1,0)$ which gives us the coset $$(1,0) + H = \{(2,1),(3,2),(0,3),(1,0)\}$$ Finally, we need to pick one last element not in any of these cosets. Let's pick $(0,2)$ giving us the coset $$(0,2) + H = \{(0,3),(2,0),(3,1),(0,2)\}$$

Now we have the $4$ elements of the quotient.

ContentLicense: CC BY-SA 3.0


问:
Hard olympiad geometry problem to prove ratio
Let $D$ be a point inside an acute triangle $ABC$ such that $\angle ADC = \angle A +\angle B$, $\angle BDA = \angle B + \angle C$ and $\angle CDB = \angle C + \angle A$. Prove that $\frac{AB \cdot CD}{AD} = \frac{AC \cdot  CB} {AB}$.
Can somebody help me to prove it synthetically

My approach- let tanget from $B C ,  A B, A C$ meet at $X, Y, Z$ resp that gives $\angle BDC = \angle ACX$ and so on. Now extend $AD$ to meet $CX$ at $J$ we get $BDJC$ is cyclic (same can be done at other sides too); at this point I tried using power of point but it didn't help... Plz provide some help

答: I will use the shortcuts $\angle A=\alpha, \angle B=\beta, \angle C=\gamma$. Let also $\angle BAD=\varphi$. It follows easily from angle-chasing that $$\angle DBA=\alpha-\varphi,\; \angle CBD=\beta-(\alpha-\varphi),\; \angle DCB=\alpha-\varphi,\; \angle ACD=\gamma-(\alpha-\varphi),\; \angle DAC=\alpha-\varphi$$ This will be helpful due to the Sine Law, since want to prove a length-ratio relationship: $$\frac{AB \cdot CD}{AD} = \frac{AC \cdot  CB} {AB}\iff \frac{AB}{AD}=\frac{AC}{CD}\cdot \frac{CB}{AB}\label{1}\tag{1}$$ The Law of Sines considered in $\triangle ABD, \triangle ADC$ and $\triangle ABC$ respectively yields that (\ref{1}) is equivalent to $$\frac{\sin(\alpha)}{\sin(\alpha-\varphi)}=\frac{\sin(\gamma)}{\sin(\alpha-\varphi)}\cdot \frac{\sin(\alpha)}{\sin(\gamma)}$$ Which is trivial.


问:
$A= \begin{bmatrix}-1 & 1 & 1 &1\\ 1 & -1 & 1 &1\\ 1 & 1 & -1 &1\\ 1 & 1 & 1 &-1\\ \end{bmatrix}$ $A$ is a symmetric matrix.Find its eigenvalues?
$A= \begin{bmatrix}-1 & 1 & 1 &1\\
1 & -1 & 1 &1\\ 1 & 1 & -1 &1\\ 1 & 1 & 1 &-1\\
\end{bmatrix}$

$A$  is a symmetric matrix.Find its eigenvalues ?

I saw this question in my book. I know that it can be solved using the cofactor definition of determinant and its eigenvalues are $+2,-2$

However, this process is cumbersome . I wonder that whether there is any trick or shortcut for finding its eigenvalues .

答:
Hints: If the eigenvalues of $A+2I$ are $\lambda_1,\lambda_2,\lambda_3,\lambda_4$, then the eigenvalues of $A$ are $\lambda_1-2,\lambda_2-2,\lambda_3-2,\lambda_4-2$. Do you see why this is true?

The matrix $A+2I$ is a $4 \times 4$ matrix of all ones. Hence, the rank of $A+2I$ is one, and it has at most one non-zero eigenvalue (so three of its eigenvalues are $0$). You can find the non-zero eigenvalue by finding the corresponding eigenvector by inspection like J. W. Tanner suggested.


问:
Product followed by summation
Is it possible to solve this finding the result of the summatory and then, the result of the product?

$\prod_{i=1}^{2}\sum_{j=1}^{n} ij$

I already know that $\sum_{j=1}^{n} ij = i\frac{n(n+1)}{2}$, so I would have to simply find $\prod_{i=1}^{2} i\frac{n(n+1)}{2} $?

答:
Yes, that is correct. Adding parentheses for clarity, we have
$$
\prod_{i=1}^2 \sum_{j=1}^n ij = \prod_{i=1}^2 \left(\sum_{j=1}^n ij\right).
$$

Title: Product followed by summation


问:
(Proof Verification) Indecomposable (Limit) Ordinals
This is problem 5 in Kunen's Chapter 1 exercises.

Suppose $\alpha$ is a limit ordinal. I want to show the following equivalences:

(1) $\forall \beta, \gamma < \alpha$, $\beta + \gamma < \alpha$

(2) $\forall \beta < \alpha$, $\beta + \alpha = \alpha$

(3) $\forall A \subseteq \alpha$, $ot(A) = \alpha$ or $ot(\alpha \setminus A) = \alpha$ ($ot$ means order type).

(4) $\exists \delta \alpha = \omega^{\delta}$

(1) $\implies$ (2) is fairly easy: just pass to the limit on $\gamma$.
(2) $\implies$ (1) is also pretty easy: if $\beta + \gamma = \alpha$ then $\beta + (\gamma + 1) > \alpha$ and since $\gamma + 1 < \alpha$ as $\alpha$ is a limit, this contradicts (2).

(3) $\implies$ (2) is fairly easy. Just take $A = \beta$.

I can finish the equivalences by showing (4) $\iff$ (1) + (2) and (4) $\implies$ (3)

(4) $\implies$ (3): An induction argument. Suppose $\alpha = \omega^{\delta + 1}$. Then we may express the situation as $X_1 \cup X_2 = \alpha$. Then by induction we have that for every $n \in \omega$, $ot(X_i \cap [\omega^{\delta} \cdot n, \omega^{\delta} \cdot (n+1))) = \omega^{\delta}$ for at least one of $i = \{1, 2\}$. Then one of the $i$ has infinitely many $n \in \omega$ such that $ot(X_i \cap [\omega^{\delta} \cdot n, \omega^{\delta} \cdot (n+1))) = \omega^{\delta}$ and then for this $i$ we have that $ot(X_i) \geq \omega^{\delta}\cdot n$ for every $n \in \omega$, and thus $ot(X_i) = \omega^{\delta + 1}$.

If $\delta$ is a limit, then apply the inductive hypothesis on all $\zeta < \delta$. Then let $A_i = \{\zeta < \delta : ot(X_i \cap \omega^{\zeta}) = \omega^{\zeta} \}$ for $i = \{1, 2\}$. As $A_1 \cup A_2= \delta$, we have for some $i$ that $sup(A_i) = \delta$. Then again we see that $ot(X_i) \geq \omega^{\zeta}$ for all $\zeta < \delta$ and thus $ot(X_i) = \omega^{\delta}$.

(4) $\implies (1) + (2)$: I suppose I don't have to do this since I have that $(4) \implies (3) \implies (2)$ so I'll omit it to save space.

$(1) + (2) \implies (4)$: Let $A = \{\delta \in OR : \omega^{\delta} \leq \alpha \}$. Then take $\eta = sup(A)$. We have that $\omega^{\eta} \leq \alpha$ as well. Suppose for contradiction that $\omega^{\eta} < \alpha$. Then $\omega^{\eta} + \alpha = \alpha$ by assumption. Then it is easy to see by induction that $\omega^{\eta}\cdot n + \alpha = \alpha$ for every $n \in \omega$. Here's a step I'm not sure of: this implies that $\omega^{\eta}\cdot \omega + \alpha = \alpha$. I think such limits can be passed only on the right side of the addition by definition. So it would have been fine if it was $\alpha + \omega^{\eta} \cdot n$ but I'm not sure about $\omega^{\eta} \cdot n + \alpha$. In other words, is $sup_{n \in \omega}(\omega^{\eta} \cdot n + \alpha) = \omega^{\eta} \cdot \omega + \alpha$? Assuming this is true however, this gives us $\omega^{\eta}\cdot \omega + \alpha = \omega^{\eta + 1} + \alpha = \alpha$ which means that $\eta \in A$ contradicting $\eta = sup(A)$.

答:
Your concern about that step in the last part is not misplaced: $n+\omega=\omega$ for all $n\in\omega$, but $\omega+\omega\ne\omega$. (There is also a comparatively minor difficulty with $A$: to employ Comprehension, you really need to limit $\delta$ to a set of ordinals, which basically means coming up with an ordinal $\eta$ such that $\omega^\eta>\alpha$.)

Suppose that $\alpha$ is not a power of $\omega$. Ordinal exponentiation is continuous in the exponent, so if $\alpha$ is not a power of $\omega$, then it is not the limit of powers of $\omega$. Show that there is a largest $\omega^\eta<\alpha$, so that $\omega^\eta<\alpha<\omega^{\eta+1}$. Let $\beta$ be the order type of $\alpha\setminus\omega^\eta$, so that $\alpha=\omega^\eta+\beta$, and conclude that $\beta=\alpha$. Use your induction argument to show that $\omega^\eta\cdot n<\alpha$ for each $n\in\omega$. Then get a contradiction by observing that $\omega^{\eta+1}=\sup\{\omega^\eta\cdot n:n\in\omega\}$.


问:
Finding maxima of a function $f(x) = 4x(16 - x)(6 - x)$ without calculcus
My question is how to prove that $f(x) = 4x(16 - x)(6 - x)$ has its maximum at point $x_0 = \frac{8}{3}$.

I am trying to use arithmetic-geometric inequality, but I am unable to solve it.

答:
The problem can be greatly simplified by considering $f(8/3+t)-f(8/3)$.

This is $4(t^3-14t^2)$. The graph of this cubic has a repeated root at $0$ and a single root at $14$ and is negative at $7$. It therefore clearly has a local maximum at $t=0$ i.e. $x=8/3$.

The same idea can be used for other polynomial functions.


问:
Combinatorics - how to count number of ways to distribute packages
Assume we have $n$  children and we want to distribute $ n $ packages, each package with a name of one children (and they have different names). I want to count for some $ 1\leq j \leq n $ in how many ways can we distribute the packages, such that $ j $ children would get the right package with their name on it, and the rest $ n-j $ children would get the wrong package.

Im not sure how to do it. Thanks in advnace.

答: It would be $\binom{n}{j}$ multiplied by the number of derangements of $n-j.$


答:
There are $\binom{n}{j}$ ways to choose which of the $j$ children get the correct package.

You need to multiply this by the number of ways to give the remaining $n-j$ packages to the remaining $n-j$ children such that they each get the wrong package. This is the number of derangements of $n-j$ objects, which is $(n-j)!\sum_{i=0}^{n-j}\frac{(-1)^i}{i!}$.

Title: Combinatorics - how to count number of ways to distribute packages

Body:
Assume we have $n$  children and we want to distribute $ n $ packages, each package with a name of one children (and they have different names). I want to count for some $ 1\leq j \leq n $ in how many ways can we distribute the packages, such that $ j $ children would get the right package with their name on it, and the rest $ n-j $ children would get the wrong package.

Im not sure how to do it. Thanks in advnace.


问:
What are the odds of picking up 10 cards of a deck of 30 (18 red and 12 blue) and only getting 2 blue cards?
I'm pretty sure you use summation,

10

Σ   (equation here)

n-1

Let's say I pick up a red one. I already know to calculate the odds of getting one (18/30=.6=60%) but what I am asking is what the odds are of picking up multiple cards of different variety.

but what do you do about the 2 blue cards? Do you just replace 10 with 8 since you only got 2 blue cards, or is there something else you have to do?

Edit: I am asking what are the odds of drawing exactly 2 blue cards, not at least 2 blue cards

Edit 2:
This is a good example of what I want to do, but I don't understand the math part of it

Suppose there are 5 black, 10 white, and 15 red marbles in an urn. If six marbles are chosen without replacement, the probability that exactly two of each color are chosen is

https://wikimedia.org/api/rest_v1/media/math/render/svg/d1c732a6291d8d06d36d382de45c024b1b769a4a

答:
We wish to find the probability of obtaining exactly two blue cards when selecting $10$ of the $30$ cards from the deck.  For this to happen, we must select $2$ of the $12$ blue cards and $8$ of the $18$ red cards.  This event has probability
$$\frac{\dbinom{12}{2}\dbinom{18}{8}}{\dbinom{30}{10}}$$
This is an example of a hypergeometric distribution problem since the cards are selected without replacement.

The number
$$\binom{n}{k} = \frac{n!}{k!(n - k)!}$$
(read $n$ choose $k$) represents the number of ways of selecting a subset of $k$ objects from a set with $n$ objects.  See this page on combinations.


问:
Find the value of $k$ for given moment generating function.
If $\displaystyle M(t) =  k\bigg(\frac{e^t}{7}-5e^t\bigg )^3$, find the value of $k$? What is the variance of random variable $X$?

How do go for to find $k$? I don't know where to begin. Any hint or help will be appreciated.

答:
In such a problem, it is a wise first step to ask 'what properties must be met that will give us a way to solve for an unknown variable such as $k$?'.

If $M(t)$ is a moment generating function then we require that $M(0) = 1$.

So $\displaystyle M(0) = k\bigg( \frac{e^0}{7} -5e^0\bigg)^3 =1$

Or in otherwords, $\displaystyle M(0) = k\bigg(\frac{1}{7}-5\bigg)^3 =1$. This should give you what you need to solve for $k$.

As for variance using an MGF, we have the following : $V(X) = M''(0) - [M'(0)]^2$.

I will leave it to you to complete.


问:
Count number of increasing functions, nondecreasing functions $f: \{1, 2, 3, \ldots, n\} \to \{1, 2, 3, \ldots, m\}$, with $m \geq n$.
I stumbled upon a question given like:

Let $m$ and $n$ be two integers such that $m \geq n \geq 1$.

Count the number of functions $$f: \{1, 2, · · · , n\} \to \{1, 2, · · · , m\}$$ of the following two types:

(a) strictly increasing; i.e., whenever $x < y, f(x) < f(y)$, and

(b) non-decreasing; i.e., whenever $x < y, f(x) \leq f(y)$.

I tried in the following way.

For (a). We can say $f(n)>f(n-1)$ AND $f(n)>f(n-2) \ldots f(n)>f(1)$ (total $n-1$ elements)

Similarly for $f(n-1)>f(n-2), f(n-1)>f(n-3) \ldots f(n-1)>f(1)$ (total $n-2$ elements)...

and $f(2)>1$

Like this $$(n-1) + (n-2) + \ldots + (1) = \frac{n(n-1)}{2}$$

Is this correct?

For (b). Since there's equality, it will be $$n + (n-1) + ... (1) = \frac{n(n+1)}{2}$$

Is my approach correct? Any help is appreciated. Thanks in advance.

答:
A different approach for the non-decreasing case.

Set $F(n,m) = |\{ f : \{1, \ldots, n\} \to \{1,\ldots,m\} \mid f \mbox{ is non-decreasing. } \}|$. Then, $F(n,1) = 1$. Furthermore, we have the following recurrence relation:
$$
 F(n,m) = \sum_{i=0}^n F(n - i, m - 1). \quad (*)
$$
Proof. If $f : \{1,\ldots,n\} \to \{1,\ldots,m\}$ is non-decreasing,
set $k = |f^{-1}(1)|$.
Then, $f^{-1}(1) = \{1,\ldots, k \}$ (possibly empty)
and $f$ restricted to $\{ k + 1, \ldots, n \}$ (also possibly empty)
could be seen as a non-decreasing function from $\{k+1,\ldots,n\}$ to $\{2,\ldots,m-1\}$. For the restriction, we have $F(n - k, m - 1)$ many possibilities (the concrete naming of the numbers does not matter, just that they form a consecutive order) and each possibility is determined uniquely. Conversely, from any non-decreasing function $g : \{1,\ldots,n\}\to \{1,\ldots,m\}$ and $0 \le k \le n$ we can uniquely construct a non-decreasing function $f : \{1,\ldots,n+k\} \to \{1,\ldots, m+1\}$ by setting
$$
 f(x) = \left\{
\begin{array}{ll}
 1        & 1 \le x \le k \\
 g(x) + 1 & \mbox{otherwise.}
\end{array}
\right.
$$
So, we have shown the recurrence equation. QED

Now, for the binomial coefficient, the following formula is valid:
$$
 \binom{m}{m} + \binom{m + 1}{m} + \binom{m + 2}{m} + \ldots + \binom{m + n}{m} = \binom{n + m + 1}{m+1},
$$
which is easy to prove by induction. Setting
$$
 G(n,m) = \binom{n + m - 1}{m-1},
$$
we see that $G$ fulfills Equation (*) above, and $G(n,1) = 1$. Hence, inductively, $F(n,m) = G(n,m)$.

A concrete example. Let $a < b < c$, then, non-decreaasing functions with codomain of size three could be interpreted as ordered strings over $\{a,b,c\}$. Then, for the domain of size three, we have the strings
$$
 aaa, aab, aac, abb, abc, acc,
 bbb, bbc, bcc, ccc.
$$
I hope it could be seen how to construct these strings out of the ordered strings over $\{b,c\}$ of length at most three by appending runs of $a$'s in front of them.


问:
Traditional correlation function for a non 2nd order stationary random function?
Consider an intrinsic RF Z(x) that is not second order stationary.

Considering an arbitrary reference RV Z(x0), how to express traditional correlation function in terms of covariance of increments expressed with reference to Z(x0).

答:
Using the notation of the Wikipedia article, it is easy to show that
$$
2\gamma (x,y) = C(x,x) + C(y,y) - 2C(x,y) + [{\rm E}(Z(x)) - {\rm E}(Z(y))]^2 .
$$
Indeed, this follows straightforwardly from
$$
2\gamma (x,y): = {\rm E}(|Z(x) - Z(y)|^2 ) = {\rm E}(Z(x)^2 ) + {\rm E}(Z(y)^2 ) - 2{\rm E}(Z(x)Z(y)),
$$
$$
C(x,x): = {\rm Cov}(Z(x),Z(x)) = {\rm Var}(Z(x)),
$$
$$
C(y,y): = {\rm Cov}(Z(y),Z(y)) = {\rm Var}(Z(y)),
$$
and
$$
C(x,y):={\rm Cov}(Z(x),Z(y)) = {\rm E}(Z(x)Z(y)) - {\rm E}(Z(x)){\rm E}(Z(y)).
$$
In case of a weak stationary $Z$ (hence, in particular, in case of a second-order/strict stationary $Z$ with finite covariance), the expectation does not vary with respect to location, that is ${\rm E}(Z(x)) = {\rm E}(Z(y))$; hence the Wikipedia formula
$$
2\gamma (x,y) = C(x,x) + C(y,y) - 2C(x,y)
$$
for stationary $Z$ (with finite covariance function),
and, in turn, the Wikipedia claim that for a non-stationary process the square of the difference between expected values at both points must be added (however, in the equation following that claim, that term was mistakenly subtracted, instead of being added).</p>


问:
Using Differentials (not partial derivatives) to prove that d/dx = -sin()/r
I am trying to prove the parts of each component of the inverse matrix in the attached image. I have tried using differentials and then solving for the other components. (I'd like to solve it this way). Trying to solve for example, $\frac{d\theta}{dx}$ (in the bottom left of the inverse matrix [attached below]) $$x = r cos(\theta)$$ –> $$dx = cos(\theta)dr - rsin(\theta)d\theta$$Then observing that we are holding $r = constant$, thus $dr = 0$. I get that $\frac{d\theta}{dx} = \frac{- 1}{r sin(\theta)}$, which is close. I put this in a partial calculator and made $\theta$ a function of x and r, $\theta = cos^{-1}\left(\frac{x}{r}\right) = \cos^{-1}\left(\frac{x}{\sqrt{x^2 +y^2}}\right)$. Taking the $\frac{\partial \theta}{\partial x}$ I get the right answer due to r being a function of x and y. If I use the $cos^{-1}\left(\frac{x}{r}\right)$ and take the partial I get what I stated above ($\frac{d\theta}{dx} = \frac{- 1}{r sin(\theta)}$). Also I tried to replace dr in $dx = cos(\theta)dr - rsin(\theta)d\theta$ by using $r^2=x^2+y^2$ by replacing dr with $rdr = xdx + ydy$ where I assumed dy to be constant. Which yielded me the wrong answer. I'd like to improve my logical thinking so any advice on what I did would be great as well. Thank you!

Summary: I am trying to prove using differentials (not partials) that $\frac{d\theta}{dx} = \frac{-sin(\theta)}{r}$

答:
The issue is that you cannot just write $\frac{d\theta}{dx}$. In thermodynamics, there is a notation which really is useful and important. They write partial derivatives with a subscript to indicate what variable(s) are left fixed. So, for example, if we have $z=f(x,y)$ and we want to find the derivative of $f$ with respect to $x$, fixing $y$, we write $$\left(\frac{\partial f}{\partial x}\right)_y \quad\text{or}\quad \left(\frac{\partial z}{\partial x}\right)_y.$$
This is important because we may have lots of variables flying around and it's important to know what variable(s) are fixed.

In your example, we can think of $(x,y)$ as functions of $(r,\theta)$. Then if we write $\partial x/\partial\theta$, this ordinarily signifies $\left(\frac{\partial x}{\partial\theta}\right)_r$. When you fix $r$, then it becomes true (because we're essentially doing one-dimensional calculus) that
$$\left(\frac{\partial\theta}{\partial x}\right)_r = \frac 1{\left(\frac{\partial x}{\partial\theta}\right)_r}.$$
However, you're muddling things by instead trying to compute $\left(\frac{\partial\theta}{\partial x}\right)_y$, and these are two totally different beasts. You really must be careful about keeping track of the independent variables. If you change those, more chain rule comes in.

Just to reiterate, you are trying to compare
\begin{align*}
\left(\frac{\partial\theta}{\partial x}\right)_r &= -\frac1{r\sin\theta} = -\frac1y \quad\text{and} \\
\left(\frac{\partial\theta}{\partial x}\right)_y &= -\frac{y}{x^2+y^2} = -\frac{\sin\theta}r.
\end{align*}

By the way, be warned. In general, we do not have
$\frac{\partial x}{\partial\theta} = \frac1{\frac{\partial\theta}{\partial x}}$. Indeed, since $x=r\cos\theta$, we have $\partial x/\partial\theta = -r\sin\theta$ (which is $-y$). On the other hand, since $\theta =\arctan(y/x)$ (at least for $-\pi/2<\theta<\pi/2$), we have $\partial\theta/\partial x = -\frac y{x^2+y^2}$, which is very different from $-y$. This is your $-\sin\theta/r$, of course. The correct relation comes from the complete derivative matrices (called Jacobians), which are inverse $2\times 2$ matrices.

You can do this all correctly with differentials (differential forms, in fact), but you must still keep track of who the independent variables are. And you really must stop writing things like $d\theta/dx$ unless $\theta$ really is a function just of one variable $x$. To get your first formula, you would have to write $d\theta$ in terms of just $dx$ and $dr$; to get the second you would have to write $d\theta$ in terms of the usual $dx$ and $dy$. It's just a question of what the independent variables are.


问:
Speed, distance, time problem
A woman drives a distance of 40 km to work each day, her average speed is v km/h. If she increases her average speed by 5 km/h, her trip is 2 minutes shorter in time than her normal time.
What is her normal speed in km/h?</p>

答:
So you can see she will travel 40/v hours normally. So then increase by 5 so v+5. then time is 40/(v+5) hours. 2 minutes=1/30 hours, so we having 40/v=40/(v+5)+1/30 so v=75,-80 but speed is positive so v=75 km/h.

Confirming: normal speed 75 km/h with distance 40 km so final time=40/75=8/15 hrs=32 minutes. sped up speed=75+5=80 km/h with distance 40 km so final time=40/80=1/2 hrs.=30 minutes. 32-30=2 minutes so it is correct.

Title: Speed, distance, time problem


问:
Can we prove the existence of $A\cup B$ without the union axiom?
If $A$ and $B$ are sets, then $A\cup B$ is defined as follows:
$$A\cup B:=\{x: x\in A \, \, \,\text{ or } \, \, \, x\in B\}.$$

In ZFC, $A\cup B$ exists because $\bigcup\{A, B\}$ exists by union axiom, and it is known that axiom of union is independent of rest of ZFC.

If there is a set such that $A\subseteq C$ and $B\subseteq C$, then we can define $A\cup B$ using the $C$ and separation axiom. But can I prove the existence of $C$ in ZF-Union? Thanks for any help.

答:
As Andrés' answer points out, ZFC - Union proves the existence of finite unions, and much more. AC is in fact essential for this theorem, for ZF proves Con(ZF - Union + "there are $x,y$ such that $x \cup y$ doesn't exist").

Recall that $\aleph(x)$ is defined to be the least ordinal which does not inject into $x$ and $\aleph^*(x)$ the least ordinal which $x$ does not surject onto.

Lemma: For infinite $A,$ define $H'(A)= \{x: \forall y \in TC(\{x\}) (|y| \le |A|) \}.$ Then $H'(A) \subset V_{\aleph^*(A)^+}.$ In particular, $H'(A)$ is a transitive set.

Proof of lemma: Let $\kappa=\aleph^*(A).$ It suffices to find a surjection from $\kappa$ onto $\text{rk}``(TC(\{x\})$ for $x \in H'(A).$

We will recursively define surjections $f_{x,n}: \kappa \rightarrow \text{rk}``(\bigcup^n \{x\})$ for all $x \in H'(A).$ Suppose we have defined all such functions up through $n.$ Define a surjection $g_{x, n+1}: \kappa \times x \rightarrow \text{rk}``(\bigcup^{n+1} \{x\})$ by $(\alpha, y) \mapsto f_{y,n}(\alpha).$ For each $\alpha, \text{ot}(g_{x, n+1}``(\{\alpha\} \times x))<\kappa,$ yielding a canonical surjection $f_{x, n+1}: \kappa \simeq \kappa \times \kappa \rightarrow \text{rk}``(\bigcup^{n+1} \{x\}).$ This completes the recursion, and now we define a surjection $f_x: \kappa \simeq \kappa \times \omega \rightarrow \text{rk}``(TC(\{x\}))$ by $(\alpha, n) \mapsto f_{x, n}(\alpha).$

Now, to prove the main result, we work in the Bristol model, a certain submodel of $L[c]$ ($c$ a Cohen real over $L$) which, among many interesting properties, satisfies ZF + existence of a set $A$ such that $A$ does not inject into $\mathcal{P}^n(\alpha)$ for any ordinal $\alpha$ and $n<\omega.$ (See https://arxiv.org/pdf/1704.06939.pdf) Fix such an $A.$ Let $\kappa = \aleph(\mathcal{P}^{\omega}(A)).$

Let $M=\{x: \forall y \in TC(\{x\}) \exists n<\omega(|y| \le |\mathcal{P}^n(A)| \vee |y| \le |\mathcal{P}^n(\kappa)|)\}.$ Applying the lemma to $\mathcal{P}^{\omega}(A \cup \kappa),$ we see that $M$ is a transitive set. We check that $M \models \text{ ZF - Union + there are $x,y$ such that $x \cup y$ doesn't exist}).$

We get extensionality and foundation from $M$ being transitive. Pairing, infinity, and power set are clear. We get separation and replacement from $M$ being closed under subset and surjection  (noting that if $x$ injects into $y,$ any surjective image of $x$ injects into $\mathcal{P}(y)$). Finally, $A, \kappa \in M,$ yet $A \cup \kappa \not \in M.$


问:
How To Solve Equation With Division By Zero
I have an equation that I've been given the task to solve as part of a course I am doing:

```<code>x = (y * a - z * b) / (u * (b - a))
</code>```

This has worked fine, but in the only question I have left, b - a = 0, in which case u * (b - a) = 0 and therefore I am trying to divide by 0.

I am literally tearing my hair out trying to solve this - how do I rearrange it so that I can calculate x when b - a = 0?

Btw, I am happy to state that this is unsolvable in these circumstances, but I must be certain that it is before I submit my work.

答: Whenever people write $x/y$, there's almost always an implicit assumption that $y \neq 0$. In your example, $x$ is undefined when $b-a=0$; it simply does not make sense to ask what the value of the function would be there.


答:
$f(x)=4x(16-x)(6-x)=4x^3 - 88x^2 +384x$

Now calculate it's derivative
$f'(x)=12x^2 -176x + 384 = 12(x-6)(x - \frac{8}{3})$

Now just find increasing and decreasing intervals

$f(x)$ is increasing on $ x< \frac{8}{3} $ and $ x>6$

And decreasing on ($ \frac{8}{3} ; 6)$ so after that you can say $x_0 = \frac{8}{3} $ is a local maximum point

Title: Finding maxima of a function $f(x) = 4x(16 - x)(6 - x)$ without calculcus

Body:
My question is how to prove that $f(x) = 4x(16 - x)(6 - x)$ has its maximum at point $x_0 = \frac{8}{3}$.

I am trying to use arithmetic-geometric inequality, but I am unable to solve it.


问:
Question on Contractions
Let $S = \{x \in \mathbb{R}^n ;  \|x\| \le 1  \}$ and $f: S \to S$ be a contraction. Determine one can have $f(S) = S$.

I really need some help with this question. In advance I wanted to give all the necessary definitions needed for this question.

Definition:

Let $(X, P)$, $(Y, P')$ be metric spaces and $f: X \rightarrow Y$ a function. Let $M \in \mathbb{R}$ with $M > 0$. We say that $f$ satisfies a Lipschitz  condition with Lipschitz constant $M$ if $\forall x, y \in X: P'(f(x), f(y)) \le M P(x,y)$

Let $(X, P)$, $(Y, P)$ be metric spaces and $f: X \rightarrow Y$ a function. We say that $f$ is a contraction (mapping) if $f$ satisfies the  Lipschitz  condition on $X$ with some Lipschitz constant $M \in (0,1)$.

答:
Consider the function $g:S\times S\longrightarrow [0,+\infty)$ defined by
$$
g:(x,y)\longmapsto \|f(x)-f(y)\|.
$$
Since $g$ is continuous and $S\times S$ is compact, it attains its sup, which is the diameter of $f(S)$:
$$
\mbox{diameter} \;f(S)=\sup g=\max g=\|f(x_0)-f(y_0)\|<\|x_0-y_0\|\leq 2=\mbox{diameter} \;S.
$$
Since they don't have the same diameter, the sets $S$ and $f(S)$ can't be equal.</p>

Title: Question on Contractions


问:
Model theory textbook to learn about the consistency and independency proofs
Is there a model theory textbook that describes how to build boolean-valued models to prove the consistency of a sentence with a theory? It would be great if the book also contained basic techniques to prove the independence of a sentence from a given set of sentences. P.S. I'm a beginner and looking for a rather clear and not encyclopedic book. I already have Keisler's, Tent's and Hodges' electronic books but don't know if they are good to study the topics I've mentioned.</p>

答:
You will not find Boolean-valued models in any model theory textbooks. Instead, you want a set theory book that takes the Boolean-values models approach to forcing.

The classic is Bell's Set Theory: Boolean-Valued Models and Independence Proofs.

Another option is Jech's Set Theory, but this book is definitely encyclopedic!


问:
Why isn't $\{\frac{1}{n}\}_{n \in \mathbb{N}} \cup \{0\}$ a neighborhood retract of any of its neighbourhoods?
I'm trying to understand why there doesn't exist any neighbourhood $U \supset \{\frac{1}{n}\}_{n \in \mathbb{N}} \cup \{0\}$ such that $\{\frac{1}{n}\}_{n \in \mathbb{N}} \cup \{0\}$ is a retract (not necessarily a $\textit{deformation}$ retract, as posted here - although I don't understand the argument given there either: why is "But $U_0$  contains infinitely many points of $X$ onto which it must deformation retract" a contradiction) of $U$. Now, if there were such a retract, then by definition there would exist a neighbourhood $U \supset  \{\frac{1}{n}\}_{n \in \mathbb{N}} \cup \{0\}$ and a continuous function $g: U \to \{\frac{1}{n}\}_{n \in \mathbb{N}} \cup \{0\} \doteq V$ such that $g|_{V} = \operatorname{Id}_V$. Intuitively I know such a function cannot be continuous at $0$ and so there is no such neighbourhood, but I haven't been able to prove this. Can anyone help me? I'd appreciate it!

答: $U$ is open and contains $0$, hence contains some open interval $(-a,a)$ with $a>0$. Pick $n>\frac1a$. Then $I:=[\frac1{n+1},\frac1n]\subset (-a,a)\subseteq U$. From $g(\frac1{n+1})=\frac1{n+1}$ and $g(\frac1n)=\frac1n$, it follows by the Intermediate Value Theorem (viewing $g$ as a function $I\to\Bbb R$) that $g(\xi)=\frac{\frac1{n+1}+\frac1n}{2}$ for some $\xi\in I$, but $\frac{\frac1{n+1}+\frac1n}{2}\notin V$.


答:
We know that $\text{speed}=\dfrac{\text{distance}}{\text{time}}$.

Hence, assuming that the woman's workplace is $40$km away, and her average speed for this journey $v$ km/h, the average time is takes for her to get to work is: $\quad t=\dfrac{40}{v}$.

Now if she travels 5 km/h faster, cutting 2 minutes ($\frac{1}{30}$ hours), the equation for $t$ becomes: $$t-\frac{1}{30}=\frac{40}{v+5}.$$

I.E: $$\frac{40}{v}=\frac{40}{v+5}+\frac{1}{30}.$$

Solving for $v$ yields $v=75$.

Title: Speed, distance, time problem

Body:
A woman drives a distance of 40 km to work each day, her average speed is v km/h. If she increases her average speed by 5 km/h, her trip is 2 minutes shorter in time than her normal time.
What is her normal speed in km/h?</p>


问:
Geometric interpretation of FINDING eigenvectors
I have a pretty good idea for the geometric interpretation of what eigenvectors are I think.

When following the steps:
\begin{equation}
Ax = \lambda x
\\
(A - \lambda I)x = 0
\end{equation}

Obviously it works because subtracting $\lambda x$ from $Ax$ will only be zero when they are equal.  However, I don't quite intuitively understand.

Subtracting by $\lambda$ in $R^2$ seems to move $\hat i $ in the x-direction by $\lambda$ and $\hat j $ in the y-direction by $\lambda$ until they are on the same line thus meaning $det(A - \lambda I) = 0 $.  I still don't completely understand why this gives us the eigenvector of our original transformation $A$ though.

Hope this has not been asked before, and makes sense. Thanks for reading.

答:
It sounds like what you're trying to understand is, in a general sense, why is it that for matrices $A,B$ and a vector $x$, we have
$$
Ax = Bx \implies (A - B)x = 0.
$$
In order to understand why this should hold in a "geometric" sense, we need a geometric interpretation of the transformation associated with $A-B$ in relation to the transformations associated with $A$ and $B$. Note that the transformation $A-B$ can be thought of as the following process:

Apply $A$ to get $Ax$,

Apply $B$ to get $Bx$,

Subtract these to get $Ax - Bx$.

The result of applying $(A-B)$ to $x$ is this difference $Ax - Bx$.

With that in mind, consider what happens when $B = \lambda I$.  The result $Ax - \lambda x$ is zero if and only if $Ax$ and $\lambda x$ are the same vector. That is, $(A - \lambda I)x = 0$ if and only if $A$ scales the vector $x$ by a factor of $\lambda$.


问:
Consider a Group $G$ of order $20$ such that $G=Aut$($Z_{25},+) \cong (U_{25}, \cdot)$. Analyze the Sylow subgroups in G.
$G=Aut$($Z_{25},+) \cong (U_{25}, \cdot)$

I know that there is one 5-Sylow subgroup and number of $2-Sylow$ subgroups is either $1$ or $5$.

(a) How do I decide whether the number of distinct 2-Sylow subgroups is $1$ or $5$.

(b) I need to show an explicit subgroup in G of each Sylow type;listing its elements in $U_{25}$.

Any guidance is greatly appreciated. Thanks!

答:
The group of units mod $25$ is cyclic, since $25 = 5^2$ is a power of an odd prime. All subgroups of a cyclic group are normal and themselves cyclic.

Since they are normal, there is exactly one $p$-Sylow subgroup for each prime $p$ dividing the order (so for $p=2$ and $p=5$).

And since all subgroups are cyclic, in particular the $2$-Sylow and the $5$-Sylow are cyclic (or orders $4$ and $5$ respectively).


问:
Linear map proof and $_{kan}[f]_{kan}$ matrix
How can I proove that $f:R^2\to R^2$, $f((x,y)^T)=(2x+y,x-2y)^T$ is linear map?
And what is its matrix $_{kan}[f]_{kan}$ for canonic basis $R^2$ then?

答:
$f$ is linear since $\forall(x,y)\in \mathbb R^2,f(x,y)=(ax+by,cx+dy)$, where $(a,b,c,d)=(2,1,1,-2)$

The images of the canonical vectors $C=\{e_1,e_2\}$ are
$$f(e_1)=f(1,0)=(2,1)$$
$$f(e_2)=f(0,1)=(1,-2).$$
The representative matrix will be $\mathcal M_c^c(f)=\begin{pmatrix}2 & 1\\1 & -2 \end{pmatrix}$ and this also shows that $\text{dim}(Im(f))=2$, since the vectors that span the image of $f$ are linearly independent.


问:
How to prove that if two independent variables have different densities then they are different?
Suppose that we have two continuous independent random variable $X$ and $Y$ with respective densities $f_x$ and $f_y$, how can we prove that $X$ is different than $Y$.

I thought about proving it by contradiction using the definition of the probability of a random variable ( using integral equalities to prove that densities are equals therefore the absurdity ) but I didn't utilize independency there so I felt like it's wrong ( also I'm not sure if two lebesgue integrals are equals in the same interval then the functions integrated are also equals ).

答:
If we have that $X \perp \!\!\! \perp Y$ then we know that $\displaystyle f_{X,Y}(x,y) = f_X(x)\cdot f_Y(y)$.

We can either have $P(X=Y) = 0$ or $f_X \neq f_Y$ as our " measure" of them being different.

For a given $z$ we have

$P(X =z, Y =z) = P(X=z)P(Y=z) = 0 \cdot 0$.

More work is required to get that $P(X=Y)=0$. See @angryavian's answer.


问:
Bayes' rule for conditional probability
Problem statement:

Your neighbour has a broken alarm system. Whenever someone breaks into his house, the alarm goes off with a probability of 95%. However, during the last 8 weeks, the alarm went off 7 times, for no reason. The probability of someone breaking into the house is 0.0005. Suppose the alarm of your neighbour starts making noise, what is the probability of someone trying to break in?

So I named I the event of a break-in and A the event of the alarm working. This gives me probabilities
$$P(A|I) = 0.95, \quad P(I) = 0.0005$$
and we are looking for $P(I|A)$. However, I have no idea what to do with the statement about the alarm going off 7 times in the last 8 weeks for no reason...

Using Bayes rule, the only probability which I don't know is $P(A|\overline{I})$, so I suspect this statement having to do something with this unknown probability.

Any suggestions? I hope no details went lost in translation, English is not my first language.

答:
The problem statement itself is not completely clear, but I suppose we can assume that they meant that "The probability of someone breaking into the house is 0.0005 each night", and that "during the last 8 weeks, the alarm went off 7 different nights".

The last two weeks contains $8 \cdot 7 = 56$ nights, of which 7 times the alarm rang, therefore the probability of the alarm going off without anyone trying to break in must be approximately $\frac 18$

Title: Bayes' rule for conditional probability


问:
Finding maxima of a function $f(x) = 4x(16 - x)(6 - x)$ without calculcus
My question is how to prove that $f(x) = 4x(16 - x)(6 - x)$ has its maximum at point $x_0 = \frac{8}{3}$.

I am trying to use arithmetic-geometric inequality, but I am unable to solve it.

答:
If AM-GM is allowed then when $x \in (0,16)$ we have
$$4x(16-x)(6-x) = \frac 15 (5x) (16-x) (4(6-x))\\ \le \frac 15 \left( \frac{5x+16-x+24-4x}{3}\right)^3 = \frac 15 \cdot \left(\frac{40}{3} \right)^3$$
The equality holds when $5x=16-x=24-4x$, or equivalently $x=\frac 83$.


问:
$g \varphi = \varphi^2 g$, $g$ injective implies that $\varphi$ and $\varphi^2$ have the same kernel, image, eigenvalue and eigenspace

Suppose that $\varphi$ and $g$ are linear transformations from $\mathbb{R^n}$ to $\mathbb{R}^n$ such that $g \circ \varphi = \varphi^2 \circ g$ and $g$ is injective. Show that $\varphi$ and $\varphi^2$ have the same kernel, image, eigenvalues and eigenspaces.

I think I need some validity check on the first part.

As $g$ is injective on finite dimensional vector space, it is in fact bijective, hence invertible. So I somehow rewrite it as
$$
g \varphi g^{-1} = \varphi^2
$$
so $\varphi$ and $\varphi^2$ are "similar". As similar transformations have the same rank and $\ker \varphi \subseteq \ker \varphi^2$, their kernel, hence image, must be equal.

The problem now lies in the eigenvalues and eigenspaces. I know that the eigenvalues of $\varphi$ and $\varphi^2$ will agree because similarity, but I don't know about whether the eigenspaces will agree or not.

答: Hint: Show that every eigenvector of $\varphi$ must in turn be an eigenvector of $\varphi^2$. Then, note that because $\varphi^2$ is similar to $\varphi$, the sum of the dimensions of the eigenspaces of $\varphi^2$ must be equal to that of $\varphi$. Thus, $\varphi^2$ can't have "more eigenvectors" that $\varphi$.


问:
Find time to collision in a pursuit

Problem 1.13 from Irodov's Problems in General Physics:

Point A moves uniformly with velocity $v$ so that the vector $v$ is continually "aimed" at point B which in its turn moves rectilinearly and uniformly with velocity $u<v$. Initially, $v⊥u$, and the points are separated by a distance $l$. The time at which the points converge is given as?

If we write $\tau$ as the time to collision, then we can immediately find
$$\int_0^\tau v\cos\theta\,dt=u\tau\Leftrightarrow\int_0^\tau\cos\theta\,dt=\frac{u\tau}{v}\\\int_0^\tau v\sin\theta\,dt=l\Leftrightarrow\int_0^\tau\sin\theta\,dt=\frac{l}{v}$$
Irodov asserts that
$$\int_0^\tau(v-u\cos\theta)dt=l$$
It turns out that if we consider $\vec w=\vec v-\vec u=(v\cos\theta-u,v\sin\theta)$, then $v-u\cos\theta$ is $v\cos\theta-u$ in the basis $(\hat v,\hat v_\perp)$, where $\hat v=(\cos\theta, \sin\theta)$ and $\hat v_\perp=(\sin\theta,-\cos\theta)$ in $(\hat\imath,\hat\jmath)$.

$\vec w=(v-u\cos\theta,-u\sin\theta)$ in $(\hat v,\hat v_\perp)$.

Consider integrating $\vec w$ (I use the integrals of the sine and cosine above in the process)
$$\int_0^\tau\vec w\,dt=\left(\int_0^\tau(v\cos\theta-u)\hat\imath dt\right)+\left(\int_0^\tau(v\sin\theta)\hat\jmath dt\right)=l\hat\jmath$$
Now consider the same but with the coordinates in $(\hat v,\hat v_\perp)$
$$\int_0^\tau\vec w\,dt=\left(\int_0^\tau(v-u\cos\theta)\hat v dt\right)+\left(\int_0^\tau(-u\sin\theta)\hat v_\perp dt\right)=\left(\frac{v^2-u^2}{v}\tau\right)\hat v-\left(\frac{ul}{v}\right)\hat v_\perp$$
If we equate both integrals and take the norm squared, we get
$$\left(\frac{v^2-u^2}{v}\tau\right)^2+\left(\frac{ul}{v}\right)^2=l^2\Leftrightarrow\tau=\frac{l}{\sqrt{v^2-u^2}}$$
But this is wrong, the actual value is
$$\tau=\frac{vl}{v^2-u^2}$$
Can anyone spot the error? Thank you!

答:
Given that A always aims at B, establish the equation below
$$\frac{v_y}{v_x}=\frac{-y}{ut-x}$$

Rewrite it as $x-ut = y\frac{v_x}{v_y}$ and differentiate both sides wrt. time
$$-\frac uy  = \frac{d}{dt} \left(\frac{v_x}{v_y}\right)\implies \frac uv \frac {dy}y = \frac{v\>{dv_y}}{v_y^2\sqrt{\frac{v^2}{v_y^2}-1}}
$$
where $v^2=v_x^2+v_y^2$ and $\frac{dv_y}{dt}=v_y \frac{dv_y}{dy}$ are applied. Integrate both sides to arrive at

$$\frac uv \ln\left(-\frac{y}l\right) = \cosh^{-1}\frac v{v_y}
$$

Then, the collision time can be obtained as follows

$$\tau = \int_0^\tau dt =
 \int_{-l}^0 \frac{dy}{v_y}
=\frac1{v} \int_{-l}^0
\cosh\left[\frac uv \ln \left(-\frac{y}l\right) \right] dy=\frac{vl}{v^2-u^2}
$$

Title: Find time to collision in a pursuit


问:
Matrix power rank problem

Prove that for a square matrix $A$ with $\mathrm{rank}(A^2) = \mathrm{rank}(A)$, we also have that $\mathrm{rank}(A^k) = \mathrm{rank}(A)$ for all $k\ge 2$.

I used the inequality of Frobenius to see that
$$\mathrm{rank}(A^2) + \mathrm{rank}(A^2) \le \mathrm{rank}(A) +\mathrm{rank}(A^3).$$

Then utilizing the given equality we see that $\mathrm{rank}(A) \le \mathrm{rank}(A^3)$ which along with the inequality
$$\mathrm{rank}(AB) \le \min(\mathrm{rank}(A),\mathrm{rank}(B))$$
would imply that $\mathrm{rank}(A) = \mathrm{rank}(A^3)$.

Is this proof valid? I understand I need to deal with the rest of the $k$ through the same process.

答: This is a valid proof. For another proof using linear transformations and their images see A square matrix $A$ is such that $\mathrm{rank}(A^{k}) = \mathrm{rank}(A^{k+1})$.</p>

Title: Matrix power rank problem


问:
If $\lim_{h \rightarrow 0}$, then where does $|h|$ spring from?
To avoid typos, please see my screen captures below, and the red underline. The question says $h \rightarrow 0$, thus why $|h|$ in the solution? Mustn't that $|h|$ be $h$?

Spivak, Calculus 2008 4 edn.  His website's errata lists no errata for these pages.

答:
Note that the definition of a limit involves the inequality $0 < |x - a| < \delta$. Substituting $a = 0$ and $x = h$ yields
$$
0 < |h| < \delta,
$$
which is the inequality that you've underlined.


答:
In general, if $(X,Y)$ has joint density $f_{X,Y}$, then the probability that $(X,Y)$ lies in some subset $A \subseteq \mathbb{R}^2$ is the two-dimensional integral
$$P((X,Y) \in A) = \iint_A f_{X,Y}(x,y) \, dx \, dy.$$
In this case, you do have a joint density: $f_{X,Y}(x,y) = f_X(x) \cdot f_Y(y)$.
And in your case, $A = \{(x,y) : x=y\}$ is a diagonal line in the $(x,y)$-plane. The two-dimensional integral of a function over a region with no area (like a line) is zero.

[Update: I noticed you mentioned Lebesgue integrals in your question, so I am guessing you would understand that the integral over a set of measure zero is zero.]

Title: How to prove that if two independent variables have different densities then they are different?

Body:
Suppose that we have two continuous independent random variable $X$ and $Y$ with respective densities $f_x$ and $f_y$, how can we prove that $X$ is different than $Y$.

I thought about proving it by contradiction using the definition of the probability of a random variable ( using integral equalities to prove that densities are equals therefore the absurdity ) but I didn't utilize independency there so I felt like it's wrong ( also I'm not sure if two lebesgue integrals are equals in the same interval then the functions integrated are also equals ).


问:
Proof of the uniqueness of maximal ideal
Let $R$ be a commutative ring with $1$. Let $M$ be a maximal ideal of $R$ such that $M^2 = 0$. Prove that $M$ is the only maximal ideal of $R$.</p>

答: Let $M'$ be a maximal ideal. Then $F=R/M'$ is a field and $M$ maps to an ideal $\overline M$ in this field with $\overline M\cdot \overline M=0$. Since $F\cdot F\ne 0$, we conclude $\overline M=0$, i.e. $M\subseteq M'$.</p>


答: $h$ might tend to zero from either side, so the statement $$-\delta \lt h \lt \delta \iff 0\lt |h| \lt \delta$$ is required.

Title: If $\lim_{h \rightarrow 0}$, then where does $|h|$ spring from?

Body:
To avoid typos, please see my screen captures below, and the red underline. The question says $h \rightarrow 0$, thus why $|h|$ in the solution? Mustn't that $|h|$ be $h$?

Spivak, Calculus 2008 4 edn.  His website's errata lists no errata for these pages.


答:
Writing
$$
0 < |h| < \delta
$$
is easier than writing
$$
-\delta  < h < \delta   \text{ and } h \ne 0 .
$$


问:
Residue Theorem if Pole is on Contour
This is  a question on contour integration. The particular problem has a (simple) pole on the contour which prohibits a direct application of Cauchy's Residue Theorem.

Daniel Fischer commented as follows

Not really. [...] if the contour is smooth at the pole, it's as if half of the pole lies inside the contour and half outside. If the contour has a corner at the pole, with (inner) angle $\alpha$, the fraction is $\alpha2\pi$, so you get $\alpha i$ times the residue of the pole instead of $2\pi i$ times as for singularities properly enclosed by the contour.

The same result is mentioned in this question.

Unfortunately, Daniel didn't know a reference for this (generalised) result. Can anyone point me to a book/paper/recourse which covers this result? I'd like to see a proof and some maths underlying this intuition.

Thank you very much!

答:
In both cited questions there is not truly a “pole on the contour”, I agree with paul garrett that this is a confusing phrase which requires a careful definition. Instead the principal value is considered, whose purpose is precisely to avoid a pole on the contour. Regarding a (poor man’s) proof of the statement, consider integrating a function $f$ along a contour $C$ consisting of two pieces, one that goes straight from a point $a$ on the negative real axis to the origin, then in a straight line from the origin to a point $b$ in the upper half plane (we do not lose any generality by doing this). Let’s call the (smallest) angle made by the broken contour $\alpha$. (We’ll also assume $f$ is analytic in an open region containing $C$.) The quantity we’d like to consider is of the form $$\lim_{\epsilon \rightarrow 0} \int_C dz \frac{f(z)}{z+i\epsilon}.$$ For any positive $\epsilon$ there is no “pole on the contour”, but it’s also not unforgivable to say “in the limit there is a pole on the contour”. Words aside, for any $0 < \epsilon$ (and small enough compared to $|a|$ and $|b|$) we can draw a circle around the point $-i\epsilon$ of radius, say, $2 \epsilon$. Consider then the points of intersection of this circle with $C$, and define a new contour $C’$ which goes from $a$ to the intersection on the negative real axis, then along a piece of the circle until the second intersection point on the segment $[0,b]$, and finally straight along that segment until $b$. Now, we can deform $C$ onto $C’$ while keeping the value of the integral invariant because $f$ is analytic in the region enclosed by the two curves. Now we use the definition of contour integration along $C’$. The contributions from the straight pieces, in the limit $\epsilon \rightarrow 0$, give the principal value $PV \int_C dz f(z)/z$, by definition. You’ll see that the integral along the arc is equal to $-i \alpha f(0)$ (in the limit $\epsilon \rightarrow 0$).

This should give you some techniques to handle problems in similar contexts.

Title: Residue Theorem if Pole is on Contour


问:
$A= \begin{bmatrix}-1 & 1 & 1 &1\\ 1 & -1 & 1 &1\\ 1 & 1 & -1 &1\\ 1 & 1 & 1 &-1\\ \end{bmatrix}$ $A$ is a symmetric matrix.Find its eigenvalues?
$A= \begin{bmatrix}-1 & 1 & 1 &1\\
1 & -1 & 1 &1\\ 1 & 1 & -1 &1\\ 1 & 1 & 1 &-1\\
\end{bmatrix}$

$A$  is a symmetric matrix.Find its eigenvalues ?

I saw this question in my book. I know that it can be solved using the cofactor definition of determinant and its eigenvalues are $+2,-2$

However, this process is cumbersome . I wonder that whether there is any trick or shortcut for finding its eigenvalues .

答:
There is a cool argument borrowed from representation theory to calculate the eigenvectors of a circulant matrix $A$: in these matrices, each column is obtained from the previous one by shifting to the right its elements. In the shift, the last element goes back to the beginning. Formally, let $R$ by the permutation matrix that sends $e_i$ to $e_{i+1}$ for $i=1, 2,3$ and $e_4$ to $e_1$. Let also $A_i$ be the $i$-th column of $A$. The fact that $A$ is circulant formally writes as $A_{i+1} = RA_i$ for $i=1,2,3$ and $A_1 = R A_3$.

Recipe. Suppose $A$ is a 4x4 circulant matrix. Suppose the first row is $(v_1, v_2, v_3, v_4)$. If $i^2 = -1$, then its complex eigenvalues are:
$$ v_1+v_2+v_3+v_4$$
$$(v_1-v_3) +i(v_2-v_4) $$
$$v_1-v_2+v_3-v_4$$
$$(v_1- v_3) -i(v_2-v_4) $$

In your case you get $2,-2,-2,-2$.

Upshot. By the end of the answer you will know how to generalize this to higher dimensions, and I highly recommend you to do this exercise.

Proof. The key observation is the following: being circulant implies $AR = RA$. Indeed, for any $i = 1,2,3$ we have

$$ A R e_i = A e_{i+1} = A_{i+1} = R A_i = RA e_i $$

and the same holds for $i=4$. Since $AR,RA$ coincide on a basis, they are equal.
How the hell this fits into the eigenvalue problem? Firstly, notice that $R$ is diagonalizable, and its eigenvectors are
$$z_1  =(1,1,1,1)$$
$$z_2 = (1,i,i^2, i^3)$$
$$z_3 =(1,-1, 1, -1)$$
$$z_4 = (1,-i,-1, i)$$

where $i^2=-1$.Indeed:

$$ Rz_1 = R(1,1,1,1) = (1,1,1,1) = \lambda_1 z_1 = z_1$$
$$ Rz_2 = R(1,i,-1,-i) = (-i,1,i,-1) = -i(1,i,-1,-i) = \lambda_2 z_2 = -i z_2 $$
$$ R z_3 = R(1,-1,1,-1) = (-1,1,-1,1) = - (1,-1,1,-1) = \lambda_3 z_3 = - z_3 $$
$$ R z_4 = R(1,-i,-1, i) = (i,1,-i,-1) = i(1,-i,-1,i) = \lambda_4 z_4 = i z_4$$

Secondly, if we compute $AR =RA$ in $z_i$ we get that $\lambda_i Az_i = R(A z_i)$. This means that $Az_i$ is an eigenvector of $R$ relative to $\lambda_i$; but there is essentially just one eigenvector relative to $\lambda_i$, so $A z_i$ must be a multiple scalar of $z_i$! This is a very tricky passage. We conclude that $z_i$ is also an eigenvector of $A$, and since we have found a basis of eigenvectors we are done with our search.

We finish with the explicit computation. Since $z_i$ has a 1 in the first component, if we have that $A z_i = \mu_i z_i$, then by looking at the first component we get that $v \cdot z_i = \mu_i$, where $v=(v_1, v_2, v_3, v_4)$. If you look closer to the expressions in the recipe, you will see that the formulas are exactly $v \cdot z_1, v \cdot z_2, v \cdot z_3, v \cdot z_4$.


问:
To prove a subring is a field
In a commutative ring $R$, if there exists an element $x$ such that $Rx + Rs = R$ for all non-unit elements $s$ outside of the Jacobson radical of $R$, then $x$ is idempotent in $R$ and for each non-unit $s$, having $xR+sR=R$ implies $(1-x)sR=(1-x)R$, and this implies $(1-x)R= F$ is a field. But how can I prove that it is a field?

答:
First, since $x$ is idempotent, then so is $(1-x)$, and this is going to be the identity element of the group $(1-x)R$.

Note also that $(1-x)x=0$.

If $s$ is a unit, then it's already invertible in $R$, so $(1-x)s$ will have inverse $(1-x)s^{-1}$.

If $s$ is not a unit, then by the condition, $xR+sR=R$, we have $(1-x)(xR+sR)=(1-x)R$, where the left side reduces to $(1-x)sR$ because $(1-x)x=0$.

But that implies that there's an $a\in R$ such that $(1-x)sa=(1-x)$, so $(1-x)a$ will be an inverse of $(1-x)s$.

More specifically, apply the condition to decompose $1\in R$ as $xu+sa=1$ with $u,a\in R$, and then multiply by $(1-x)$ to directly obtain $(1-x)sa=(1-x)$.

Title: To prove a subring is a field


问:
Plotting in the Complex Plane
I just wonder how do you plot a function on the complex plane? For example,$$f(z)=\left|\dfrac{1}{z}\right|$$
What is the difference plotting this function in the complex plane or real plane? </p>

答:
Note that for representing real number, we need only one axis (x or y ,one dimension). But for representing complex number we need two axis (x and y, two dimension). In some sense, there is no difference between real plane and complex plane.

For the function $f(z)=\frac{1}{z}$
 if $z$ is allowed to take only real number, it is a two dimensional plot on real plane ($R^2$, x-y axis), x-axis for taking all real number and y-axis for taking all corresponding function value (which is a real number)
 if $z$ is allowed to take complex numbers, it is a four dimensional plot on $R^4$ ($x-y-x_1-y_1$ axis), $x-y$ axis for taking all real number and $x_1-y_1$axis for taking all corresponding function value (which is a complex number) . It is very difficult to visualize.

Title: Plotting in the Complex Plane


问:
Time Complexity through recurrence relation
Suppose I have a code whose runtime complexity is described as a second degree linear homogeneous recursion formula as fn = fn−1 + fn−2, n>=3 where f1 = 1 and f2 = 2. I want to find constant c such that the runtime complexity of the algorithm can be described as Θ(c^n). I solved the recurrence relation but I don't understand how to compute it as Θ(c^n). Let me know if you need more clarification.</p>

答:
$$f_n=\frac{\text{Fibonacci}(n)+\text{Lucas}(n)}{2}$$
As $$\underset{n\to \infty }{\text{lim}}\;\frac{f_n}{\phi ^n}=\frac{\sqrt{5}+5}{10} $$
We can say that the $c$ you are looking for is the golden ratio
$$\phi=\frac{\sqrt{5}+1}{2}$$


问:
Geodesics on hyperbolic surfaces
Suppose that one has a compact hyperbolic surface realised as a quotient $X=\Gamma\setminus\mathbb{H}$. So in particular, $\Gamma$ consists only of hyperbolic elements of $\mathrm{PSL}(2,\mathbb{R})$ and the identity. Suppose that one takes an element $\gamma\in\Gamma$ non-identity, and for the sake of simplicity suppose is it primitive (so not a non-trivial power of another element in the group).

The axis of this element $\gamma$ in $\mathbb{H}$ will project to a closed geodesic on the surface $X$ through the natural covering map. Suppose now that I consider some other point $z\in\mathbb{H}$ that is not on the axis of $\gamma$ and I consider the projection of the geodesic segment between $z$ and $\gamma(z)$ onto the surface. This will give me a closed curve and will be a geodesic also since we projected a geodesic segment. It won't necessarily however be a closed geodesic since it may not close smoothly at the image of $z$ on the surface.

Question: Will this geodesic loop be freely homotopic to the closed geodesic originating from the projection of the axis? (Of course, in the case where $\gamma$ were non-primitive I would expect that it would be freely homotopic to some power of this projected axis instead).

I believe this to be true but I am not sure how one would go about showing it, any help would be appreciated.

答:
This is true and pretty easy to prove.

Let $\delta(s)$ be the shortest geodesic arc from $z$ to $A = \text{Axis}(\gamma)$, parameterized by $s \in [0,d(z,A)]$ with initial endpoint $\delta(0)=z$, with terminal endpoint $\delta(d(z,a)) = P \in A$, and hitting $A$ at a right angles at the point $P$.

Note that $\gamma \circ \delta(s)$ is, similarly the shortest geodesic arc from $\gamma(z)$ to $A$, hitting $A$ at right angles at the point $\gamma(P)$.

Now take a parameterized family of geodesic arcs $\zeta_t$ from $\delta(t)$ to $\gamma\circ\delta(t)$, defined for $t \in [0,d(z,A)]$. If you parameterize this family by normalized arc length (normalized to have domain $[0,1]$), and if you also normalize the parameter $t$ to vary over $[0,1]$, and then project to the quotient, that will give you the desired free homotopy.

Notice: this proof does not use that $\gamma$ is primitive. The key fact is that for a primitive element $\gamma$, the axis of $\gamma$ is identical to the axis of $\gamma^k$ for all $k \ge 1$, the only distinction being the length of a fundamental domain along the axis.

Title: Geodesics on hyperbolic surfaces


问:
Product followed by another product: how to solve?
I want to verify the result that I found to this equation:

$\prod_{i=1}^{n}\prod_{j=1}^{2} ij$

I found that $\prod_{j=1}^{2} ij = 2i^2$. After that I did: $\prod_{i=1}^{n} 2i^2$ and, finally, found that:

$\prod_{i=1}^{n}\prod_{j=1}^{2} ij = 2^n (n!)^2$

I am not sure if I can solve it this way (a product first and then another product).

答: This is exactly what is expected.  You can imagine parentheses around the inner product.  You should evaluate that first, as you did.</p>


问:
Asymptotic normality of estimator and change of sign
Say that given an estimator $\hat{T}$, of a statistic $T$, we have that $\sqrt{n}(\hat{T}-T) \overset{{\strut\text{D}}}\rightarrow \mathcal{N}(0,Var)$, where $n$ is the sample size. Consider now $-\hat{T}$, does the asymptotic result hold also in this case? If yes/no, under which conditions?

EDIT: more information to make te problem clear. Say that we are interested in the following statistic

\begin{equation}
     S=
          \left\{ \begin{array}{ll}
           1-T &\text{if}\quad  x \geq 1/2 \\
           T-1 &\text{if} \quad  x< 1/2
        \end{array} \right.
\end{equation}.

We also know that when $x \neq 1/2$, $\sqrt{n}(\hat{T}-T) \overset{{\strut\text{D}}}\rightarrow \mathcal{N}(0,Var)$. Can we say the same for $S$ and $\hat{S}$? The hat denotes the estimator, all the considered statistics depend only on $x$.

答:
If $X_n \overset{D}{\to} X$ then $-X_n \overset{D}{\to} -X$. I think you can prove this directly using one of the many equivalent definitions of convergence in distribution, or use a hammer like Slutsky's theorem.

Thus $\sqrt{n}((-\hat{T}) - (-T)) \overset{D}{\to} \mathcal{N}(0, V)$.


问:
Vector calculus for ellipse in polar coordinates
I'm having trouble with this question, can somebody please help me with it! I'll thanks/like your comment if help me =)

I know that for a ellipse the parametric is $x=a\sin t$ , $b= b \cos t$, $t\in (0, 2\pi)$ (?)

For part a) I drew up the graph but not sure if it's right. The circle has radius 1 and for the ellipse I'm able to find $x= 2 $.
$$
(x-1)^2 =9  \\
\sqrt{(x-1)^2}=\sqrt 9\\
x-1=3\\
x=4$$

For $y=2\sqrt 2$
$$
y^2=8\\
\sqrt y=\sqrt 8\\
y=\sqrt 4 \sqrt 2\\
y= 2\sqrt 2 \text{ or } 2.8 $$

So the region should be the circle? since the ellipse covers the whole circle?
Thank you very much for helping!
Cheers.

答: The region between the ellipse and the circle is what you are asked to investigate. So it's the ellipse minus the circle; an ellipse with a circular hole in int near its center.


问:
Powers of a matrix, largest required collection for linear dependence to occur, reduction to vectors
Consider the dependence equation

$$
A^m + c_1A^{m-1}+...+c_{m-1}A + c_mI = 0
$$

where $A \in \Bbb{R}^{n \times n}$ and $I$ is the identity matrix. Asked to show that there exists an $m> 0$ such that some choice of $c_i$ yields a solution we note that the dimension of the vector  space of square matrices is $n^2$ and that therefore, at the latest, $m>n^2-1$ yields a solution.

My question relates to this: If we chose to multiply on the right by some general $x \in \Bbb{R}^n$ such that

$$
A^mx + c_1A^{m-1}x+...+c_{m-1}Ax + c_mIx = 0
$$

we have $m+1$ vectors and seek a linear dependence relation among them. Then we would say that dependence is achieved at the latest when $m>n-1$. Square matrices say something about transformations of a vector space as I understand it. Yet I can not quite grasp where the loss of information comes from. What goes wrong when we right multiply by $x$, reducing it to a question about vectors instead of matrices? Does it have something to do with only considering one x instead of a set of vectors spanning the underlying space? Thanks in advance.

答:
As remarked in another answer, the Cayley-Hamilton theorem provides an explicit set of coefficients (in terms of $A$) for which such a relation holds, with $m=n$. But you can deduce the existence of such a relation, with $m\leq n$, from the relation deduced for arbitrary $x\in\Bbb{R}^n$ in the second part of your argument; this does not involve determinants and such.

A first thing to do is reformulate the dependency relations in terms of polynomials: with the degree$~m$ unitary polynomial $P=X^m+c_1X^{m-1}+\cdots+c_{m-1}X+c_m$, the relations are $P[A]=0$ (the zero matrix) respectively $P[A]x=0$ (the zero vector). An advantage of this formulation is that one easily shows that such a relation implies any similar relation obtained by replacing $P$ by a polynomial multiple $PQ$.

A relation $P[A]x=0$ for a particular $x\in\Bbb R^n$ is weaker than $P[A]=0$, so it is not surprising that the argument proving existence of unitary $P$ of degree at most$~n$ satisfying the former relation does not work for proving the same for the latter relation. The former relation can also be written $x\in\ker(P[A])$, and if one would simply apply it for $x$ traversing a basis of$~\Bbb R^n$, one would get $n$ different corresponding polynomials$~P$, each of degree at most$~n$, and taking their least common polynomial multiple $M$ this gives $\ker(M[A])=\Bbb R^n$, so $M[A]=0$. But then one could only say that $\deg(M)\leq n^2$ (since the least common multiple could be the product), so it would be no better than what is obtained by the direct argument given in the question.

But one can do better, since having $P[A]x=0$ with $P$ unitary of minimal degree gives more than one nonzero vector in $\ker(P[A])$; indeed it gives $\dim\ker(P[A])\geq\deg(P)$. Once this is established, one can argue the existence of unitary $Q$ with $Q[A]=0$ and $\deg(Q)\leq n$ as follows by induction on the dimension. If $\deg(P)=n$ (which is quite often the case), one can simply take $Q=P$. Otherwise the image $W$ of $P[A]$ is a subspace of dimension (by rank nullity) $d=n-\dim\ker(P[A])\leq n-\deg(P)$, and closed under multiplication by$~A$. The induction hypothesis, applied to the subspace$~W$ and a matrix that expresses multiplication by $A$ on a basis of$~W$, then gives a unitary polynomial $P'$ with $\deg(P')\leq d$ such that $W\subseteq\ker(P'[A])$. Setting $Q=P'P$ one has $Q[A]=P'[A]\cdot P[A]=0$ while $\deg(Q)\leq d+\deg(P)\leq n$, so $Q$ satisfies the requirement.

Finally, the inequality $\dim\ker(P[A])\geq\deg(P)$ used above is based on the fact that with $P[A]x=0$ one also has, for every $k\in\Bbb N$, that $P[A](A^kx)=(PX^k)[A]x=0$ (since $PX^k$ is a multiple of $P$). Of these vectors $A^kx$ that lie in $\ker(P[A])$, the first $\deg(P)$ (namely $x$, $Ax$, $A^2x$, ... $A^{\deg(P)-1}x$) are linearly independent by the minimality of $\deg(P)$ (a linear dependence would provide a lower degree polynomial). This establishes the inequality.


问:
xp to level formula
So I have this function to calculate how much xp is needed to get to a level.
25 * level * (1+level)

but im having trouble making a xp to level function. I have tried a few things that people on Discord gave me.

(25 * xp) + ((25 * xp)^2)

((xp / 25) / (1-xp))

just to name a few. but none work.

this is made with code, but i thought id ask here since its more math related than code related.

答:
Let the amount of xp needed to get to the next level be $x$ and the current level to be $y$. We have that $$x=25\cdot y(1+y)$$Expand and divide by $25$: $$y^2+y=\frac x{25}$$Complete the square $$\begin{align}y^2+y+\frac14&=\frac x{25}+\frac14\\\left(y+\frac12\right)^2&=\frac{4x+25}{100}\\y&=\frac{\sqrt{4x+25}}{10}-\frac12\end{align}$$(We have to take the positive square root because the level is positive)

Test: Let's say that level(or $y$)$=25$. Then xp needed(or $x$)=$25 \cdot 25 \cdot (25+1)=16250$.

Now we can test the formula:$$\begin{align}&\frac{\sqrt{4\cdot16250+25}}{10}-\frac12\\&=\frac{\sqrt{65000+25}}{10}-\frac12\\&=\frac{255}{10}-\frac12\\&=25.5-0.5\\&=25\end{align}$$ which is correct.

Title: xp to level formula


问:
Counting minimum elements needed such that their sum covers the whole finite space.
In $\mathbb{F}_p$, how to find a subset with smallest cardinality such that the sum between its pairs cover $\mathbb{F}_p\setminus\{0\}$.
So for a subset with cardinality $n$ there are ${n\choose 2}$ pairs and correspondingly ${n\choose 2}$ sums. I want $n$ to be smallest such that those ${n\choose 2}$ sums cover $\mathbb{F}_p\setminus\{0\}$.

For example in $\mathbb{F}_7$, let $A=\{0,1,2,4\}$,
The sums between its pairs covers $\mathbb{F}_7\setminus\{0\}$ since
\begin{align*}
0+1=1,0+2=2,1+2=3,0+4=4,1+4=5,2+4=6\;.
\end{align*}
I want to know if over large $p$ similar set can be easily constructed and what would be the size of that set (I expect it to be close to $\sqrt{2p}$). Any similar literature is also appreciated.

答:
Nice question! First, as in RobPratt's answer I'll generalize to the non-prime case. Rob discusses two variants of the question both of which seem quite interesting to me: the first is to find a set of non-negative integers of minimal size whose distinct pairwise sums cover $\{ 1, \dots n-1 \}$, and the second is the same question but working $\bmod n$. For lack of better notation let me call these $f_{+}(n)$ and $f_{cyc}(n)$. Neither of them appear to be in the OEIS but A046693 has similar values and is related, answering a similar question but about pairwise differences rather than sums; "perfect ruler" may be a useful keyword here. If we allow sums of the same element then we are studying the sumset from additive combinatorics and there may be useful tools there also.

We clearly have $f_{cyc}(n) \le f_{+}(n)$. Interestingly we also have $f_{+}(n) \le f_{+}(n-1) + 1$ since if we can cover $\{ 1, \dots n-1 \}$ we need at most one new integer to cover $\{ 1, \dots n \}$, suggesting that the integer version of the problem may have more usable inductive structure. The "information-theoretic lower bound" is

$$f_L(n) \le f_{cyc}(n) \le f_{+}(n)$$

where $f_L(n)$ is the smallest nonnegative integer $k$ such that ${k \choose 2} \ge n-1$, or equivalently $(2k - 1)^2 \ge 8n - 7$, hence

$$f_L(n) = \left\lceil \frac{\sqrt{8n-7} + 1}{2} \right\rceil \approx \sqrt{2n}.$$

(The above formula doesn't work for $n = 1$.) $f_L(n)$ is just the sequence $0, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, \dots $ which, after the somewhat degenerate value $0$, takes the value $k$ a total of $k-1$ times. This lower bound is achievable iff it is possible to find a subset of the above sum whose distinct pairwise sums cover $\{ 1, \dots n-1 \}$ exactly once each. According to Rob's data the first point at which $f_L(n) < f_{+}(n)$ is $n = 11$, where $f_L(11) = 5$ but $f_{+}(11) = 6$, and the first point at which $f_L(n) < f_{cyc}(n)$ is $n = 15$, where $f_L(15) = 6$  but $f_{cyc}(15) = 7$.

Here is the best upper bound I have so far. The construction is quite simple but all of the more complicated constructions I've come up with so far have done worse!

Proposition:

$$f_{+}(n) \le \text{min} \left( 2 \lceil \sqrt{n} \rceil - 1, 2 \left\lceil \frac{ \sqrt{4n+1} - 1}{2} \right\rceil \right).$$

Proof. Let $k, \ell$ be positive integers. Every integer in the interval $[0, k \ell - 1]$ can be written uniquely in the form $ak + b$ where $0 \le b \le k-1, 0 \le a \le \ell - 1$. It follows that if we take $S = \{ ak : 0 \le a \le \ell - 1 \} \cup \{ b : 0 \le b \le k - 1 \}$, which has size $k + \ell - 1$, then distinct pairwise sums of elements of $S$ cover $\{ 1, \dots k \ell - 1 \}$.

So we want to chose $k$ and $\ell$ such that $k + \ell - 1$ is as small as possible subject to the constraint that $k \ell \ge n$. Standard arguments imply that this means we want to choose $k$ and $\ell$ to be as close as possible. If we take $k = \ell = \lceil \sqrt{n} \rceil$ then this gives $f_{+}(n) \le 2 \lceil \sqrt{n} \rceil - 1$, which was the bound I had previously written down here.

But actually it is possible to do a little better than this for some values of $n$ by taking $\ell = k-1$. Then $k(k-1) \ge n$ gives $(2k-1)^2 \ge 4n+1$ which gives

$$k = \left\lceil \frac{ \sqrt{4n+1} + 1}{2} \right\rceil$$

and hence

$$f_{+}(n) \le 2k-2 = 2 \left\lceil \frac{ \sqrt{4n+1} - 1}{2} \right\rceil.$$

which is occasionally better, e.g. when $n = 50$ (the worst case for the $2 \lceil \sqrt{n} \rceil - 1$ bound, one larger than a perfect square) the original bound gives $15$ but this bound gives $14$. With a little more effort we should be able to characterize when one bound or the other is better. $\Box$

So, in summary, we have

$$\boxed{ \left\lceil \frac{\sqrt{8n-7} + 1}{2} \right\rceil \le f_{cyc}(n) \le f_{+}(n) \le \text{min} \left( 2 \lceil \sqrt{n} \rceil - 1, 2 \left\lceil \frac{ \sqrt{4n+1} - 1}{2} \right\rceil \right) }.$$

Rob's data implies that neither the upper nor the lower bound is sharp, although for $2 \le n \le 50$ it does give that the upper bound is sharp for $f_{+}(n)$ when $n$ or $4n+1$ is a perfect square. I am very curious if this will continue to be true. (Edit: Rob checked in the comments and it fails for $n = 64$. Welp!) For easier comparison with Rob's data here's a table of the upper bound for $n \in \{ 1, \dots 50 \}$, with points where it differs from $f_{+}(n)$ highlighted in red (in each case it's off by $1$):

$$
\begin{matrix}
\color{red}{1} &2 &3 &3 &4 &4 & \color{red}{5} &5 &5 & \color{red}{6}\\
6 &6 & \color{red}{7} & \color{red}{7} &7 &7 &\color{red}{8} &\color{red}{8} &8 &8 \\
\color{red}{9} & \color{red}{9} & \color{red}{9} &9 &9 & \color{red}{10} & \color{red}{10} & \color{red}{10} &10 &10 \\
\color{red}{11} & \color{red}{11} & \color{red}{11} & \color{red}{11} &11 &11 & \color{red}{12} & \color{red}{12} & \color{red}{12} & \color{red}{12}\\
 \color{red}{12} &12 & \color{red}{13} & \color{red}{13} & \color{red}{13} & \color{red}{13} & \color{red}{13} & \color{red}{13} &13 & \color{red}{14}
\end{matrix}
$$

And here's a graph generated in Google Sheets:

It would be good to have empirical evidence for larger values of $n$. I don't know if Rob's approach will give, say, $n = 100$ or $n = 1000$, but I think larger values of $n$ should be approachable by just generating subsets randomly and checking their pairwise sums; for subsets close to the optimal bound this should work with high probability. The probabilistic method was the first thing I tried to write down a bound but I couldn't make it work.

As a concrete challenge I'd love to see if anyone could offer better upper or lower bounds than the above for $n = 100$ or $n = 1000$. You could take $n = 101$ or $n = 1009$ if you want to stick to primes. The lower and upper bounds here are, respectively,

$$15 \le f_{cyc}(100) \le f_{+}(100) \le 19$$
$$15 \le f_{cyc}(101) \le f_{+}(101) \le 20$$
$$46 \le f_{cyc}(1000) \le f_{+}(1000) \le 63$$
$$46 \le f_{cyc}(1009) \le f_{+}(1009) \le 63.$$

Edit: Lots of stuff including some references in this very closely related but not entirely identical question, which considers sumsets and so allows non-distinct sums, and also asks to cover $0$; this is arguably more natural (e.g. it gives the problem more symmetries). These are called sum covers or finite additive bases. Fitch and Jamison's Minimum sum covers of small cyclic groups opens with more or less the same bounds as above, considers both distinct and non-distinct sums, and has a table of values and of optimal covers for $3 \le n \le 54$.


答:
First, the graph of a complex function is by definition $\{(z,w)\in{\mathbb C}^2: w=f(z)\}$, which lives in 4D.  Thus, there's not a "simple" way to visualize this.

Nonetheless, there are a number of standard tricks to help us visualize the function.  Perhaps the most standard is to illustrate the effect that the function has on some standard domain or set of domains.  If you type "plot 1/z" into WolframAlpha, for example, you'll see a number of images related to the function, one of which is labeled "Complex map" and looks like so:

This illustrates how a grid of lines throughout the square $[-1,1]\times[-1,1]$ is affected by the map $z\rightarrow 1/z$.  This is a bit like trying to understand the map $f(x)=x^2$ by examining the following picture:

The top picture represents a set of points evenly distributed throughout the interval $[0,2]$; the bottom illustrates the image of the points under $f(z)=z^2$.

I reiterate, though, this is just one of a number of techniques for visualizing these types of functions.  Other possibilities include: plotting the real and imaginary part as 3D graphs, doing the same with the magnitude and argument, or creating contour plots of these.  This works because for example, writing $w=|f(x+i*y)|$, we see that $w$ is a real-valued function of the two real variables $x$ and $y$, which means we can make a 3D plot.  Here's the result of the WolframAlpha query "plot |1/z|", for example:

It can get really crazy if you move to the Riemann sphere.  Here's WolframAlpha's "Riemann sphere map":

To really understand this, you should check out the video Möbius Transformations Revealed on YouTube!

Title: Plotting in the Complex Plane

Body:
I just wonder how do you plot a function on the complex plane? For example,$$f(z)=\left|\dfrac{1}{z}\right|$$
What is the difference plotting this function in the complex plane or real plane? </p>


问:
How To Solve Equation With Division By Zero
I have an equation that I've been given the task to solve as part of a course I am doing:

```<code>x = (y * a - z * b) / (u * (b - a))
</code>```

This has worked fine, but in the only question I have left, b - a = 0, in which case u * (b - a) = 0 and therefore I am trying to divide by 0.

I am literally tearing my hair out trying to solve this - how do I rearrange it so that I can calculate x when b - a = 0?

Btw, I am happy to state that this is unsolvable in these circumstances, but I must be certain that it is before I submit my work.

答:
```<code>x = (y * a - z * b) / (u * (b - a))
</code>```

comes from something like
$$u(b-a)x=ya-zb$$
if $b-a=0$ that is if $b=a$ the LHS becomes $0$
$$0=(y-z)b$$
Now we have two possibilities:

if RHS is zero,e.g. if $y=z$, the equation is indeterminate and has infinite solutions

if RHS is not zero the equation is impossible and there is no solution.

Hope this helps

Body:
x = (y * a - z * b) / (u * (b - a))

comes from something like
$$u(b-a)x=ya-zb$$
if $b-a=0$ that is if $b=a$ the LHS becomes $0$
$$0=(y-z)b$$
Now we have two possibilities:

if RHS is zero,e.g. if $y=z$, the equation is indeterminate and has infinite solutions

if RHS is not zero the equation is impossible and there is no solution.

Hope this helps


问:
$\lim_{x \to 0} (e^x - 1)/x^8$ .
I want to know how to solve this limit problem with Maclaurin's series expansion of only $e^x$ in the neighborhood of $x=0$.

答:
The limit does not exist. $(e^x-1)/x^8$ approaches infinity as $x$ approaches $0$ from the positive end, but $(e^x-1)/x^8$ approaches negative infinity as $x$ approaches $0$ from the negative end. L'Hôpital's rule states that if $f(x) \to 0$ and $g(x) \to 0$ as $x$ approaches $a$, then
$$
\lim_{x \to a}\frac{f(x)}{g(x)}=\lim_{x \to a}\frac{f'(x)}{g'(x)}
$$
provided that
$$
\lim_{x \to a}\frac{f'(x)}{g'(x)}
$$
exists. In this case, that limit does not exist, and so L'Hôpital is not applicable.

Title: $\lim_{x \to 0} (e^x - 1)/x^8$ .


问:
In how many ways $n$ couples can be seated on a bench so that..

In how many ways $n$ couples can be seated on a bench so that...

every wife seats next to her husband?

I came to take every couple as one object so $n!$ and $2^n$ for switching seats betwen wife and husband or husband and wife so at the end $n!*2^n$

no wife will sit next to her husband?

I did all the possibilities - the possibilities each wife seats to her husband
then we get possibilities of the wife not seating next to her husband
$2n!- (n!2^n)$

But I am doubting my answers, am I wrong?

答:
Your answer for the first part is correct.

We can do the second part using the principle of inclusion and exclusion.  How many ways are there for $k$ couples to sit together?  There are $\binom{n}{k}$ ways to choose the couples, and then $k!$ ways to arrange them in order, and then we can seat them in $2^k$ ways.  We can arrange the remaining people in order in $(2n-2k)!$ ways.  There are $k+1$ spaces around the distinguished $k$ couples in which to place the other people, and by stars and bars, there $\binom{2n-2k+k}{k}=\binom{2n-k}{k}$ ways to distribute them.

By inclusion and exclusion, the total number of ways is $$\sum_{k=0}^n(-1)^k\binom{n}{k}k!2^k(2n-2k)!\binom{2n-k}{k}=\\\sum_{k=0}^n(-1)^k\binom{n}{k}(2n-k)!2^k$$

Computing the first few values, and plugging them into OESI, we find A007060.


问:
Alternating geometric series, not sure what i am looking at
I have written out a series describing a model system but i cannot find if there is a historical representation of the like series:

$$N_s= N\sum_{i=1}^n(-1)^{i-1}P^i$$

It appears to be an alternating geometric series, similar to the Mercator series.

Body:
$$\sum_{i=1}^n(-1)^{i-1}P^i=-\sum_{i=1}^n(-P)^i=-\left(\frac{1-(-P)^{n+1}}{1-(-P)}-1\right)=\frac{P+(-P)^{n+1}}{1+P}$$

See here for details.

Then

$$N_s=N\frac{P+(-P)^{n+1}}{1+P}$$


问:
Question regarding a proof of Riemann's theorem concerning removable singularities
I'm currently going through the theorem and there is a part in the proof that throws me for a loop.

$\textbf{If we have a function $f(z)\in\mathcal{H}(B'(a,r))$ which is bounded on $B'(a,r)$, then $f(z)$ has a}$

$\textbf{removable singularity in $a$.}$

Define $h(a)=0$ and $h(z)=(z-a)^2f(z)$. We then see it follows that $h'(a)=\lim_{z\rightarrow a}\frac{h(z)-h(a)}{z-a}=\lim_{z\rightarrow a}(z-a)^2f(z)=0$ because of the boundedness of $f$. $\texttt{The proof then continues with the claim that $h(z)=(z-a)^2g(z)$ for a suitable}$

$g(z)\in\mathcal{H(B(a,r)}$.

My question then is, why is it $(z-a)^2$? How have we proven that the order of $h$ in $a$ is 2? I get that you can expand it with power series because it is holomorphic, ie. $h(z)=\sum_{n=0}^\infty a_n(z-a)^n$. But let's say $a_2=0$, then $h''(a)=0$ and the order is not 2.

答:
You have $h(z)=\sum_{n=0}^\infty a_n(z-a)^n$ with $h(0) = a_0 = 0$ and $h'(0) = a_1 = 0$, so
$$
h(z)=\sum_{n=2}^\infty a_n(z-a)^n = (z-a)^2 \sum_{n=0}^\infty a_{n+2}(z-a)^n = (z-a)^2 g(z)
$$
where $g(z) = \sum_{n=0}^\infty a_{n+2}(z-a)^n$ is holomorphic in a neighborhood of $z=a$.

The multiplicity of the zero of $h$ at $z=a$ is at least two. It can be higher, but that does not invalidate the conclusion.

What you are perhaps thinking of is this: $h$ has a zero of multiplicity $p \ge 2$, so
$$
 h(z) = (z-a)^p \phi(z)
$$
where $\phi$ is holomorphic in a neighborhood of $z=a$ with $\phi(a) \ne 0$. But then
$$
 h(z) = (z-a)^2 \underbrace{(z-a)^{p-2} \phi(z)}_{g(z)}
$$
is the desired representation.


问:
Calculating flight distance of drone without losing line of sight due to obstacles
I hope everyone is off to a good star of the new year!

So I'm trying to figure out a way of calculate how far I'm able to fly my drone without losing visual sight of it when having an obstacle (a forest for example, but a house or hill or similar would also be applicable) between me and the drone. This would be helpful when planning the flight and choosing a take off site.

The problem:
Where I live we have lots of forests. There are clearings in the forests of different sizes however and I want to launch and control my drone from inside of these clearings. The problem is that I need to keep a clear visual line of sight (VLOS) to the drone, the reason for this is twofold: It's the law and the drone will lose its connection eventually if the obstacle is removing enough signal strength. Without knowing how far I'm able to fly the drone in VLOS while planning the mission I risk not being able to cover the planned area. So I need to be able to calculate the possible flight distance during planning and i figured simple trigonometry would be a logic way of doing that.

The solution:
Calculating the flight distance using simple trigonometry, using the Pythagorean theorem and Tangents, Sines, and Cosines.

How:
The illustration below shows the problem. The line i call VLOS need to be clear of any obstacle, in this case, trees. I want to know the maximum flight distance before the VLOS line hits a tree.

Assuming I know the height of the obstacle and the distance between it and where I will be standing with the remote, and also the altitude of the drone, I should be able to calculate the flying distance without losing VLOS.

As you see in this illustration I made (Flight distance illustration) if the drone goes any further the VLOS will hit the trees and thus making it impossible to see, and also weakening the signal. Assuming I'm already at maximum height (120 m) I'm unable to increase the altitude.

In this illustration (Flight distance illustration with values) I have changed the names of the lines to a,b,c etc. I have also made another triangle consisting of the distance between the RC and the bottom of the tree (b1), the height of the tree (a1) and the distance between the RC and the top of the tree. (c1).

Here are the values i will use:

a1= 36,7m

b1= 33m

c1= ?

a2= 120m

b2= ? (what I'm after)

c2= ?

v= ?

To start I would use the pythagorean theorem to get the length of c1 (distance between RC and treetop):

√(a1^2+b1^2)= c1

√36,7^2+33^2= 49,35m

The next step then would be to calculate the angle of v using arccos (degrees)

arccos(b1/c1)=v

arccos(33/49,35)=48,03°

Now the last step is to get the flight distance (b2) using Tangents

a2/Tan(v)=b2

120/Tan(48,03)=107m

So the maximum flight distance (while still being able to unhindered see the drone) is calculated to be 107m, however I have tried this exact scenario and the flight distance was instead 172m. Why is that?

The weaknesses that I have found to this method is:

My math. To put i simply I'm not very good at math and I could have easily made a mistake in my equations.

Using the wrong value for a1. This the easiest error to make here, since I don't have the exact height of the trees. Accuracy depending on method used for measuring the height. (in my case a tree height measuring application)

Using the wrong value for b1. Also easy to make. Depends on method used to measure. (in my case I measured in QGIS on satellite imagery)

Note: The drone doesn't change its altitude and it is relative to where the RC is, so the terrain under the drone doesn't affect the result of a2, it is constant)

If I change a1 and b1 to be -5m and +5m (a1=31,7 and b1=38) I still only get 148 m of flight distance. I find it rather unlikely that I would be that much off on both of these values.

While I was out doing this test I was also able to make a test where a1=26,7m and b1=94m. The result using the same calculation as above is 422 m  flight distance (or b2). The real result however was 843 m of flight distance!

So what is going on here? Why is the calculated flight distance much lower than the real flight distance?

Am I using the equations wrong?

I look forward to any input on this, thanks in advance!

UPDATE: I will do a third test using an obstacle with known height and distance since it all points to that there is something off with the values of a1 and b1. I will post the result as soon as this is done. Thanks for all the input so far!

Best regards
Patrik Forsberg

答:
I think the shortcoming in your conservative calculations are that you are treating the trees / forest as solid barriers - something that absorbs your TX signal $100 \%$. The waves will still propagate via diffraction, reflection and scatter in most vegetation, so the trees are acting more like a filter than a plug.

Take a look at this article. It may give you some insight on how to apply correction to your distance values depending on the vegetation you are working around.

My guess is your signal is attenuating around $15-20$ dB, so perhaps calculate the line of sight signal minus your attenuation to get a more accurate distance.

Cheers,

David


问:
Does $a_n:=\left(1+\frac1{n+c}\right)^n$ converge to $e$, for $c\in\Bbb{N}$?
In my lecture, we defined $e$ as
$$\lim_{n\to\infty}\left(1+\frac 1n\right)^n = \sum_{k=0}^\infty \frac 1{k!} = e$$

While playing around with those definitions, I stumbled onto
$$a_n := \left(1 + \frac{1}{n +c}\right)^n$$ where $c \in \mathbb{N}$. From plotting it, it seems like it converges to $e$ as well, but slower if $c$ gets larger, but I can't find a proof for it.

Is my assumption true, and if so how would I go about proving it?

答:
Consider:

$$\lim_{n\to\infty}\bigg(1 + \frac{1}{n+c}\bigg)^{n}=\lim_{n\to\infty}\frac{\displaystyle\bigg(1 + \frac{1}{n + c}\bigg)^{n+ c}}{\displaystyle\bigg(1 + \frac{1}{n+c}\bigg)^{c}}=\frac{\displaystyle\lim_{n\to\infty}\bigg(1 + \frac{1}{n + c}\bigg)^{n + c}}{
\displaystyle\lim_{n\to\infty}\bigg(1 + \frac{1}{n + c}\bigg)^{c}}$$

Because $n + c\to\infty$ as $n\to\infty$:

$$=\frac{e}{\displaystyle\lim_{n\to\infty}\bigg(1+\frac{1}{n + c}\bigg)^{c}} = \frac{e}{1^{c}}=\boxed{e}$$


问:
Why does rewriting an equation change the limits?
Why does rewriting

$$f(x) = \frac{x^3 - 1}{x -1}$$

into

$$f(x) = x^2 + x + 1$$

change the answer? In the first equation, it's obvious that $x \neq 1$, but when we solve it a little, the $x \neq 1$ completely disappears.

Wouldn't that mean if you rewrite all equations that have multiplication to include variables under the divisor, then wouldn't they all have indeterminants?

答:
It changes because these are two different equations. Your first $f(x)$ is not the same as your second $f(x)$.

The first $f(x)$ implies that $x \neq 1$, as you say, so if you want to rewrite it, then you would have to explicitly state the domain:
$$f(x) = x^2 + x + 1, \quad x \neq 1$$

In other words, if you are working carefully, it is your job to make sure that the condition $x \neq 1$ does not "completely disappear".


问:
sum of period function
If $h(n)$ is a function over $\mathbf{Z}$ and $h(n)$ is periodic with period of $N$, that is,
$h(n+N)=h(n)$ for all $n$. Show that:

\begin{eqnarray*}
\sum_{n=m}^{m+N-1} h(n)=\sum_{n=0}^{N-1} h(n)
\end{eqnarray*}
for all m in $\mathbf{Z}$.

For this, I rewrite the sum:
\begin{eqnarray*}
\sum_{n=m}^{m+N-1} h(n-m)=\sum_{n=0}^{N-1} h(n)
\end{eqnarray*}
And I think that I have to used that $h$ is periodic but I can't. Can you help me with some hint? Thanks.

答:
For any given $n,m$ we have no idea how the function behaves is in won't do any good to consider $h(n-m)$.  But we do know $h(n-kN) = h(n)$ so we can match up the values $n: 0 \le n \le N-1$ with the values $n': m\le n' \le m + N-1$ so they are apart by a multiple of $N$ we are good.

Now $0$ and $m$, $1$ and $m+1$ etc. aren't a multiple of $N$ apart but is the any other $n': m \le n' \le m + (N-1)$ then are a multiple of $N$ apart from $0$? what about from $1$, $2$ etc?

Now $m,m+1, ....., m+(N-1)$ must have one of each possible residue classes  and $0, ...., N-1$ does too. so that should be it.  If $i \equiv i' \pmod N$ then $f(i) = f(i')$ and as all the $i\in \{0,.....,N-1\}$ are each equiv to a distinct $i'\in \{m,.....,m+(N-1)\}$ so the sum should be the same.

so the number theory heavy proof:

If $k \equiv k'\pmod N$ then $f(k) = f(k')$.

$\sum_{n=0}^{N-1} f(n) = \sum_{n \in \{0,1,2,....,N-1\}} f(n)=$

$\sum_{k \in B} f(n)$ where $B$ is a set with $N$ elements and each distinct element of $B$ is congruent to a distinct element of $\{0,1,2,....,N-1\}$.

And $\{m,m+1,....., m+(N-1)\}$ is precisely such a set.

End of proof.

A less number theory heavy and more mechanical proof:

By division thereom there is a distinct $k\in \mathbb Z$ and $r\in \mathbb Z; 0 \le r \le N-1$ so that $m = kN + r$.

$\sum_{n=m}^{m+(N-1)} f(n) =$

$\sum_{n= kN +r}^{kN+r +(N-1)=(k+1)N + (r-1)} f(n)=$

$\sum_{n=kN +r}^{(k+1)N-1} f(n) + \sum_{n=(k+1)N}^{(k+1)N+(r-1)}f(n) =$

$\sum_{n=kN +r}^{(k+1)N -1}f(n-kN) + \sum_{n=(k+1)N}^{(k+1)N+(r-1)}f(n-(k+1)N)=$

$\sum_{n'=r}^{N-1}f(n') + \sum_{n'=0}^{r-1} f(n')= \sum_{n'=0}^{N-1} f(n')$.

(If $r=0$ note that $\sum_{n=0}^{-1} a_n = \sum_{0\le n\le -1} a_n = \sum_{n\in \emptyset}a_n = 0$.)

For example: if $N = 5$ and $m = 23$ then $\sum_{n=23}^{23+4=27} f(n) = f(23)+f(24)+f(25)+f(26)+f(27)$

$= \underbrace{f(3) + f(4)} +\underbrace{f(0) + f(1) + f(2)}=$

$ \underbrace{f(0) + f(1) + f(2)}+\underbrace{f(3) + f(4)}=$

$\sum_{n=0}^{4} f(n)$.

Title: sum of period function


答:
An expression alone is not enough to define a function. (Very few functions actually have expressions, but that's a different story.) To have a function you must also have a domain.

Usually we are lazy and just assume "the largest domain possible where the expression makes sense". But in this case, as you have discovered, that approach fails as the two expressions imply different domains. So the domain must be specified. Most easily, I think, by saying
$$
f(x)=x^2+x+1\quad (x \neq1)
$$
Or maybe you want the entire number line as domain. And in that case you would instead fix your first expression into
$$
f(x)=\cases{\frac{x^3-1}{x-1}& if $x\neq1$\\3& if $x=1$}
$$

Title: Why does rewriting an equation change the limits?

Body:
Why does rewriting

$$f(x) = \frac{x^3 - 1}{x -1}$$

into

$$f(x) = x^2 + x + 1$$

change the answer? In the first equation, it's obvious that $x \neq 1$, but when we solve it a little, the $x \neq 1$ completely disappears.

Wouldn't that mean if you rewrite all equations that have multiplication to include variables under the divisor, then wouldn't they all have indeterminants?


答:
You can show this with a quick change of variables.  Let $m = n + c$, which means that $$a_{n} = \left(1 + \frac{1}{m}\right)^{m-c} = \left(1 + \frac{1}{m}\right)^{m}\left(1 + \frac{1}{m}\right)^{-c}$$  Now, as $m\to\infty$ as $n\to\infty$, we have
\begin{align}
\lim_{n\to\infty}a_{n} &= \lim_{m\to\infty}\left(1 + \frac{1}{m}\right)^{m}\left(1 + \frac{1}{m}\right)^{-c}\\
&= \lim_{m\to\infty}\left(1 + \frac{1}{m}\right)^{m}\cdot\lim_{m\to\infty}\left(1 + \frac{1}{m}\right)^{-c}\\
&=e\cdot 1\\
&=e
\end{align}

Title: Does $a_n:=\left(1+\frac1{n+c}\right)^n$ converge to $e$, for $c\in\Bbb{N}$?

Body:
In my lecture, we defined $e$ as
$$\lim_{n\to\infty}\left(1+\frac 1n\right)^n = \sum_{k=0}^\infty \frac 1{k!} = e$$

While playing around with those definitions, I stumbled onto
$$a_n := \left(1 + \frac{1}{n +c}\right)^n$$ where $c \in \mathbb{N}$. From plotting it, it seems like it converges to $e$ as well, but slower if $c$ gets larger, but I can't find a proof for it.

Is my assumption true, and if so how would I go about proving it?


问:
How to approximate/connect two continuous cubic Bézier curves with/to a single one?
I subdivide a cubic Bézier curve at a given t value using de Casteljau’s algorithm, which yields two cubic Bézier curves. Afterwards I “scale” the second curve (proportionally).

I’d like to reconnect or approximate the two curves to/with a single curve in a third step. Is that possible?

This illustrates what I’m intending to do.

I guess reversing de Casteljau’s algorithm won’t work because I don’t have one of the intermediate points.

If there are multiple approaches, I’d favor a simpler (faster to compute) strategy.

Thanks in advance.

Update:
Maybe this figure makes it more clear; it shows all the points I have:

The original cubic Bézier curve is defined by the points $ p_{0}, p_{1}, p_{2}, p_{3} $.

It is divided at a given $ t $ (timing) value using de Casteljau’s algorithm, which yields the points $ q_{1}, r_{2}, i_{1}, q_{2}, r_{1}, k $ where $ k $ is the division point.

The two subcurves are defined by the control points $ p_{0}, q_{1}, q_{2}, k $ and $ k, r_{1}, r_{2}, p_{3} $, respectively.

The scaled second subcurve is defined by the points $ k, {r}' _{1}, {r}' _{2}, {r}' _{3} $

Scaling is applied as follows: $ {p}' = k + (p - k) \cdot factor $ for $ r_{1}, r_{2}, p_{3} $

答:
You probably already know this, but let me explicitly point out:

== exact match ==

It is not possible to construct a single cubic Bezier curve that exactly matches your new curve.

A single cubic Bezier curve has a constant "curvature" A along its length.
When you shrink it, the new curve has "sharper" curvature B (but still constant along the length of the new curve).

It is not possible to construct a single cubic Bezier curve -- since, like all single cubic curves, it has constant curvature C along its length -- such that C=A along the part of the length, and C=B along the rest of the length, where A<>B.

(I'm mis-using the term "curvature" here for something that is more precisely the 3rd derivative of a curve, sometimes called the "jerk").

== approximation ==

Perhaps the simplest approximation is:
Use the initial starting point and first control knot -- p0 and p1,
and the final control knot and final ending point -- r'2 and r'3.
Use those 4 points as the start, control knots, and endpoint of a Bezier curve that approximates the one you want: a0, a1, a2, a3.

This approximation exactly hits the endpoints of your desired curve, and has the same initial and final slope at those endpoints, but it slightly diverges from your desired curve in the middle.
In particular, it probably doesn't go exactly through the cutpoint K.

There are many other possible approximations you could make.
The "Don Lancaster's Guru's Lair Cubic Spline Library"
may have the details I'm leaving out:

It is possible to nudge a1 along the line p0-p1, or to nudge a2 along the line r'2-r'3 -- or both -- such that the approximation curve not only starts and ends at the same points and slopes, but also passes through the cutpoint K.

pick any 4 points along your new curve (perhaps the endpoints, the cutpoint K, and some other point) and generate a cubic Bezier curve that goes exactly through all 4 points.

pick many points along your new curve -- bunched together in places where curve matching is important, perhaps near the endpoints and point K, and spaced further apart where curve matching is not so important -- and generate a cubic Bezier curve that is a least-squares best fit to those points.

ContentLicense: CC BY-SA 2.5


问:
more questions: Integral $\int_{0}^{A}\frac{\exp(-2\pi iwx)}{x-c}dx $
This is  a continue of my previous question
Integral $\int_{0}^{A}\frac{\exp(-2\pi iwx)}{x-i}dx $.

Here $A>0$, $w$-real, $c$-complex number.

I have realized, that I need a precise answer for any $w$, not only an approximation for big $w$

By definition  incomplete Gamma function is:$$\Gamma(0,x)=\int_{x}^{\infty}t^{-1}e^{-t}dt $$
Why does the simple change of variable doesn't work?
$$\int_{0}^{A}\frac{e^{-2\pi iw(x-c+c)}}{x-c}dx=e^{-2\pi iwc}\int_{-2\pi iwc}^{2\pi iw(A-c)}\frac{e^{-t}}{t}dt=e^{-2\pi iwc}[\Gamma(0,-2\pi iwc)-\Gamma(0,2\pi iw(A-c))]  $$

(change of the variable $2\pi iw(x-c)=t $).

Instead, the correct result, which mathematica gives, is :
$$\begin{multline}
e^{-2\pi iwc}[-\Gamma(0,2i(A-c)\pi w)+\Gamma(0,-2\pi icw)\\
+\log(A-c)-
log(-c)-\log(i(A-c)w)+\log(-icw)]
\end{multline} $$
The part with logarithm is just a sum of corresponding arguments. For some $c$ this sum is zero, but not always.

答:
The incomplete gamma function $\Gamma(0,z)$ has branch points at $z=0$. The (standard) implementation of Mathematica implements the function with a branch cut along the negative real line. Thereby, the expression
$$e^{-2\pi iwc}\int_{-2\pi iwc}^{2\pi iw(A-c)}\frac{e^{-t}}{t}dt=e^{-2\pi iwc}[\Gamma(0,-2\pi iwc)-\Gamma(0,2\pi iw(A-c))]$$
is valid as long as the integral does not cross the negative real line. Otherwise, you have to correct the expression by the jump across the branch cut. The jump across the branch cut is given by
$$\lim_{\epsilon \to 0^+}[ \Gamma(0,-x+i\epsilon)- \Gamma(0,-x-i \epsilon)] = \oint dz \frac{e^{-z}}{z} = -2\pi i, \text{ for } x>0.$$
This is equivalent to the logarithms given by Mathematica. However, you can write it simpler by noting that $$\gamma(t) = -2\pi i w c t + 2\pi i w (A-c) (1-t)$$ parametrizes the integration path with $t\in[0,1]$. The path crosses the real line when $\text{Im} \gamma(t) =0$ which is equivalent to
$$ A w (1-t) - w\,\text{Re} c =0$$ with the solution $t=1- \,\text{Re}c/A$. In order that this point is in the integration region, $0<\text{Re}\,c < A$. Furthermore, $\text{Re} \gamma(t) = w \,\text{Im}\,c < 0$ in order that the integration crosses the branch cut.

Putting everything together, we obtain the result
$$\begin{multline}
\int_{0}^{A}\frac{e^{-2\pi iw(x-c+c)}}{x-c}dx = e^{-2\pi iwc}[\Gamma(0,-2\pi iwc)-\Gamma(0,2\pi iw(A-c))] \\- \begin{cases}2\pi i e^{-2\pi i w c} & w \,\text{Im}\,c < 0 \text{ and } 0<\text{Re}\,c < A, \\
0 & \text{else}. \end{cases}
\end{multline}$$