问:
Proof there is no largest cardinal number
For any set $A$, I proved already that $|A| < |\mathcal{P}(A)|$ by injecting $A \to \mathcal{P}(A)$ by $a \mapsto \{a\}$ and then demonstrating, by contradiction, that no surjection can exist. I want to prove that there is no largest cardinal number, but the argument
$$|\mathbb{N}| < |\mathcal{P}(\mathbb{N})| < |\mathcal{P}(\mathcal{P}(\mathbb{N}))| < |\mathcal{P}(\mathcal{P}(\mathcal{P}(\mathbb{N})))| < \ldots$$
Perhaps more formally, I could suppose for the sake of contradiction that $|A|$ is the largest infinite cardinal, but this theorem implies that $|\mathcal{P}(A)| > |A|$, a contradiction.

How can I make this proof sufficiently formal?

答:
The simplest way to prove the claim - which you give - is to observe that $\vert A\vert<\vert\mathcal{P}(A)\vert$ for every $A$. (As an aside, this isn't really a proof by contradiction but rather a proof by negation, which is constructively valid.) On the other hand, the chain idea you write down doesn't work, first because it's not really clear what it means (what is "..."?), and second - and more importantly - because an unending chain of cardinals need not be unbounded.

That said, there are a couple comments worth making. First, there is an unbounded chain of cardinals coming from the powerset operation - namely, the $\beth$ numbers. Basically, we make precise the notion of "iterating the powerset $\alpha$-many times" for every ordinal $\alpha$; it's not hard to prove $\beth_\alpha\ge\vert\alpha\vert$ and so the chain of $\beth$ numbers is unbounded. This doesn't result in a new proof of the original claim, but it's an interesting thing to know about.

Second, and more subtly, the powerset might "miss things" - there could be cardinals in between $\vert A\vert$ and $\vert\mathcal{P}(A)\vert$. (To be precise, the usual axioms of set theory can neither prove nor disprove the existence of such gaps.) And on this note there is a genuinely different proof that there is no largest cardinal: namely, we can show that for every set $A$, there is a smallest cardinal $\kappa$ (or $\vert A\vert^+$) onto which $A$ does not surject, and moreover this $\kappa$ is in fact the cardinal successor of $\vert A\vert$ (that is, $\alpha>\vert A\vert$ and nothing is in between $\vert A\vert$ and $\alpha$). So this gives the second proof: replace "$\vert\mathcal{P}(A)\vert$" with "$\vert A\vert^+$." Of course this takes significantly more work to develop than the powerset version, but it is worth mentioning nonetheless.


问:
how to prove sins(1+cos) = 4sin(x/2)cos^3(x/2)
How to prove this ?
$$\sin{x}(1+\cos{x})=4\sin{\frac{x}{2}}\cos^3{\frac{x}{2}}$$

thanks

答:
I get it, sorry for my careless
$$1+\cos{x}=2\cos^2{\frac{x}{2}}$$
and
$$\sin{x}=2\sin{\frac{x}{2}}\cos{\frac{x}{2}}$$

then get the answer.

ContentLicense: CC BY-SA 4.0


问:
Why is $\cos\theta$ used in three-dimensional geometry in place of $\tan\theta$ or $\sin\theta$?
While going through the introduction of 3D geometry, I'm finding the discussion starts with $\cos\theta$ called "direction cosines".

My query is, in 2D geometry, we find simpler and clear to understand equations of a line as $y= mx+ c$, so

Why all of a sudden we introduce $\cos\theta$ and also take help of a parallel vector which is not a part of the line?

Why do we depend on a vector introduction? Can not the equation of a line be derived using its own points?

Why can not it be used with $\tan\theta$ or $\sin\theta$ notations?

Why is it that the equation $ax+by+cz+ d=0$, which looks like the equation of a straight line, is the equation of a plane?

Due to all this 3D happens to be inaccessible to understand in the introduction itself. Why it becomes so complex?

Can 2D geometry be done using cosine or sine functions? or is $\tan\theta$ fixed for it, and $\cos\theta$ is fixed for 3D geometry?

Thanks.

答:
There are numerous formulations for lines in 2D and 3D. Some have direct analogies and some do not.

Here is a sampling of different ways to define a line in both 2D and 3D.

$$\begin{array}{r|l|l}
\text{formulation} & \text{2D} & \text{3D}\\
\hline \text{ray from point} & \begin{pmatrix}x\\
y
\end{pmatrix}=\begin{pmatrix}r_{x}\\
r_{y}
\end{pmatrix}+t\,\begin{pmatrix}e_{x}\\
e_{y}
\end{pmatrix} & \begin{pmatrix}x\\
y\\
z
\end{pmatrix}=\begin{pmatrix}r_{x}\\
r_{y}\\
r_{z}
\end{pmatrix}+t\,\begin{pmatrix}e_{x}\\
e_{y}\\
e_{z}
\end{pmatrix}\\
\text{between two points} & \begin{pmatrix}x\\
y
\end{pmatrix}=(1-t)\begin{pmatrix}a_{x}\\
a_{y}
\end{pmatrix}+t\,\begin{pmatrix}b_{x}\\
b_{y}
\end{pmatrix} & \begin{pmatrix}x\\
y\\
z
\end{pmatrix}=(1-t)\begin{pmatrix}a_{x}\\
a_{y}\\
a_{z}
\end{pmatrix}+t\,\begin{pmatrix}b_{x}\\
b_{y}\\
b_{z}
\end{pmatrix}\\
\text{implicit} & e_{x}\,(y-r_{y})+e_{y}\,(r_{x}-x)=0 & \begin{pmatrix}e_{y}\,(z-r_{z})+e_{z}\,(r_{y}-y)=0\\
e_{x}\,(z-r_{z})+e_{z}\,(r_{x}-x)=0\\
e_{x}\,(y-r_{y})+e_{y}\,(r_{x}-x)=0
\end{pmatrix}\\
\text{Plücker} & \begin{pmatrix}m_{z}\end{pmatrix}=\begin{pmatrix}x\\
y
\end{pmatrix}\times\begin{pmatrix}e_{x}\\
e_{y}
\end{pmatrix} & \begin{pmatrix}m_{x}\\
m_{y}\\
m_{z}
\end{pmatrix}=\begin{pmatrix}x\\
y\\
z
\end{pmatrix}\times\begin{pmatrix}e_{x}\\
e_{y}\\
e_{z}
\end{pmatrix}\\
\text{equation} & a\,x+b\,y+c=0 & \dfrac{x-r_{x}}{e_{x}}=\dfrac{y-r_{y}}{e_{y}}=\dfrac{z-r_{z}}{e_{z}}=t\\
\text{slope-intercept} & y=m\,x+b & ?\\
\text{angle }\varphi\text{-offset }d & x\,\sin\varphi-y\cos\varphi=d & \text{N/A}\\
\text{projective meet} & \begin{pmatrix}x\\
y\\
1
\end{pmatrix}\cdot\begin{pmatrix}n_{y}\\
n_{x}\\
-d
\end{pmatrix}=0 & \begin{aligned}\begin{pmatrix}e_{x}\\
e_{y}\\
e_{z}
\end{pmatrix} & =\begin{pmatrix}n_{x}\\
n_{y}\\
n_{z}
\end{pmatrix}\times\begin{pmatrix}n_{x}\\
n_{y}\\
n_{z}
\end{pmatrix}\\
\begin{pmatrix}m_{x}\\
m_{y}\\
m_{z}
\end{pmatrix} & =d_{1}\begin{pmatrix}n_{x}\\
n_{y}\\
n_{z}
\end{pmatrix}-d_{2}\begin{pmatrix}n_{x}\\
n_{y}\\
n_{z}
\end{pmatrix}
\end{aligned}
\end{array}$$

In the above list ($x$,$y$ ..) denotes a point on the line, ($r_x$,$r_y$..) denotes a known point, ($e_x$,$e_y$ ..) denotes line direction vector, ($n_x$,$n_y$ ..) denotes perpendicular direction, $t$ is either a free parameter or a constant,  ($a$,$b$,$c$) are equation coefficients, $\varphi$ is the direction angle from horizontal of a 2D line and $d$ the offset of the line from the origin. Oh ,and ($m_x$,$m_y$ ..) are parameters that describe the moment of the line about the origin. And ($a_x$,$a_y$..) ($b_x$,$b_y$..) are the coordinates of two points.

I am not sure where you see a $\cos \varphi$ to define a line, but my guess is that you saw that in the context of the dot product $\cdot$

$$ \| a \cdot b \| = \| a \| \| b \| \cos \varphi $$

This particular identity isn't of much use for defining lines. The question needs more details to be answered fully.


问:
Probabilities in a game
John plays a game with a die. The game is as follows: He rolls a fair six-sided die. If the roll is a $1$ or $2$, he gets $0$ dollars. If he rolls a $3, 4$ or $5$, he gets $5$ dollars. If he rolls a $6$, he wins $X$ dollars where $X$ is a continuous random variable that is uniform on the interval $(10, 30)$. Let $Y$ be the amount of money John wins by playing the game.

(i) Compute the cumulative distribution function (cdf) of $Y$.

(ii) What is the probability that John rolled a $6$ given that he won less than $15$ dollars?

(iii) Compute $E(Y)$.

My attempt:

(i) If $Y > 5$ then $P(Y \leq y) = P(X \leq y)$. Then $P(Y \leq 5) = P(Y = 0) + P(Y = 5) = P(roll = 1 or 2) + P(roll = 3, 4 or 5) = \frac{1}{3} + \frac{1}{2} = \frac{5}{6}$.

Not sure if this is even correct.

(ii) $P(roll = 6 | Y < 15) = \frac{P(roll = 6 \land Y < 15)}{P(Y<15)}$

But by Bayes theorem $P(roll = 6 | Y < 15) = \frac{P(Y < 15 | roll = 6) \cdot P(roll = 6)}{P(Y<15)}$

We know $P(roll = 6) = \frac{1}{6}$.

Given that he rolled a $6$, the probability that he won less than $15$ dollars is equal to $P(X < 15) = \frac{15 - 10}{30 - 10} = \frac{1}{4}$

Lastly, $P(Y < 15) = 1 - P(Y \geq 15)$. However, since the only situation in which John wins $15$ dollars or more is if he rolls a $6$. We may infer that $P(Y \geq 15) = P(X \geq 15) = 1 - P(X < 15) = \frac{3}{4}$. So $P(Y < 15) = 1 - \frac{3}{4} = \frac{1}{4}$.

So $P(roll = 6 | Y < 15) = \frac{\frac{1}{4} \cdot \frac{1}{6}}{\frac{1}{4}} = \frac{1}{6}$

Not sure how to determine the other probabilities.

(iii) We can check $Y$ conditioned on $X = x$: $E(Y|X=x) = (0 \cdot \frac{1}{3}) + (5 \cdot \frac{1}{2}) + (x \cdot \frac{1}{6}) = \frac{5}{2} + \frac{x}{6} = \frac{x + 15}{6}$. But $E(E(Y|X)) = E(Y)$ by the law of iterated expectation.

Applying it we have $E(Y) = E(E(Y|X)) = E(\frac{X + 15}{6}) = \frac{1}{6} E(X) + \frac{15}{6}$

Since $X$ is uniform on $(10, 30)$ we know $E(X) = \frac{1}{2} (10 + 30) = 20$

Therefore $E(Y) = \frac{35}{6}$.

Is this correct? I have a feeling that my attempt for (i) is incorrect, and I am unsure about (ii) and (iii). Any assistance is much appreciated.

答:
In short $Y= 0\mathbf 1_{1\leq X\leq 2}+5\mathbf 1_{3\leq X\leq 5}+Z\mathbf 1_{X=6}$ where $X\sim\mathcal U\{1,2,3,4,5,6\}$ and independently $Z\sim\mathcal U(10..30)$. That means:-

$$Y=\begin{cases}0 &:& 1\leq X\leq 2\\5&:& 3\leq X\leq 5\\Z&:& X=6\\0&:&\textsf{else}\end{cases}$$

(i) The CDF will be a piecewise function.  You need to evaluate the probability in each of the pieces.

So, the cumulative probability equals zero for for all $y<0$. There is a massive step in the CDF at $y=0$, which equals the probability that the die rolls $1$ or $2$; ie $\mathsf P(1\leq X\leq 2)$.  There is another massive step at $y=5$, equal to the probability that the die rolls $3,4,$ or $5$.  At and after $10$ there is no step, but a linear accumulation until $y=30$, when we reach total probability.

$\qquad\begin{align}\mathsf P(Y\leqslant y)&=\begin{cases}0&:&\qquad y<0\\\mathsf P(1\leq X\leq 2)&:&0\leqslant y\lt 5\\\mathsf P(1\leq X\leq 5)&:& 5\leqslant y\lt 10\\\mathsf P(1\leq X\leq 5)+\mathsf P(X=6)\mathsf P(Z\leqslant y)&:& 10\leqslant y< 30\\1&:& 30\leqslant y\end{cases}\end{align}$

(ii) You mostly have this.  Under the condition that $X=6$, there $Y=Z$; and $X\perp Z$, so...

$\qquad\mathsf P(X=6\mid Y\leqslant 15)~{=\dfrac{\mathsf P(X=6, Y\leqslant 15)}{\mathsf P(Y\leqslant 15)}\\=\dfrac{\mathsf P(X=6)\mathsf P(Z\leqslant 15)}{\mathsf P(Y\leqslant 15)}}$

(iii) Expectation is Linear, and the expectation of an indicator equals the probability of the event.  Also, again, $X$ and $Z$ are independent.

$\qquad\mathsf E(Y)~{=\mathsf E(0\mathbf 1_{1\leq X\leq 2}+5\mathbf 1_{3\leq X\leq 5}+Z\mathbf 1_{X=6})\\[1ex]=0\,\mathsf P(1\leq X\leq 2)+5\,\mathsf P(3\leq X\leq 5)+\mathsf E(Z)\,\mathsf P(X=6)}$

Title: Probabilities in a game


问:
If $f$ is continuous a.e. on $\mathbb{R}$, then it is measurable.
I have seen the proofs of this just using the basic definition but I am trying to do this by using these functions:
$$\phi_f^{(n)}(x) := \sum_{k \in \mathbb{Z}} f\left(\frac{k}{n}\right) \chi_{[\frac{k}{n},\frac{k+1}{n})},$$ for $n \in \mathbb{N}$. For a set $A$ we have $\chi_A$ defined as $\chi_A(x) = 1$ if $x \in A$ and $0$ otherwise. If I can show that these functions are indeed measurable and that they converge to $f$ pointwise a.e., then $f$ is measurable. Clearly these sets are going to measurable, the set $\{\phi_f^{(n)}>a\}$ ends up being a union of intervals which of course is measurable for each $a \in \mathbb{R}$. My problem is showing that these things converge to $f$ pointwise. Here is my attempt, fix $x$ and consider $$|\sum_{k \in \mathbb{Z}} f\left(\frac{k}{n}\right) \chi_{[\frac{k}{n},\frac{k+1}{n})}-f(x)| = |f(k^*/n)-f(x)|,$$ for some $k^* \in \mathbb{Z}$ such that $x \in [\frac{k^*}{n},\frac{k^*+1}{n})$. I am just having trouble finding $N \in \mathbb{N}$ such that $|f(k^*/n)-f(x)| < \epsilon$ when $n > N$.

Any help and tips?

Edit: I now see that as typing this that the $k^*$ does not work for every $n$. Rather for each $n$ there is $k_n$ such that $x \in [\frac{k_n}{n},\frac{k_n+1}{n}).$ Then the sequence $\{\frac{k_n}{n}\}$ converges to $x$. I think this proves the problem. I am not sure though. Also, I do not see where I use the fact that $f$ is continuous a.e. could someone help me see where this is used? Thanks again.

答: Define $A:=\{x\, | f(x)\, \text{is continuous}\}$ and by assumption $\mu(A^c)=0$. Let $x\in A$ and then as you say, we can choose a sequence $k_n$ such that $\frac{k_n}{n}\rightarrow x$. Since $f(x)$ is continuous at $x$, there must exist an $N$ such that $|f(\frac{k_n}{n})-f(x)|<\epsilon$ for $n>N$. Moreover, $x\in A$ was arbitrary, so this convergence happens pointwise almost everywhere.


问:
Looking for reference on triangulating convex (or regular) $n$-gons
Looking for reference on triangulating convex (or regular) $n$-gons.

There are some basic interesting facts on them, like the number of triangulations of an $n$-gon is the $n-2$ Catalan number. I'm looking for a more in depth exposition, and google is failing me.

Thanks!

P.S. I have access to Springer's electronic database of books through my university

答:
Mansour, Rastegar On typical triangulations of a convex n-gon.  Lots of additional references as well.

From the abstract:

... among other things, we give new proofs for already known results
such as the degree of a fixed vertex and the number of ears in [a
random triangulation] $T_n$, as well as, provide new results on the
number of “blue” angles and refined information on the distribution of
angles at a fixed vertex ...

See also Mašović et al, Orbiting Triangle Method For Convex Polygon Triangulation


问:
Application of Spectral mapping Theorem
Let $H$ be a Hilbert space. Let $D\in B(H)$ be the diagonal operator with $De_n = d_ne_n$, where $(e_n)_n$ is an orthonormal basis.

Suppose $f: \sigma(D) \rightarrow \mathbb{C}$ is a continuous function. Show that $f(D)$ is still diagonal, i.e $f(D)e_n=f(d_n)e_n$.

I thought about using the spectral mapping theorem. If $p_n$ is a polynomial, then by Weierstrass, the continuous $f$ will be the limit. So we by the spectral mapping theorem, we have $\sigma(f(D)) = f(\sigma(D))$.

But I'm not sure how to construct the sequence of polynomials...

Any help will be appreciated!

答:
Your instinct is a good one: Let $p_n$ be the sequence of polynomials given by Stone-Weirstrass with $\sup_{x\in \sigma(A)}|p_n(x)-f(x)|\to 0$ as $n\to \infty$.

Now it is obvious that for the polynomials, $p_n(A)$ are diagonal. So, for any $n$, and $i\ne j$,
$$
\langle e_j,p_n(A)e_i\rangle=0.
$$
So,
$$
\lim_{n\to\infty}\langle e_j,p_n(A)e_i\rangle=\langle e_j,f(A)e_i\rangle=0
$$
where we have used that in fact $||p_n(A)-f(A)||\to 0$ as $n\to \infty$ because of, for example, the spectral mapping.

Title: Application of Spectral mapping Theorem


问:
Left eigenvectors of a non-normal matrix from right eigenvectors
For a diagonalizable non-normal matrix is it possible to find left eigenvectors solely from right eigenvectors?

If this sounds too general or no clear statement can be made about this, I can provide a kind of example that is of interest, but I, personally, do not quite remember anything on that.

答:
If $A$ is diagonalizable, we can write: $A = R\Lambda R^{-1}$, where $R$ is the matrix whose columns are the right eigenvectors of $A$.

We define the matrix $L=R^{-1}$. So we have $A = L^{-1}\Lambda L$. The left eigenvectors will be the rows of $L$. To see why, take $\vec v$ to be any row, say the $j$th row. (So $\vec v$ is a row vector.) Then: $\vec vL^{-1} = \hat e_j$ (the $j$th 1-hot row vector) This can be seen by noting that $LL^{-1}=I$, and just looking at the $j$th row of that computation in particular. Finally, we have:

$$
\vec vA = \vec v L^{-1}\Lambda L = \hat e_j\Lambda L = \hat e_j \lambda_j L = \lambda_j \vec v
$$

This shows that $\vec v$ is a left eigenvector.


答:
Claim: There does not exist any set which has the largest cardinal.

Proof: On the contrary let $A$ be the set with the largest cardinal. By Cantor's theorem, there exists no onto set from set $A$ to its power set $P(A)$ and therefore, $|A|\lt P(A)$, which is a contradiction. Proved.

Title: Proof there is no largest cardinal number

Body:
For any set $A$, I proved already that $|A| < |\mathcal{P}(A)|$ by injecting $A \to \mathcal{P}(A)$ by $a \mapsto \{a\}$ and then demonstrating, by contradiction, that no surjection can exist. I want to prove that there is no largest cardinal number, but the argument
$$|\mathbb{N}| < |\mathcal{P}(\mathbb{N})| < |\mathcal{P}(\mathcal{P}(\mathbb{N}))| < |\mathcal{P}(\mathcal{P}(\mathcal{P}(\mathbb{N})))| < \ldots$$
Perhaps more formally, I could suppose for the sake of contradiction that $|A|$ is the largest infinite cardinal, but this theorem implies that $|\mathcal{P}(A)| > |A|$, a contradiction.

How can I make this proof sufficiently formal?


问:
how to prove this trig inequality: $\cos x \cos y + z \sin x \sin y \geq \cos \left( \sqrt{x^2 + y^2 - 2 x y z} \right)$
The following inequality has come up in my work. I'm trying to prove that it is true:
$$
\begin{equation}
\cos x \cos y + z \sin x \sin y \geq \cos \left( \sqrt{x^2 + y^2 - 2 x y z} \right)
\end{equation}
$$
where
$$
\begin{align}
-\pi \leq{} &x \leq \pi \\
-\pi \leq{} &y \leq \pi \\
-1 \leq{} &z \leq 1
\end{align}
$$

The LHS of the inequality is derived from the spherical law of cosines, the RHS is derived from the law of cosines, and $z$ represents the cosine of another variable. Note that the inequality holds with equality when $z=1$.

I have also put the inequality in the following form using the product-to-sum trig identity, and rearranging the RHS:

$$
\begin{equation}
(1+z) \cos(x-y) + (1-z) \cos(x+y) \geq
2 \cos \left( \sqrt{(x-y)^2 + 2 x y (1-z)} \right)
\end{equation}
$$

I have also tried other things like applying Cauchy-Schwarz to the LHS, and applying arccosine to both sides, but I can't seem to prove that the inequality is true.

I am quite certain that the inequality holds because I have performed a Monte Carlo simulation (code shown below) which shows that the inequality holds for randomly sampled values.

python Monte Carlo random sampling code

```<code>import numpy as np

n = 10**6
x = np.random.uniform(-np.pi, np.pi, n)
y = np.random.uniform(-np.pi, np.pi, n)
z = np.random.uniform(-1, 1, n)
lhs = np.cos(x)*np.cos(y) + z*np.sin(x)*np.sin(y)
rhs = np.cos(np.sqrt(x**2 + y**2 - 2*x*y*z))
check = lhs>=rhs
print('inequality is true', np.sum(check), '/', n, 'times')
</code>```

答:
I think if $0\le y\le x\le \pi$ and $x+y>\pi$, you can take $x'=\pi-x$ and $y'=\pi-y$ and use Martin R's proof with $x',y',z$ instead.  It works because $x'+y'=2\pi-x-y<\pi$ and $$(x'^2+y'^2-2x'y'z)-(x^2+y^2-2xyz)=-2\pi(1-z)(x+y-\pi)\le 0$$ so $$\cos\sqrt{x'^2+y'^2-2x'y'z}\ge \cos\sqrt{x^2+y^2-2xyz}$$
while
$$\cos x'\cos y'+z\sin x' \sin y'=\cos x\cos y+z\sin x\sin y.$$
Apparently there is another equality condition $x,y=\pm \pi$ and $z=\pm 1$.

From Martin R comment below, I need
$$\sqrt{x'^2+y'^2-2x'y'z}\le \sqrt{x^2+y^2-2xyz}\le 2\pi -\sqrt{x'^2+y'^2-2x'y'z}.$$
I proved only the inequality on the left.  Not yet on the right.  After trying to prove the right inequality, I got this messy inequality to prove
$$(1+z)\Big[(x+y+\pi)^2-4(x^2+y^2)+z(x+y-\pi)^2\Big]\ge 0.$$
This is true because $1+z\ge 0$ and
$$(x+y+\pi)^2-4(x^2+y^2)+z(x+y-\pi)^2\ge (x+y+\pi)^2-4(x^2+y^2)-(x+y-\pi)^2 = 4x(\pi-x)+4y(\pi-y)\ge 0.$$


问:
Von-Neumann-Morgenstern Axioms Clarification Question
I want to solidify my understanding of the von-Neumann-Morgenstern axioms. How would you analyze these scenarios using the lens of these axioms?

Suppose that Person A owns a potentially expensive baseball card. All people within this universe abide by maximizing subjective utility, aligning with the von-Neumann-Morgenstern axioms.

a. In a universe in which both person A and person B have the same utility function and same wealth to start off with, why would person A want to sell the baseball card to person B instead of owning it, and In the same instance, why would person B want to purchase the card instead of returning it? (Note: Technically, person A owns the baseball card, so he does have slightly more money)

b. In this scenario, person B wants to purchase a different card from person C. Is there ever a scenario where person B would purchase a card from person C for a set amount, and then immediately flip the purchase to sell to person D for less money?

答:
In the context of just the Von Neumann Theorem, I don't think there is anything sophisticated going on here. As the problem is stated, there doesn't seem to be any sort of transaction costs being occurred.

For part a. Person A will sell the card if and only if he receives the monetary amount that is of equal or greater value to that of the card. Additionally, person B will buy the card if and only if they receive the card for less than or equal value to that of the card. Since person A and B have the same utility function, this transaction occurs if and only if the card is sold for its exact value.

For part b. The answer is no following identical reasoning.


问:
What is the correct way to draw a Karnaugh map
I'm studying digital logic at university currently, and the textbook has an example of a 4 variable K-map drawn with the $x_1$ and $x_2$ on top. However, most places I can find draw the map inverted with the $x_1$ and $x_2$ on bottom. I've taken to drawing it that way also, only because it's faster for me to check my answers using other tools which all represent K-maps in this same way. The only difference seems to be that the book has minterms drawn in column major order, and the rest of the world has them drawn in row major order. Is there a correct or preferred way to draw a K-Map?

答: It's all up to you; different ways of drawing (four-variable) Karnaugh maps only differ in how variables are ordered. They all give the same results.</p>


问:
Find a maximal ideal in $\mathbb Z[x]$ that properly contains the ideal $(x-1)$
I'm trying to find a maximal ideal in ${\mathbb Z}[x]$ that properly contains the ideal $(x-1)$.

I know the relevant definitions, and that "a proper ideal $M$ in ${\mathbb Z}[x]$ is maximal iff ${\mathbb Z}[x]/M$ is a field."

I think the maximal ideal I require will not be principal, but I can't find it.

Any help would be appreciated.

Thanks.

答:
All ideals of the form $(p,X-1)$ with $p$ a prime number satisfy your condition. Note that $\mathbb Z[X]/(p,X-1)\simeq \mathbb Z_p$: we have $$\mathbb Z[X]/(p,X-1)\simeq \frac{\mathbb Z[X]/(X-1)}{(p,X-1)/(X-1)}\simeq\mathbb Z/(p).$$
Moreover, you can prove that these are all maximal ideals with the required property.</p>

ContentLicense: CC BY-SA 3.0


问:
Prove the following using mathematical induction
Prove using mathematical induction that $n<3^n$ for all positive integers $n$

I came until here, 3^k+1< 3^(k+1)

I wanna know if this is already the final answer?

答:
Is it true for n=1? Yes. Suppose true for $n$ and show this implies it's true for $n+1<3^{n+1}$. Then we have the following:
\begin{equation}
\begin{split}
 n<3^n\\
\Rightarrow n+1<3^n+1< 3^n+3^n+3^n \quad\text{Since n>1}\\
=3\cdot3^n=3^{n+1}
\end{split}
\end{equation}


问:
Remodelling random points on a circle: Arc length between points distributed on circle is uniform?
An update to this: Modelling random points on a circle , but I hope my posts are self-contained.

Suppose 3 (distinct) points are uniformly and independently distributed on a circle of unit length (smaller than a unit circle!). This is really circle and not disc. Call these points $A,B,C$.

There is a claim here:

Let $X$ be the anticlockwise distance along the circle's circumference from $B$ to $A$.
Let $Y$ be the anticlockwise distance from $B$ to $C$.

Since the three points are independently uniformly distributed along the circumference of the circle, $X$ and $Y$ are iid variables with uniform distributions on $[0,1).$

Question: What exactly are $X$ and $Y$ (like the specific formulas in terms of the random variables $A,B,C$, and why are they iid Unif(0,1)? Please consider modifying what I did below to answer this question.

What I tried for identical distributed Unif(0,1): I tried thinking of something related to my wrong model.

For each $\omega \in \Omega$, we'll have either a line up of Case 1: $A(\omega),B(\omega),C(\omega)$ or Case 2: $C(\omega),B(\omega),A(\omega)$.

This model involves some point on the arc between A and C not containing B is selected as like the point 0/1 in viewing the circle as the unit interval with end points glued together. (Unfortunately, I think this choice of point kind of depends on a choice of $\omega$. Perhaps a choice of bijection $\phi$ from circle to unit interval doesn't depend on $\omega$ directly, but I think it depends on the choice of point.)

So, if we somehow are able to well-definedly imagine $A,B,C$ as members of the unit interval, then we have $A<B<C$ in Case 1 and then $C<B<A$ in Case 2.

Here, I might model $X$ as is something like $X=B-A$ in Case 1 and $X=1+(B-A)$ in Case 2. Similarly, $Y=B-C$ in Case 2 and $Y=1+(B-C)$ in Case 1.

To compute cdf of $X$: (btw, I'm assuming inequalities as strict or loose here are not really relevant)

5.1. $F_X(x) = P(X \le x)$ is $1$ for $x \ge 1$ and $0$ for $x \le 0$

5.2. For $x \in (0,1), F_X(x) = P(X \le x)$

$= P(X \le x, 1 > B-A > 0) + P(X \le x, -1 < B-A < 0)$

$= P(0 < B-A \le x < 1) + P(0 < 1+(B-A) \le x < 1)$

5.3. If $P(0 < B-A \le x < 1) = x - \frac12 x^2$ and $P(0 < 1+(B-A) \le x < 1) = \frac12 x^2$, then I have proven $X \sim Unif(0,1)$. Similarly, $Y \sim Unif(0,1)$.

5.4. I was able to make those computations in (5.3), but I'm not exactly sure what those assumptions were. Assuming the integrand is just '$1 \ da \ db$', the regions of integration have areas of, resp, $x - \frac12 x^2$ and $\frac12 x^2$ and so the areas are the values of the integrals. I think assuming $A,B$ are iid Unif(0,1), then the computation is correct, but I'm not sure that we can view $A,B$ as iid Unif(0,1) based on that my model was wrong. Well perhaps when converting $A,B,C$ from uniform on circle to uniform on $(0,1)$, we get that at least $A$ and $B$ are independent and that $B$ and $C$ are independent even if all 3 together are not independent (and even if they are not pairwise independent, i.e. we have pairwise independence except for independence of $A$ and $C$). So, perhaps the converted $A,B,C$ are not iid Unif(0,1), but maybe there is some partial independence here, and I believe the converted $A,B,C$ have $(0,1)$ (or $[0,1]$, whatever) as images.

What I tried for independence:

(Btw, since there's no measure theory here, I'm assuming the independence definition here is that the joint pdf splits up.)

I think this depends on the formulas for $X$ and $Y$, so I'm thinking to just wait on resolution on what the formulas are. Currently, there's a $B$ in each of the formulas for $X$ and $Y$, but I'm hoping this information with $B$ cancels out somehow. Something like how in the Gauss-Bonnet Theorem/Formula all the geometry information is cancelled out to get a topological quantity. Or maybe the $B$ isn't relevant after you compute the pdf's because...the joint pdf's are just constant whenever they are nonzero. Idk.

These questions are all related, but I hope I made each self-contained

Random points on a circle

More random points on a circle

Most random points on a circle

Modelling random points on a circle

Remodelling random points on a circle: Arc length between points distributed on circle is uniform?

答:
There is actually nothing wrong with choosing an arbitrary fixed point on the circle as your "origin" and giving each point a coordinate equal to the distance from the origin to that point counterclockwise along the circle.
In this coordinate system, three points $A,B,C$, each placed randomly on the circle with a uniform probability distribution on the circumference, each probability independent of the other two points, will be placed at three coordinates on the circle.
If we also call those coordinates $A,B,C$ respectively,
then the coordinates $A,B,C$ are real-valued random variables that are i.i.d.
and uniformly distributed on $[0,1).$

Where you run into trouble is when you try to say $A < B < C$ or $C < B < A.$
It is certainly true that the three points will (with probability $1$)
be placed in one of two ways: either $(1)$ a counterclockwise arc starting at $A$ will reach $B$ first and $C$ second, or $(2)$ a counterclockwise arc starting at $A$ will reach $C$ first and $B$ second.
It is also true that in the case $(2)$ just described, you can equally well say that a counterclockwise arc starting at $C$ will reach $B$ first and $A$ second;
provided all three points are distinct, the two descriptions of this case are equivalent.
But none of this implies that $A < B$ or $B < C$ in case $(1),$ because you have forgotten that all three numbers $A,B,C$ are distances from a previously chosen fixed point we called the "origin."
The statement $A<B<C$ is a statement about the relative placement of four points (the origin, $A$, $B$, and $C$): namely that by starting at the origin and going counterclockwise, you will encounter $A$ first, $B$ second, and $C$ last. And while it is true that there are really only two ways to sequence three points around a circle, there are much more than two ways to sequence four points around a circle.

I suggested here that if you really want to only deal with cases $A<B<C$ and $C<B<A$ you would have to give up the i.i.d. assumption. But I think a better approach is to keep the i.i.d. assumption and give up the idea of restricting your possible arrangements to only the cases
$A<B<C$ and $C<B<A$.

I have spent an awful lot of text discussing the chains of inequalities $A<B<C$ and $C<B<A$ and the two cases $(1)$ and $(2)$, but only reason I have done this is to show why these ideas are wrong ways to think about this problem.
I'm going to draw a line now (literally) under this paragraph and once we cross that line we will never see those inequalities or cases again.

To recapitulate, we have three random points on a circle, and the locations of those three points (measured counterclockwise from some fixed point) are the three i.i.d. real random variables $A,B,C$ each uniformly distributed on $[0,1).$
The joint distribution of these three variables is a uniform distribution on the cube $[0,1) \times [0,1) \times [0,1),$ represented by the figure below:

Let $B$ be the coordinate along the vertical axis in this figure, and let $A$ and $C$ be the other two coordinates.

Now let's define $X$ as the length of the shortest counterclockwise arc starting at $B$ and ending at $A$.
That's the definition of $X$; we'll work out the formulas as needed to satisfy that definition.

Consider the example where $A$ is $90$ degrees counterclockwise from $B$, that is, the counterclockwise distance from $B$ to $A$ is $0.25.$
If the coordinate of $B$ is $B = 0.3,$ the coordinate of $A$ is easily found:
$A = 0.3 + 0.25 = 0.55.$
But if $B = 0.9,$ things work a little differently. The first $0.1$ unit of length in the counterclockwise direction gets us from $B$ to the origin; we still have to go another $0.15$ units of length from the origin in order to finish the arc from $B$ to $A$, and therefore the coordinate of $A$ is $A = 0.15.$
That is, simple addition would have given $0.9 + 0.25 = 1.15$, but when we passed the origin we instantly subtracted $1$ from the coordinate (because we start counting distance from the last time we crossed the origin), and therefore the result is
$A = 0.9 + 0.25 - 1 = 0.15.$

The rule therefore is: if the arc from $B$ to $A$ goes past the origin, that is,
if $A < B,$ then $A = B + X - 1$ and therefore $X = A - B + 1$;
but if the arc does not go past the origin, that is, if $B < A,$
then $A = B + X$ and $X = A - B.$

Note that the inequality $B < A$ doesn't say anything about the positions of $A$ and $B$ relative to each other; it just says that we can get from $B$ to $A$ in a counterclockwise direction without passing through the arbitrary point we chose as the origin of coordinates.

Next, let's define $Y$ as the length of the shortest counterclockwise arc starting at $B$ and ending at $C$. Using the same reasoning we used for $X$, we can show that this definition implies that
$Y = C - B + 1$ if $C < B$ and $Y = C - B$ if $B < C.$

By definition, since $X$ is the shortest counterclockwise arc from $B$ to $A$, $X$ cannot be less than $0$ (you have to go counterclockwise, not clockwise!) and $X$ cannot be greater than $1$ (because you will certainly reach $A$ before you circle all the way around to $B$ again).
It should be clear that in fact the possible values of $X$ are exactly $[0,1),$
and likewise with $Y$.

There are at least two ways to prove that $X$ and $Y$ are i.i.d. and uniformly distributed on $[0,1).$

In my opinion, the easiest and most intuitive proof is that if the distribution of $X$ was not uniform, then if you found out the location of $B$ you would know that $A$ was more likely to occur in some arc of the circle than in in some other equal-sized arc. That is, the probability distribution of $A$ conditioned on a value of $B$ would be different from the unconditional distribution of $A.$
Therefore $B$ and $A$ would not be independent.
But since $B$ and $A$ are independent, $X$ must be uniformly distributed on $[0,1).$ Likewise for $Y$.

The second part of the proof is that if $X$ and $Y$ were not independent, then if you knew the locations of $A$ and $B$ you would know $X$; the distribution of $Y$ conditioned on $X$ might not be the same as the unconditioned distribution, that is, it might not be uniform; and therefore you would be able to say (based on the knowledge of $A$ and $B$) that $C$ is more likely to occur in one arc of the circle than in some other arc of equal length. But that would mean $C$ would not be independent of $A$ and $B$. Since we know that $C$ is independent of $A$ and $B$, $Y$ must be independent of $X$.

Another, much longer proof can be done by constructing the joint distribution of $B,$ $X,$ and $Y.$

We start by considering a different joint distribution: the joint distribution of $B,$ $x = A - B,$ and $y = C - B.$
(Lower-case $x$ and $y$ for simple difference of coordinates rather than the length of a counterclockwise arc.)
This distribution looks something like the graph below,
where the vertex in the lower right of the figure represents the outcome
$x = A-B=1-\epsilon,$ $y = C-B=1-\epsilon,$ $B=0$
and the vertex in the upper left represents the outcome
$x=A-B=-1,$ $y=C-B=-1,$ $B=1-\epsilon.$
(I write $1-\epsilon$ instead of $1$ because technically it is not possible for any of these quantities to be exactly equal to $1$.)

If we take a horizontal slice of this distribution at any particular value of $B,$
the distribution in that slice will be uniform over the square
$[-B,1-B) \times [-B,1-B)$,
that is, the square such that $-B \leq x = A - B < 1 - B$
and $-B \leq y = C - B < 1 - B$.
And since $B$ is uniformly distributed, any equally-very-thin horizontal slice is equally likely, so the distribution over the entire volume is uniform;
the density is $1$ throughout.

But the only part of this distribution that directly represents part of the distribution of $X$ and $Y$ is the part where $A > B$ and $C > B,$ that is, the
square-based pyramid below:

Within this pyramid, whatever $A - B$ and $C - B$ came out to be, $X$ and $Y$ come out to those values, respectively.

The case where $C > B$ but $A < B$ is represented by the following tetrahedron bounded by the equations $x = A - B \leq 0,$ $x + B = A \geq 0,$
$y = C - B \geq 0,$ $y + B = C \leq 1.$

But since $X = A - B + 1 = x + 1$ in this case, this part of the joint distribution of $X,$ $Y,$ and $B$ is translated $1$ unit in the $x$ direction so that it falls inside the cube $[0,1) \times [0,1) \times [0,1).$

The case where $A > B$ but $C < B$ is represented by the following tetrahedron bounded by the equations $x = A - B \geq 0,$ $x + B = A \leq 1,$
$y = C - B \leq 0,$ $y + B = C \geq 0.$

But since $Y = C - B + 1 = y + 1$ in this case, this part of the joint distribution of $X,$ $Y,$ and $B$ is translated $1$ unit in the $y$ direction so that it falls inside the cube $[0,1) \times [0,1) \times [0,1).$

The final case, where $A < B$ and $C < B$, is represented by the inverted square-based pyramid in the figure below,
bounded by the equations $x = A - B \leq 0,$ $x + B = A \geq 0,$
$y = C - B \leq 0,$ $y + B = C \geq 0,$ $B < 1$:

In this case $X = x + 1$ and $Y = y + 1,$ that is, this pyramid is translated by $1$ unit in both the $x$ and $y$ directions in order to become the part of the joint distribution of $X,$ $Y,$ and $B$ for this case.
Again this places the pyramid inside the cube $[0,1) \times [0,1) \times [0,1).$

When the four parts of the distribution of $X$ and $Y$ are assembled inside the cube
$[0,1) \times [0,1) \times [0,1)$ in this way, they exactly fill the cube without overlapping. Moreover, since the distribution of $A-B,$ $C- B,$ and $B$ from which these pieces were taken has uniform density $1,$ so does the distribution of
$X,$ $Y,$ and $B$ within the cube $[0,1) \times [0,1) \times [0,1).$

Therefore the variables $X,$ $Y,$ and $B$ are i.i.d. uniformly distributed over
$[0,1).$ It follows a fortiori that the variables
$X$ and $Y$ are i.i.d. uniformly distributed over $[0,1).$

Personally I like the first proof much better. The second proof takes a lot more work for the construction and requires careful checking to make sure that the four pieces of the distribution really fill the cube without overlapping.


问:
Identity of a commutative ring
so I was trying to prove that $$F = \{f: R \to R \mid f(x) = 0 \,\forall x\in D\}$$ D is a subset of R is a commutative ring with an identity. I was able to prove that it is a commutative ring and was able to show that it has an additive identity. However, I got stuck with multiplicative identity because I know that it has to be 1: R to 1. However, this would imply that it does not belong to F. I don't know if I am not interpreting it correctly. Any help would be appreciated.

Btw, addition is pointwise and multiplication is pointwise.

答:
If you consider the function $z: \mathbb{R} \to \mathbb{R}$ given by $z(x) = 0$ if $x \in D$ and $z(x) = 1$ if $x \not \in D$ you should be able to show that $z$ is a multiplicative identity for $F$.

Note that the problem does not require $F$ to have the same multiplicative identity as some larger more "natural" set of functions (for example the set of all functions $\mathbb{R} \to \mathbb{R}$, with the usual operations), just that it have a multiplicative identity.

Note also that if the functions were required to be continuous on all of $\mathbb{R}$ (or perhaps have other interesting properties in addition to being $0$ on $D$) this construction might not work. The pointwise operations do, as you point out, require the identity to take the value $1$ a lot of the time (namely at all points not in $D$), and the definition of $D$ requires the identity to take the value $0$ on $D$, so that's what the identity has to be if there is one.

Title: Identity of a commutative ring


问:
Terminology for Galois groups of non-Galois extensions.
I am having a confusion with terminology.  If $L/K$ is not Galois, what is the meaning of "the Galois group of $L$ over $K$"?   I have two guesses:

1) It is the field automorphisms of $L$ that fix $K$.

2) It is the Galois group of the Galois closure of $L$ over $K$.

Thanks!

答: Indeed, (2) seems to be standard convention. Wikipedia defines it that way, and I have run across this and become confused before myself.</p>


问:
Calculate the limit $\lim_{(x,y)\to (0,0)} \frac{x-\cos(x^2+y^2)-\arctan(x)+1}{x^2+y^2}$
Find the limit, $$\lim_{(x,y)\to (0,0)} \frac{x-\cos(x^2+y^2)-\arctan(x)+1}{x^2+y^2}.$$

My attempt:

I have tried several paths for evaluating the limit. For instance, $y=0$, $x=0$, $y=x$, $x=\tan y$, etc. I always obtain $0$. But I haven't been able to prove that the limit is equal to $0$.

答:
You may use the following limits which you can easily show using Taylor or L'Hosp.:

$\lim_{t\to 0}\frac{1-\cos t}{t^2}=\frac 12$, hence, $\lim_{t\to 0}\frac{1-\cos t}{t}=0$

$\lim_{x\to 0}\frac{x-\arctan x}{x^2}=0$

Now, just rewrite the given expression as follows:

\begin{eqnarray*}\frac{x-\cos(x^2+y^2)-\arctan(x)+1}{x^2+y^2}
& = & \underbrace{\frac{1-\cos(x^2+y^2)}{x^2+y^2}}_{\stackrel{(x,y)\to (0,0)}{\longrightarrow}0} + \underbrace{\frac{x-\arctan x}{x^2+y^2}}_{\left|\frac{x-\arctan x}{x^2+y^2}\right|\leq\left|\frac{x-\arctan x}{x^2}\right|\stackrel{(x,y)\to (0,0)}{\longrightarrow}0} \\
\end{eqnarray*}


问:
Showing that $a^{12}\equiv 1\pmod{210}$ if $a$ is coprime to $210$
I ran into this next question:

Show that if $a$ is coprime to $210$:

$a^{12}\equiv1 \pmod{210}$.

This is not a homework question.

Thank you very much in advance,

Yaron

答:
Hint $\ $ Either apply Carmichael's generalization of Euler-Fermat, or, directly, by little Fermat

$$A^{N_j}\equiv 1\ \ ({\rm mod}\ M_j)\ \Rightarrow\ A^{{\rm lcm}\ N_j}\equiv 1\ \ ({\rm mod\ lcm}\ M_j)$$

$${\rm for}\quad \begin{cases} \:N = (1,2,4,6)\,\Rightarrow\,{\rm lcm}\ N_j\, = 12\\ \, M = (2,3,5,7)\,\Rightarrow\, {\rm lcm}\ M_j = 210\end{cases}\ \ \ \ $$


问:
How to evaluate $ \frac{1}{3} + \frac{2}{3^{2} } + \frac{1}{3^{3}} + \frac{2}{3^{4}} + \frac{1}{3^{5}} + ...$?
I was given the series:
$$ \frac{1}{3} + \frac{2}{3^{2} } + \frac{1}{3^{3}} + \frac{2}{3^{4}} + \frac{1}{3^{5}} + ...$$
Making some observations I realized that the $ a_{n} $ term would be the following:
$$ a_{n} = \frac{1}{ 3^{n} } \left(\frac{3}{2}+ \frac{(-1)^{n}}{2} \right)$$
What I wanted to do is to find the result of the series, so the answer would be:
$$\sum_{n=1}^{ \infty } \frac{1}{ 3^{n} } \left(\frac{3}{2}+ \frac{(-1)^{n}}{2} \right) = \frac{3}{2} \sum_{n=1}^{ \infty } \left[ \frac{1}{3^{n} } \right]+ \sum_{n=1}^{ \infty } \left[\frac{1}{3^{n} } \frac{(-1)^{n}}{2}\right]$$
I can tell that the first term is convergent because it is a geometric series, in fact, the result is $\frac{3}{4}$. However, I have no clue in how to solve the second term series. I should say that the series given in the beginning is convert and its result is 5/8. How to arrive to it is a mystery to me.

Body:
In base $3$, we can say

$$N = \frac {1}{10} + \frac{2}{100} + \frac{1}{1000} + \frac{2}{10000} + \cdots
=0.121212\cdots$$

Staying in base 3, we get

\begin{array}{rcr}
   N &= &0.121212\cdots \\
100N &= &12.121212 \cdots \\
  -N &= &-0.121212\cdots \\
\hline
22N &= &12.000000\cdots \\
\end{array}

So $N = \dfrac{12}{22}$

In base $10$, this becomes $N = \dfrac 58$

Added 3/19/2021

You can also do this directly

\begin{align}
   N &= \frac{1}{3} + \frac{2}{3^{2} } + \frac{1}{3^{3}}
                    + \frac{2}{3^{4}} + \frac{1}{3^{5}} + … \\
  9N &= 3 + 2 + \frac{1}{3} + \frac{2}{3^{2} } + \frac{1}{3^{3}}
                    + \frac{2}{3^{4}} + \frac{1}{3^{5}} + … \\
  9N &= 5 + N \\
   N &= \frac 58
\end{align}


问:
The sequence $(D^{-h_k}_i f)_k \subset L^\infty(\mathbb R^n)$ $\star$-weakly converges to some $f_i \in L^\infty(\mathbb R^n)$.
Let $f$ be a bounded lipschitz continuous function. It is not to hard to show that
$$\|D^{-h}_i f\|_\infty \le C,$$
for $C$ the Lipschitz constant and
$$D^{-h}_i f (x)= \frac{f(x ) - f(x - he_i)}{h}, \quad h \in \mathbb R.$$
In my functional analysis course, we were given the following exercise:

If $(h_k)_k \subset \mathbb R$ with $h_k \to 0$, then there exists $f_i \in L^\infty_{loc}(\mathbb R^n)$ such that, for all compact set $K \subset \mathbb R^n$, $(D^{-h_k}_i f)_k$ converges $\star$-weakly to $f_i$ in $L^\infty(K)$ (up to a subsequence). Moreover, show that $f_i \in L^\infty(\mathbb R^n)$.

I don't really understand the condition "then there exists $f_i \in L^\infty_{loc}(\mathbb R^n)$". Indeed, from Banach-Alaoglu theorem we have that there is a subsequence of $(D^{-h_k}_i f)_k$ that weakly-$\star$ converges to some $f_i \in L^\infty(\mathbb R^n)$. Why do we have to go through $L^\infty_{loc}(\mathbb R^n)$ and compact sets ?

答:
What is the dual space of $L^\infty(\mathbb{R}^n)$? It's the space of Radon measures that need not be bounded. Hence, using Banach-Alaoglu is not justified because you might be working with an unbounded sequence.

However, if you're working with a compact set $K$, then these measures are in fact bounded and one can use Banach-Alaoglu as you say.


问:
continuity, supremum/infimum
I came across this but I'm still struggling to understand the concept fully. Specifically, how do we know $\text{lub}\{f(x)\mid a-\epsilon<x<a+\epsilon\}-\text{glb}\{f(x)\mid a-\epsilon<x<a+\epsilon\}$ decreases as $\epsilon$ decreases?

答:
Because as $\varepsilon$ decreases you're taking bounds over smaller sets.  Anything that is an upper or lower bound for the larger set must necessarily also be an upper or lower bound for any subset.  So at a minimum, we know that the difference is non-increasing as $\varepsilon$ gets smaller.

If $f$ is continuous at $a$ (as the answer to the linked question assumes), then the difference of the bounds must in fact go to $0.$  If the difference were to go to some $\mu \gt 0$, then any open set around $a$, no matter how small, would have points $y, z$ such that $\vert f(y)-f(z) \vert \gt \frac{\mu}{2}.$

That means for $\varepsilon \lt \frac{\mu}{4}$ it's impossible to find $\delta$ such that $\vert x-a \vert \lt \delta \Rightarrow \vert f(x)-f(a) \vert \lt \varepsilon$, which contradicts the assumption that $f$ is continuous at $a$.

Title: continuity, supremum/infimum


问:
when can I separate an infinite series from a sum?
First of all I apologize if this question turns out to be pretty silly: when can I separate an infinite series from a sum? That is, when $$\sum_{n=0}^{\infty}{(x_n + y_n)} =  \sum_{n=0}^{\infty}{x_n} +\sum_{n=0}^{\infty}{y_n}$$ I don't remember this fact very well, I don't know if the space in which the $x_n$ and $y_n$ terms are should be taken into account, or it simply requires convergence.

I appreciate a good answer.

答: Assuming that both $\sum_{n=0}^\infty x_n$ and $\sum_{n=0}^\infty y_n$ converge, then you can perform this separation. You can show this via taking limits of the partial sums for both of the above series and showing it converges to the left hand side.


答:
The requirement is simply $ \sum_{n=0}^{\infty}{x_n} $ and $ \sum_{n=0}^{\infty}{y_n} $ converges. Here is a counter-example if the above is not satisfied:

Take $a_n = (-1)^n $ and $ b_n = (-1)^{n+1} $. Then $ a_n + b_n = 0$ for any natural number $ n $, so the left hand side yields $0$. However, the R.H.S. is not convergent at all.

Body:
First of all I apologize if this question turns out to be pretty silly: when can I separate an infinite series from a sum? That is, when $$\sum_{n=0}^{\infty}{(x_n + y_n)} =  \sum_{n=0}^{\infty}{x_n} +\sum_{n=0}^{\infty}{y_n}$$ I don't remember this fact very well, I don't know if the space in which the $x_n$ and $y_n$ terms are should be taken into account, or it simply requires convergence.

I appreciate a good answer.


问:
Find an equation of the plane which passes through…
Help me find an equation of the plane which passes through the point A(1,−2,−1) and which is tangent to the surface z=ln(2x+y).

The normal vector is:
$$
[\frac{2}{2x+y},\frac{1}{2x+y}, -1]
$$
A is not a tangent point (I checked it once I started solving this).
How to find a tangent point? If I found it, I'd be able to find the equation of the plane.

Regards.

答:
The equation of a plane can be written as the set of all points $\textbf {r}$ such that $\textbf {n.r} = \textbf {n.a}$ where $\textbf {n}$ is a normal vector to the plane and $\textbf {a}$ is a point on the plane.

Since A and the point on your surface that the plane is tangent to (call this point B) are both on the plane, the vector joining A to B must be perpendicular to the normal vector to the surface at B (so their dot product must be zero). Solving this should give you the set of points on the surface for which the tangent plane contains A.


答:
If $A \subset B$ and $B$ is bounded above or below then $A$ is also bounded above or below and $\sup A \le \sup B$ and $\inf A \ge \inf B$.

Why? If $A$ is bounded above then there is a $u$ that is an upper bound of $B$. So $u \ge b; \forall b \in B$.  So for all $a \in A \subset B$ we know $a \in B$ so $u \ge a$ so $u \ge b; \forall a \in A$.  SO $u$ is an upperbound of $A$ so $A$ is bounded above.

Now let $s = \sup B$ the $s$ is an upper bound of $B$ but $A\subset B$ so $s$ is an upper bound of $A$.  So the least upper bound of $A$ must be less than or equal to $A$.  So $\sup A \le \sup B$.

The exact same argument is true the $\inf A \ge \inf B$.

So $\sup A \le \sup B$ a and $\inf A \ge \inf B$ so

$A\subset B$ and $A,B$ bounded above and below then $\sup A - \inf A \le \sup B-\inf A$.

Now if $\epsilon_1 < \epsilon_2$ and if $A =\{f(x)\mid a-\epsilon_1<x<a+\epsilon_1\} $ and $B= \{f(x)\mid a-\epsilon_2<x<a+\epsilon_2\} $ then (as $a-\epsilon_2 < a-\epsilon_1< a +\epsilon_1 < \epsilon_2$) we have $A \subset B$ and

our result follows.

Title: continuity, supremum/infimum

Body: I came across this but I'm still struggling to understand the concept fully. Specifically, how do we know $\text{lub}\{f(x)\mid a-\epsilon<x<a+\epsilon\}-\text{glb}\{f(x)\mid a-\epsilon<x<a+\epsilon\}$ decreases as $\epsilon$ decreases?


问:
Determining the covariance
Let $X$ be a random variable that is uniform on $[0, 1]$ and let $X_k$ for $k = 1, 2, ..., n$ be a random sample of $X$. Define the random variable $Y$ and $Z$ as follows: $Y =$ the number of $i$ so that $X_i \geq \frac{1}{2}$ and $Z =$ the number of $i$ so that $X_i \geq \frac{3}{4}$. Determine $cov(Y, Z)$. Are $Y$ and $Z$ independent? Why or why not?

I know that the formula is $cov(Y, Z) = E(YZ) - E(Y)E(Z)$ but I don't know how to find these expected values.

I have no idea how to approach this problem. I have spent hours doing research but I cannot find anything useful. Any assistance is much appreciated.

答:
$Y\sim Bin(n;1/2)$ and $Z\sim Bin(n;1/4)$.

They are NOT independent and it can easy be  proved observing, i.e. that

$$P(Y=n)=\frac{1}{2^n}$$

but

$$P(Y=n|Z=n)=1$$

To calculate $E(YZ)$ you can use the Law of total expectation

Title: Determining the covariance


问:
How many triangles determined by three vertices of a regular $13$-gon contain the polygon's center?
Can you help me solve this problem?

A regular 13-sided polygon is inscribed in a circle with centre $O$. Triangles can be formed by choosing three vertices of this polygon to be the vertices of the triangle.

How many of the triangles that can be formed in this way have the point $O$ inside?

I have no idea how to approach this question, so I tried to start off simple by  drawing the number of triangles that can be inscribed in a square and a pentagon. However, after finding the values 4 and 8, I have no idea where to go from here.

Any help is highly appreciated. Thank you!

答:
Let the paths between the three chosen vertices have lengths $a,b,c$. The number positive integer solutions to $a+b+c=13$ with $a,b,c\le6$, i.e. the number of nonnegative integer solutions to $a+b+c=10$ with $a,b,c\le5$. By stars and bars and inclusion and exclusion, this is
$$\binom{10+2}2-3\binom{4+2}2=21$$
These $21$ solutions reduce to five upon counting permutations as identical: three with two duplicated lengths ($166,355,544$) and two with all distinct lengths ($256,346$). Each of the first set counts $13$ times and each of the second $26$ times, for a final answer of $3×13+2×26=91$.


问:
$y^2 - x^3$ not an embedded submanifold
How can I show that the cuspidal cubic $y^2 = x^3$ is not an embedded submanifold of $\Bbb{R}^2$? By embedded submanifold I mean a topological manifold in the subspace topology equipped with a smooth structure such that the inclusion of the curve into $\Bbb{R}^2$ is a smooth embedding. I don't even know where to start please help me. All the usual tricks I know of removing a point from a curve and see what happens don't work. How can I extract out information about the cusp to conclude it is not? Also can I put a smooth structure on it so it is an immersed submanifold? THankz.</p>

答: It is better to view $y$ as the independent variable and $x=y^{2/3}$.  Since $2/3<1$, this has infinite slope at the origin for positive $y$ and infinite negative slope for negative $y$.  Hence the origin is not a smooth point of this graph, which is therefore not a submanifold.</p>

Title: $y^2 - x^3$ not an embedded submanifold


答:
The first step is to compute the distributions of the random variables $Y$ and $Z$. Let's start with $Y$. Since $X_k \tilde U[0,1]$, $P(X_k \geq 1/2) = 0.5$ and $P(X_k < 1/2) = 0.5$. The random variable $Y=m$ if $m$ out of the $n$ $\{X_k\}$s are greater than 0.5. This is a classical binomial distribution.

$
P(Y=m)  =  {n \choose m} 0.5^m \; 0.5^{n-m} = {n \choose m} 0.5^n
$

You can use standard formulae to conclude that $\mathbb{E}(Y) = 0.5n$. By the same token, $Z$ is also binomially distributed and $\mathbb{E}(Z) = 0.25n$.

Now, let's define a random variable $W = YZ$. To compute $\mathbb{E}(W)$, it helps to express:

$Y = \sum_{i=1}^n A_i$ and $Z = \sum_{i=1}^n B_i$, where $\{A_i\}$ and $\{B_i\}$ are indicator random variables. Specifically, $A_i = 1$ if $X_i \geq 1/2$ and $A_i = 0$ otherwise. Similarly, $B_i = 1$ if $X_i \geq 3/4$ and $B_i = 0$ otherwise.

Now, $W = \sum_{i=1}^n A_i \sum_{j=1}^n B_j = \sum_{i=1}^n A_iB_i + \sum_{i \neq j} A_iB_j$

Taking expectation:
$\mathbb{E}(W) = \sum_{i=1}^n \mathbb{E}(A_i B_i) +   \sum_{i \neq j}\mathbb{E}(A_i) \mathbb{E}(B_j)$.

Note that $A_i$ and $B_j$ are independent for $i \neq j$, but obviously $A_i$ and B_i$ are not independent.

Now, $A_iB_i = 1$ if $A_i=1$, $B_i=1$ (and 0 otherwise), which happens only when $X_i \geq 3/4$. This happens with probability $1/4$. Thus, $\mathbb{E}(A_i B_i) = 1/4$.

Also, note that $\mathbb{E}(A_i) \mathbb{E}(B_j) = 1/2 \times 1/4 = 1/8$.

Putting all of this together, you can compute $\mathbb{E}(W)$, and eventually $Cov(Y, Z) = \mathbb{E}(W) - \mathbb{E}(Y) \mathbb{E}(Z)$.

Title: Determining the covariance

Body:
Let $X$ be a random variable that is uniform on $[0, 1]$ and let $X_k$ for $k = 1, 2, ..., n$ be a random sample of $X$. Define the random variable $Y$ and $Z$ as follows: $Y =$ the number of $i$ so that $X_i \geq \frac{1}{2}$ and $Z =$ the number of $i$ so that $X_i \geq \frac{3}{4}$. Determine $cov(Y, Z)$. Are $Y$ and $Z$ independent? Why or why not?

I know that the formula is $cov(Y, Z) = E(YZ) - E(Y)E(Z)$ but I don't know how to find these expected values.

I have no idea how to approach this problem. I have spent hours doing research but I cannot find anything useful. Any assistance is much appreciated.


问:
How to solve large numbers if they are a prime number? Eg Is 3599 a prime number?
I am reading the book, the Flash Boys, and in it is a trick interview question as per the title. The person solves the problem so:

```<code>3599 = (3600 – 1) =
(60² – 1²) =
(60 – 1) (60 + 1)
= 59 × 61
3599 = 59 × 61 not a prime number.
</code>```

I am curious about this part (60² – 1²) = (60 – 1) (60 + 1)
Is this some kind of a rule?

答:
This is a well-known identity known as the "difference of squares" identity:

$$a^2 - b^2 = (a-b)(a+b)$$

You can see this algebraically by expanding the right-hand side:

$$(a-b)(a+b) = a^2 + ab - ab - b^2 = a^2 - b^2$$

You can also see it geometrically: suppose we have a large pink square as below, with side length $a$, and a square in the corner with side length $b$. You can come up with several expressions with this knowledge for the pink area.

You can take the whole square, and remove the blue bit, getting $a^2 - b^2$

You can add up the smaller pink rectangles individually, getting $(a-b)^2 + 2b(a-b)$. Factor out $(a-b)$ from that, and you get $(a-b)((a-b) + 2b) = (a-b)(a+b)$.


答:
One more option that apparently hasn't been mentioned yet: in your original question you mentioned being stuck on the term
$$\sum_{n=1}^{ \infty } \left[\frac{1}{3^{n} } \frac{(-1)^{n}}{2}\right]$$
This can be rewritten as
$$\frac{1}{2}\sum_{n=1}^{ \infty } \left(-\frac{1}{3}\right)^n$$
which can also be evaluated as a geometric series.

Title: How to evaluate $ \frac{1}{3} + \frac{2}{3^{2} } + \frac{1}{3^{3}} + \frac{2}{3^{4}} + \frac{1}{3^{5}} + ...$?

Body:
I was given the series:
$$ \frac{1}{3} + \frac{2}{3^{2} } + \frac{1}{3^{3}} + \frac{2}{3^{4}} + \frac{1}{3^{5}} + ...$$
Making some observations I realized that the $ a_{n} $ term would be the following:
$$ a_{n} = \frac{1}{ 3^{n} } \left(\frac{3}{2}+ \frac{(-1)^{n}}{2} \right)$$
What I wanted to do is to find the result of the series, so the answer would be:
$$\sum_{n=1}^{ \infty } \frac{1}{ 3^{n} } \left(\frac{3}{2}+ \frac{(-1)^{n}}{2} \right) = \frac{3}{2} \sum_{n=1}^{ \infty } \left[ \frac{1}{3^{n} } \right]+ \sum_{n=1}^{ \infty } \left[\frac{1}{3^{n} } \frac{(-1)^{n}}{2}\right]$$
I can tell that the first term is convergent because it is a geometric series, in fact, the result is $\frac{3}{4}$. However, I have no clue in how to solve the second term series. I should say that the series given in the beginning is convert and its result is 5/8. How to arrive to it is a mystery to me.


答:
Choose two points. These are then a certain number of edges apart, up to $6$. A brief investigation will show that there are a number of points that can form a centre-including triangle with those points, and that number is equal to the separation of the points.

There are equal numbers of points with all valid separations, and each triangle will be counted three times, so the answer is
$$\binom{13}{2}\big / 6\cdot (1+2+3+4+5+6)/3 = 13\times 7 = 91$$

Title: How many triangles determined by three vertices of a regular $13$-gon contain the polygon's center?

Body:
Can you help me solve this problem?

A regular 13-sided polygon is inscribed in a circle with centre $O$. Triangles can be formed by choosing three vertices of this polygon to be the vertices of the triangle.

How many of the triangles that can be formed in this way have the point $O$ inside?

I have no idea how to approach this question, so I tried to start off simple by  drawing the number of triangles that can be inscribed in a square and a pentagon. However, after finding the values 4 and 8, I have no idea where to go from here.

Any help is highly appreciated. Thank you!


问:
Splitting a circle into 3 equal parts using 2 lines
The picture probably explains my question best.

I need to find a way to divide a circle into 3 parts of equal area with only 2 lines that intersect each other on the outline of the circle.

Also I need to check, if whatever diameter is between those lines, also splits circles with a different diameter into equal parts.

And lastly, and probably the most difficult question: How do I have to calculate the angle between x lines that all intersect in one point, so that the circle is split into x+1 parts with area = 1/(x+1) of the circle?

I tried my best, but couldn't even find a single answer or the right strategy to tackle the question...

1

答:
Too long for comments

If you want to solve $$\theta+\sin(\theta)=\frac\pi3$$ what you can do is to expand the lhs as a Taylor series and use series reversion. Using ths simple
$$y=\theta+\sin(\theta)=2 \theta -\frac{\theta ^3}{6}+\frac{\theta ^5}{120}-\frac{\theta^7}{5040}+O\left(\theta ^9\right)$$ this would give
$$\theta=\frac{y}{2}+\frac{y^3}{96}+\frac{y^5}{1920}+\frac{43
   y^7}{1290240}+O\left(y^9\right)$$ Making $y=\frac \pi 3$ and computing
$$\theta=0.53626300$$

You could also use the $1,400$ years old approximation
$$\sin(\theta) \simeq \frac{16 (\pi -\theta)\theta}{5 \pi ^2-4 (\pi -\theta) \theta}\qquad (0\leq \theta\leq\pi)$$ and solve the cubic
$$-\frac{5 \pi ^3}{3}+\pi\left(16  +\frac{19 \pi }{3}\right) \theta-16\left(1+\frac{\pi }{3}\right) \theta^2+4 \theta^3=0$$ which shows only one real root (not very nice formal expression) which is $0.53631167$.

Since, by inspection, you know that the solution is close to $\frac \pi 6$, you could perform one single iteration of Newton-like method and have explicit approximations which will be better and better increasing the order $n$ of the method. For example, Newton method would give
$$\theta_{(2)}=\frac \pi 6+\frac{1}{3} \left(2-\sqrt{3}\right) (\pi -3)$$ Halley method would give
$$\theta_{(3)}=\frac \pi 6+\frac{2 \left(2+\sqrt{3}\right) (\pi -3)}{45+24 \sqrt{3}-\pi }$$
As a function of $n$, the results would be
$$\left(
\begin{array}{ccc}
 n & \text{estimate} & \text{method} \\
 2 & 0.536245321326154 & \text{Newton} \\
 3 & 0.536266784935255 & \text{Halley} \\
 4 & 0.536266978676557 & \text{Householder} \\
 5 & 0.536266978987702 & \text{no name} \\
 6 & 0.536266978988890 & \text{no name} \\
 7 & 0.536266978988891 & \text{no name}
\end{array}
\right)$$


问:
Drawing chips from a bag
A bag with contains $5$ chips that are either red or blue chips. The number of red chips is a random variable $X$ where $X$ can be either $2, 3$ or $4$ with equal probability. Given that when $5$ chips are drawn with replacement, the result is: $3$ of the draws are red and $2$ are blue, what is the conditional probability that $X = 4$?

My attempt:

Consider Bayes Theorem: $P(X = 4 | 3 red, 2 blue) = \frac{P(X = 4 \land 3 red, 2 blue)}{P(3 red, 2 blue)} = \frac{P(3 red, 2 blue | X = 4) \cdot P(X = 4)}{P(3 red, 2 blue)}$.

Assume $X = 4$ (then there are 4 reds and 1 blue) and let $Y$ be the number of red chips drawn. $Y$ is binomial with $n = 5$ and $p = \frac{4}{5}$. So $P(Y = 3) = 0.2048$ (by applying the binomial function). So $P(3 red, 2 blue | X = 4) = 0.2048)$.

Clearly $P(X = 4)$ = $\frac{1}{3}$.

All that remains in to determine $P(3 red, 2 blue)$. I tried this:

If $X = 2$ let $Z$ be the number of red chips drawn ($Z$ is binomial with $n = 5$ and $p = \frac{2}{5}$) and then $P(Z = 3) = 0.2304$

If $X = 3$ let $Z$ be the number of red chips drawn ($Z$ is binomial with $n = 5$ and $p = \frac{3}{5}$) and then $P(Z = 3) = 0.3456$

If $X = 4$, we already saw that $P(Z = 3) = 0.2048$.

So $P(3 red, 2 blue) = 0.2304 + 0.3456 + 0.2048 = 0.7808$

Plugging in the appropriate probabilities shows that $P(X = 4 | 3 red, 2 blue) = \frac{0.2048 \cdot \frac{1}{3}}{0.7808} \approx 0.0874$

Did I do this correctly? This is practice for an upcoming examination and no solutions are available. Whatever help I can get is appreciated.

答:
Your approach is correct but you made a mistake in calculation. Also I will suggest that your working should be using fractions instead of converting into decimals.

If $Y$ is the event of $3$ red and $2$ blue in $5$ draws with replacement,

$\small P(X = 4 | Y) = \displaystyle \frac{P(X = 4 \ \cap \ Y)}{P(Y)}$

$\small P(Y) = P(X=2 \cap Y) + P(X=3 \cap Y) + P(X=4 \cap Y)$

$ = \displaystyle \small \frac{1}{3} \cdot {5 \choose 3} \cdot \big[\big(\frac{2}{5}\big)^3 \big(\frac{3}{5}\big)^2 + \big(\frac{3}{5}\big)^3 \big(\frac{2}{5}\big)^2 + \big(\frac{4}{5}\big)^3 \big(\frac{1}{5}\big)^2\big]$

$\small P(X=4 \cap Y) = \displaystyle \frac{1}{3} \cdot {5 \choose 3} \cdot \big(\frac{4}{5}\big)^3 \big(\frac{1}{5}\big)^2$

$\small P(X = 4 | Y) = \displaystyle \frac{16}{61}$

Title: Drawing chips from a bag


问:
Integral inequality, $f$ continuous, increasing function
Let $f$ be a continuous, increasing  function on $[a,b]$, $c$ is the middle of $[a,b]$.

Prove that $\frac{f(a)+f(c)}{2} \le \frac{1}{b-a} \cdot \int _a ^b f(x)dx \le \frac{f(b)+f(c)}{2} $ .

Could you help me with that?

I thought I may use intermediate value theorem, but I didn't come up with anything.

答:
I assumed $c$ can be any point in $[a,b]$ hence this answer is incorrect.

I think $f$ has to be concave down.

Let's take $f(x)=x^2$ , which is concave up and see. To test take $c=b$ then $(f(a)+f(c))/2=(a^2+b^2)/2$ and $\int_a^b f(x)dx/(b-a)=(a^2+b^2+ab)/3$. Your inequality, on the left, would imply $(a^2+b^2)/2\le (a^2+b^2+ab)/3$ which upon simplification becomes $a^2+b^2\le 2ab$ which implies $(a-b)^2\le 0$.


问:
I need to statistically analyze some simple data for a paper, but I am not sure the best way to do so.
I have some simple data for a paper. It is in the format as follows:

```<code>Name  | Numerical Quality One | Numerical Quality Two | Yes or No? | Yes or No? |

Bob   |                   4.5 |                     3 |        Yes |         No |
Jenny |                     5 |                     2 |          - |         No |
Steve |                     3 |                     5 |        Yes |        Yes |
</code>```

And so on for ~18 people or so. The numerical qualities are in a set range between 1 and 5, and are not necessarily correlated. (They are the answers to a question where the format is 1 for strongly disagree, and 5 for strongly agree). Some people neglected to answer some questions, in which case I have a dash "-" for their data on that question.

My professor expects a detailed analysis on this data. However, I don't know what kind of chart or graph to give him, besides the average and median for each question. I haven't taken statistics in several years and I don't know how best to analyze it.

I have some freedom in my analysis so any suggestion for a type of graph/chart/math which I can apply to analyze this data would be appreciated.

Thank you.

答:
You have some work to do, deciding what you want to know
from your data. Here are some examples of
possible tests.

Wilcoxon test for Likert data:

```<code>x1 = c(2,3,3,4,3,2, 3,5,5,3,2,3, 1,2,2,4,5,4)
x2 = c(2,2,2,3,1,2, 2,5,4,1,3,1, 2,1,1,2,3,2)
</code>```

For many of the 18 subjects, scores on the second question
seem less favorable than scores on the first.

A Wilcoxon test finds significantly greater scores on the
first than on the second; the P-value about $0.002 < 0.5 = 5\%$
so you might reject the null hypothesis that the first question scores higher at the 5% level. However, the Wilcoxon test
does not perform well when there are so many tied values, so
some people might quibble with this conclusion.

```<code>wilcox.test(x1,x2, alt="greater", pair=T)

      Wilcoxon signed rank test with continuity correction

data:  x1 and x2
V = 110, p-value = 0.001844
alternative hypothesis: true location shift is greater than 0

Warning messages:
1: In wilcox.test.default(x1, x2, alt = "greater", pair = T) :
   cannot compute exact p-value with ties
2: In wilcox.test.default(x1, x2, alt = "greater", pair = T) :
   cannot compute exact p-value with zeroes

d = x1 - x2;  d
[1]  0  1  1  1  2  0  1  0  1  2 -1  2 -1  1  1  2  2  2
sum(d > 0);  sum(d < 0)
[1] 13
[1] 2
</code>```

However, among the 15 subjects who answered differently on the two
questions, only 2 gave higher scores and 13 gave lower scores.
A sign test finds that only two higher scores on the second
question, rejects the null hypothesis that the questions have
equivalent responses against the alternative that the the
first question got more favorable answers: P-value about 0.003.

```<code>dbinom(2, 15, .5)
[1] 0.003204346
</code>```

The answer above is from R. Minitab has a formal sign test procedure; Minitab output is shown below (using a normal approximation). The P-value is nearly the same:

```<code>Sign test of median =  0.00000 versus > 0.00000

      N  Below  Equal  Above       P  Median
Dif  18      2      3     13  0.0037   1.000
</code>```

Chi-squared test for Yes/No data.

```<code>                  Question 2
Question 1         Yes    N0        Total
-----------------------------------------
   Yes               4     7          11
   No                5     2           7
----------------------------------------
Total                9     9          18

TBL = rbind(c(4,7), c(5, 2));  TBL
      [,1] [,2]
[1,]    4    7
[2,]    5    2
</code>```

A chi-squared test finds no significant pattern of association (positive or negative)
between Yes and No answers on the two questions.

```<code>chisq.test(TBL)

    Pearson's Chi-squared test
    with Yates' continuity correction

data:  TBL
X-squared = 0.93506, df = 1, p-value = 0.3336

Warning message:
In chisq.test(TBL) :
 Chi-squared approximation may be incorrect
</code>```

Because of the small counts, there is a warning message that
the P-value may not be correct. However, the implementation
of chisq/test in R allows for simulating a more accurate
P-value, as below. However, the test still does not find
a significant association between answers to the two
questions. [Another alternative when counts are small would
be Fisher's Exact Test, not illustrated here.]

```<code> chisq.test(TBL, sim=T)

    Pearson's Chi-squared test
    with simulated p-value
    (based on 2000 replicates)

 data:  TBL
 X-squared = 2.1039, df = NA, p-value = 0.3343
</code>```

Body:
You have some work to do, deciding what you want to know
from your data. Here are some examples of
possible tests.

Wilcoxon test for Likert data:

x1 = c(2,3,3,4,3,2, 3,5,5,3,2,3, 1,2,2,4,5,4)
x2 = c(2,2,2,3,1,2, 2,5,4,1,3,1, 2,1,1,2,3,2)

For many of the 18 subjects, scores on the second question
seem less favorable than scores on the first.

A Wilcoxon test finds significantly greater scores on the
first than on the second; the P-value about $0.002 < 0.5 = 5\%$
so you might reject the null hypothesis that the first question scores higher at the 5% level. However, the Wilcoxon test
does not perform well when there are so many tied values, so
some people might quibble with this conclusion.

wilcox.test(x1,x2, alt="greater", pair=T)

      Wilcoxon signed rank test with continuity correction

data:  x1 and x2
V = 110, p-value = 0.001844
alternative hypothesis: true location shift is greater than 0

Warning messages:
1: In wilcox.test.default(x1, x2, alt = "greater", pair = T) :
   cannot compute exact p-value with ties
2: In wilcox.test.default(x1, x2, alt = "greater", pair = T) :
   cannot compute exact p-value with zeroes

d = x1 - x2;  d
[1]  0  1  1  1  2  0  1  0  1  2 -1  2 -1  1  1  2  2  2
sum(d > 0);  sum(d < 0)
[1] 13
[1] 2

However, among the 15 subjects who answered differently on the two
questions, only 2 gave higher scores and 13 gave lower scores.
A sign test finds that only two higher scores on the second
question, rejects the null hypothesis that the questions have
equivalent responses against the alternative that the the
first question got more favorable answers: P-value about 0.003.

dbinom(2, 15, .5)
[1] 0.003204346

The answer above is from R. Minitab has a formal sign test procedure; Minitab output is shown below (using a normal approximation). The P-value is nearly the same:

Sign test of median =  0.00000 versus > 0.00000

      N  Below  Equal  Above       P  Median
Dif  18      2      3     13  0.0037   1.000

Chi-squared test for Yes/No data.

                  Question 2
Question 1         Yes    N0        Total
-----------------------------------------
   Yes               4     7          11
   No                5     2           7
----------------------------------------
Total                9     9          18

TBL = rbind(c(4,7), c(5, 2));  TBL
      [,1] [,2]
[1,]    4    7
[2,]    5    2

A chi-squared test finds no significant pattern of association (positive or negative)
between Yes and No answers on the two questions.

chisq.test(TBL)

    Pearson's Chi-squared test
    with Yates' continuity correction

data:  TBL
X-squared = 0.93506, df = 1, p-value = 0.3336

Warning message:
In chisq.test(TBL) :
 Chi-squared approximation may be incorrect

Because of the small counts, there is a warning message that
the P-value may not be correct. However, the implementation
of chisq/test in R allows for simulating a more accurate
P-value, as below. However, the test still does not find
a significant association between answers to the two
questions. [Another alternative when counts are small would
be Fisher's Exact Test, not illustrated here.]

 chisq.test(TBL, sim=T)

    Pearson's Chi-squared test
    with simulated p-value
    (based on 2000 replicates)

 data:  TBL
 X-squared = 2.1039, df = NA, p-value = 0.3343


问:
Countable dense subset of Baire (ω^ω)

Prove that
$$
D =
\{ f \in \mathbb{N}^\mathbb{N} \mid \exists i \forall j \geq i f(j) = 0 \}
$$
is a countable dense subset of $\mathbb{N}^\mathbb{N}$ (Baire).

Here is the theorem about the Seperability of Baire space. How can I start? Actually isn’t it’s clear that for all s finite sequence there at least one x eventually goes with 0? how can I show it more formally?

答:
Every basic open set of Baire space is determined by an initial segment.

So every such sets contains (lots of) sequences that are eventually $0$: after the initial segment condition has been satisfied, we're free to choose coordinates..

So the set of eventually $0$ sequences (or eventually $1$ sequences etc) are dense in Baire space (i.e. $\omega^\omega$)

Title: Countable dense subset of Baire (ω^ω)


问:
Formula to calculate logarithmic curve in the context of IT security

Background

I'm actually a dev, but I think this question fits here as its about maths. I'm implementing a site wide throttle on too many failed requests as protection against distributed brute force attacks.

The question I am stuck with is, after how many failed login requests should I start to throttle?

Now one reasonable way is, as mentioned here "using a running average of your site's bad-login frequency as the basis for an upper limit". If the site has an average of $100$ failed logins, $300$ (puffer added) might be a good threshold.

Now I don't have a running average and I don't want someone having to actively increase the upper limit as the user base grows. I want a dynamic formula that calculates this limit based on the active users amount.

The difficulty is that if there are only a few users, they should have a much higher user to threshold ratio than let's say $100,000$ users. Meaning that for example for $50$ users the limit could be set at $50\%$ of the total user count which means allowing $25$ failed login requests site-wide in a given timespan. But this ratio should decrease for 100k users, the threshold should be more like around $1\%$. $1000$ failed login requests in the same let's say hour, is a lot (probably not accurate at all I am not a security expert, the numbers are only examples to illustrate).

The Question

I was wondering, is there any mathematical formula that could archive this in a neat way?

This is a chart of what I think the formula should be calculating approximately:

Here is what I have now (I know it's terrible, any suggestion will be better I'm sure):

```<code>$threshold = 1;
if ($activeUsers <= 50) {
    // Global limit is the same as the total of each users individual limit
    $threshold *= $activeUsers; // If user limit is 4, global threshold will be 4 * user amount
} elseif ($activeUsers <= 200) {
    // Global requests allows each user to make half of the individual limit simultaneously
    // over the last defined timespan
    $threshold = $threshold * $activeUsers / 2;
} elseif ($activeUsers <= 600) {
    $threshold = $threshold * $activeUsers / 2.5;
} elseif ($activeUsers <= 1000) {
    $threshold = $threshold * $activeUsers / 3.5;
} else { // More than 1000
    $threshold = $threshold * $activeUsers / 5;
}
return $threshold;
</code>```

答:
I ended up not using some math formula but a ratio of unsuccessful to total login requests.

Code looks like this:

```<code>$loginAmountStats = $this->requestTrackRepository->getLoginAmountStats();
// Calc integer amount from given percentage and total login
$allowedFailureAmount = $loginAmountStats['login_total'] / 100 * $this->settings['login_failure_percentage'];
if ($loginAmountStats['login_failures'] > $allowedFailureAmount) {
    // If changed, update SecurityServiceTest distributed brute force test expected error message
    $msg = 'Maximum amount of tolerated requests reached site-wide.';
    throw new SecurityException('captcha', SecurityException::GLOBAL_LOGIN, $msg);
}
</code>```

Body:
I ended up not using some math formula but a ratio of unsuccessful to total login requests.

Code looks like this:

$loginAmountStats = $this->requestTrackRepository->getLoginAmountStats();
// Calc integer amount from given percentage and total login
$allowedFailureAmount = $loginAmountStats['login_total'] / 100 * $this->settings['login_failure_percentage'];
if ($loginAmountStats['login_failures'] > $allowedFailureAmount) {
    // If changed, update SecurityServiceTest distributed brute force test expected error message
    $msg = 'Maximum amount of tolerated requests reached site-wide.';
    throw new SecurityException('captcha', SecurityException::GLOBAL_LOGIN, $msg);
}


问:
Does the converse of uniform continuity -> Preservance of Cauchy sequences hold?

We know that if a function $f$ is uniformly continuous on an interval $I$ and $(x_n)$ is a Cauchy sequence in $I$, then $f(x_n)$ is a Cauchy sequence as well.

Now, I would like to ask the following question:

The function $g:(0,1) \rightarrow \mathbb{R}$ has the following property: for every Cauchy sequence $(x_n)$ in $(0,1)$, $(g(x_n))$ is also a Cauchy sequence. Prove that g is uniformly continuous on $(0,1)$.

How do we go about doing it?

答: $g$ is clearly continuous, you really only need to worry about what would happen at the endpoints.  some sequence $x_n\to 1$ has $g(x_n)\to g(1)$, similarly for zero.  so you can define $g$ on $[0,1]$ where it will be uniformly continuous (basically $g$ doesnt zoom off to infinity at the endpoints, else $g(x_n)$ wouldnt be cauchy)</p>


问:
Solving $4^x + 7^x = 9^x$ algebraically
I came across the question $4^x + 6^x = 9^x$ and found this was fairly easy to convert to a quadratic equation because of the ratio of 4, 6 and 9.

So I thought I'd try solving $4^x + 7^x = 9^x.$

I solved this graphically using Geogebra and found the answer is $x = 1.4574697.$   However, I can not figure out how to solve this algebraically.  Every approach that I try fails.

Any ideas as to how to go about this?

答:
Consider that you look for the zero's of function $$f(x)=9^x-4^x - 7^x $$ It is very stiff; so let us consider instead
$$g(x)=\log(9^x)-\log(4^x+7^x)=x\log(9)-\log(4^x+7^x)$$ which is much more close to linearity which is very good for any numerical solver.

By inspection $g(1)=-\log \left(\frac{11}{9}\right)<0$. Making a Taylor series around $x=1$
$$g(x)=(\log (9)-\log (11))+(x-1) \left(-\frac{4 \log (4)}{11}-\frac{7 \log (7)}{11}+\log(9)\right)+O\left((x-1)^2\right)$$ Ignoring the higher order terms, then an estimate is
$$x=\frac{4 \log (4)+7 \log (7)-11 \log (11)}{4 \log (4)+7 \log (7)-11 \log (9)}\sim 1.44122$$ Starting with this estimate, one or two iterations of Newton method will give the "exact" solution.

We could do better using one single iteration of Newton-like methods of order $n$ still using $x_0=1$. The formulae will be a bit messy but look at the numerical results
$$x_{(2)}=1.441218 \qquad x_{(3)}=1.457292\qquad x_{(4)}=1.457512$$

Title: Solving $4^x + 7^x = 9^x$ algebraically


问:
Is there a difference between $\lim\limits_{x \rightarrow p}f(x)$ and $\lim\limits_{h \rightarrow 0}f(p+h)$?
Are these limits equivalent?
$$
\lim\limits_{x \rightarrow p}f(x) \\\lim\limits_{h \rightarrow 0}f(p+h)
$$
They both describe $f(x)$ as $x$ gets arbitrarily close to $p$, but I see both used in different contexts so I'm wondering if there is actually a difference between the two. Thanks!

答:
They are actually the same.

Let $\lim\limits_{x \rightarrow p}f(x)=l\in \mathbb R$. What existence of this limit means is that for every $\epsilon\gt 0,\exists \delta\gt 0: 0\lt |x-p|\lt \delta\implies |f(x)-l|\lt \epsilon$

WLOG, put $x=p+h$ so that we have $0\lt |h| \lt \delta\implies |f(p+h)-l|\lt \epsilon$

Now use definition of limit again to finish the proof.


问:
Determine the following subsets of R3 are subspaces of R3. If so, give a proof, and if not, explain why.
U1={(x, y, 1)|x, y are real numbers}

U2={(a, a - b, b)|a, b are real numbers}

U3={(r, s, t)|r, s, t are non-negative numbers}

For U1:

According to the Zero Vector: $\lt x, y, 1\gt \neq \lt 0, 0, 0\gt$

According to Under Addition: $\lt 0, 0, 1\gt + \lt 0, 0, 1\gt = \lt 0, 0, 2\gt$ Not a part of the set

This is not a subspace of $\mathbb{R}^3$

For U2:

According to the Zero Vector: $\lt a, a-b, b\gt = \lt 0, 0, 0\gt$

According to Under Addition $\lt 0, 0, 0\gt + \lt 0, 0, 0\gt = \lt 0, 0, 0\gt$

This is a subspace of $\mathbb{R}^3$

With U3 however, (0,0,0) can work, but in order for the statement to be correct r, s, & t would all have to be greater than or equal to 0. I can use the obvious Zero Vector method, but what about Under Addition or Under Multiplication?

答:
$U_1$ isn't a subspace because it doesn't contain the zero vector.

$U_2=\rm {span}\{(1,1,0),(0,-1,1)\}$, and is thus a subspace.

$U_3$ is not closed under scalar multiplication.


问:
Arithmetic operations on Knuth arrow notation
I want to create a game that explores massive numbers (on the scale of Tree 3, G64, etc.). Normal scientific notation is too small, so common BigNum or alike libraries aren't capable of this.
I would imagine numbers would be stored in arrow notation, notably up arrow notation.

Representing these numbers is simple, but my question is how to do operations on them. For example, these up arrow notated numbers:

$a ↑↑↑ b + c ↑↑↑ d$

$a↑^nb + c↑^kd$

$(a↑↑↑b)*(c↑↑↑d)$

I'm also interested in arithmetic with chain arrow notated numbers too. (chained arrow notation)

答:
In terms of adding, the general case will be that one term is massively larger than the other and no simpler form will be available. Even where comparability might be possible, how would you deal with the simplest case $a^b+c^d$?

In multiplying think about $a^b\cdot c^d$ - what would be your goal for this.

If you can explain what you are aiming for in these simple cases, that would help give a clue as to what you are imagining. However, I suspect you are looking for something which doesn't exist.


问:
Dealing with a symbol not in the language L
I'm attempting to interpret a question, given:

Let $L$ be a first-order language, $\Gamma$ be a set of sentences of $L$, $\forall xFx$ a sentence of $L$, and $c$ a constant not in in $L$.

The intent being to prove that if $\Gamma$ is satisfiable then the union of $\Gamma$ and $\forall xFx \implies F(c)$ is satisfiable.

How am I to interpret the constant $c$ being not in in $L$? Does this mean it is to be considered as anything?

Since $F(c)$ appears to me meaningless if $c$ is not in the language...

答:
$c$  is a new constant symbol added to the original language $\mathcal L$.

In this way, we have a new language $\mathcal L′ = \mathcal L \cup \{ c \}$.

In this new language we have all the previous formulas plus the new formulas using $c$, like: $∀xF(x) → F(c)$.

An interpretation $\mathfrak I$ for the new language $\mathcal L′$ will be an interpretation that gives meaning also to the symbol $c$, i.e. that assigns to $c$ an object of the domain of the interpretation (called $c^{\mathfrak I}$).

What does it mean to prove that $∀xF(x) → F(c)$ is satisfiable?

It means to consider an interpretation $\mathfrak I$ suitable for the language $\mathcal L'$ (and thus an interpretation where the constant $c$ has meaning) and show that the formula is satisfied in $\mathfrak I$.


问:
Several points are marked on a line, and all possible segments are made between pairs of these points. One point lies on 80 segments, another 90......
One of the points lies on 80 of these segments; another point lies on
90 segments. How many points were marked on the line?

Answer Choices are 20, 22, 80, and 90

My work:

答:
Assuming being the endpoint (that is, one of the pre-selcted set of points) means to belong to a segment, there are two cases for any point: either it is an endpoint or not.

Suppose there are $N > 0$ points chosen.

If the point $P$ is not an endpoint and there are $m$ points to the left, then there are $N-m$ points to the right and $P$ belongs to $m\cdot (N-m)$ segments.

OTOH if $P$ is an endpoint and there are $m$ points to the left, then there are $(N-m-1$) points to the right and $P$ belong to $m\cdot (N-m-1)$ segments as an internal point and to $N-1$ segments as an endpoint (one to each of remaining $N-1$ points).

So, you need to find such number $N$, that there exist numbers $m_{80}$ and $m_{90}$ such that
$$m_{80}(N-m_{80}) = 80 \quad \text{or} \quad m_{80}(N-1-m_{80})+(N-1) = 80$$
and
$$m_{90}(N-m_{90}) = 90 \quad \text{or} \quad m_{90}(N-1-m_{90})+(N-1) = 90$$

But I have no idea how to do that efficiently. :(


问:
Determining the covariance
Let $X$ be a random variable that is uniform on $[0, 1]$ and let $X_k$ for $k = 1, 2, ..., n$ be a random sample of $X$. Define the random variable $Y$ and $Z$ as follows: $Y =$ the number of $i$ so that $X_i \geq \frac{1}{2}$ and $Z =$ the number of $i$ so that $X_i \geq \frac{3}{4}$. Determine $cov(Y, Z)$. Are $Y$ and $Z$ independent? Why or why not?

I know that the formula is $cov(Y, Z) = E(YZ) - E(Y)E(Z)$ but I don't know how to find these expected values.

I have no idea how to approach this problem. I have spent hours doing research but I cannot find anything useful. Any assistance is much appreciated.

答:
$Y$ is the count of samples that exceed $1/2$, and $Z$ the count that exceed $3/4$.

They are not independent because it is clear that $Y\geq Z$ is certain (any sample counted towards $Z$ will also count towards $Y$).

Indeed $Y-Z$ is the count of samples that exceed $1/2$ yet do not exceed $3/4$.

We shall use indicator random variables for the events of samples occurring in these mutually exclusive ranges. Let us define for all $i$: $U_i=\mathbf 1_{1/2\lt X_i\leq 3/4}$ and $V_i=\mathbf 1_{3/4\lt X_i}$.  Since $(X_i)_{i=1}^n$ is a sequence of iid uniformly distributed random variables, $(U_i)_{i=1}^n$ is a sequence of iid bernoulli random variables, and $(V_i)_{i=1}^n$ likewise.

$$U_i\sim\mathcal{Bern}(1/4)\\V_i\sim\mathcal{Bern}(1/4)$$

Now for all $i\neq j$ we have $V_i\perp V_j$, $U_i\perp U_j$, and $U_i\perp V_j$; because the samples are independent, so are these indicators.  On the other hand, we are certain that $U_iV_i=0$, since the indicated events are disjoint for any particular sample.

Finally, the purpose of this is that: $Z=\sum_{i=1}^n V_i$ and $Y-Z=\sum_{i=1}^n U_i$.

$$\begin{align}\mathsf{Cov}(Y,Z)~&=~\mathsf{Cov}(Z,Z)+\mathsf{Cov}(Y-Z,Z)\\&=~\mathsf{Var}(\sum_{i=1}^n V_i)+\mathsf{Cov}(\sum_{i=1}^n U_i,\sum_{j=1}^nV_j)\\&~~\vdots\end{align}$$

Title: Determining the covariance


答:
The result suggests that here an endpoint is not counted as lying on a segment.

When we assume this to be the case, we find that each point will lie on $ab$ segments, where there are $a$ points to one side and $b$ points to the other - in other words, the total number of points is $a+b+1$.

Looking then at the factors of $80$ and $90$, we can see that both can be produced by a partition of $21$: $80= 16\times 5$ and $90= 15\times 6$. This implies that the answer sought is $22$.

By contrast, if we assume that the endpoints do indeed lie on segments, each point lies on $ab+a+b = (a+1)(b+1)-1$ segments and we would be looking for suitable ways to factor $81$ and $91$, but this doesn't give an answer.

Title: Several points are marked on a line, and all possible segments are made between pairs of these points. One point lies on 80 segments, another 90......

Body:
One of the points lies on 80 of these segments; another point lies on
90 segments. How many points were marked on the line?

Answer Choices are 20, 22, 80, and 90

My work:


问:
The constrains of Butcher tableau
Related posts(but did not answer the question):

deriving an implicit Runge Kutta method from its Butcher tableau

Understanding the Butcher tableau of implicit midpoint method

butcher tableau for given algorithm

butcher tableau runge kutta methods

One Wikipedia's webpage, Runge-Kutta methods could be generally described by Butcher tableau. However, it did not explain how to obtain the Butcher tableau.

There were several constrains

$\sum_{i=1}^s b_i=1$ for the consistence of Runge-Kutta method.

A "popular condition" for determining coefficients: $\sum_{j=1}^{i-1}a_{ij}=c_i$.

But then it left without comment as if one could just put any number there, but there was also example of generic second order and third order method which seemed to indicate further constrains on $b_i$, $c_i$, and $a_{ij}$.

My question was

1.a. how to obtain/calculate the Butcher tableau. What were the constrains exactly?

1.b. Especially, how was $a_ij$ being chosen under those constrains?(For example, how was "RK 3/8-rule" being read, since there were negative coefficients in $a_{ij}$)

1.c. Why was $\sum_{j=1}^{i-1}a_{ij}=c_i$ popular? Is this an explicit constrains or just a convention?

答:
$\sum a_{ij}=c_i$: Consider the differential equation $\dot x(t)=1$, $x(0)=0$. Then it is quite reasonable to request that in the whole solution process the $x$ values are equal to the $t$ values. In general it should not make a difference if you consider a general ODE or its autonomous form.

If you can somewhat read German, go to the ultimate source, the article by M. Wilhelm Kutta "Beitrag zur näherungsweisen Lösung totaler Differentialgleichungen" is a quite explicit answer to your question. His approach for the low-order explicit methods is to completely solve the coefficient equations, then select a quadrature method for the $c_i$ and $b_i$,  symmetry constraints and zero coefficients. These then mostly determine the tableau.

For the higher-order explicit methods, where the number of stages is larger than the order, equations are added for structural constraints that simplify the order conditions, demands on the approximation orders of intermediate points, also in view of constructing a "dense output" interpolation, constructing an embedded method, first-same-as-last, and again zero patterns in the matrix. Then often some of the coefficients of the leading error term are selected for minimization, the system is solved. If possible, the solution is perturbed into a close-by rational solution.

With implicit methods one has even more freedom to add constraints. A common method is to use the collocation approach. Others are to make the matrix lower-triangular giving semi-implicit methods where each stage equation can be solved separately, then making the diagonal entries all the same, so that their simplified Newton methods can all use the same Jacobi matrix and its factorization.

Title: The constrains of Butcher tableau


问:
How to calculate fractional roots on a computer?
I worked out a closed form formula for a function that is defined for positive integers $n$:

When $n$ is even: $x = 1 - (\alpha - 1)^n$

When $n$ is odd: $x = (\alpha - 1)^n + 1$

When this is inverted naively into code:

```<code>const computeInverseBlendAlpha = (targetOpacity, nCopies) => {
  console.log("computeInverseBlendAlpha", targetOpacity, nCopies);
  return nCopies % 2
    ? (targetOpacity - 1) ** (1 / nCopies) + 1
    : (1 - targetOpacity) ** (1 / nCopies) + 1;
};
</code>```

It produces garbage values (NaN for odd n and nonsensical $>1$ values for even n).

So, there are strong clues here that it seems to be important to define that I want to limit $0 \le \alpha \le 1$. I can see that e.g. I need to obtain the appropriate $\alpha \le 1$ solution for the even fractional power. There is always a second real solution and javascript is always providing that wrong solution with the exponentiation.

In the odd case, e.g. -0.8 ** 1/3 produces NaN even though it should be $-.9283$... I do suspect that here even the intermediate value $1/3$ is not representable as a binary floating point value, and I could convince myself that it may be nonsensical to raise something to such a power.

Clearly we need to use more sophisticated algorithms than the Math.pow provided by this language to compute the values I am interested in. I'm curious what straightforward techniques I might employ for that. I guess I didn't pay enough attention in high school. I know that the complex roots exist in a circle on the complex plane and if I could get all of those roots then I could pick out the correct real roots. What are some algorithms that can calculate them?

答:
In pencil and paper math, you can have something like $(-8)^{1/3}$ and people see that as the same as $\sqrt[3]{-8}$, which is $-2$.

But that required knowing the exponent was a rational number. In general, an exponent is not rational. And in general for most computing systems, $a^b$ means $\exp(b\ln(a))$, and there are methods for computing $\ln(x)$ and $\exp(x)$ that are deep in the language, or even in the hardware, to make them fast. That requires $a$ to be positive. The consequence is you should never allow for a negative base in code like this (unless you know the exponent is a clean integer, where soemthing special can be done).

Actually in this setting, the exponent in $(-8)^{1/3}$ is the floating point $0.33\ldots3$. That is the same as $\frac{33\ldots3}{100\ldots0}$. So this would be taking an even root of $-8$, which is not real. It's just another reason to outlaw using a negative base (except for when the exponent is an integer).

This is the source of your first issue. When $n$ is odd, you ask it to use $x-1$, a negative value, as the base. It returns NaN.

For even $n$, you say it is nonsensical that the result is greater than $1$. Why is that nonsensical? Your expression adds $1$ to $(1-x)^{1/n}$, so it should be greater than $1$. (But I think that expression is not inverting what you started with.)

As noted in the comments, you start with
$$x=1-(1-\alpha)^n$$
regardless of $n$'s parity. Solve for $\alpha$ and you have $$\alpha=1-(1-x)^{1/n}$$ So replace

```<code>  return nCopies % 2
    ? (targetOpacity - 1) ** (1 / nCopies) + 1
    : (1 - targetOpacity) ** (1 / nCopies) + 1;
</code>```

with

```<code>  return 1 - (1 - targetOpacity)**(1 / nCopies);
</code>```

Body:
In pencil and paper math, you can have something like $(-8)^{1/3}$ and people see that as the same as $\sqrt[3]{-8}$, which is $-2$.

But that required knowing the exponent was a rational number. In general, an exponent is not rational. And in general for most computing systems, $a^b$ means $\exp(b\ln(a))$, and there are methods for computing $\ln(x)$ and $\exp(x)$ that are deep in the language, or even in the hardware, to make them fast. That requires $a$ to be positive. The consequence is you should never allow for a negative base in code like this (unless you know the exponent is a clean integer, where soemthing special can be done).

Actually in this setting, the exponent in $(-8)^{1/3}$ is the floating point $0.33\ldots3$. That is the same as $\frac{33\ldots3}{100\ldots0}$. So this would be taking an even root of $-8$, which is not real. It's just another reason to outlaw using a negative base (except for when the exponent is an integer).

This is the source of your first issue. When $n$ is odd, you ask it to use $x-1$, a negative value, as the base. It returns NaN.

For even $n$, you say it is nonsensical that the result is greater than $1$. Why is that nonsensical? Your expression adds $1$ to $(1-x)^{1/n}$, so it should be greater than $1$. (But I think that expression is not inverting what you started with.)

As noted in the comments, you start with
$$x=1-(1-\alpha)^n$$
regardless of $n$'s parity. Solve for $\alpha$ and you have $$\alpha=1-(1-x)^{1/n}$$ So replace

  return nCopies % 2
    ? (targetOpacity - 1) ** (1 / nCopies) + 1
    : (1 - targetOpacity) ** (1 / nCopies) + 1;

with

  return 1 - (1 - targetOpacity)**(1 / nCopies);


问:
How to determine if the limit $\lim\limits_{N\to\infty}\frac1{a_N}\sum_{n=N+1}^\infty a_n$ converges?
Let $a_{n}>0$, and let $\displaystyle \sum_{n=1}^{\infty}a_{n}=a$; then
does this limit converge to some finite number?</p>

<p>$$\lim_{N\to\infty}\dfrac{a-\displaystyle\sum_{n=1}^{N}a_{n}}{a_{N}}$$ </p>

答:
Below are two examples, of which one converges and the other diverges.

$a_n=\frac{1}{2^n}$, it is easy to see this converges.

$a_n=\frac{1}{n(n+1)}$, it is easy to see this diverges.


问:
Why is it not possible to show that $\frac{d}{dx}e^x=e^x$ by differentiating the Fourier series
The Fourier series of $ f (x) = e ^ x $ is given by

$$f(x)= \sinh(1)+2\sinh(1) \sum_{n=1}^{\infty}\frac{(-1)^n}{1+\pi^2n^2}[\cos(n\pi x)-n\pi\sin(n\pi x)]$$

By taking the derivative I get

$$f'(x)=2\sinh(1) \sum_{n=1}^{\infty}\frac{(-1)^n}{1+\pi^2n^2}[-n\pi\sin(n\pi x)-n^2\pi^2\cos(n\pi x)]$$

But I can't get an argument as to why it can't be shown that the derivative of $e ^ x$ is $e ^ x$ when I derive the expanded Fourier series.

Can you help me with an argument?

答: The theorem on differentiating Fourier series (on $[-1,1]$ in this case) says that we may differentiate term-by-term if the original function is (piecewise continuously) differentiable on $(-1,1)$ and continuous at the endpoints $-1$ and $1$. This second hypothesis does not hold for the periodic extension of $e^x$.