问:
Do all LCG-based PRNGs suffer from predictable patterns?
I needed to produce trivial (low-quality) random integers and remembered how simple linear congruential generators were to implement from school:

Went to Wikipedia, found the first example which appeared to produce 32 bits (sourced from the ubiquitous Numerical Recipes):

Jammed this in as the following Perl one-liner, which takes the 10th iteration (n = 10) and the current Unix time as seed:

```<code>perl -le '$n = shift; for (1..10) { $n = int(1664525 * $n + 1013904223) % 2**32 } print $n' $(date +%s)
</code>```

And I was a little surprised to see the last digit in the output was always incrementing by 1. So I printed all of the iterates to find that this pattern occurs only in the 10th iteration:

```<code>~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820918
  1 = 3975067229
  2 = 810304536
  3 = 3116890263
  4 = 2673982730
  5 = 3148974305
  6 = 3740634316
  7 = 619471291
  8 = 3601034206
  9 = 3361989029
 10 = 1048979136     # <-  6

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820919
  1 = 3976731754
  2 = 1199874241
  3 = 1762722604
  4 = 2832966811
  5 = 1716457790
  6 = 2657060741
  7 = 2470761248
  8 = 3240913919
  9 = 1251936594
 10 = 1295718537     # <-  7

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820920
  1 = 3978396279
  2 = 1589443946
  3 = 408554945
  4 = 2991950892
  5 = 283941275
  6 = 1573487166
  7 = 27083909
  8 = 2880793632
  9 = 3436851455
 10 = 1542457938     # <-  8

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820921
  1 = 3980060804
  2 = 1979013651
  3 = 3349354582
  4 = 3150934973
  5 = 3146392056
  6 = 489913591
  7 = 1878373866
  8 = 2520673345
  9 = 1326799020
 10 = 1789197339     # <-  9

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820922
  1 = 3981725329
  2 = 2368583356
  3 = 1995186923
  4 = 3309919054
  5 = 1713875541
  6 = 3701307312
  7 = 3729663823
  8 = 2160553058
  9 = 3511713881
 10 = 2035936740     # <-  0

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820923
  1 = 3983389854
  2 = 2758153061
  3 = 641019264
  4 = 3468903135
  5 = 281359026
  6 = 2617733737
  7 = 1285986484
  8 = 1800432771
  9 = 1401661446
 10 = 2282676141     # <-  1

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820924
  1 = 3985054379
  2 = 3147722766
  3 = 3581818901
  4 = 3627887216
  5 = 3143809807
  6 = 1534160162
  7 = 3137276441
  8 = 1440312484
  9 = 3586576307
 10 = 2529415542     # <-  2

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820925
  1 = 3986718904
  2 = 3537292471
  3 = 2227651242
  4 = 3786871297
  5 = 1711293292
  6 = 450586587
  7 = 693599102
  8 = 1080192197
  9 = 1476523872
 10 = 2776154943     # <-  3

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820926
  1 = 3988383429
  2 = 3926862176
  3 = 873483583
  4 = 3945855378
  5 = 278776777
  6 = 3661980308
  7 = 2544889059
  8 = 720071910
  9 = 3661438733
 10 = 3022894344     # <-  4

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820927
  1 = 3990047954
  2 = 21464585
  3 = 3814283220
  4 = 4104839459
  5 = 3141227558
  6 = 2578406733
  7 = 101211720
  8 = 359951623
  9 = 1551386298
 10 = 3269633745     # <-  5

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820928
  1 = 3991712479
  2 = 411034290
  3 = 2460115561
  4 = 4263823540
  5 = 1708711043
  6 = 1494833158
  7 = 1952501677
  8 = 4294798632
  9 = 3736301159
 10 = 3516373146     # <-  6

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820929
  1 = 3993377004
  2 = 800603995
  3 = 1105947902
  4 = 127840325
  5 = 276194528
  6 = 411259583
  7 = 3803791634
  8 = 3934678345
  9 = 1626248724
 10 = 3763112547     # <-  7

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820930
  1 = 3995041529
  2 = 1190173700
  3 = 4046747539
  4 = 286824406
  5 = 3138645309
  6 = 3622653304
  7 = 1360114295
  8 = 3574558058
  9 = 3811163585
 10 = 4009851948     # <-  8

~ perl -le '<span class="math-container">$n = shift; print "seed = $</span>n"; for (1..10) { <span class="math-container">$n = int(1664525 * $</span>n + 1013904223) % 2**32; printf "%2d = %d\n", <span class="math-container">$_, $</span>n }' $(date +%s)
 seed = 1603820931
  1 = 3996706054
  2 = 1579743405
  3 = 2692579880
  4 = 445808487
  5 = 1706128794
  6 = 2539079729
  7 = 3211404252
  8 = 3214437771
  9 = 1701111150
 10 = 4256591349     # <-  9
</code>```

So I'm curious if this is a quirk of the programming? Of the chosen a, c, and m parameters? Or do all LCGs suffer from these low-period patterns?

答:
It's not uncommon for there to be patterns in the low bits of PRNG outputs.  And as you realize, LCGs are not state of the art.

For insight on this issue, a good starting point is Melissa O'Neill's paper.  She has an extended discussion of problems with low bits in LCGs and other PRNGs.  The PRNGs she develops are based on LCGs, but involve rearranging their outputs to try to avoid such problems.

Some of the papers or web pages at Sebastiano Vigna's website are also relevant to issues with low bits.  And if that's not enough to satisfy your curiosity, Pierre L'Ecuyer's website is a great resource.  (His paper with Pannetton and Matsumoto (available at L'Ecuyer's site) shows that even mathematically sophisticated PRNGs can have problems when the seed has too many zero bits.  Vigna's paper about retiring the Mersenne Twister algorithm is relevant to this issue, too.)

(And one has to mention Knuth's The Art of Computer Programming, volume 2, chapter 3.  People call this the bible of pseudorandom number generation, and it deserves that title even though it's no longer enough.  It is still the bible for LCGs, though, and worthy of study in any event.)


问:
Probability example A tosses coin B rolls a die
I have been given this example:

A those a coin and THEN B rolls a Die.
This is repeated independently until a head or one of the numbers 1,2,3,4 appears which the at this time the game is stopped. Note that winning is when the game is stopped and its a fair coin and dice

Compute the probability of of A winning the game.

I see this as follows:

A can win either by getting head on the first or by $$\sum _{n=1}^{\infty } \frac{1}{2}(P(5or6|tail)^n = \sum _{n=1}^{\infty } \frac{1}{2} \left(\frac{2}{12}\right)^n=1/10 $$
(using geometric series)

As these events are mutually exclusive I could sum them up and I get the probability of A given by P(A) is 1/2+1/10=60% chance of A winning.

Now this is the same answer as the book is giving, but in the example they have provided is this solution, which I don't follow:

Using independency, the probability of A wins is thus the conditional probability equals
$$(1/2)/((1/2)+(1/2)*(4/6))$$

Now could someone please show me how these numbers came about?

答:
One way to solve this is using odds in its true meaning. Note that if neither wins in the first round,  we are back to square $1$

$P(A \,wins\, in\, round\, 1) = \frac 12,\;\;\; P(B\, wins\, in\, round\, 1) = \frac12\cdot\frac46 $

Odds of $A$ winning $ = \frac12 : \frac12\cdot\frac46 $

so $P(A\, wins) = \dfrac{\frac12}{\frac12 + \frac12\cdot\frac46}$

ContentLicense: CC BY-SA 4.0


问:
Random variable proof of indicator function
I have a random variable  $X : \Omega \to \mathbb{R}^{n}$  and $a>0$.
How can I show that the function $Y : \Omega \to \mathbb{R}^{n}$ defined by
$$    Y(\omega) = \left\{\begin{array}{lr}
        X(\omega), & \text{if }|X(\omega)| \leq  a \\
        0, & \text{if }|X(\omega)| >  a
        \end{array}\right\}
 $$

is a random variable ?

答:
Let $E\subseteq \mathbb{R}^n$ be a measurable set, and put $A=\{\vec{x}\in\mathbb{R}^n:|\vec{x}|\leq a\}$. Then $Y^{-1}(A^c)=\emptyset$ since $|Y(\omega)|\leq a$ for any $\omega\in\Omega$.

Note that $E$ is a disjoint union of the two measurable sets $E\cap A$ and $E\cap A^c\subseteq A^c$ so $$Y^{-1}(E)=Y^{-1}(E\cap A)\cup Y^{-1}(E\cap A^c)=X^{-1}(E \cap A)$$ which is measurable.


问:
variational characterization of convex projection
Let $C$ be a nonempty closed convex subset of
a real Hilbert space $X$, and let $x \in X$.
Then there
exists a unique point $P_{C}x \in C$ such that
$\left\Vert x - P_{C}x \right\Vert
= \min_{y \in C} \left\Vert x-y \right\Vert$.
Moreover, this point is characterized by
$$
P_{C}x \in C \quad \text{and}
\quad
\left( \forall y \in C \right)
~
\left< x-P_{C}x ~ , ~ y-P_{C}x \right> \leq 0.
$$
I happened to know that
this characterization is (or was)
known as the Bourbaki-Cheney-Goldstein
inequality
and started to look around
for book references but could not
find one.
(This characterization is
known to me as
"obtuse angle criterion"
or "projection theorem.")

My question is:
Is there any book that refers to
the above characterization as
"Bourbaki-Cheney-Goldstein"?
I am curious about this
and it would be nice to
know the reason behind this name.

Any help would be highly appreciated.

答: Refer to that book written by P.G.Ciarlet, Linear and Nonlinear Functional Analysis with Applications, Theorem 4.3-1.

ContentLicense: CC BY-SA 3.0


问:
unequal sample sizes t-test
I'm trying to investigate whether mean concentrations of a particular hormone significantly differ in two groups. However, one group has 1000 samples, and another has about 50.

I have found one approach is reducing the majority group to match the smaller group, i.e. getting rid of 950 samples randomly. However, this approach seems wasteful because we are now getting rid of 95% of the data in the first group.

Is it possible to divide up the large group into 20 groups with N = 50, and do a t-test for all 20 smaller sized groups at equal sizes? If so, how do I report back one p-value? Another approach I wanted to try is repeated random under sampling ( similar to the first approach but the groups are created randomly) to match the smaller group, but run into the same issue where I then have as many p-values as repeated trials.

I know there are different test that can be run such as Mann Whitney and Welch's, but I really wanted to see whether a t-test will suffice doing multiple comparisons?

Thanks

答:
The Welch test is a $t$-test, because the test statistic is, under certain assumptions, approximately $t$-distributed.  In fact, if the within-group variances are roughly equal, there is nothing stopping you from performing the usual $2$-sample $t$-test.  The larger group would have an asymptotically normal sample mean except under severe violations of the Central Limit Theorem.  The small group, while small relative to the larger group, is still $n_2 = 50$ observations at which point the critical value for the test is very close to a standard normal critical value.  In fact, the Satterthwaite approximation for the degrees of freedom for a Welch $t$-test would be very close to $n_2 - 1 = 49$, except if the variance of the first group is enormous even with the large data size.

The takeaway here is that you should not be concerned about the difference in sample sizes.  Of more concern would be deviations from normality or other violations of the test assumptions.  I would not attempt to do the kind of procedure you are proposing; this would most likely lose an enormous amount of statistical power, or inflate the Type I error due to multiple comparisons.  There simply is no need to go with such an elaborate testing procedure.

Title: unequal sample sizes t-test


问:
Boundary of a set is subset of the set if and only if the set is closed
Let $X$ be a topological space and $A \subset X$. I wish to show that

$\partial A \subset A$ if and only if $A$ is closed.

I am not seeking a full answer, but just some sort of hint of how to approach this. It is the "$\Longrightarrow$" direction I'm stuck on.

"$\Longrightarrow$" Suppose $\partial A \subset A$. I wish to show $\bar{A} = A$ (the closure of $A$ is equal to $A$), but I'm not sure how to show this. I thought of "element chasing" for this, but this doesn't seem like it will work.

"$\Longleftarrow$" Suppose $A$ is closed. Then $A = \bar{A}$, and we have $\partial A = \bar{A} \setminus \mathring{A} \subset \bar{A} = A$, done.

答: HINT: You know that $\operatorname{bdry}A=(\operatorname{cl}A)\setminus\operatorname{int}A$. If $A$ is not closed, there is some $x\in(\operatorname{cl}A)\setminus A$; is $x\in\operatorname{bdry}A$? Is $x\in A$?


答: Assume $\partial A \subseteq A$. Using your definition, $\partial A = \overline{A} \setminus \text{Int}(A)$. Then, we have that $\overline{A} = \partial A \cup \text{Int}(A)$. Thus, if $x \in \overline{A}$, then $x \in \partial A$ or $x \in \text{Int}(A)$. In the first case, $x \in \partial A \subseteq A$. In the latter case, then $x \in \text{Int}(A) \subseteq A$. Thus, we have that $\overline{A} \subseteq A$ so $A$ is closed.

Title: Boundary of a set is subset of the set if and only if the set is closed

Body:
Let $X$ be a topological space and $A \subset X$. I wish to show that

$\partial A \subset A$ if and only if $A$ is closed.

I am not seeking a full answer, but just some sort of hint of how to approach this. It is the "$\Longrightarrow$" direction I'm stuck on.

"$\Longrightarrow$" Suppose $\partial A \subset A$. I wish to show $\bar{A} = A$ (the closure of $A$ is equal to $A$), but I'm not sure how to show this. I thought of "element chasing" for this, but this doesn't seem like it will work.

"$\Longleftarrow$" Suppose $A$ is closed. Then $A = \bar{A}$, and we have $\partial A = \bar{A} \setminus \mathring{A} \subset \bar{A} = A$, done.


问:
Find number of elements of $\mathbb{Z}_2[x] / (x^3 + x^2 + 1)$
As part of a longer problem, I need to find the number of elements of the multiplicative group of $\mathbb{Z}_2[x] / (x^3 + x^2 + 1)$.

I have no idea where to start with this. I understand that these polynomials have coefficients in the finite field $\mathbb{Z_2}$, so they can take on forms like $x^3 + x^2 + 1$ and $x^3 - x^2 - 1$, but I am not sure where to go from here....

Any help is appreciated!!

答:
I suspect that you have all the ingredients already, maybe have already put them together to get your desired degree of understanding. But let me lay it all out:

Any time you have a field $k$ and an irreducible $k$-polynomial $f(X)$, then the factor ring $k[X]/\bigl(f(X)\bigr)$ is also a field that contains $k$ in a natural way, via (for $a\in k$) $a\mapsto$ the class of $a$, modulo the ideal $(f)$. So the factor ring can be considered a finite extension of $k$, of degree equal to the degree of $f$.

In your particular case, I’m sure that you’ve seen that $X^3+X^2+1$ is $\Bbb Z_2$-irreducible. The elements of the factor ring can all be written $a+bX+cX^2$ for $a,b,c\in\Bbb Z_2$, since anything of degree three or higher can be made congruent to something of degree $\le2$ by application of Euclidean division.

Thus our extension field is of order eight, and its multiplicative group is of order seven. Since $7$ is a prime, any element of our new field different from $1$ will generate the full group.


问:
Linearity of Duality map implies Banach space is actually Hilbert.
Let $E$ be banach and $J:E \to E*$ be the duality map, that is, $<J(x),x>= \lvert \lvert x \rvert \rvert ^2$ and $\lvert \lvert J(x) \rvert \rvert = \lvert \lvert x \rvert \rvert$. Note that J does not have to be linear.

Proposition: If J were linear, then E is actually Hilbert.

I went ahead and defined $<x,y>:=<J(x),y>$ and it holds all I need, except symmetry (I'm working over the reals). I can't show that $J(x)(y)=J(y)(x)$ and can't see a reason why it should. I actually had a different proof, using parallelogram law, but my prof told me I was complicating myself and hinted me with the definition above. Any tips? Is there something obvious that I'm not seeing?

答: Define inner product as $ \langle x, y \rangle =\frac {J(x)y+J(y)x} 2$. This should resolve the issue with symmetry without affecting other properties.


问:
Compound interest formula with regular deposits, solve for time
I cant seem solve the following problem due to my bad memory of logarithms

if someone opens an account with
initial balance of $B$
interest rate of $R$
and does a constant monthly deposit of $D$

how long before the account balance reaches $X$ ?

答:
There are three implicit conditions when applying this formula:

the deposits $A$ are uniform and equally spaced in time,

they are made always at the end of each month, and

the interest rate $i$ remains unchanged.
$$X=B(1+i)^n+A\dfrac{(1+i)^n-1}{i}.$$

I'd like to note that when the second implicit condition for applying the formula derived by Américo Tavares changes to:

They are made always at the beginning of each month

The formula becomes:

$$X=B(1+i)^n+A\dfrac{(1+i)^{n+1}-(1+i)}{i}.$$

This formula is  also used in Microsoft Excel to calculate the Future Value (FV). The user can choose whether deposits are made at the beginning or at the end of the period.


问:
Prove that if $B1$ is a base for $\tau_{1}\{\emptyset, \mathbb{N}\}$ then $\tau_{1}\{\emptyset, \mathbb{N}\}\subseteq B_{1}$
Be $\tau_{1}$ and $\tau_{2}$ topologies over $\mathbb{N}$ defined by:

$\tau_{1}=\{\{m\in \mathbb{N}:m<n\}:n\in \mathbb{N}\}\cup \{\mathbb{N}\}\}$ and $\tau_{2}=\{A\subseteq \mathbb{N}: 0\in A\}\cup \{\emptyset\}$.

Prove that if $B_1$ is a base for $\tau_{1}\{\emptyset, \mathbb{N}\}$ then $\tau_{1}\{\emptyset, \mathbb{N}\}\subseteq B_{1}$.

(i) If $B_{1}$ is an open base for $\tau_1$ then $\tau_{1}-\{\emptyset, \mathbb{N}\} \subseteq B_1$. If $B_1$ is a basis for the Topology $\tau_1$ then any element of $\tau_1$ can be written as a union of the elements of $B_1$. We need to show that $\tau_1-\{\emptyset, \mathbb{N}\} \subseteq B_1$.
Let $V \in \tau_1- \{\emptyset, \mathbb{N}\}$ so as $B_1$ is a base of $\tau_1$, we have that $V = \bigcup_ {\lambda \in I} B_\lambda$.

Is the union of base elements at the base?

(ii) How is the $B_1$ base? A $B_2$ base for $\tau_2$ I would kick $\tau_1$.

答:
I believe that the question actually asks you to show that $\tau_1\color{red}{\setminus}\{\varnothing,\Bbb N\}\subseteq B_1$. In other words, you’re to show that $B_1$ must contain all of the sets $\{m\in\Bbb N:m<n\}$ for $n\in\Bbb N$. Fix $n\in\Bbb N$, let $U=\{m\in\Bbb N:m<n\}$, and suppose that $U\notin B_1$. Since $B_1$ is a base for $\tau_1$, and $U\in\tau_1$, there must be some $\mathscr{U}\subseteq B_1$ such that $U=\bigcup\mathscr{U}$. What sets could belong to $\mathscr{U}$? Clearly they must all be subsets of $U$, as otherwise $\bigcup\mathscr{U}$ could not be equal to $U$. The only members of $\tau_1\setminus\{U\}$ that are subsets of $U$ are the sets $U_m=\{k\in\Bbb N:k<m\}$ for $m<n$. Thus, $\mathscr{U}\subseteq\{U_m:m<n\}$, and

$$\bigcup\mathscr{U}\subseteq\bigcup_{m<n}U_m=U_{n-1}=\{k\in\Bbb N:k<n-1\}\,.$$

But $n-1\in U\setminus U_{n-1}$, so $\mathscr{U}\ne U$. That is, $U$ is not the union of members of $B_1$, contradicting the assumption that $B_1$ is a base for $\tau_1$. This show that $U$ must in fact belong to $B_1$, and since $U$ was an arbitrary member of $\tau_1\setminus\{\varnothing,\Bbb N\}$, we’ve proved that $B_1\supseteq\tau_1\setminus\{\varnothing,\Bbb N\}$, as desired.

I can’t tell what (ii) actually is; I suspect that it contains some significant typos. However, I can tell you that $\tau_2$ has a base that contains just one open set: it is the smallest open set containing $0$.


答:
The polynomial $x^3+x^2+1$ is irreducible, because neither $0$ nor $1$ is a root $\bmod2$.  So we get a field, an extension of $\Bbb Z_2$.

The dimension of the $\Bbb Z_2$ vector space is $3$, since the possible remainders upon division by $x^3+x^2+1$ are polynomials of degree $2$ or less.

Thus the order of the field is $2^3=8$; its multiplicative group $7$.

Title: Find number of elements of $\mathbb{Z}_2[x] / (x^3 + x^2 + 1)$

Body:
As part of a longer problem, I need to find the number of elements of the multiplicative group of $\mathbb{Z}_2[x] / (x^3 + x^2 + 1)$.

I have no idea where to start with this. I understand that these polynomials have coefficients in the finite field $\mathbb{Z_2}$, so they can take on forms like $x^3 + x^2 + 1$ and $x^3 - x^2 - 1$, but I am not sure where to go from here....

Any help is appreciated!!


问:
Question about test function
I'm reading this book and on page 66, the author gives this example about hypothesis testing:

I don't understand why the author has defined the test function in this way. Why did he choose $\phi(8)=67/75$? Why the size is exactly 0.05?

答:
It's a randomized test... it is not very common. Scrolling the various k's in your $Bin(10;0.5)$ you will never get exactly $\alpha=5\%$, thus you reject with probability 1 if $X>8$ and with probability $p$ if $X=8$

How to calculate $p$?

$$1\cdot\mathbb{P}[X=10]+1\cdot\mathbb{P}[X=9]+p\cdot\mathbb{P}[X=8]+0\cdot\mathbb{P}[X<8]=0.05$$
That is

$$0.0009765625+0.0097656250+p\cdot 0.0439453125=0.0500000000$$

$$p=0.8933333333=\frac{67}{75}$$

In a Real Statistics work, when you know that $X=8$ has a $p_{value}=5.47\%$ you have enough information to take your decision. Nobody is interested to get "exactly" $\alpha=5\%$

Title: Question about test function


问:
Switching derivative and sum of absolutely continuous functions
Let $g_k$ be a sequence of absolutely continuous functions on $[a,b]$. Suppose $\sum_{k=1}^
\infty g_k(x)$ is convergent for all  $x \in [a,b]$ and define $f(x) = \sum_{k=1}^
\infty g_k(x)$. Also suppose that $\sum_{k=1}^\infty \int_a^b |g_k'(x)|dx < \infty$. From these hypotheses, I have shown that $f$ is absolutely continuous on $[a,b]$. I am trying to show now that $f'(x) = \sum_{k=1}^\infty g_k'(x)$ for a.e. $x \in [a,b]$ but I am not sure how to proceed.

I tried applying this theorem as every absolutely continuous function is a difference of increasing functions: https://en.wikipedia.org/wiki/Fubini%27s_theorem_on_differentiation. But I'm unsure about the convergence of the increasing functions so don't think that works. I'd appreciate any help on this problem!

答: Recall that AC functions are indefinite integrals of their derivatives. It is shown in Rudin's RCA (Theorem 7.19) that any AC continuous function on $[a,b]$ is the difference of two AC increasing functions. So the proof reduces to the case when the functions are all increasing. In this case $\int_c^{d} \sum g_k'(t)dt= \sum\int_c^{d}  g_k'(t)dt$ by Tonelli's Theorem. This gives $\int_c^{d} f'(t)dt=\int_c^{d} \sum g_k'(t) dt$ whenever $a\leq c <d \leq b$. This implies that $ f'(t)= \sum g_k'(t) $ almost evrywhere.


问:
Solve Nonlinear Differential Equation $v^2_y = -\frac{1}{3}v^3 + cv^2$
I want to know how to solve the above equation.
The equation comes about when reducing a PDE by finding the symmetries of the PDE and then applying one of them.
I want to understand how the solution is found.
The answer given is
$$
v = 3c \frac{1}{\cosh ^2 \left[\frac{1}{2}\sqrt{cy} + \delta \right]}
$$

(I had to use the $\frac{1}{\cosh}$ as \sech is not recognised.)

答:
As @Matthew Pilling commented, considering the differential equation
$$(v')^2=-\frac 13 v^3+v^2$$ it could be an idea to swith variables first to have
$$(y')^2=\frac{3}{(3-v) v^2}\implies y'=\pm \frac{\sqrt 3 } {v\sqrt{3-v} }$$ Integrating
$$y+C=\pm\int \frac{\sqrt 3 } {v\sqrt{3-v} } dv$$
$$I=\int \frac{\sqrt 3 } {v\sqrt{3-v} } dv=\log \left(1-\sqrt{1-\frac{v}{3}}\right)-\log \left(1+\sqrt{1-\frac{v}{3}}\right)$$
$$I=-2 \tanh ^{-1}\left(\sqrt{1-\frac{v}{3}}\right)$$ Then $v$ and use the hyperbolic half-angle substitution.


问:
A nice enumeration of $R(\omega)$
Define $R(0)=0=\emptyset, R(n+1)=P(R(n))$ and $R(\omega) = \cup_{n < \omega} R(n)$. Thus $R(\omega)$ is the set of all sets, which are build out of finitely many braces and $0$.

Consider the following relation $E$ on $\omega$: If and only if the $n$th number in the binary representation of $m$ is $1$, then $n E m$. Now I want to construct an isomorphism $(R(\omega),\in) \cong (\omega,E)$ [This is an exercise in Kunen's set theory]. After some playing around I've come up with the following definition:

$g : R(\omega) \to \omega, g(x) = \sum_{y \in x} 2^{g(y)}$.

This is a well-defined recursion, since $rank(y) < rank(x)$. If $g$ is injective, then it is easy to see that $x \in y \Leftrightarrow g(x) E g(y)$. However I don't see this; neither why $g$ is surjective.

答:
Take the minimal $n$ such that there are $x,y \in R(\omega)$ for which $x \not= y$ and $g(x)=g(y)=n$.

If $g(x) = g(y)$ then we know the following: $|x| = |y|$ and $\forall u \in x \exists v \in y (g(u) = g(v))$ but since it is clear that $u \in v \Rightarrow g(u) < g(v)$ we have that there is some $u \in x, v\in y$ for which $g(u) = g(v) < g(y) = n$ which contradictions the assumption.

I've got no idea about the surjective part. Seems slightly tricky, but I'll get back to you when I have an answer.

We know that $g(\emptyset) = 0$.

Let $n$ be the minimal number that is not in the range of $g$, we can write $n = 2^{n_0}+\ldots +2^{n_k}$ where $n_0 < n_1 < \ldots < n_k$. Since $n_i < n$ we have that there is $x_i \in R(\omega)$ for which $g(x_i) = n_i$. So now we can take $x = \{x_i |0\le i\le k\}$ and it is a simple argument that $x \in R(\omega)$ and clearly $g(x) = n$.

ContentLicense: CC BY-SA 2.5

Title: A nice enumeration of $R(\omega)$


问:
Find the probability that k people sits adjacent in a row of n seats
I was solving a problem in probability (basic level). The problem is from a text book (Morris H.DeGroot). The problem is as,

if $k$ people are seated random in a row containing $n$ seats ( $n > k$ ). What is the probability that people will occupy $k$ adjacent seats in the row.

My approach of the solution is: Sample space is clearly ${n \choose k}$.
 Now to get the event's possible outcomes I assume that 'k' adjacent seats are as 1 unit (as all the 'k' should be adjacent) then subtracting 'k' from 'n' and adding 1 unit to 'n' gives $(n-k)+1$. Now from this we just choose '1'. so it will be ${n-k+1 \choose 1}$
               .

So the answer is $(n-k+1) \times \frac{1}{{n \choose k}}$. I see that the answer is correct from the text book answers. Is my approach correct? If not please let me know what should be the approach to solve this problem.

Thanks

答: Your answer is correct, and with a very high probability this is the most simple approach you could find :)</p>


问:
Binomial distribution (i think)
This may seem like a simple question but I honestly don't really know how I would go about solving it.
So essentially the question is as follows:

2 players play a match whereby the winner is the first person to win n games.

the probability of player 1 winning a single game is 0.835
the probability of player 2 winning a single game is 0.165

what is the smallest value for n such that the probability that player 1 is the overall winner of the match is at least 0.9

I feel like i need to use binomial distribution to solve the question but i wasn't able to do so.
Any help will be greatly appreciated.

答:
With $p = 0.835, 2$ games are obviously not enough, because A would need to win both games, with a $Pr = {0.835}^2 <0.9$, so trials can begin from number of games played, $K = 3$

You would find computations much simpler if you focus on the losses of $A$ rather than wins.

For example, with $K=3$, $A$ can afford to lose at most one game, so the probability of an overall win is $\binom30q^0p^3 + \binom31q^1p^2$, which happily works out to

$\binom30 0.165^0\cdot 0.835^3 + \binom310.165^1\cdot0.835^2 = 0.9273$

thus the smallest value of n (games won) needed $=2$

Response to queries

We are trying to use the smallest number of games $(K)$ so we can find the smallest number of wins ($n$) needed.

With $K=3$, we found $n=2$ is possible if we include  more than $2$ wins in the series of $K$ games.

If we want to strictly say that more than $n$ wins can't be included in the probability calculations, the formula will change to $\binom{K}{n} p^nq^{K-n} \geq 0.9$

A little thought will show that with this formula, the Pr will never reach $0.9$, even for $n=2$, see here

So either we'll have to allow  more than $n$ wins in the Pr computations, else it is impossible.

Title: Binomial distribution (i think)


问:
How to simplify absolute value expressions such as: $|x+1|+|x-1|$ algebraically?
After plotting this function on desmos, I understood that this absolute expression is actually a piecewise function.

Hence this: $$f(x)=|x+1|+|x-1|$$is the same as
$$f(x)=\left\{\begin{align}2x\quad&\text{if }x>1\\-2x\quad &\text{if }x<-1\\2\quad &\text{if}-1<x<1\end{align}\right.$$

But is there a way to do this algebraically instead of plotting?

答: \begin{align}\lvert x+1\rvert+\lvert x-1\rvert&=\begin{cases}x+1+\lvert x-1\rvert&\text{if }x\ge-1\\ -x-1+\lvert x-1\rvert&\text{if }x<-1\end{cases}=\\&=\begin{cases}x+1+ x-1&\text{if }x\ge-1\land x\ge1\\x+1- x+1&\text{if }x\ge-1\land x<1\\  -x-1+ x-1&\text{if }x<-1\land x\ge1\\ -x-1- x+1&\text{if }x<-1\land x<1\end{cases}=\\&=\begin{cases}2x&\text{if } x\ge1\\2&\text{if }-1\le x<1\\   -2x&\text{if }x<-1\end{cases}\end{align}


问:
pushforward measure and radon nykodim derivative
I need to determine the pushforward measure $f_*m$ of continuous measurable functions like e.g $f(x)=c,f(x)=x,...,f(x)=cos(x)$ and also if possible i need to calculate the radon nikodym derivative with respect to $m$, where $m$ denotes the lebesgue measure. I would probably not struggle as much as i do, if i had an example of how its done, since i cant really find any easy examples on the internet such as : $f(x)=x^2$.

Any sort of advice will be very helpful and thanks in advance.

答:
Working the details requires work, but here is an idea.

We have, where $f$ is monotone, $$m(f^{-1}(a,b))=f^{-1}(b)-f^{-1}(a)=(f^{-1})'(\xi)\,(b-a)=(f^{-1})'(\xi)\,m((a,b)).$$

For a continuous positive  function $g$ and appropriate partitions $\{a_k\}$,
$$
\int g\,d(f_*m)=\lim_n\sum_k g(a_k)\, m(f^{-1}(a_k,a_{k+1}))=\lim_n\sum_kg(a_k)\,\frac1{f'(f^{-1}(a_k))}\,m((a_k,a_{k+1}))=\int \,g\,\frac1{f'\circ f^{-1}}\,dm.
$$


问:
Function resulting from taking a function from histogram data input.
I was working with histograms and I have a histogram which has a shape that is well approximated by $a(\cos(x)+1)$. I was wondering if I took a function on the data, say $\cos(x)$ and plotted the resulting data in a histogram, what function would well approximate that histogram? I have written a little code in python to make my question more clear:

```<code>import numpy as np
import matplotlib.pyplot as plt

list_of_x = []
list_of_cosx = []

for i in range(100000):
    v = 2*np.arccos(2*np.random.random()-1)-np.pi
    list_of_x.append(v)
    list_of_cosx.append(np.cos(v))

plt.hist(list_of_x, bins=100)
plt.show()
# Well approximated by cos

plt.hist(list_of_cosx, bins=100)
plt.show()
# Well approximated by ???

<span class="math-container">```
```

答:
When you make a histogram as you did in your python code, what you're actually doing is setting up a probability density function $f_X(x)$ for your variable $x$, then you create a big number $N$ of random numbers in accordance with this probability distribution, and then you count number of occurrences of each possible value of $x$ and you plot it on histogram.

If your familiar with the concept of probability density functions (PDFs), you will notice straight away that this histogram is actually approximating your set PDF, and if you let $N \to \infty$ and the width of the bins (let's call it $\delta$) $\delta \to 0$, you will get the PDF, up to normalization.

Let me put a disclaimer here: I am a complete layman in this field, but I did some research) There is a result in probability theory known as change of variables in PDFs and it says the following. Say you have a random variable $X$ or in other words a PDF $f_X(x)$ defined on reals, and a monotonic function $g: {\mathbb R} \rightarrow {\mathbb R}$ and $g$ is invertible. Then the PDF of a new random variable $Y = g(X)$ is given by:
$$f_Y(y) = f_X(g^{-1}(y)) \left\vert \frac d{dy} (g^{-1}(y)) \right\vert$$

Now notice that using this formula we can calculate the PDF for your $x$ values exactly. In your program you used imported random function to generate a random number in interval $[0,1]$ with uniform distribution. We can call this our random $X$ variable with PDF being
$$f_X(x) = \left\{\begin{array}{rl}
 1, & \text{if } x \in [0,1] \\
 0, & \text{elsewhere }
\end{array}\right.$$

And we seek PDF for $Y = g(X)$, where
$$g(x) = 2\arccos(2x-1) - \pi$$

We see that $\arccos(x)$ is defined on interval $[-1,1]$ and it is a strictly decreasing invertible function, hence $g(x)$ is too. So we can apply the theorem. First we find that $g$ takes $x \in [0,1]$ (which is just what we want) and the image is interval $[-\pi, \pi]$. So whatever function $f_Y(y)$ we get as PDF of $Y$, we should only look at its part defined on interval $[-\pi,\pi]$. After finding the inverse function $g^{-1}(y)$ and plugging it into the formula provided by the theorem, we get:
$$f_Y(y) = \frac14 \sin\left( \frac{y+\pi}2 \right), \quad y \in [-\pi,\pi]$$

<img src="https://i.stack.imgur.com/Xrs8T.png" alt="Graph of $f_Y(y)$" />

Now let's compare this with our python generated histogram. To get the width of each bin of the histogram we can say:

$$ \delta = \frac{\text{width of function domain}}{\text{number of bins}} = \frac{2\pi}{100}$$

We will use $f_Y(y)$ to predict the approximate height of a bin centered at $y=0$. The probability of $\vert y \vert \lt \frac{\delta}2$ is
$$P(-\frac\delta2 \lt y \lt \frac\delta2) = \int_{-\frac\delta2}^{\frac\delta2} f_Y(y) dy \approx \delta \cdot f_Y(0) = \frac{2\pi}{100} \cdot 0.25$$

This means that if we take $N=100000$ random numbers and plot them, the most likely count of them ending up in this bin is $N$ times the probability we just calculated. If you plug it all in you get that you should expect the peak of your histogram to be somewhere around $1570$. You can run your program and make sure that this is actually the case.

Now, all this partially answers your question. If you take a monotone function of your data you are essentially defining $Z=h(Y)$ and repeating the process.

But if you define $Z=Y^2$, you must be careful to notice that now $y \in [-\pi,\pi]$, but $h(y) = y^2$ is not monotone on this interval. Luckily there is a generalization of the theorem which says that if function $g$ is not monotone on the whole interval i.e. it does not have one unique inverse function, you can essentially divide up that interval into $n$ subintervals on each of which the function is monotone and has an inverse. Then the general formula is:

$$f_Y(y) = \sum_{k=1}^{n} \left| \frac{d}{dy} g^{-1}_{k}(y) \right| \cdot f_X\big(g^{-1}_{k}(y)\big),$$

where $g^{-1}_k(y)$ is an inverse of $g(x)$ on the $k$-th such subinterval.

In our example we divide $[-\pi, \pi]$ into $[-\pi,0]$ and $(0,\pi]$.
$$h(y) = y^2 \quad \implies \quad h^{-1}_{1,2}(z) = \pm \sqrt{z},$$
where $+\sqrt{z}$ is inverse on $(0,\pi]$ and $-\sqrt{z}$ is inverse on $[-\pi,0]$. After doing the dirty work, you end up with a result which you can plot and check again with python using the same technique described above.

$$f_Z(z) = \frac1{8\sqrt{z}} \left[ \sin\left(\frac{\pi+\sqrt{z}}{2}\right) + \sin\left(\frac{\pi-\sqrt{z}}{2}\right) \right], \quad z \in [0,\pi^2]$$


问:
Need help understanding proof for probability of union for two events.
My book says that for any two events A and B

$P(A \cup B) = P(A)+P(B)-P(A\cap B)$

The proof it provides is this:

$$\def\P{\mathop{\rm P}}\begin{align}\P(A \cup B) &= \P(A \setminus B) + \P(A \cap B) + \P(B \setminus A) \\[1ex]&= \P(A \setminus B) + \P(A \cap B) + \P(B \setminus A) + \P(A\cap B) - \P(A\cap B) \\[1ex]&= \P(A)\hspace{16.5ex}+\P(B)\hspace{16.5ex}-\P(A\cap B)  \end{align}$$

My question is what happened to the $P(A\setminus B)$ and $P(B\setminus A)$ in the second line?

答: $P(A\setminus B)+P(A\cap B)=P(A)$ since these are disjoint events, whose union is $A$.  Likewise for $B$.


问:
Convert Riemann Sum into definite integral
I have the equation $$\lim_{n\to\infty}\frac{\left(r-1\right)}{n}\sum_{j=r}^{n}\frac{n}{j-1}\left(\frac{1}{n}\right)$$
which is converted to a definite integral using x as the limit of (r-1)/n, t for (i-1)/n and dt for 1/n

$${x\int _{x}^{1}{\frac {1}{t}}\,dt}.$$

I can only make sense of this intuitively but cannot convert it myself. Can someone show me the step by step process of how they converted the equation using the appropriate substitutions of a and b in the following equation.

$${\int _{x=a}^{b}{f(x)}\,dx}=\lim_{n\to\infty}\sum_{j=1}^{n}f\left(a+\frac{b-a}{n}j\right)\frac{b-a}{n}.$$

One of the main things confusing me is that j is not equal to 1 or 0 unlike typical Riemann sums. Any help will be greatly appreciated!

答:
The sum written is $$\frac{\left(r-1\right)}{n}\sum_{j=r}^{n}\frac{n}{j-1}\left(\frac{1}{n}\right) =  (r-1)\sum_{j=r}^{n}\dfrac{1}{n(j-1)} = \dfrac{r-1}{n}\cdot\Big(H_{n-1}-H_{r-1} \Big)$$
And this limit evaluates to $0$ as $\lim_{n \to \infty}\dfrac{\ln(n)}{n} = 0$


问:
Find all entire functions $f$ such that $|f|$ is harmonic.
I'm trying to find all entire functions $f$ such that $|f|$ is harmonic. My attempt is as follows.

Because $f$ is entire, we may write $f(z) = f(x + iy) = u(x,y) + iv(x,y)$ where $u$ and $v$ have continuous first-order partial derivatives and satisfy the Cauchy-Riemann equations. Furthermore, $u$ and $v$ are harmonic. Now $|f| = \sqrt{u^2 + v^2}$ so I thought maybe to look at $|f|^2$ first. Then,
$$(|f|^2)_{xx} = 2(u_x)^2 + 2(v_x)^2 + 2(u\cdot u_{xx} + v \cdot v_{xx})$$
and
$$(|f|^2)_{yy} = 2(u_y)^2 + 2(v_y)^2 + 2(u\cdot u_{yy} + v \cdot v_{yy}).$$
I need $(|f|^2)_{xx} + (|f|^2)_{yy} = 0$ in order for $|f|^2$ to be harmonic. So adding these equations and using that $u$ and $v$ are harmonic, I obtain
$$(u_x)^2 + (u_y)^2 + (v_x)^2 + (v_y)^2 = 0.$$
By the Cauchy-Riemann equations, I can simplify this to
$$(u_x)^2 + (v_x)^2 = 0.$$
I'm a little stuck on how to proceed from here. I want to somehow conclude $|f|^2$ is constant but I'm not sure how.

答:
$f(z)=f(x+iy)=u+iv$. Then from analyticity of $f$:
$$
u_x=-v_y\textrm{ and }u_y=v_x.\tag 1
$$
Hence if $|f|=\sqrt{u^2+v^2}$ (away from the zeros  of $f$), then
$$
|f|_x=\frac{u_x+v_x}{\sqrt{u^2+v^2}}\Rightarrow |f|_{xx}=\frac{(u_{xx}+v_{xx})|f|-\frac{(u_x+v_x)^2}{|f|}}{|f|^2}\Rightarrow
$$
$$
|f|_{xx}=\frac{u_{xx}+v_{xx}}{|f|}-\frac{(u_x+v_x)^2}{|f|^3}.\tag 2
$$
In the same way
$$
|f|_{yy}=\frac{u_{yy}+v_{yy}}{|f|}-\frac{(u_y+v_y)^2}{|f|^3}.\tag 3
$$
Hence using $u_{xx}+v_{yy}=0$, $v_{xx}+v_{yy}=0$ and equations (1), we get
$$
\Delta|f|=|f|_{xx}+|f|_{yy}=-\frac{1}{|f|^3}\left((u_x+u_y)^2+(u_y-u_x)^2\right)=-2|f|^{-3}\left((u_x)^2+(u_y)^2\right).\tag 4
$$
Hence
$$
\Delta|f|=0\textrm{ iff }(u_x=u_y=v_x=v_y=0)\textrm{ iff }f=const.\tag 5
$$
In case that $f(z)$ is zero in a set $A$, then $A$ will be discrete and from (5) constant in $\textbf{C}-A$. Hence $f(z)$ zero everywhere.


问:
Help with truth statements "For all $x \in \varnothing, p(x)$" and "$\exists x \in \varnothing, p(x)$ "
Why is the statement "For all $x \in \varnothing, p(x)$" always true, and why is the statement "$\exists x \in \varnothing, p(x)$ always false for a statement $p(x)$ that depends on $x$?

答:
I think this case is easiest to understand if we consider the quantifier $\exists$ first, and then define $\forall$ in terms of $\exists$.

Let $S$ be a non-empty set.

We can make the following claim and justify it intuitively.

$$ \exists x : S \mathop. \varphi(x) \;\;\text{if and only if}\;\; \{ x :x\in S \land \varphi(x) \} \ne \emptyset $$

In prose, (there exists an $x$ in S such that $\varphi(x)$) if and only if (the set of all $x$s such that $x$ is in $S$ and $\varphi(x)$ is nonempty).

Let's extend this formula to the case where $S$ is empty.

$$ \{ x : x \in \emptyset \land \varphi(x) \} \ne \emptyset $$

However, $x \in \emptyset$ is never true, therefore this expression simplifies to

$$ \emptyset \ne \emptyset $$

which is false. Thus

$$ \exists x : \emptyset \mathop. \varphi(x) \;\;\text{is never true}$$

Next, we think about what forall means, then we can define it in terms of existence.

$$ \forall x : S \mathop. \varphi(x)  \;\;\text{if and only if}\;\;  \lnot \exists x : S \mathop. \lnot \varphi(x)$$

In prose, $\varphi$ is true for all $x$ in $S$ if and only if there does not exist an $x$ in $S$ such that $\varphi$.

If we apply this definition, then we get that forall, when quantified over the empty set, is true.

$$ \forall x : S \mathop. \varphi(x) $$
$$ \lnot \exists x : S \mathop. \lnot \varphi(x) $$
$$ \lnot \bot $$
$$ \top $$


问:
limit of $e^z$ at $\infty$
What's the limit of $e^z$ as $z$ approaches infinity?

I am given that the answer is "There is no such limit."

Is this correct, and if so, am I correct to demonstrate this by showing that as $y$ tends to infinity along the $y$-axis, the magnitude of $e^z$ remains $1$, i.e. it doesn't have infinite magnitude, thus it cannot be tending to infinity? And does this mean $e^z$ has an essential singularity at infinity?

答:
Use the fact: $f$ has a pole of order $k$ at $z=z_0$ if and only if
$$
\lim_{z\to z_0}(z-z_0)^k f(z)=L(\ne 0).
$$

Relpacing $z$ by $\frac 1 z$ and consider the function $f(z)=e^{\frac 1 z}$.
For each $k=0, 1, 2, \ldots $, the limit
$$
\lim_{z\to 0}z^ke^{\frac 1 z}
$$
does not exist (it suffices to check when $z$ is real).

Thus, $f$ has no poles(including removeable singularity) at the origin, and has essential singularity at the origin.
(or more simply, it can be checked by expanding $f$
as Laurent series-using taylor series formula).

Therefore, $e^z$ has an essential singularity at $\infty$.

Title: limit of $e^z$ at $\infty$


Title: How to simplify absolute value expressions such as: $|x+1|+|x-1|$ algebraically?

Body:
After plotting this function on desmos, I understood that this absolute expression is actually a piecewise function.

Hence this: $$f(x)=|x+1|+|x-1|$$is the same as
$$f(x)=\left\{\begin{align}2x\quad&\text{if }x>1\\-2x\quad &\text{if }x<-1\\2\quad &\text{if}-1<x<1\end{align}\right.$$

But is there a way to do this algebraically instead of plotting?

Body:
We know $f(x) \geq 0$.

And,
$$
\begin{align}
\{f(x)\}^2
& = (x+1)^2 + (x-1)^2 + 2 \lvert x + 1 \rvert \cdot
\lvert x - 1 \rvert \\
& = 2(x^2 + 1) + 2 \lvert x^2 - 1 \rvert \\
& = \begin{cases} 2(x^2 + 1) + 2(x^2 - 1) = 4x^2 ~~~~~ \text{if } x^2 \geq 1, \\
2(x^2 + 1) - 2(x^2 -1) = 4 ~~~~~ \text{if } x^2 \leq 1.
\end{cases}
\end{align}
$$

Because $f(x) \geq 0$, hence,

$$
f(x) =
\begin{cases} 2|x| ~~~~~ \text{if } |x| \geq 1, \\
2 ~~~~~ \text{if } |x| \leq 1.
\end{cases}
$$


答:
$$L=\lim_{n\to\infty}\frac{\left(r-1\right)}{n}\sum_{j=r}^{n}\frac{n}{j-1}\left(\frac{1}{n}\right)$$
$$L=\lim_{n \to \infty}\frac{(r-1)}{n}\sum_{j=r}^{n}\frac{n}{j-1}\left(\frac{1}{n}\right)=\lim_{n \to \infty}\frac{(r-1)}{n}\int_{r/n}^{1}\frac{dx}{x}=\lim_{n \to \infty}\frac{(r-1)}{n}\ln(n/r)=0.$$
Lastly L-Hospiltal rule has been used.

Title: Convert Riemann Sum into definite integral

Body:
I have the equation $$\lim_{n\to\infty}\frac{\left(r-1\right)}{n}\sum_{j=r}^{n}\frac{n}{j-1}\left(\frac{1}{n}\right)$$
which is converted to a definite integral using x as the limit of (r-1)/n, t for (i-1)/n and dt for 1/n

$${x\int _{x}^{1}{\frac {1}{t}}\,dt}.$$

I can only make sense of this intuitively but cannot convert it myself. Can someone show me the step by step process of how they converted the equation using the appropriate substitutions of a and b in the following equation.

$${\int _{x=a}^{b}{f(x)}\,dx}=\lim_{n\to\infty}\sum_{j=1}^{n}f\left(a+\frac{b-a}{n}j\right)\frac{b-a}{n}.$$

One of the main things confusing me is that j is not equal to 1 or 0 unlike typical Riemann sums. Any help will be greatly appreciated!


问:
Divergence of a vector tensor product/outer product: $ u \bullet \nabla u = \nabla \bullet (u \otimes u) $
I'm currently studying the derivation of the RANS (Reynolds Averaged Navier Stokes) equations, used in the study of turbulence, and I've stumbled upon a step wich I don't understand very well.

The problem is on the following identity (one of the steps of the formal derivation of the RANS equations, present in many online texts):

$$ u \bullet \nabla u = \nabla \bullet (u \otimes u) $$

, where $ u = \{ u \; v \; w \} $ is a 3D vector and $ u \otimes u $ is the tensor dot product / outer product of vector $u$ by itself:

$$ u \otimes u =
        \begin{pmatrix}
        u^2 & uv & uw \\
        vu & v^2 & vw \\
        wu & wv & w^2 \\
        \end{pmatrix}
$$

My question is: where can I find a proof of the previous equality?

When I try to derive it by hand I don't end up with the result above (I'm probably commiting an error somewhere).

Can someone derive it (in a simple way) here by hand?

I've searched online, but I haven't found anything this specific.

答:
You can use Einstein's summation
$$ \nabla \cdot (u \otimes u ) = \dfrac{\partial}{\partial x_j} (u_i u_j) = u_i \dfrac{\partial}{\partial x_j} (u_j) + u_j \dfrac{\partial}{\partial x_j} (u_i) = u(\nabla \cdot u) + u \cdot \nabla(u) $$
Using these rules:

Gradient of vector $\vec{V}$: $\boxed{\nabla V = \dfrac{\partial}{\partial x_j} (V_i)}$

Divergence of vector $\vec{V}$: $\boxed{\nabla \cdot V = \dfrac{\partial}{\partial x_j} (V_j)}$

Divergence of tensor(Rank 2) $V_{ij}$: $\boxed{\nabla \cdot V_{ij} = \dfrac{\partial}{\partial x_j} (V_{ij})}$

And in case of incompressible flow, $\nabla \cdot u = 0$
$\implies \nabla \cdot (u \otimes u ) = u \cdot \nabla(u)$

PS : In the derivation of RANS equations, we know the all-important term is the Reynolds Stress Term ($-\overline{u' \otimes u'}$). To derive this term, it's easier to use the conservation form $(\nabla \cdot (u \otimes u ))$ rather than the convective form $(u \cdot \nabla(u))$ although both are identical for incompressible flow


答:
The way to see this is as follows: you must observe that
$$|f(x)| = \begin{cases}
f(x), & f(x) \geq 0 \\
-f(x), & f(x) < 0\text{.}
\end{cases}$$
It does not matter where the equality sign goes (i.e., $\geq$ as opposed to $>$, or $<$ as opposed to $\leq$) in the vast majority of situations.

We thus have
$$|x + 1| = \begin{cases}
x + 1, & x + 1 \geq 0 \\
-(x+1), & x + 1 < 0
\end{cases} = \begin{cases}
x + 1, & x \geq -1 \\
-x - 1, & x < -1
\end{cases}$$
$$|x - 1| = \begin{cases}
x - 1, & x - 1 \geq 0 \\
-(x - 1), & x - 1 < 0
\end{cases} = \begin{cases}
x - 1, & x \geq 1 \\
-x + 1, & x <1\text{.}
\end{cases}$$
Next, we must add these functions together.

First, observe that $|x + 1|$ is defined piecewise over the intervals $(-\infty, -1)$ and then $[-1, \infty)$. These are indicated by the blue and red below respectively.

For $|x - 1|$, we must look at $(-\infty, 1)$ and then $[1, \infty)$. These are indicated by the orange and green below respectively.

Apologies for my art skills.

Given the above, it is clear that the sum of $|x + 1|$ and $|x- 1|$, as a piecewise function, must have three components:

The blue-orange one, in $(-\infty, -1)$

The red-orange one, in $[-1, 1)$

The red-green one, in $[1, \infty)$.

The blue-orange component is when $x < -1$, or $|x + 1| = -x - 1$ and $|x - 1| = -x + 1$. Thus the sum of these is $-x - 1 + (-x + 1) = -2x$.

The red-orange component is when $-1 \leq x < 1$, or $|x + 1| = x + 1$ and $|x - 1| = -x + 1$. Thus the sum of these is $x + 1 + (-x + 1) = 2$.

The red-green component is when $x \geq 1$, or $|x + 1| = x + 1$ and $|x - 1| = x - 1$. Thus the sum of these is $x + 1 + (x - 1) = 2x$.


答:
$$v'^2=-\frac{1}{3}v^3+v^2 \implies v'=\pm(v^2-v^3/3)$$
$$\implies \int\frac{dv}{\sqrt{v^2-v^3/3}}=\pm \int dx \implies \int \frac{dv}{v\sqrt{1-v/3}}=\pm x+C.$$
Let $1-v/3=u^2$, then
$$\int \frac{-2du}{1-u^2}=C \pm x \implies \ln \frac{u-1}{u+1}=C\pm x$$
$$\implies u=\frac{1+e^{C\pm x}}{1-e^{c\pm x}}\implies u=-\coth [(C\pm x)/2].$$
$$\implies v(x)=-3 \text{csch}^2(C\pm x)/2]$$
Since $C$ is arbitrary: $$v(x)=-3\text{sech}^2(C\pm x)/2].$$ can also be a solution.

Title: Solve Nonlinear Differential Equation $v^2_y = -\frac{1}{3}v^3 + cv^2$

Body:
I want to know how to solve the above equation.
The equation comes about when reducing a PDE by finding the symmetries of the PDE and then applying one of them.
I want to understand how the solution is found.
The answer given is
$$
v = 3c \frac{1}{\cosh ^2 \left[\frac{1}{2}\sqrt{cy} + \delta \right]}
$$

(I had to use the $\frac{1}{\cosh}$ as \sech is not recognised.)


答:
The rejection criterion is $\Pr_\theta[X \ge k_\alpha] \le \alpha$, and since under the null hypothesis, $X$ is binomial with $\theta = \frac{1}{2}$, this probability is given by the sum $$\Pr[X \ge k_\alpha \mid \theta = 1/2] = \sum_{x=k_\alpha}^n \binom{n}{x} \theta^x (1 - \theta)^{n-x} = \frac{1}{2^n} \sum_{x = k_\alpha}^n \binom{n}{x} = \frac{1}{2^{10}} \sum_{x = k_\alpha}^{10} \binom{10}{x} \le \alpha.$$  When we calculate this sum for various choices of $k_\alpha$, we get the table $$\begin{array}{c|c|c}
k_\alpha & \Pr[X = k_\alpha \mid \theta = 1/2] & \Pr[X \ge k_\alpha \mid \theta = 1/2] \\
\hline
10 & \frac{1}{1024} & \frac{1}{1024} \approx 0.000976563 \\
9 & \frac{10}{1024} & \frac{11}{1024} \approx 0.0107422 \\
8 & \frac{45}{1024} & \frac{56}{1024} \approx 0.0546875 \\
7 & \frac{120}{1024} & \frac{176}{1024} \approx 0.171875 \\
\vdots & & \\
\end{array}$$
and the rightmost column are the values given in the problem.  The problem then is that the rejection criterion $X \ge 8$ cannot be used because the resulting Type I error is slightly too large (by about $0.0046875$) for a test of size $\alpha$; but the criterion $X \ge 9$, while resulting in a level $\alpha$ test, would have less power to reject the null than a test of size $\alpha$, because in some cases, when the truth is $\theta > 1/2$ and we should reject the null, we cannot because we might observe only $X = 8$ and the criterion requires $X \ge 9$.

So the remedy that is proposed is to employ a randomization step to determine when to reject the null when $X = 8$, in such a way that the size of the test is exactly equal to $\alpha$.  To do this, the example proposes to reject with some probability $p < 1$ when $X = 8$.  This is the "flip a coin" scenario they describe.  Now, it makes sense that, because the rejection region $X \ge 8$ is only slightly larger than $\alpha$, when we observe $X = 8$, we should be okay to reject the null most of the time, but not all of the time.  In other words, $p$ should be closer to $1$ than to $0$.  To determine exactly what value $p$ should be so that the Type I error is exactly $0.05$, we need to go back to the table and observe that the rightmost column is formed by cumulatively adding up the second column--i.e., this is a running total.  So the required value of $p$ is the one for which when we add $p$ times the probability of $X = 8$ to the running total, we get $0.05$; that is to say, $$\frac{1}{1024} + \frac{10}{1024} + \frac{45}{1024} p = 0.05 = \frac{1}{20}.$$  Solving this gives the claimed $$p = \frac{67}{75}.$$  So when we see $X = 8$, we flip that coin and reject the null with probability $67/75$, and the resulting Type I error is exactly $0.05$.

However, this sort of procedure, while theoretically sound, certainly should cause the statistician some degree of discomfort.  After all, the sample contained all the evidence that we had about $\theta$, and that sample does not change within a given experiment.  Yet, depending on the outcome of a random coin toss, one that has nothing to do with the underlying process that generated the sample itself, we make a decision about whether to reject the null.  This hardly seems "reasonable" from the perspective of making a statistical inference.  Another way to understand this is, if you conducted the experiment for $n = 10$ and found $X = 8$, and I conducted my own experiment with $n = 10$ and also found $X = 8$, you might, on the basis of the same evidence, conclude that $\theta > 1/2$ but I might not make that conclusion because my coin toss outcome was not the same as yours.  Yet the coin has nothing to do with the experiment that generated the outcome $X = 8$ in both cases.  This is why we do not see such randomized testing procedures commonly performed.

Title: Question about test function

Body:
I'm reading this book and on page 66, the author gives this example about hypothesis testing:

I don't understand why the author has defined the test function in this way. Why did he choose $\phi(8)=67/75$? Why the size is exactly 0.05?


问:
How many $8$-digit numbers do not contain the string $55555$?
I'm having a little trouble figuring out this exercise.

Consider an $8$-digit number. How many numbers do not contain even numbers? How many numbers do not contain the string $55555$?

For the first part I've worked out that since there are only $5$ odd numbers $\{1,3,5,7,9\}$ and a total of $8$ digits the answer is $5^8$, but I don't know how to tackle the second part.

答:
Edit

First see (all) of the comments following this answer, especially the comments of N.F. Taussig.  I overlooked a required subtlety of my approach.  I have edited my answer accordingly.

Further, since this subtlety is required by my approach, it is now unclear to me whether Inclusion-Exclusion is more appropriate.

The computation is $T - F$ where $T$ is the total number of 8 digit numbers possible and $F$ is the total number of 8 digit numbers possible that contain "$55555$".

This problem has two wrinkles:

Can the leftmost digit = $0$?

Should Inclusion-Exclusion be used.

I will start with the arbitrary interpretation that the leftmost digit can be $0$.  Then, at the end of my answer, I will adjust, in case this interpretation is outlawed.  Although Inclusion-Exclusion is plausible, simplest approach (edit: ??) is to stay with mutually exclusive cases.

$$T = 10^{8}.$$

To compute $F$, I will compute $F_5, F_6, F_7,$ and $F_8$, where $F_k$ denotes how many 8 digit numbers have exactly $k$ $5$'s and have a block of "$55555$".

Then, $$F = F_5 + F_6 + F_7 + F_8.$$

Clearly, $$F_8 = 1.$$

For $F_7$, the gapped digit may not be the 4th or 5th digit (from the left), since the block of "$55555$" must occur.  Therefore,

$$F_7 = 6 \times 10^1.$$

Edit

The above computation for $F_7$ is wrong, since it overlooks that $F_7$ represents having exactly seven $5$'s.  The correct computation here is

$$F_7 = 6 \times 9^1.$$

For $F_6$, the following locations of the non-5 digits are permissible:

$\{(1,2), (1,3), (1,7), (1,8), (2,3), (2,8), (6,7), (6,8), (7,8)\}$

Therefore,

$$F_6 = 9 \times 10^2.$$

Edit

The above computation for $F_6$ is wrong, since it overlooks that $F_6$ represents having exactly six $5$'s.  The correct computation here is

$$F_6 = 9 \times 9^2.$$

For $F_5$, the string of "$55555$" must begin on digit positions $1,2,3$ or $4$.

Therefore,

$$F_5 = 4 \times 10^3.$$

Edit

The above computation for $F_5$ is wrong, since it overlooks that $F_5$ represents having exactly five $5$'s.  The correct computation here is

$$F_5 = 4 \times 9^3.$$

If leftmost digit can not be $0$:

Edit

In this section, I apply all of the editing needed, without elaboration, re $F_k$ represents the situation where exactly $k$ $5$'s are present.

The first adjustment is

$$T = 9 \times 10^7.$$

For $F_8$, no adjustment is necessary.

For $F_7$, if the gapped digit is the 1st digit from the left, then there are only 8 choices for the 1st digit (i.e. the first digit can not be a $0$ or a $5$).  If instead, the gapped digit is any of digit positions $2,3,6,7,8$, then in each case, there are 9 possible digits for the gapped position.

Therefore $$F_7 = 8 + (5 \times 9) = 53.$$

For $F_6$, of the 9 permissible locations for the non-5 digits, 4 of the 9 involved the 1st digit.  When the first digit is involved, there are only ($8 \times 9 = 72$) possibilities, instead of ($9^2$).

Therefore, $$F_6 = (4 \times 72) + (5 \times 81).$$

For $F_5$, if the leftmost digit occurs in the 1st slot, the enumeration of $(9^3)$ stands.  If it begins in the 2nd, 3rd, or 4th slot, then the enumeration becomes $8 \times 9^2.$

Therefore $$F_5 = 729 + (3 \times 648).$$


问:
How can I find $6N^2 + 3NS + S^2 - 21N -61$, without finding N and S itself?
Let $N$ and $S$ be the roots of $A(D) = 5D^2 - 21D - 61$. How can I find $6N^2 + 3NS + S^2 - 21N -61$, without finding N and S itself?
I know how to get $N^2 + S^2$ from $(N+S)^2 - 2(NS)$ via Vieta's formulas but that's about it, I'm not sure how to proceed from here.

Body:
As you mentioned we can apply:

$(N+S)^2=N^2+S^2+2NS$

$5D^2-21D-61=0$ $\rightarrow D^2-\frac{21}5 D-\frac {61}5=0$

$N+S=\frac{-21}5$ and $NS=\frac{-61}5$

$N^2+S^2+2NS=(\frac {21} 5)^2=\frac{441}{25}$

$5N^2-21N-61=0$

Summing these relations we get:

$6N^2+3NS+S^2-21N-61=\frac{441}{25}-\frac{61}{5}=\frac{197}{25}$


问:
Differential equations math help?
I have the equation $y' \sin x=y \ln y$. I told my teacher that we can solve if with separate variables method but he told me that we cant do that. He didn't explain why. Can you tell me why?</p>

答:
I have no idea what your teacher is at.  If by separation of variables, you mean

$$\frac{dy}{y \ln{y}} = \frac{dx}{\sin{x}}$$

Then you are on the right track here.  Integrating both sides, you get

$$\ln{\ln{y}} = \int \frac{dx}{\sin{x}} = -\ln{(\csc{x}+\cot{x})} + C$$

Title: Differential equations math help?


问:
Proof: if for each $v \in V$ there is an element $c_v \in K$ such that $g(v) = c_vf(v)$, then there is $c \in K$ for which $g = cf$
$V$ and $W$ are linear spaces over the field $K$ and $f, g : V → W$ are linear transformations.

Prove that if for each $v \in V$ there is an element $c_v \in K$ such that $g(v) = c_vf(v)$, then there is $c \in K$ for which $g = cf$

I find that proof interesting. As I understand the thing is: if for every vector in space $V$ there is an element in $K$ that makes two linear transformations equal for that particular vector then in that field, there is an element that makes those two linear transformations equal for every vector of field $K$. Is that correct? Can I have a hint for this one?

答:
Consider $u,v \in V$.  We want to show that $c_u=c_v$ (why?).  There's a trivial case where either $f=0$ or $g=0$ (the zero map), which I'll leave you to deal with.  So assume that $f$ and $g$ are non-trivial, and WLOG suppose $f(u),g(u)\neq 0$.

We know that $g(v) = c_v f(v)$, $g(u) = c_u f(u)$, and $$g(v+u) = c_{v+u} (f(v)+f(u)) = c_v f(v) + c_u f(u)$$
If $f(u)$ and $f(v)$ are linearly independent, then the above implies $c_v = c_{v+u} = c_u$, as desired.

If $f(u)$ and $f(v)$ are linearly dependent, then $f(v) = \lambda f(u)=f(\lambda u)$ for some $\lambda$.  So
$$
\begin{align*}
g(v) & = g(v-\lambda u + \lambda u) \\
& = g(v-\lambda u) + \lambda g(u) \\
& = c_{v-\lambda u} f(v-\lambda u) + \lambda c_u f(u) \\
& = 0 + c_u \lambda f(u) \\
& = c_u f(v)
\end{align*}
$$


答:
Plotting can give hints on what to do, but they're not conclusive.

The especially interesting points for $|f(x)|$ are those where $f$ “changes sign". In your case you have two of them, namely $-1$ and $1$.

So you can start to see what happens when $x<-1$: here we have $x+1<0$ and also $x-1<0$, so
$$
f(x)=-(x+1)-(x-1)=-2x
$$
When $-1\le x\le 1$, we have $x+1\ge0$ and $x-1\le 0$, so
$$
f(x)=(x+1)-(x-1)=2
$$
When $x>1$, we have $x+1>0$ and $x-1>0$, so
$$
f(x)=(x+1)+(x-1)=2x
$$
Conclusion:
$$
f(x)=\begin{cases} -2x & x<-1 \\[6px] 2 & -1\le x\le 1 \\[6px] 2x & x>1 \end{cases}
$$
Where to put the special points? Don't worry, it's irrelevant. You could as well divide the cases into
$$
x\le -1 \qquad -1<x<1 \qquad x\ge 1
$$
and the function wouldn't change, of course.


问:
Question about continuity of a function from $\Bbb R^2$ to $\Bbb R.$

Consider the function $f : \Bbb R^2 \longrightarrow \Bbb R$ defined by $$
f(x,y) = \left\{
        \begin{array}{ll}
            \frac {x^4y} {\sqrt {x^6 + y^3}} & \quad \text {if}\ (x,y)  \neq (0,0) \\
           \  0 & \quad \text {if}\ (x,y) = (0,0).
        \end{array}
    \right.
$$
Prove that $f$ is not continuous at $(0,0).$

I have tried by taking the paths $y = mx^2,$ for different values of $m$ for approaching towards $(0,0).$  But along all such paths the double limits as $(x,y) \to (0,0)$ are zero. Which paths should I take then? Any help will be appreciated.

Thanks in advance.

答:
This may be easier to see if we rewrite the function with the sum of cubes formula

$$\frac{x^4y}{\sqrt{x^2+y}\sqrt{x^4-x^2y+y^2}}$$

Given that the function is not defined on $x^2+y=0$, use the path $x^2+y = x^n$ for some $n>2$

$$f(x,x^n-x^2) = \frac{x^{4+n}-x^6}{\sqrt{x^{3n}-3x^{2n+2}+3x^{n+4}}} = \frac{x^6}{x^{2+\frac{n}{2}}}\frac{x^{n-2}-1}{\sqrt{x^{2n-4}-3x^{n-2}+3}}$$

which goes to $-\frac{1}{\sqrt{3}}$ when $n=8$


问:
Is this correct arguing?
Is this correct to conclude this way?

Premise $\neg p$

Premise $(\neg p \vee q) \to r$

Therefore $\neg p \wedge (\neg p \vee q) \to r$

Therefore $\neg p \to r$

答: Yes, you are allowed to jump from step 3 to step 4, because the 2nd premise says that if either constraint $\neg p$ or $q$ is satisfied, then $r$ is implied.  In step 3, focusing on the left hand side, you notice that $\neg p$ is a premise.  Therefore, one of the constraints in premise 2 is satisfied, so the implication holds.

Title: Is this correct arguing?


问:
Lifting a homeomorphism $X/G\to X/H$ preserving generators
I have the following problem (in some slightly different context, but I think it works here too):

Suppose we have $G$ and $H$ two cyclic infinite subgroups of the homeomorphisms of $\mathbb{R}^n$, say $G=\{\alpha^k\}_{k\in\mathbb{Z}}, H=\{\beta^\ell\}_{\ell\in\mathbb{Z}}$, which act freely and properly discontinously on $\mathbb{R}^n$ such that both projections $\pi:\mathbb{R}^n\to\mathbb{R}^n/G$ and $\pi':\mathbb{R}^n\to\mathbb{R}^n/G$ are covering maps.

Moreover, suppose we have an homeomorphism $f:\mathbb{R}^n/G\to\mathbb{R}^n/H$. Then, I know that, as $\mathbb{R}^n$ is simply-connected, I can lift $f\circ\pi:\mathbb{R}^n\to\mathbb{R}^n/H$ to a function $\tilde{f}:\mathbb{R}^n\to\mathbb{R}^n$ such that $\pi'\circ \tilde{f}=f\circ\pi$. Moreover, using $f^{-1}$ we can see that $\tilde{f}$ is an homeomorphism

Problem: I have to prove that the generator $\alpha$ goes to $s_{\alpha}$ where $s_{\alpha}$ is a generator of $H$, i.e. $s_{\alpha}=\beta$ or $\beta^{-1}$. More explicitly, $\pi'\circ \tilde{f}(\alpha x)=f\circ \pi(\alpha x)=f\circ \pi(x)=\pi'\circ \tilde{f}(x)$ so $\tilde{f}(\alpha x)=\beta^k \tilde{f}(x)$. I have to prove that $k=\pm 1$.

I tried to prove that there is an isomorphism between $G$ and $H$ given by $\varphi(\alpha^k)=\beta^\ell$ where $\ell$ is the only that satisfies $\tilde{f}(\alpha^k x)=\beta^\ell \tilde{f}(x)$ but I couldn't succeed.

Any help is welcome.

答:
The following feels overcomplicated, but it should do what you want as I understand your question.

For $y \in \mathbb{R}^n$, applying $\pi' \circ \tilde{f}$ to $y$ and $\alpha(y)$ gives
$$\{\beta^{\ell_1}(\tilde{f}(y)) : \ell_1 \in \mathbb{Z}\} = \{\beta^{\ell_2}(\tilde{f} \circ \alpha(y)) : \ell_2 \in \mathbb{Z}\}.$$
Thus for all $x \in \mathbb{R}^n$, there exists some $\ell \in \mathbb{Z}$ such that $\beta^\ell(x) = \tilde{f} \circ \alpha \circ \tilde{f}^{-1}(x)$. Set
$$E_\ell := \{x \in \mathbb{R}^n : \beta^\ell(x) = \tilde{f} \circ \alpha \circ \tilde{f}^{-1}(x)\}.$$
Clearly $E_\ell$ is closed. We've just shown $\cup_\ell E_\ell = \mathbb{R}^n$. Since $\beta$ acts freely, the $E_\ell$ are also disjoint. It is a fact that the only way to write $\mathbb{R}^n$ as a countable union of disjoint closed sets is the trivial way, so some $E_\ell = \mathbb{R}^n$.  Hence $\beta^\ell = \tilde{f} \circ \alpha \circ \tilde{f}^{-1}$ for some $\ell \in \mathbb{Z}$.

Symmetrically, $\alpha^k = \tilde{f}^{-1} \circ \beta \circ \tilde{f}$ for some $k \in \mathbb{Z}$. Hence $\beta^{\ell k} = (\beta^\ell)^k = \beta$. Again since $\beta$ is free, this forces $\ell k = 1$, so $\ell = k \in \{\pm 1\}$, i.e. $\beta^{\pm 1} = \tilde{f} \circ \alpha \circ \tilde{f}^{-1}$.


问:
Finding Remainder when N is divided by 99.
Consider the number $N = 1222233333333344\cdots$ (1000 digits). Find the remainder when $N$ is divided by $99$.

MY WORK :-
for a number to be divisible by 99 it must be divisible by 9 and 11.
for $N$ to be divisible by 9, the sum must be divisible by 9; and the sum of all the digits is :
$$1 * 1 + 2 * 4 + 3 * 9 + \cdots =
                         1 + 8 + 27 +\cdots$$
Basically sum of cubes.

答:
Hint:

As you say, for a number to be divisible by $9$, the sum of its digits must be divisible by $9$, but actually there is a stronger result: the original number and the sum of the digits have the same remainder when divided by $9$.

There is a similar divisibility test for $11$, but it uses the difference between the sums of alternate digits. For example, $6789$ has the same remainder when divided by $11$ as $(9+7)-(8+6)$ does.

If you know the remainders when divided by $9$ and $11$, you can deduce the remainder for $99$ (by the Chinese remainder theorem).


问:
$\operatorname{int}_ {\tau_1}(A) \subseteq\operatorname{int}_{\tau_2}(A) $ and $ \overline{A}^{\tau_1} \supseteq\overline{A}^{\tau_2}$
Let $\tau_1$ and $\tau_2 $ topologies over a set $X$ such that $ \tau_1 \subseteq \tau_2 $. Show that for every $ A \subseteq X $, you have to $\operatorname{int}_{\tau_1}(A) \subseteq \operatorname{int}_{\tau_2}(A)$ and $\overline{A}^{\tau_1} \supseteq \overline{A}^{\tau_2}$.

答:
$\operatorname{int}_{\tau_1}(A)$ is a $\tau_2$-open subset of $A$ by the inclusion of topologies. $\operatorname{int}_{\tau_2}(A)$ is the maximal $\tau_2$-open subset of $A$. The inclusion follows.

$\overline{A}^{(\tau_1)}$ is a $\tau_1$-closed hence also $\tau_2$-closed superset of $A$. $\overline{A}^{(\tau_2)}$ is the minimal $\tau_2$-closed superset of $A$. The inclusion follows.


问:
How to generalize the Euclidean "unicycle" model?
There is a common system of ODEs known as the unicycle model / Dubin's model which describes the kinematics of an ant-like "unicycle" that can drive forward with some velocity $v(t) \in \mathbb{R}$ and turn in-place with some angular velocity $\omega(t) \in \mathbb{R}$ about the ground normal. The position of the unicycle / ant is described by $\big{(}x(t), y(t)\big{)} \in \mathbb{R}^2$ and its orientation is described by its "heading" angle $\ \theta(t) \in \mathcal{S}^1$.

\begin{align}
\dot{x} &= v\cos(\theta)\\[2pt]
\dot{y} &= v\sin(\theta)\\[2pt]
\dot{\theta} &= \omega
\end{align}

These equations rely on the ant traversing a flat 2D plane. I have been thinking a lot about how to generalize this simple model to an arbitrarily curved (but smooth) 2D surface.

We can imagine the infinity of geodesics that intersect $\big{(}x(t_0), y(t_0)\big{)}$. Then $\theta(t_0)$ essentially picks one of those geodesics. While $v > 0$ and $\omega = 0$, the ant moves what it thinks is "straight forward." It will follow the same geodesic until it chooses to turn ($\omega \neq 0$) onto a different geodesic.

Suppose our smooth surface is defined by an injective function that embeds it in 3D Euclidean space:
$$
r : \mathbb{R}^2 \to \mathbb{R}^3\ ,\ \ \ r(x,y) = \begin{bmatrix} \bar{x}(x,y) \\ \bar{y}(x,y) \\ \bar{z}(x,y) \end{bmatrix}
$$

We have its Jacobian and any necessary higher partial derivatives as well:
$$
J(x,y) := \begin{bmatrix}\frac{\partial r}{\partial x}(x,y)\,\ \frac{\partial r}{\partial y}(x,y)\end{bmatrix} \in \mathbb{R}^{3 \times 2}
$$

The velocity vector is,
$$
\dot{r} = \dot{x}\frac{\partial r}{\partial x} + \dot{y}\frac{\partial r}{\partial y} = J \begin{bmatrix} \dot{x} \\ \dot{y} \end{bmatrix}
$$

The scalar velocity $v$ in the flat model would correspond to the magnitude of the velocity vector in the general model, i.e. $v = ||\dot{r}||$. Letting $\hat{\tau}$ be the direction of $\dot{r}$ we can write,
$$
\dot{r} = v\hat{\tau} = J \begin{bmatrix} \dot{x} \\ \dot{y} \end{bmatrix}
$$

Non-degeneracy of the surface-coordinates implies that $\frac{\partial r}{\partial x}$ is linearly independent of $\frac{\partial r}{\partial y}$. Thus, $J$ is full-column-rank. Left-multiplying the above by $J^\intercal$ and inverting yields,
$$
\begin{bmatrix} \dot{x} \\ \dot{y}\end{bmatrix} = v(J^\intercal J)^{-1}J^\intercal\hat{\tau} \tag{1}
$$

It's noteworthy that $J^\intercal J$ is the metric tensor in coordinates. This is almost the ODE I'd need for $\big{(}x, y\big{)}$, but $\hat{\tau}$ is undefined when evaluating the right-hand-side. I tried defining $\hat{\tau}$ in terms of some rotation $\theta$ of the surface gradients (with $\dot{\theta} = \omega$) and got cool but erroneous results:

$$
\text{This ^ uses Eq.1 with:}\ \ \ \ \hat{\tau} = \cos(\theta)\frac{\frac{\partial r}{\partial x}}{\big{|}\big{|}\frac{\partial r}{\partial x}\big{|}\big{|}} + \sin(\theta)\frac{\frac{\partial r}{\partial y}}{\big{|}\big{|}\frac{\partial r}{\partial y}\big{|}\big{|}}
,\ \ \ \ \dot{\theta}=\omega$$
The error is that for $\omega = 0$ and $v \neq 0$, holding $\hat{\tau}$ some fixed $\theta$ away from a gradient direction doesn't cause the ant to move along a geodesic. Moreover, it doesn't make sense for $\theta=0$ to yield a $\frac{\partial r}{\partial x}$-follower... $\hat{\tau}$ really needs to be parallel-transported along the surface. Parallel-transport is a statement about how tangent vectors (e.g. $\dot{r}$) change, so we need to examine acceleration.

If the ant never turned or varied speed, then its acceleration would be strictly normal to the surface (acceleration just due to curvature):
\begin{gather}
\langle \frac{\partial r}{\partial x}, \ddot{r} \rangle \ \ \overset{\dot{v}=\omega=0}{=}\ \ 0\\[3pt]
\langle \frac{\partial r}{\partial y}, \ddot{r} \rangle \ \ \overset{\dot{v}=\omega=0}{=}\ \ 0
\end{gather}

The left-hand-side can be expressed more compactly as $J^\intercal \ddot{r}$. Expanding $\ddot{r}$,
\begin{align}
\ddot{r} &= J \begin{bmatrix} \ddot{x} \\ \ddot{y} \end{bmatrix} + \dot{J} \begin{bmatrix} \dot{x} \\ \dot{y} \end{bmatrix}\\[4pt]
J^\intercal \ddot{r} &= J^\intercal J \begin{bmatrix} \ddot{x} \\ \ddot{y} \end{bmatrix} + J^\intercal \dot{J} \begin{bmatrix} \dot{x} \\ \dot{y} \end{bmatrix} \ \ \overset{\dot{v}=\omega=0}{=}\ \ 0
\end{align}

and finally left-multiplying by the inverse metric tensor $(J^\intercal J)^{-1}$,
$$
\begin{bmatrix} \ddot{x} \\ \ddot{y} \end{bmatrix} + (J^\intercal J)^{-1} J^\intercal \dot{J} \begin{bmatrix} \dot{x} \\ \dot{y} \end{bmatrix} \ \ \overset{\dot{v}=\omega=0}{=}\ \ 0 \tag{2}
$$

This is the geodesic equation. The second term can be simplified with Christoffel symbols, but that isn't really necessary. $\dot{J} = \dot{x}\frac{\partial J}{\partial x} + \dot{y}\frac{\partial J}{\partial y}$ is just another computable function to me. I can use Equation 1 to convert some arbitrary initial $\hat{\tau}$ heading direction into an initial condition on $\big{(} \dot{x}, \dot{y} \big{)}$ and then integrate Equation 2 for the motion along the geodesic as long as $\dot{v} = \omega = 0$.

I suspect that to generalize this to the $\omega \neq 0$ and $\dot{v} \neq 0$ case, the right-hand-side will have to be some function of them rather than $0$. But what function? Edit: And how do we encode "heading" so that the ant can "stand still" when $v = 0$, and even turn "in-place" (about the normal)?

What (if any) ODE system describes the ant / unicycle moving on an arbitrary smooth 2D surface?
$$
\overset{?}{f}(x,y,\theta;v,\omega,r) = 0
$$

where $f$ can involve any derivatives up to second-order. Thanks in advance! :)

Addendum

The answer given by Kajelad below seems correct! Though for posterity I would like to add an elaboration of that answer here, using notation consistent with the above and providing more motivation / steps.

First lets define the Frenet-Serret basis:
$$
\hat{\tau} := \frac{\dot{r}}{||\dot{r}||},\ \ \ \ \hat{\eta} := \frac{\frac{\partial r}{\partial x} \times \frac{\partial r}{\partial y}}{\big{|}\big{|}\frac{\partial r}{\partial x} \times \frac{\partial r}{\partial y}\big{|}\big{|}},\ \ \ \ \hat{\beta} := \hat{\eta} \times \hat{\tau}
$$

These are the standard tangent, normal, and binormal vectors respectively ($\hat{\tau}$ being the same as I had previously defined) and they span $\mathbb{R}^3$ orthonormally at all points on the surface. Thus, the ambient acceleration vector can be expressed as some linear combination of them.
$$
\ddot{r} = a\hat{\tau} + b\hat{\beta} + c\hat{\eta}
$$

From the previous discussion, we know that if $\dot{v} = \omega = 0$, then $\ddot{r} = c\hat{\eta}$ will yield geodesic motion. Therefore $a$ and $b$ must depend multiplicatively on $\dot{v}$ and $\omega$. We also know that this must reduce to the traditional model in the Euclidean case. As we'll see, the correct relations are (rather intuitively),
$$
a = \dot{v},\ \ \ \ b = \omega v
$$

For clarity in the following algebra I'll define these shorthands,
$$
q := \begin{bmatrix} x \\ y \end{bmatrix},\ \ \ \ \tilde{J} := (J^\intercal J)^{-1}J^\intercal
$$

This makes our previous Eq.1 appear nicely as $\dot{q} = v\tilde{J}\hat{\tau}$, and we also have $\ddot{r} = J\ddot{q} + \dot{J}\dot{q}$. Thus,
$$
J\ddot{q} = \dot{v}\hat{\tau} + \omega v \hat{\beta} + c\hat{\eta} - \dot{J}\dot{q}
$$

Left-multiplying by $\tilde{J}$ not only cancels the leftmost $J$, but also kills the $c\hat{\eta}$ term because $J^\intercal \hat{\eta}=0$.
$$
\ddot{q} = \dot{v}\tilde{J}\hat{\tau} + \omega v \tilde{J}\hat{\beta} - \tilde{J}\dot{J}\dot{q} \tag{3}
$$

Next, lets define our generalization of "heading" as the unique vector $h(t) \in \mathbb{R}^2$ satisfying,
\begin{align}
\hat{\tau} &= Jh\\[4pt]
h &= \tilde{J}\hat{\tau} = \tfrac{1}{v} \dot{q}
\end{align}

This vector exists because $\hat{\tau}$ lives in the tangent space (the span of $J$). Furthermore, $\hat{\beta}$ also lives in the tangent space as a $90^\circ$ rotation about the normal from $\hat{\tau}$. Calling that transform $R^{\hat{\eta}}_{90^\circ} \in \mathbb{SO}3$, we have,
\begin{align}
\hat{\beta} &= R^{\hat{\eta}}_{90^\circ} \hat{\tau}\\[4pt]
\tilde{J} \hat{\beta} &= (J^\intercal J)^{-1} J^T R^{\hat{\eta}}_{90^\circ} J h \tag{$\hat{\tau} \to Jh$}\\[4pt]
&= \sqrt{|J^\intercal J|}(J^\intercal J)^{-1}\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}h\\[4pt]
&=: Rh
\end{align}

We can derive an ODE for $h$ by using the above relations to put Eq.3 in terms of $h$.
\begin{align}
\ddot{q} &= \dot{v}h + \omega v Rh - v\tilde{J}\dot{J}h\ \ \tag{$\tilde{J}\hat{\tau} \to h,\ \tilde{J}\hat{\beta} \to Rh,\ \dot{q} \to v h$} \\[4pt]
\dot{v}h + v\dot{h} &= \dot{v}h + \omega v Rh - v\tilde{J}\dot{J}h \tag{$\ddot{q} \to \dot{v}h + v\dot{h}$}\\[4pt]
\dot{h} &= \omega Rh - \tilde{J}\dot{J}h \tag{cancellations}
\end{align}

The $\dot{J}$ is still hiding a $\dot{q}$ dependence, so lets expand it in terms of the Hessian $H := \frac{dJ}{dq}$.
$$
\dot{J} = \dot{x}\frac{\partial J}{\partial x} + \dot{y}\frac{\partial J}{\partial y} =: H \odot \dot{q} = v H \odot h
$$

Finally, we arrive at,
$$
\dot{h} = \omega Rh - v\tilde{J}(H \odot h)h
$$

The rightmost-term can be simplified using Christoffel symbols, but that isn't critical as it is already something I can compute. This equation mirrors Kajelad's result:
$$
\dot{T}^i = \omega R^i{}_j T^j-v\Gamma^i{}_{jk}T^jT^k
$$

So in summary, the generalized model is:
\begin{gather}
\begin{bmatrix} \dot{x} \\ \dot{y} \end{bmatrix} = vh \tag{4}\\[4pt]
\dot{h} = \omega Rh - v(J^\intercal J)^{-1}J^\intercal(H \odot h)h \tag{5}\\[4pt]
R = \sqrt{|J^\intercal J|}(J^\intercal J)^{-1}\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} \tag{6}
\end{gather}
where heading $h(t) \in \mathbb{R}^2$, $J$ and $H$ are the embedded surface's Jacobian and Hessian respectively, and $v$ and $\omega$ are the specified ant/unicycle movements. This could be (more commonly) written in terms of the metric tensor ($J^\intercal J$) and Christoffel symbols (gradients of the metric tensor). The appeal of that form is that it's completely independent of any embedding of our surface $r$; only the metric tensor field is needed.

Note that the units are consistent ($H$ has units of inverse-space). In the Euclidean case, the Hessian vanishes and the ODE reduces to the classic model. Lastly, if $\omega = 0$, the $\dot{h}$ equation becomes a parallel-transport / geodesic equation. Now to test in simulation!

(Concluding remark: While very mechanical, the above derivation is a reflection of some rather fundamental and cool concepts in differential geometry, which Kajelad's answer used explicitly and may have gone beyond my background with. The key idea here, I think, is the Levi-Civita connection, or more specifically, the "covariant-derivative." We took a covariant-derivative in the above when we took a regular derivative of $\dot{r}$ and then projected it onto the tangent space by left-multiplying $\tilde{J}$. Instead, I could have used the abstract parlance and just defined $\nabla_{\dot{r}} \dot{r} = \ddot{r} - c\hat{\eta}$. The ugliness in my derivation above is in how tied it is to coordinate representations of all the geometric quantities involved. To those unfamiliar with differential geometry, however, it is far more grounded, and can even serve as a gateway to the beautiful abstraction.)

答:
Let $R$ be a consistently chosen rotation by $90^\circ$. Such an operator always exists locally, e.g. for embedded surfaces in $\mathbb{R}^3$ one can choose a unit normal vector field $n$ and define $R(v):=n\times v$. Let $\gamma:\mathbb{R}\to S$ be the parameterized curve of interest. The "most general" second order equations of motion for such a curve can be written in terms of the vector acceleration $A$, which describes how $\gamma$ departs from geodesic motion:
$$
\nabla_{\dot{\gamma}}\dot{\gamma}=A
$$
Which in local coordinates can be written in terms of the Christoffel symbols $\Gamma$:
$$
\ddot{\gamma}^i+\Gamma^i{}_{jk}\dot{\gamma}^j\dot{\gamma}^k=A^i
$$
One can split $A$ into a parallel and perpendicular components, which can be parameterized by the scalar acceleration $a$ and the angular velocity $\omega$.
$$
\nabla_{\dot{\gamma}}\dot{\gamma}=a\frac{\dot{\gamma}}{\|\dot{\gamma}\|}+\omega R(\dot{\gamma}) \\
$$
Not that $a$ is indeed the acceleration as typically defined by $a=\frac{d}{dt}\|\dot{\gamma}\|$. The angular velocity $\omega$ behaves exactly as you would expect in the flat case, but on a curved manifold there is not a geometrically meaningful notion of absolute angle $\theta$, since we cannot compare angles at different points. In coordinates, the resulting system can be written as
$$
\ddot{\gamma}^i=a\frac{\dot{\gamma}^i}{\|\dot{\gamma}\|}+\omega R^i{}_j\dot{\gamma}^j-\Gamma^i{}_{jk}\dot{\gamma}^j\dot{\gamma}^k
$$
If you're interested in allowing $\dot{\gamma}=0$, you can split $\dot{\gamma}$ into two degrees of freedom $T=\dot{\gamma}/\|\dot{\gamma}\|$ and $v=\|\dot{\gamma}\|$ (with $T$ constrained by $g_{ij}T^iT^j=1$). With a bit of algebra, this simplifies to a system of ODEs with degrees of freedom $(\gamma,T,v)$, where the $v$ equation conveniently decouples from the rest.
\begin{align*}
\dot{\gamma}^i=&vT^i \\
\dot{T}^i=&\omega R^i{}_j T^j-v\Gamma^i{}_{jk}T^jT^k \\
\dot{v}=&a
\end{align*}

There are, of course, other ways to parameterize curves like this. The best known are the Frenet-Serret equations, which use auxiliary vector-valued degrees of freedom rather than a rotation, but this is probably unnecessary unless you are interested in higher dimensions.

Note on computing $R$ in terms of $g$

Throughout all matrices are 2x2. Let $\epsilon=\begin{bmatrix}0&-1\\1&0\end{bmatrix}$ and $g=J^TJ$. Note that for any matrix $A$, we have $A^T\epsilon A=|A|\epsilon$. Let $U$ be a matrix whose columns form an oriented, $g$-orthonormal basis, i.e. $U^TgU=I_2$, $|U|>0$. This implies $U=g^{-1}(U^{-1})^T$ and $|U|=|g|^{-1/2}$. In an oriented orthonormal basis, a $90^\circ$ rotation is just $\epsilon$, so we have
\begin{align}
R=&U\epsilon U^{-1} \\
=&g^{-1}(U^{-1})^T\epsilon U^{-1} \\
=&g^{-1}|U^{-1}|\epsilon \\
=&\sqrt{|g|}\ g^{-1}\epsilon
\end{align}


问:
Given two natural numbers $a,b$ so that $ab+\left(a+1\right)\left(b+1\right)=2n=fixed,$ find $a\left(a\leq b\right)$ such that $b-a$ at the least.

Problem. Given two natural numbers $a, b$ so that $ab+ \left ( a+ 1 \right )\left ( b+ 1 \right )= 2n= fixed,$ by programmin' find $a\left ( a\leq b \right )$ such that $b- a$ at the least.

I haven't been good at solving Diophantine-equations and commanding computer to do it. Seems like there exists no sequences like this on oeis.org., what I did by myself is transforming the problem into the acquainted one. My idea is using discriminants..

First, $b- a$ at the least meaning $\left ( a+ b \right )^{2}- 4ab$ at the least,

Second,
$$ab+ \left ( a+ 1 \right )\left ( b+ 1 \right )= 2n\Rightarrow 2ab= 2n- a- b- 1$$
That means $\left ( a+ b \right )^{2}+ 2\left ( a+ b \right )+ 2-4n$ at the least, but in natural interval, what I can only do is checking the discriminant, which is a square,

$$4n- 1= m^{2}$$

Is that all for my problem, I need to your help, thank you.

答:
Manipulate the given equation as follows $$ab + (a+1)(b+1) = 2n$$ $$2ab + a + b + 1 = 2n$$ $$4ab + 2a + 2b + 1 = 4n-1$$ $$(2a-1)(2b-1) = 4n-1$$ Now, you just need to factor $4n-1$ into two factors which are as close together as possible.

A naive approach is to set $f = \lfloor \sqrt{4n-1} \rfloor$, and while $f \not\mid 4n-1$, decrement $f$. When this terminates, $f$ will be the largest factor of $4n-1$ that is less than or equal to $\sqrt{4n-1}$. Then $\tfrac{4n-1}{f}$ will be the smallest factor of $4n-1$ that is greater than or equal to $\sqrt{4n-1}$. So $2a-1 = f$ and $2b-1 = \tfrac{4n-1}{f}$.

It might be better to compute the prime factorization of $4n-1$ and then list out the factors. Set $2a-1$ and $2b-1$ to be the middle two factors if $4n-1$ is not a perfect square, and set $2a-1 = 2b-1 = \sqrt{4n-1}$ if $4n-1$ is a perfect square.


问:
Checking if a prime ideal is principal for a particular cubic field
Consider the totally real cubic field $K = \mathbb{Q} (\alpha) = \mathbb{Q} [x]/(f)$ defined by $f = x^{3} - x^{2} - 9 x + 10$ (see https://www.lmfdb.org/NumberField/3.3.1957.1). The ring of integers in this particular case is $\mathcal{O}_K = \mathbb{Z} [\alpha] \cong \mathbb{Z}[x]/(f)$.

Now $\mathfrak{p} = (2,\alpha)$ is a prime ideal of norm $2$, and it is not principal, as one can check with computer calculations. (In fact it is a generator of the class group, which is $C_2$.) I was wondering if there's an easy way to see that.

There are algorithms (based on LLL reduction) that verify if any given ideal in $\mathcal{O}_K$ is principal, but I expect some better explanation that may be checked with less computations.

In fact, computer calculations confirm that there are no elements of norm $2$ in $\mathcal{O}_K$, and this would be enough to conclude that $\mathfrak{p}$ is not principal. Curiously, it seems like the equation $N_{K/\mathbb{Q}} (a + b\alpha + c\alpha^2) = 2$, while not having solutions $a,b,c \in \mathbb{Z}$, seems to have solutions in $\mathbb{Z}/p^k\mathbb{Z}$ for all small $p^k$. I checked this experimentally, but the cubic form in question may in fact violate the local-global principle, so there may be no easy way to show that there are no integer solutions.

Is there a good way to see that $\mathfrak{p}$ is not a principal ideal?

答:
In the process of computing the class group, you should have shown that $(\alpha-2) = \mathfrak p^2$. Therefore if $\mathfrak p = (\beta)$ for some $\beta \in \mathcal O_K = \mathbf Z[\alpha]$, we'd have $(\alpha-2) = (\beta)^2 = (\beta^2)$, so $\beta^2 = (\alpha - 2)\varepsilon$ for some unit $\varepsilon \in \mathcal O_K^\times$.  We want to show $(\alpha-2)\varepsilon$ is not a square in $\mathcal O_K$ for all $\varepsilon \in \mathcal O_K^\times$. How can we do that?

You might think "Oh no, I have to compute the unit group, which has rank 2. How do you compute a rank 2 unit group by hand?"  We don't need the full unit group. What we need is to understand the unit group modulo squares because squared units can be absorbed into the hypothetical $\beta^2$.

The unit theorem tells us that $\mathcal O_K^\times = \pm u^\mathbf Z \times v^\mathbf Z$ for some independent units $u$ and $v$, which would mean $\mathcal O_K^\times/(\mathcal O_K^\times)^2 = \langle -1, \overline{u}, \overline{v}\rangle \cong (\mathbf Z/(2))^3$.  A computer algebra package says fundamental units for $K$ are $u := \alpha-1$ and $v := \alpha-3$.  It is easy to check $u$ and $v$ have norm $1$, so they are both units. It now suffices to show not that these are fundamental units (that is far more work than we need!), but that they together with $-1$ generate the units modulo squares. Since the structure of the unit group modulo squares is (as a multiplicative group with $\mathbf Z/(2)$ acting as exponents) $3$-dimensional, it suffices to show $-1$, $u$, and $v$ are independent modulo squares: none of the $7$ products (corresponding in linear algebra language to nontrivial "$\mathbf F_2$-linear combinations")
$$
-1, u, v, -u, -v, uv, -uv
$$
is a square. Obviously $-1$ is not a square in the number field, since cubic fields have a real embedding. To show the remaining six units are not squares, here are two approaches. The second is more robust (viable for testing a number is not a higher power rather than just not a square).

Method 1: If something is a square, then under every real embedding it has to be mapped to a positive number.  The polynomial $f(x) = x^3 - x^2 - 9x + 10$ has three real roots, so you have three real embeddings to use. The real roots of $f(x)$ are $\alpha_1 \approx -3.0409$, $\alpha_2 \approx 1.1294$, and $\alpha_3 \approx 2.9115$.  I will write $u_j$ and $v_j$ for the images of $u = \alpha-1$ and $v = \alpha -3$ under the real embedding that sends $\alpha$ to $\alpha_j$.

Since $\alpha_1 < 0$ we have $u_1 < 0$, $v_1 < 0$, and $-u_1v_1 < 0$, so $u$ and $v$ and $-uv$ are not squares. Since $\alpha_2$ is between $1$ and $2$, we have $-u_2 < 0$ and $u_2v_2 < 0$, so $-u$ and $uv$ are not squares. That leaves just $-v = 3 - \alpha$, whose image under all real embeddings is positive, so we did not succeed in showing $-v$ is not a square in $\mathcal O_K$ by finding a negative image under some real embedding.  It's time to move on to Method 2.

Method 2: To show a number $\gamma$ in $\mathcal O_K$ is not a square, find a prime ideal $\mathfrak q$ such that $\gamma \bmod \mathfrak q$ is not a square in $\mathcal O_K/\mathfrak q$. (This is a fancy version of the fact that 10007 is not a square in $\mathbf Z$ since it's not a square mod $10$, or not a square mod $5$.)  I was able to apply this idea to show $u, v, -u, -v, uv, -uv$ are not squares by using the unique prime ideals of norm $5$, $11$, and $13$, and a prime ideal of norm $17$ (there are three of those).

For example, the prime $\mathfrak q$ of norm $5$ is $(5,\alpha)$, so $\alpha \equiv 0 \bmod \mathfrak q$ and thus in the residue field $\mathcal O_K/\mathfrak q \cong \mathbf Z/(5)$ we have $v = \alpha-3 \equiv -3 \equiv 2$ and $2 \not= \Box$ in $\mathbf Z/5\mathbf Z$.  So $v$ is not a square in $\mathcal O_K$.  Also $-v \equiv 3 \mathfrak q$ and $3 \not= \Box$ in $\mathbf Z/5\mathbf Z$, so $-v$ is not a square in $\mathcal O_K$ either. We  handled all the other units by Method 1, so I'll stop here with Method 2, but you should check that Method 2 handles everything by reducing each of the 6 units modulo some prime ideal of norm $5$, $11$, $13$, and $17$ to verify that it is not a square modulo a prime ideal and thus is not a square in $\mathcal O_K$.

Our goal is to show $(\alpha-2)\varepsilon$ is not a square for every unit $\varepsilon$. For this task, $\varepsilon$ only matters modulo unit squares.
We know $\mathcal O_K^\times/(\mathcal O_K^\times)^2$ is represented by $\{1,-1,u,v,-u,-v,uv,-uv\}$, so it remains to show the eight products
$$
\alpha-2, -(\alpha-2), u(\alpha-2), v(\alpha-2), -u(\alpha-2), -v(\alpha-2), uv(\alpha-2), -uv(\alpha-2)
$$
are all not squares in $\mathcal O_K$.  You can try this using Method 1 (real embeddings) or Method 2 (reduction modulo well-chosen prime ideals). For example, under the real embedding sending $\alpha$ to $\alpha_1 \approx -3.0409$, we have $\alpha_1 - 2 \approx -5.0409$, $u_1 = \alpha_1 - 1 \approx -4.0409$ and $v_1 = \alpha_1 - 3 \approx -6.0409$, so (i) $\alpha_1-2 < 0$, (ii) $-u_1(\alpha_1-2) < 0$, $-v_1(\alpha_1-2) < 0$, and (iii) $u_1v_1(\alpha_1-2) < 0$. Therefore $\alpha-2$, $-u(\alpha-2)$, $-v(\alpha-2)$, and $uv(\alpha-2)$ are all not squares.  It remains for you to check that $-(\alpha-2)$, $u(\alpha-2)$, $v(\alpha-2)$, and $-uv(\alpha-2)$ are all not squares. Have fun!


答:
Complementary hint.

$S_3(n) = \sum_{i=1}^n i^3 = [S_1(n)]^2 = [\sum_{i=1}^n i]^2.$

The first order of business is to nail down how the sequence ends.

$S_2(n) = \sum_{i=1}^n i^2 = \frac{(n)(n+1)(2n+1)}{6}.$

Therefore, $S_2(9) = 285.$

Then, you have 100 occurrences of $(10)$ which takes the running total of digits from $285$ to $485.$

Then, you have 121 occurrences of $(11)$ which takes the running total of digits from $485$ to $727$.  This means that the sequence concludes with 136 occurrences of $(12)$, followed by the single digit $1$.

This analysis is needed to utilize Especially Lime's hint/answer.

Title: Finding Remainder when N is divided by 99.

Body:
Consider the number $N = 1222233333333344\cdots$ (1000 digits). Find the remainder when $N$ is divided by $99$.

MY WORK :-
for a number to be divisible by 99 it must be divisible by 9 and 11.
for $N$ to be divisible by 9, the sum must be divisible by 9; and the sum of all the digits is :
$$1 * 1 + 2 * 4 + 3 * 9 + \cdots =
                         1 + 8 + 27 +\cdots$$
Basically sum of cubes.


答:
To deduce $\lnot p\to r$ you must be able to derive $r$ under the assumption of $\lnot p$.   So first assume that.

To derive $r$ under that assumption, using modus ponens with the premise of $(\lnot p\lor q)\to r$ as you were trying to do, you first need to be able to derive $\lnot p\lor q$.

Well, deriving $\lnot p\lor q$ under the assumption of $\lnot p$ is readily done by applying the rule of addition; also known as the rule of or-introduction, or disjunction introduction.

Now to apply modus ponens, you usually would not need to derive $(\lnot p\lor q)\land((\lnot p\lor q)\to r)$, but you obviously could, should your proof system require it.  But does it?

In any case, your proof was not too far off, and shows you have the right idea, but needs a lot of work.  So do try again before looking at the spoiler.

 ${1)~\lnot p\hspace{15.5ex}\textsf{by premise}\\2)~(\lnot p\lor q)\to r\hspace{5.25ex}\textsf{by premise.}\\\quad{3)~\lnot p\hspace{13.25ex}\textsf{by assumption}\\4)~\lnot p\lor q\hspace{9.5ex}\textsf{by addition }(3)\\4.5)~(\lnot p\lor q)\land((\lnot p\lor q)\to r)\hspace{4ex}\textsf{by conjunction $(4,2)$, should you need it.}\\5)~r\hspace{15ex}\textsf{by modus ponens }(4, 2)}\\6)~\lnot p\to r\hspace{10.75ex}\textsf{by deduction }(3{-}5)\\~\\\therefore \lnot p, (\lnot p\lor q)\to r\vdash \lnot p\to r}$

Title: Is this correct arguing?

Body:
Is this correct to conclude this way?

Premise $\neg p$

Premise $(\neg p \vee q) \to r$

Therefore $\neg p \wedge (\neg p \vee q) \to r$

Therefore $\neg p \to r$


问:
The Completeness of A Space
Before I ask my question, let me list some definitions that's used in the question.

Given $s\geq1$, $X$ is nonempty set and $d: X\times X \rightarrow [0,\infty)$ is $b_s$-pseudo metric on $X$ if for $x,y,z\in X$

i. $d(x,x)=0$

ii. $d(x,y)=d(y,x)$

iii. $d(x,y)\leq s[d(x,z)+d(z,y)]$

$F=\{d_n:n\in\mathbb{N}\}$ is a family of $b_s$-pseudo metric.

i. a sequence $\{x_n\}$ in $X$ is $F$-convergent to $x\in X$ if for all $d_k \in F$ and positive $\varepsilon$ there exist $N\in\mathbb{N}$ such that $$d_k(x_n,x)<\varepsilon$$
for all $n\geq N_0$.

ii. a sequence $\{x_n\}$ in $X$ is $F$-Cauchy if for all $d_k \in F$ and positive $\varepsilon$ there exist $N\in\mathbb{N}$ such that $$d_k(x_n,x_m)<\varepsilon$$
for all $n,m\geq N_0$

iii. $X$ is $F$-complete if each of its $F$-Cauchy sequence is $F$-convergent.

Now let's say I have:

$X =C([0,\infty),\mathbb{R})$ i.e. a set of all continuous function from $[0,\infty)$ to $\mathbb{R}$, AND

$F=\{d_k:k\in\mathbb{N}\}$ where $$d_k(x,y)=\max_{t\in[0,k]}(x(t)-y(t))^2$$
for all $x,y\in X$
Every element of $F$ is $b_2$-pseudo metric on $X$.

Here, I want to show that $X$ is $F$-complete. This is the answer I get from my previous question here (Showing Completeness of a Space). But unfortunately, I wrote the wrong definition for $F$-convergent and $F$-Cauchy sequence there. So I tried to work on it again.

Suppose we have an arbitrary $F$-Cauchy sequence $\{x_n\}$ on $X$. Then, for any $k\in \mathbb{N}$ and $\epsilon>0$ we may find $N$ such that
$$\tag{1} d_k(x_n,x_m)=\max_{t\in [0,k]}(x_n(t)-x_m(t))^2<\epsilon$$
for every $n,m\geq N$.

By $(1)$, we have for every $t\in [0,\infty)$, $\{x_n(t)\}$ is a Cauchy-real number sequence. Hence, it's convergent to some point $y_t\in\mathbb{R}$, i.e. $y_t = \lim_{n\rightarrow\infty} x_n(t)$. The limit of this real number sequence is unique, so I can define a function $x : [0,\infty)\rightarrow\mathbb{R}$ where $$x(t) = \lim_{n\rightarrow\infty} x_n(t)$$
for all $t\in[0,\infty)$.

We should show that $x(t)$ is continuous and finally show that $\{x_n\}$ is $F$-converges to $x$. This is how I show that $x$ is continuous.

For any $k\in \mathbb{N}$ and $\varepsilon>0$, we can pick any $t \in [0,k]$. Then, we have $N(t)\in\mathbb{N}$ such that $$|x_n(t) - x(t)|<\varepsilon$$
for all $n\in\mathbb{N}$ where $n\geq N(t)$

Now, we must choose a fix $n_*\in\mathbb{N}$ (I chose $n_*=\max_{t\in[0,k]}N(t)$) such that the inequality below holds for every $n\in\mathbb{N}$ where $n\geq n_*$ and for all $t\in[0,k]$.
$$\tag{2} |x_n(t)-x(t)|<\varepsilon$$
From $(2)$ we got $x_n$ is uniformly convergent to $x$ on $[0,k]$ for all $k\in\mathbb{N}$. Because $x_n$ is continuous on $[0,k]$ for all $n\in\mathbb{N}$, thus $x$ is continuous on $[0,k]$. Hence, $x$ is continuous on $[0,\infty)$.

I looked again at the $n_*$ I've chosen and soon realized that $[0,k]$ has an infinite number of elements and $[0,k]$ is bounded, but the function $N(t)$ is not necessarily continuous. So I can't choose $n_*$ as maximum value of $N(t)$ a.k.a the way I chose $n_*$ is invalid.

Now, here's my question. Is there a way to find a fix $n_*$ for $(2)$?

答: On the right side of (1) change $\epsilon$ to $\epsilon^{2}$. You will then have $|x_n(t)-x_m(t) |<\epsilon$ for all $n, m \geq N$ for all $t \in [0,k]$. Let $m \to \infty$. You get  $|x_n(t)-x(t) |\leq \epsilon$ for all $n \geq N$ for all $t \in [0,k]$. Hence you can take $n_{*}$ to be $N$.

Title: The Completeness of A Space


问:
How many ways to select $4$ people at a round table such that no two of the selected people are adjacent?

There are $100$ people sited in a circular table with $100$ chairs. How
many ways to select $4$ such that each chosen person is not adjacent to
any other chosen person.

The problem is equivalent to the following

Let there be $100$ empty chairs in a circular table. How many ways to choose $4$ chairs such that each chosen chair is not adjacent to any other chair

When it's a straight table, we can remove a chair between each chosen one yielding $\binom{97}{4}$ by bijection argument. It can maybe be applied when the table is circular.

I found a solution using PIE

$$\binom{100}{4}-\frac{100\binom{98}{2} \cdot 4-100 \cdot 9 7 \cdot 6+4 \cdot 100}{4}= 3460375$$

答:
From the straight table case, subtract the case when both #1 and #100 are selected. When the ends of row are joined to form a circle, we get our desired arrangement.

By the bijection argument, it's $$\binom{97}{4} - \binom{95}{2}$$

 Since it remains to select two non-adjacent chairs from #3 to #98 inclusive ie, 96 chairs.