问:
Why is $\pi $ equal to $3.14159...$?
Wait before you dismiss this as a crank question :)

A friend of mine teaches school kids, and the book she uses states something to the following effect:

If you divide the circumference of any circle by its diameter, you get the same number, and this number is an irrational number which starts off as $3.14159... .$

One of the smarter kids in class now has the following doubt:

Why is this number equal to $3.14159....$? Why is it not some other irrational number?

My friend is in a fix as to how to answer this in a sensible manner. Could you help us with this?

I have the following idea about how to answer this: Show that the ratio must be greater than $3$. Now show that it must be less than $3.5$. Then show that it must be greater than $3.1$. And so on ... .

The trouble with this is that I don't know of any easy way of doing this, which would also be accessible to a school student.

Could you point me to some approximation argument of this form?

答:
I think it is a very nice way to explain what is a definition in math. You have got a number with the same value for every one. As long you can make the kids believe the ratio circumference/diameter does not depends on the size of the circle nor of the kid measuring it nor the paper nor of the the weather nor...

Then you leave the choice: do you want to make your computation with the symbol $\pi$ or with the value $3.14159...$ which you will have to remember. Personally, I'd rather learn a new symbol and leave it like that in the formulas rather than go the hard way of multiply with a 5 decimal digit (well and $\infty$ decimal digit in some sense).

Afterword you can think of a way to compute it. You'll go into explaining how clever where   the many mathematicians that did try to design they own way to compute $\pi$.

But what really matters is: what ever the way you try, you will find the same number. And in facts, the number of things you can do without knowing the exact value is incredible.

How does know the exact value of $\pi$ by the way ?

And how can you prove that  $3.14159...$ so close to $\pi$ ?

Title: Why is $\pi $ equal to $3.14159...$?


问:
Extrema of ab + ac + bc - abc if a + b + c = 1
a, b and c are three non-negative real numbers such that a+b+c=1.
What are the extrema of
ab+bc+ca-abc?

I know by AM-GM that $ab + bc + ac \geq 3a^{2/3}b^{2/3}c^{2/3}$ and again by AM-GM $1 \geq 3a^{1/3}b^{1/3}c^{1/3}$ but I'm guessing there is a clever way to write an expression involving the 3 terms, which we can then use AM-GM on in order to solve. Any insights would be appreciated.

答:
Hint:

$$ab+bc+ca-abc=(1-a)(1-b)(1-c)-1+(a+b+c)$$

Spoiler:

(Upper bound)

 You're given $a+b+c=1$ and $a,b,c$ are non-neg reals, so they must be in $[0,1]$ and thus $1-a, 1-b, 1-c$ are non-neg reals. Apply AM-GM for upper bound.

(Lower bound)

 The lower bound is clearly $0$ for the given conditions since the expression is non-negative with $0$ attained at $(1,0,0), (0,1,0)$ and $(0,0,1)$

ContentLicense: CC BY-SA 4.0


问:
Find $x$ for random variable with 15 degrees of freedom
I have a question stating:

If $X$ is a chi-square random variable with 15 degrees of freedom, find the value of $x$ such that $P(X >= x) = 0.05$.

The answer in the book is $0.05$.  I am confused why the variable $x$ would be equal to $0.05$ in the statement $P(X >= x) = 0.05$ rather than being equal to a value from a chi-square table for $\chi^2$15, 0.05

Body:
According to R, the value of $x$ is 24.99579.

> qchisq(0.95,15)
[1] 24.99579


问:
Different representations of the perspective projection matrix?
So in the textbook, we want to map $(x,y,z,1)$ to $\big(\frac{x}{1-\frac{z}{d}}, \frac{y}{1-\frac{z}{d}}, 0, 1\big)$. Since we are working with homogenous coordinates, this is the same thing as mapping $(x,y,z,1)$ to $(x,y,0,1-\frac{z}{d})$. It can be shown the perspective matrix to map this is:

$$P = \begin{bmatrix}
    1& 0& 0 & 0 \\
    0& 1& 0 & 0 \\
    0& 0& 0 & 0 \\
    0& 0& -1/d & 1 \\
\end{bmatrix}$$

Now, what I was wondering was if I could just map it from $(x,y,z,1)$ to $\big(\frac{x}{1-\frac{z}{d}}, \frac{y}{1-\frac{z}{d}}, 0, 1\big)$ which gives:

$$P = \begin{bmatrix}
    \frac{1}{1-\frac{z}{d}}& 0& 0 & 0 \\
    0& \frac{1}{1-\frac{z}{d}}& 0 & 0 \\
    0& 0& 1 & 0 \\
    0& 0&  & 1 \\
\end{bmatrix}$$

The final homogeneous vector by applying $P$ to $(x,y,z,1)$ is the same but clearly the matrices $P$ are different. Is there anything fundamentally wrong with doing what I did and have a matrix in terms of the input $z$?

答: The matrix of your transformation cannot depend on the point, it has to be a constant matrix. There is a one to one correspondence between matrices and transformations (for any given basis).</p>


问:
Find Root Solution
$$\frac{3 (1 - 2x)}{{\sqrt[4]{(1 - x)x}}} = \log_2\left(\frac{1 - x}{x}\right) \sqrt {2} $$
It is clear the $\frac{1}{2}$ is a solution, but there are others solutions. If we subtract this two side of equation and plot in a visualization software, we can see that are others roots. I like to find the solution that are close to $x = 0.2$.

Addendum: I need a exact solution.

Title: Find Root Solution

Body:
As you did, consider that you look for the zero's of function $$f(x)=\frac{3 (1 - 2x)}{{\sqrt {2}} {\sqrt[4]{(1 - x)x}}} - \log_2\left(\frac{1 - x}{x}\right)$$
Beside the trivial $x=0.5$, graphing, you noticed three other roots close to $x=0.2$, $x=0.8$ and another close to $x=1$; if you plot again the function between $0.95$ and $1.0$, the largest root is close to $x=0.99$.

Now, using these values a starting points, use Newton method and get the following iterates
$$\left(
\begin{array}{cc}
n & x_n \\
 0 & 0.2000000000 \\
 1 & 0.1704681790 \\
 2 & 0.1750941042 \\
 3 & 0.1752348886 \\
 4 & 0.1752350156
\end{array}
\right)$$

$$\left(
\begin{array}{cc}
n & x_n \\
 0 & 0.8000000000 \\
 1 & 0.8295318210 \\
 2 & 0.8249058958 \\
 3 & 0.8247651114 \\
 4 & 0.8247649844
\end{array}
\right)$$

$$\left(
\begin{array}{cc}
n & x_n \\
 0 & 0.9900000000 \\
 1 & 0.9912580691 \\
 2 & 0.9911109005 \\
 3 & 0.9911082777 \\
 4 & 0.9911082769
\end{array}
\right)$$


问:
Solving this problem without Taylor series ( I made an extra assumption)
I want to show that the derivative of a (one-time differentiable) function $f(x)$ is given by $$f'(a)= \lim \limits_{h \to 0} \dfrac {1}{h} \displaystyle \int_{-1}^{1} \dfrac{3u}{2} f(a+uh) \ du$$

I used the Taylor's expansion about the point $x=a$ and the conventional $h$ as $uh$ [i.e. $f(x+h)= f(x) + h f'(x) + \cdots$] and got the answer. However, I made an additional assumption that the function $f(x)$ possesses a convergent series about $uh$ and this includes the assumption that the function is differentiable more than once.

Tried applying the Leibniz rule, but could not get to the RHS. How can I prove the result without using the Taylor series?

答:
Let $u=t^{1/3}/h$ so that $$du=\frac{1}{3h}t^{-2/3}\,dt$$ and thus the desired limit is $$\lim_{h\to 0}\frac{1}{2h^3}\int_{-h^3}^{h^3}\frac{f(a+t^{1/3})}{t^{1/3}}\,dt$$ Next use $v=h^3$ to get $$\lim_{v\to 0}\frac{1}{2v}\int_{-v}^{v}\frac{f(a+t^{1/3})-f(a)}{t^{1/3}}\,dt+\frac{f(a) }{2v} \int_{-v} ^{v} t^{-1/3}\,dt$$ Note that the second integral is $0$ and the first integral can be split into integrals over $[-v, 0]$ and $[0,v]$. Thus the limit is split into limit of two terms one of which is $$\lim_{v\to 0}\frac{1}{2v}\int_0^v\frac{f(a+t^{1/3})-f(a)}{t^{1/3}}\,dt$$ and by fundamental theorem of calculus this equals $$\frac{1}{2}\lim_{t\to 0}\frac{f(a+t^{1/3})-f(a)}{t^{1/3}}=\frac{f'(a)}{2}$$ Similarly the other limit also equals $f'(a) /2$ and the desired limit is $f'(a)$.

The above uses the assumption that $f$ is Riemann integrable in some neighborhood of $a$ and derivative $f'(a) $ exists.


问:
Inequality statement in an ordered field.
Let $F$ be an ordered field. For all $x \in F$ such that $x < z$, then $x < y$. Does that mean $y \geq z$?

If so, what is the simplest way to prove this. If not, counterexample?

答: Solved. If $y<z$ then $y < y$ cannot hold. so $y \geq z$.


答: Yes, you can do this easily by contradiction. Let $F$ be an ordered field where for all $x\in F$ such that $x<z$, then $x<y$. Further suppose that $y < z$. By hypothesis, this also means $y<y$, which is a contradiction.

Title: Inequality statement in an ordered field.

Body:
Let $F$ be an ordered field. For all $x \in F$ such that $x < z$, then $x < y$. Does that mean $y \geq z$?

If so, what is the simplest way to prove this. If not, counterexample?


问:
By using set identities, prove that for all sets A and B
$(A − B) \cap (A \cap B) = \varnothing$

how can this be solved

答: $A \cap B \subseteq B$ but $B$ is disjoint from $A-B$.


问:
Strategy to maximize value from iterative dice rolls
This is based on a statistics question I had over on the rpg.stackexchange site and it was suggested that I bring it over here.

The premise is a game where you have 20 d6 dice. You roll each die sequentially and add the result to your score. Each time before rolling a new die you have the option to reset your score and re-roll all previously rolled dice along with the new die.

For example:
You roll a 4 on your first die, then a 2 on your second die for a score of 6. You choose to re-roll on your third die, rolling 3d6 and getting 3. On your fourth die you again choose to re-roll (4d6) and this time you get 18. etc...

What strategy of re-rolling would result in the maximum score once you have rolled all 20 dice?

答:
Suppose you have rolled $n$ dice. If you choose to re-roll all of these, then your expected score for these dice is $7n/2$. So you should only choose to re-roll all the die if your total score after $n$ rolls is less than $7n/2$, else you'd have nothing to gain.

Now, finding the expected value of following this strategy is much more interesting. I haven't gone through the computations yet, but I can say for sure that it should be larger than the average score of $70$ that you'd expect with no re-rolling.


问:
A non-combinatorial inductive proof
It is given that each person in the group of n persons has at least half of the persons in the group as his friends.It is required to prove that it is possible  to seat them in a circle so that everyone sits next to a friend of his or hers.Here,I have tried to prove the statement by induction .

PROOF:If there are 3 persons in the group, then the statement is easily verifiable. Let there be k(k is even) persons in the group such that they can be seated in a circle in the desired order.Now,if there are k+1 persons in
the room then k of them can be still seated in a circle such that the desired order is achieved. Now,it is required to seat the (k+1)th person in the circle such that the order is retained. According to the statement, the (k+1)th person will have at least (k+2)/2 friends in the circle. Let it be assumed that none of his friends share a common friend in the circle or sit beside each other. If this is so, then there are at least (k+2)/2 persons in total that sit beside  (k+2)/2 of the (k+1)th persons friend.
Thus,togetherly,there are at least k+2 persons seated in the table.This contradicts the fact that there are k persons in the circle. Hence,at least two of his friends share a common friend in the circle or sit beside each other. If one denotes  the (k+1)th person by M , his friends as G1 and G2 then for
G1 and G2 sitting beside each other M can be seated in between them and for G1 an G2 sharing a common friend C, then M can be seated in between C and G2. This completes the proof.

I am doubtful about the accuracy of the proof.Please help me to verify that it is correct.If it is wrong,please help me improve it.This proof covers only the case in which k is even.However,as per the given reply,this doesnt hold for the case in which k is odd.

答:
What if $k=3$, and you have $4$ people, $A,B,C$, and $D$, such that $A$ is friends with $D$ and $B$, $B$ is friends with $A$ and $C$, $C$ is friends with $B$ and $D$, and $D$ is friends with $C$ and $A$? When you remove any one of them, $2$ of the remaining $3$ people have only one friend, so the induction hypothesis doesn’t apply. To make an argument by induction, you would first have to show that you can always remove one person in such a way that the remaining group satisfies the induction hypothesis.

I suggest treating it as a problem in graph theory: each person is a vertex, and two vertices (people) are joined by an edge if they are friends. Then the result follows from Ore’s theorem.

Title: A non-combinatorial inductive proof


问:
Proving the remainder is $1$ if the square of a prime is divided by $12$
Given, $p$ is a prime number and $p>3$. How do we prove that the remainder $r$ is always $1$ if $p^2$ is divided by $12$?</p>

答:
Hint:

since $p>3$ we know that $p$ is not even.
So the posibilities for $p$ mod$(4)$ are :  $...$

consequently for $p^2$ mod$(4)$ are : $...$

and for $p$ mod$(3)$ are : $...$

consequently for $p^2$ mod$(3)$ are : $...$

If you did the right calculations you will see that in both cases $p^2\equiv 1$ mod$(4)$ and mod$(3)$ , so ?

ContentLicense: CC BY-SA 3.0


问:
Symmetric Matrices of Multinormal Distributions
I'm working on some computational mathematics for development in three.js and have been working  with out the first parameters of multinormal distributions in Mathematica 12.2. (They're useful in procedural terrain generation because they have nice organic looking properties when mixed together.)

However, after looking pretty deeply at the properties of the covariance matrix such as its eigenvalues, variance, and standard deviation, I found a trait that reduces the randomness of the outputted distributions. They all seem to tilt bottom-left to top-right. (The variance and standard dev. are listed with each plot)

The properties of the covariance matrix used in a multinormal distribution is that it is positive and symmetric. However, I'm wondering what controls the rotation of the spread, and if a top-left, bottom-right orientation is possible? Or is this a fundamental property of positive and symmetric matrix? I thought I knew a lot of matrices but obviously that was wrong, and there is a gap in my knowledge. Investigating on my own it seems fundamental to its nature but I wanted to do a bit more indepth research because my plan of action for the project depends on the root cause of this orientation behaviour.

Updated 2021-01-29

What I was missing was the concept of correlation coefficients from statistics (described minimally in the accepted answer but it is the answer I used in the project). Understanding the relationship between "x", "y", and "p" does return the expected results. Below "p" is a negative exponent.

答:
However, I'm wondering what controls the rotation of the spread, and if a top-left, bottom-right orientation is possible?

Yes, just put minus sign on the off-diagonal terms.

Or is this a fundamental property of positive and symmetric matrix?

The off diagonal terms determine the direction and the shape of your ellipse. As larger it w.r.t. the variance terms (main diagonal), the more "edgy" your ellipse. For positive values you have your current "positive" direction (=correlation), for negative values you'll have the opposite (=negative correlation).  For zero terms you will have a perfect circle. All covariance matrices are positive definite. Whatever the orientation of the plot. As long as you don't have degenerate components, that is, with zero variance (main diagonal), your covariance matrix will be positive definite matrix. Otherwise only semi-positive definite matrix.


问:
Calculating Probabilities in Bayesian Network

The Bayesian network below contains only binary states. The conditional probability for each state is listed. From the Bayesian network, calculate the following probabilities:

a)
$P(b)$

b)
$P(d)$

c)
$P(c \mid \neg d)$

d)
$P(a \mid \neg c, d)$

For a) I calculated this to be $ P(b) = \sum_a P(b \mid a) \cdot P(a) = P(b \mid a) \cdot p(a) + P(b \mid \neg a) \cdot P(\neg a) = 0.44$

b) Exact same method as in a: $P(d) = \sum_b P(d \mid b) \cdot P(b) = P(d \mid b) \cdot P(b) + P(d \mid \neg b) \cdot P(\neg b) = 0.712 $

Now for c) and d) Im not so sure.

c) I first tried calculating $P(c,\neg d)$ using the formula $P(x_1,...x_n) = \prod_{i = 1}^n P(x_i \mid Parents(x_i))$ This gives $P(c,\neg d) = P(c \mid b) \cdot P(\neg d \mid b) = 0.1 \times 0.4 = 0.04.$ Then Applying Bayes rule gives: $$P(c \mid \neg d) = \frac{P(c,\neg d)}{P(\neg d)} = \frac{0.04}{0.288} \approx 0.139$$

d)

Same approach as in c), I first tried to calculate the joint distribution with the same formula: $P(a,\neg c, d) = P(a) \cdot P(\neg c \mid b) \cdot P(d \mid b) = 0.8 \times 0.9 \times 0.6 = 0.432$ Finally, applying Baye's rule again this gives $$P(a \mid \neg c, d) = \frac{P(a,\neg c, d))}{P(\neg c, d)} = \frac{0.432}{0.04} = 10.8$$ which is clearly wrong.

Is anyone able to see what Im doing incorrectly?

答:
$a\to b\overset{\nearrow \raise{1ex}\large c}{\underset{\searrow\lower{1ex}\large d}{\quad\phantom\vert}}$ coresponds to the factorisation $\mathsf P(a,b,c,d)=\mathsf P(a)\,\mathsf P(b\mid a)\,\mathsf P(c\mid b)\,\mathsf P(d\mid b)$ .

We may similarly factorise parts of the diagram

$\mathsf P(b) = \sum_a \mathsf P(b \mid a) \cdot\mathsf P(a)$

$\checkmark$ Indeed. We factorise the diagram $a\to b$ and sum over all values for $a$.

$\mathsf P(d) = \sum_b \mathsf P(d \mid b) \cdot \mathsf P(b)$

$\checkmark$ Quite right.  We factorise the diagram $b\to d$ and sum over all values for $b$; since we calculated $\mathsf P(b)$ above.

$\mathsf P(c\mid\lnot d)$

You are correct to use the conditional probability's definition. However relevant factorisation is $\mathsf P(b, c,\lnot d)=\mathsf P(b)\,\mathsf P(c\mid b)\,\mathsf P(\lnot d\mid b)$ (and likewise for $\lnot b$).

So...

$$\begin{align}\mathsf P(c\mid\lnot d) &=\dfrac{\mathsf P(c,\lnot d)}{\mathsf P(\lnot d)} \\[1ex] &= \dfrac{\sum_b \mathsf P(b)\,\mathsf P(c\mid b)\,\mathsf P(\lnot d\mid b)}{\sum_b \mathsf P(b)\,\mathsf P(\lnot d\mid b)}\\[1.5ex]&=\dfrac{\mathsf P(b)\,\mathsf P(c\mid b)\,\mathsf P(\lnot d\mid b)+\mathsf P(\lnot b)\,\mathsf P(c\mid\lnot b)\,\mathsf P(\lnot d\mid\lnot b)}{\mathsf P(b)\,\mathsf P(\lnot d\mid b)+\mathsf P(\lnot b)\,\mathsf P(\lnot d\mid\lnot b)}\end{align}$$

Although, since you already have $\mathsf P(d)$, you can simply do:$$\mathsf P(c\mid\lnot d) =\dfrac{\mathsf P(b)\,\mathsf P(c\mid b)\,\mathsf P(\lnot d\mid b)+\mathsf P(\lnot b)\,\mathsf P(c\mid\lnot b)\,\mathsf P(\lnot d\mid\lnot b)}{1-\mathsf P(d)}$$

$\mathsf P(a\mid c,\lnot d)$

Of course, it is much the same$$\begin{align}\mathsf P(a\mid c,\lnot d)&=\dfrac{\sum_b\mathsf P(a, b,c,\lnot d)}{\mathsf P(c,\lnot d)}\\[1ex]&=\dfrac{\mathsf P(a)\sum_b\mathsf P(b\mid a)\mathsf P(c\mid b)\mathsf P(\lnot d\mid b)}{\mathsf P(c\mid\lnot d)\,(1-\mathsf P(d))}\end{align}$$


问:
Is there an easy way to see that all derivatives are bounded?

Show that all derivatives of $f:\mathbb{R}\to\mathbb{R}$ given by $$f(x):=\frac{1}{\sqrt{x^2+1}+1}$$ are bounded.

It's easy to see that all derivatives are continuous. So the only potential problem is that a derivative might blow up at $\infty$. Is there an easy way to see that this does not happen? I guess deriving an explicit form of the n-th derivative is not the way to do it (I'd doubt there is an easy closed form).

答:
Hint: You don't need an explicit form for the derivatives, you only need their leading behaviour for large $x$. You could do this by considering what gives the largest contribution.

Warning - $\sin x^2$ is bounded but its derivative is not. You'll have to be slightly careful in what you throw away.

Let $u=\sqrt{1+x^2}\sim x$. Then $u'=x/u\sim 1$. As a result you can check that $u^{(n+1)}\sim x^{-n}$ since all derivatives are just polynomials in $x$ over powers of $u$ and there is no difference in order between differentiating with respect to $x$ or $u$.

Similarly you can deduce that any derivative of $1/(1+u)$ has the form of a sum of fractions which in turn have the form of a product of derivatives of $u$ in the numerator and a power of the denominator below. Then the numerator is at most order 1 and the denominator decays.

An alternative method is to write

$$f'(x)=-f(x)^2\times x/u$$

Then one can proceed by induction.


问:
Probability breakdown of a certain roll
There are six regular (6-sided) dice being rolled. However, each dice has one side colored gold. The 1st has a gold 1, the 2nd has a gold 2... and the 6th has a gold 6.

I calculate the probability of rolling two sets of three with 6 dice:

$$\frac{{6 \choose 2} {6 \choose 3} {3 \choose 3}}{6^6} = \frac{300}{6^6}$$

As there are ${6 \choose 2}$ ways to assign the numbers, ${6 \choose 3}$ ways to arrange the 1st set of 3 dice into the available spaces and ${3 \choose 3}$ for the 2nd set.

An example of this kind of roll would be 1 1 1 2 2 2 or 3 5 3 5 5 3 (i.e. two groups of 3 of a kind).

How can I determine how many of these 300 rolls have 0 gold sides, how many have 1 gold side, and how many have 2 gold sides.

For instance, the roll 2 1 2 1 2 1 would have 0 gold sides, the roll 1 1 1 2 2 2 would have 1 gold side (the 1st dice), and the roll 1 2 1 2 1 2 would have 2 gold sides (the 1st and 2nd dice).

答:
It seems to be $\displaystyle {4 \choose 2}{6 \choose 2}*2=180$.

You choose which 2 of the 6 numbers to be the gold faces. Then you choose which 2 of the 4 remaining numbers will be the first number (none of them possibly being a gold face), and the other two are left for the second number.

E.g.

1 x x 4 x x

1 1 x 4 x 1

1 1 4 4 4 1

Lastly, I think you may have made a mistake in your calculation. There are ${6 \choose 3}{6 \choose 2}*2=600$ ways to get three each of two numbers. You need to multiply by 2 because after you’ve selected the positions and the numbers, you can put the numbers in one way, or the opposite.

_ _ * _ * *

3,5

3 3 5 3 5 5

5 5 3 5 3 3

Title: Probability breakdown of a certain roll


问:
How do i prove this using precise definition of a limit?
$(x^2 - 6x +11) = 6$

lim approaching 1

Given ϵ  > 0

if |x−1|<δ then $|x^2 − 6x + 11 -6|$=$|x^2 - 6x +5|$<ϵ
this gets factored to:
$|x^2 - 6x +5|$ = (x-1)(x-5)<ϵ
This is where i am stuck, can someone explain to me what to do next?

So basically we start with $-1<x-1<1$ = $0<x<2$ for (x-1) and we find the equivalence for (x-5) $-5<x-5<-3$
is that correct?
Just to make sure but is it $-5<x-5<-3$ or $-5<x-5<3$? because if you  add -5 to both sides it becomes -3.

答:
Here I propose the solution to the general case where $x$ approaches $a\in\mathbb{R}$ for the sake of curiosity.

In general, it can be proven that
\begin{align*}
\lim_{x\to a}(x^{2} - 6x + 11) = a^{2} - 6a + 11
\end{align*}

Indeed, let us consider that $|x - a| < \delta$. Then we have that
\begin{align*}
|(x^{2} - 6x + 11) - (a^{2} - 6a +11)| & = |x^{2} - a^{2} - 6(x - a)|\\\\
& = |(x-a)(x+a) - 6(x-a)|\\\\
& = |x-a||x + a - 6 |\\\\
& = |x-a||(x-a) + 2a - 6|\\\\
& \leq |x - a|(|x-a| + 2|a-3|)\\\\
& < \delta^{2} + 2\delta|a-3| = \varepsilon
\end{align*}

Consequently, for every $\varepsilon > 0$, there corresponds $\delta = -|a-3| + \sqrt{|a-3|^{2} + \varepsilon}$ such that
\begin{align*}
|x - a| < \delta \Rightarrow |f(x) - f(a)| < \varepsilon
\end{align*}
where $f(x) = x^{2} - 6x + 11$, and we are done.

Hopefully this helps!


答:
Note: "WLOG" means "Without Loss of Generality"

WLOG, the roll is 3-"1"'s and 3-"2"'s, sequenced as "111222".

WLOG, D-1 is the die with a gold "1", D-2 is the die with a gold "2".

Chance of D-1 being in the last 3 numbers times chance of D-2 then being in the first 3 numbers = chance of Gold = 0 ($G_0$)

$$G_0 = \frac{3}{6} \times \frac{3}{5}.$$

Chance of D-1 being in the first 3 numbers times chance of D-2 then being in the second 3 numbers = chance of Gold = 2 ($G_2$)

$$G_2 = \frac{3}{6} \times \frac{3}{5}.$$

Obviously,

$$G_1 = 1 - (G_0 + G_2).$$

$(G_x \times n) $ where $n$ is the number of throws gives the number of throws that produce exactly $x$ gold numbers.

Title: Probability breakdown of a certain roll

Body:
There are six regular (6-sided) dice being rolled. However, each dice has one side colored gold. The 1st has a gold 1, the 2nd has a gold 2... and the 6th has a gold 6.

I calculate the probability of rolling two sets of three with 6 dice:

$$\frac{{6 \choose 2} {6 \choose 3} {3 \choose 3}}{6^6} = \frac{300}{6^6}$$

As there are ${6 \choose 2}$ ways to assign the numbers, ${6 \choose 3}$ ways to arrange the 1st set of 3 dice into the available spaces and ${3 \choose 3}$ for the 2nd set.

An example of this kind of roll would be 1 1 1 2 2 2 or 3 5 3 5 5 3 (i.e. two groups of 3 of a kind).

How can I determine how many of these 300 rolls have 0 gold sides, how many have 1 gold side, and how many have 2 gold sides.

For instance, the roll 2 1 2 1 2 1 would have 0 gold sides, the roll 1 1 1 2 2 2 would have 1 gold side (the 1st dice), and the roll 1 2 1 2 1 2 would have 2 gold sides (the 1st and 2nd dice).


答:
Prasun Biswas has a nice answer ,here is a generalised approach which is more uglier but can serve as a good method with similar problems

Let $u=ab,w=a+b$ also  $w\le a+b+c= 1$

by AM_GM we get $0\le u\le \frac{w^2}{4}$

we have to get extrema of $$ab+bc+ca-abc=ab(1-c)+c(1+b)=wu+(1-w)w$$ let $$f(u)=wu+(1-w)w$$ indeed its a lenear function in $u$ so our extrema will be at the endpoints ie when $u=0,u=w^2/4$ also as $w\ge 0$ the function has a positive slope hence $$\min f(u)=f(0)=w(1-w)\ge 0 \tag {when w=0,1}$$    $$\max f(u)=f(w^2/4)=\max(w^3/4+w-w^2)= \frac{8}{27}$$ $$ \iff \frac{w^3}{4}+w-w^2-\frac{8}{27}=\frac{(3w-8){(2w-3)}^2}{108}\le 0$$

Title: Extrema of ab + ac + bc - abc if a + b + c = 1

Body:
a, b and c are three non-negative real numbers such that a+b+c=1.
What are the extrema of
ab+bc+ca-abc?

I know by AM-GM that $ab + bc + ac \geq 3a^{2/3}b^{2/3}c^{2/3}$ and again by AM-GM $1 \geq 3a^{1/3}b^{1/3}c^{1/3}$ but I'm guessing there is a clever way to write an expression involving the 3 terms, which we can then use AM-GM on in order to solve. Any insights would be appreciated.


问:
Solving $\sqrt{7x-4}-\sqrt{7x-5}=\sqrt{4x-1}-\sqrt{4x-2}$
Where do I start to solve a equation for x like the one below?

$$\sqrt{7x-4}-\sqrt{7x-5}=\sqrt{4x-1}-\sqrt{4x-2}$$

After squaring it, it's too complicated; but there's nothing to factor or to expand?

Ideas?

答:
From $$\sqrt{7x-4}-\sqrt{7x-5}=\sqrt{4x-1}-\sqrt{4x-2}$$ multiply both sides by $$(\sqrt{7x-4}+\sqrt{7x-5})\times(\sqrt{4x-1}+\sqrt{4x-2})$$ obtaining $$\sqrt{4x-1}+\sqrt{4x-2} =\sqrt{7x-4}+\sqrt{7x-5}$$ so that
$$2\sqrt{4x-1}=2\sqrt{7x-4}$$

And after dividing by $2$ and squaring, obtain $x=1$.

Note: this underlies he other answers so far given, but this approach is a form of "multiplying by the conjugate" which comes in handy in a variety of situations.


问:
What is the relationship between the column space of a matrix and its dimensionality?
The following text is from page 36 of chapter 2 of the book Deep Learning by Ian Goodfellow et al.:

In order for the system $Ax = b$ to have a solution for all values of
$b \in \mathbb{R}^m$, we therefore require that the column space of
$A$ be all of $\mathbb{R}^m$. If any point in $\mathbb{R}^m$ is
excluded from the column space, that point is a potential value of $b$
that has no solution. The requirement that the column space of $A$ be
all of $\mathbb{R}^m$ implies immediately that $A$ must have at least
$m$ columns, that is, $n \ge m$. Otherwise, the dimensionality of the
column space would be less than $m$. For example, consider a $3 \times
 2$ matrix. The target $b$ is 3-D, but $x$ is only 2-D, so modifying
the value of $x$ at best enables us to trace out a 2-D plane within
$\mathbb{R}^3$. The equation has a solution if and only if $b$ lies on
that plane.

I'm not sure I understood this part:

The requirement that the column space of $A$ be all of $\mathbb{R}^m$ implies
immediately that $A$ must have at least $m$ columns, that is, $n \ge m$. Otherwise, the dimensionality of the column space would be less than $m$.

Considering a dataset here then does he mean that the number of observations must be at least the number of fields in that dataset. Otherwise the dimensionality or rank or number of pivot entries or number of linearly independent columns would turn out to be less than the number of components i.e. $m$ involved. What will happen if it is less than $m$?

Later he has given an example. Please comment if my understanding is correct.

The target $b$ is 3-D, but $x$ is only 2-D, so modifying the value of $x$
at best enables us to trace out a 2-D plane within $\mathbb{R}^3$.

For a $3 \times 2$ matrix, the target $b$ is 3-D then that means there is a data-set (say) consisting of 3 observations but by $3 \times 2$ matrix as per book and considering each observation as a column vector then there are total 2 observations with 3 properties each and so 2-D nature of $x$ should be justified.

Have I mixed things? Please help and let me know if there is anything else that you might require for more complete comprehension.

答:
What will happen if it is less than $m$?
Then the system will no longer be assured of having a solution since there will be more equations than the number of unknowns involved.

Answer to part 2:
Since for more equations than the number of unknowns involved one will have to try different values of $x_1$ & $x_2$ (taking these to be components of $x$) or linear combinations to trace out a plane spanned by $v_1$ & $v_2$ i.e. $3 \times
 2$ here and checking if $b$ lies on that plane.


问:
I'm a bit confused about function notation and range/domain
Given the function $$f :[-a,3a) \to \mathbb{R}, f(x) = 2a - x $$where $a ∈ \mathbb{R}^+$, then the range of the function of f is:

My working out so far

$$f(x) = 2a - (-a)$$
$$  = 3a$$

$$f(x) = 2a - 3a = -a$$

So would that mean the range of the function is the same as the domain?

答: Close - be careful since your domain is $[-a, 3a)$. Remember that we can't actually input $3a$ into our function and thus $-a$ isn't actually in the range of our function. But, we can certainly say that our range is instead $(-a, 3a]$. How would we rigorously prove this? Well, suppose $x$ is an element of our domain. That is, suppose $-a \leq x < 3a$. Multiplying these inequalities by $-1$, we have $ -3a < -x \leq a$. Then, if we add $2a$ to everything, we obtain $-a < 2a -x \leq 3a$. But that $2a-x$ in the middle is precisely $f(x)$, so we have shown $ -a < f(x) \leq 3a$ holds for all $x$ in our domain. So our range, denote it by $R$, is a subset of $(-a, 3a]$. To show the reverse inclusion, suppose $y \in (-a, 3a]$. That is, $-a < y \leq 3a$. Then, by manipulating these inequalities in a similar manner as done previously, one can show that $2a-y$ is an element of our domain (i.e. $-a \leq 2a - y < 3a$ holds) and clearly $f(2a-y) = y$. Hence, $(-a, 3a] \subset R$ which implies $R = (-a, 3a]$.


问:
Joining faces in planar graph
Let $G=(\{1,\ldots,n\},E)$ be a conncected graph which is planar in the embedding where the vertices $1,\ldots,n$ are placed equidistantly on the circle and all edges are drawn as straight lines.

This graph will have one outer (unbounded) face and (potentially) a certain number of inner (compact) faces. Now iteratively remove edges separating two inner faces.

Question:

Is this procedure well defined in the sense that it is independent of the order of removal? (I think it is)

Is there a name for the resulting graph? I searched for "skeleton" but that does not seem to be correct. What is the structure of the resulting graph? To me it seems that all remaining inner faces will be convex polygons, and that these inner faces are interconnected by trees? Is this correct?

答:
The procedure is well-defined (once you've chosen the embedding you start with), since you'll only be left with edges that border the external face. Those edges can never be deleted, and every other edge eventually will be.

A cactus graph is the name for the result.

Title: Joining faces in planar graph


问:
Weird probability equation
I'm trying to read a lines of code in C++ and I came cross this exponetial.

 exp(x * log(lambda) - lambda - lgamma(x + 1))

x and lambda could mean anything, but I know it's trying to calculate the probability of something, just judging from the only comment made on this function.

I was thinking it might be related to the Poisson distribution, but after taking the taylor expansion of the Poisson distribution, I'm not sure what this equation is.
Maple gives me exp(-lambda) + (exp(-lambda)*ln(lambda) + exp(-lambda)*gamma)*x for the first two terms, which isnt really related.

Does anyone know what this is exponential is?

Thanks for all your help!

答:
Yes, I do. First note that lgamma returns the natural logarithm of the gamma function evaluated at its argument.

Your equation is $e^{x\log \lambda-\lambda-\log \Gamma(x+1)}=\lambda^xe^-\lambda[\Gamma(x+1)]^{-1} =\lambda^xe^-\lambda\frac 1 {x!}$, the pmf of a Poisson distribution with rate parameter $\lambda$ and support $x=0,1,2,..$.

So it’s calculating the probability of observing $x$ number of so and so in the context of your problem.

Title: Weird probability equation


问:
Solve $\sqrt{x+4}-\sqrt{x+1}=1$ for $x$
Can someone give me some hints on how to start solving $\sqrt{x+4}-\sqrt{x+1}=1$ for x?

Like I tried to factor it expand it, or even multiplying both sides by its conjugate but nothing comes up right.

答:
Start by squaring it to get

$$x+4-2\sqrt{(x+4)(x+1)}+x+1=1\;,$$

which simplifies to

$$\sqrt{(x+4)(x+1)}=x+2\;.$$

Now square again.

Title: Solve $\sqrt{x+4}-\sqrt{x+1}=1$ for $x$


问:
Determinant of matrix that is diagonal, but for last row/column
I would like to compute the determinant of a symmetric $(K+1)\times (K+1)$ matrix in which the upper left $K \times K$ matrix is diagonal but the $(K+1)$th row and column are complete. E.g.
$$
X = \begin{bmatrix}
x_1 & 0 & \dots & 0 & y_1 \\
0 & x_2 & \dots & 0 & y_2 \\
\vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & \dots & x_K & y_K \\
y_1 & y_2 & \dots & y_K & y_{K+1}
\end{bmatrix}
$$
Is there a simple way to compute $\det(X)$?

Note, a similar question was asked for a matrix with the same form but with more constraints on the entries:

Determinant of an almost-diagonal matrix

I can't see that the answer to this question helps here though.

答:
$\def\m#1{\left[\begin{array}{r}#1\end{array}\right]}$Given a block matrix
$$X = \m{A&B\\C&D}$$
the determinant is
$$\det(X) = \det\left(D-CA^{-1}B\right)\cdot\det(A)$$
For the current problem, this results in
$$\det(X)
 = \left(y_{K+1}-\sum_{i=1}^K\frac{y^2_i}{x_i}\right)\cdot
   \left(\prod_{\ell=1}^K x_\ell\right)$$


问:
Question about rearranging terms of a sequence in limit superior.
Let $a_n$ be a bounded sequence of real numbers and $\phi: \mathbb{N}\to\mathbb{N}$ a bijection.

Is it true that:
$$\limsup_{n\to \infty} (a_n-a_{\phi(n)})=0 $$

And for that matter does
$\limsup_{n\to \infty} a_n = \limsup_{n\to \infty}a_{\phi(n)} $?

Unable to find a counterexample, I tried to prove this by somehow showing that $|\limsup_{n\to \infty} (a_n-a_{\phi(n)})|\leq 0$.

Using basic properties I get:
\begin{array}
|\limsup_{n\to \infty} (a_n-a_{\phi(n)})|
& \leq |\limsup_{n\to \infty} a_n + \limsup_{n\to \infty}-a_{\phi(n)}| \\
& \leq |\limsup_{n\to \infty} a_n - \liminf_{n\to \infty}a_{\phi(n)}| \\
\end{array}

Which in my mind sums up to showing that the sequence
$a_n-a_{\phi(n)}$ converges. I figured that this is not true since for the sequence $0,1,0,1 \dots$ I can rearrange it as $0,0,1,0,0,1 \dots$ and so the difference of the two is still divergent.

What is the right approach to tackle this type of problem?

答:
Let $a_n=(-1)^n$, and let

$$\varphi(n)=\begin{cases}
n+1,&\text{if }n\text{ is even}\\
n-1,&\text{if }n\text{ is odd,}
\end{cases}$$

so that

$$\langle a_n:n\in\Bbb N\rangle=\langle 1,-1,1,-1,\ldots\rangle\,,$$

and

$$\langle a_{\varphi(n)}:n\in\Bbb N\rangle=\langle -1,1,-1,1,\ldots\rangle\,.$$

Then

$$\langle a_n-a_{\varphi(n)}:\in\Bbb N\rangle=\langle 2,-2,2,-2,\ldots\rangle=\langle 2(-1)^n:n\in\Bbb N\rangle\,,$$

with limit superior $2$.


问:
Example 9.6 in Loring Tu's An Introduction to manifolds
Example 9.6 is showed as follows in Loring Tu's An Introduction to manifolds:

However, I can't understand the thing that "mainly because". The regular submanifold is defined as follows:

I don't know what is the relation between "vanishing coordinate functions" and "zero set of coordinate functions". I get confused here, can anyone clarify this for me?

答: Vanishing is sometimes a synonym for something being zero. The zero set of a function is where the function vanishes/goes to zero. Reading the next line you can see how the adapted chart is just where we have turned all coordinates greater than k to 0, in a sense the information in those higher coordinates has vanished.</p>


问:
Trouble with finding variance of $(\hat{Y_{0}} - Y_{0})$ in terms of regression estimation
This question comes from Rice's Mathematical Statistics Ch. 14 - (14):

Values which may be of use:

$\hat{\beta_{0}} = \bar{y} - \hat{\beta_{1}}\bar{x}$

$Var(\hat{\beta_{1}}) = \frac{\sigma^{2}}{S_{xx}}$

So my problem is in finding the expression correctly. I think my issue is I'm not treating certain parameters and values in the correct way.

Attempt

$$\hat{Y} - Y_{0} = \bar{y} - \hat{\beta_{1}}\bar{x} - \beta_{0} + x_{0} \hat{\beta_{1}} - x_{0}\beta_{1} - e_{0} \\
= \bar{y} - \beta_{0} + \hat{\beta_{1}}(x_{0} - \bar{x}) - x_{0}\beta_{1} - e_{0}$$

Taking the variance:

$$Var(\hat{Y} - Y_{0}) = Var(\bar{y}) + Var(\beta_{0}) + (x_{0} - \bar{x})^{2} Var(\hat{\beta_{1}}) + Var(x_{0}\beta_{1}) + Var(e_{0}) \\
= \frac{\sigma^{2}}{n} +  Var(\beta_{0}) + (x_{0} - \bar{x})^{2}\frac{\sigma^{2}}{S_{xx}} + Var(x_{0}\beta_{1}) + \sigma^{2} $$

This is where I'm stuck. I'm not sure how to treat $ Var(\beta_{0})$ and $Var(x_{0}\beta_{1})$. They are not constants, at least I don't think they are. So I'm missing an assumption I should be applying. Fortunately I do have a solution of what I'm supposed to arrive at:

But I can't seem to work out how to get to this final step based on what I have. What is it I'm forgetting to do?

答:
One assumes that the true process
$$Y_0 = \beta_0 + \beta_1x_0 + e_0$$
holds, where all are constants except $e_0 \sim \mathcal{N}(0, \sigma^2)$. Assume $n$ is the number of data points.

Suppose we have an estimate $\widehat{Y}_0 = \widehat{\beta}_0 + \widehat{\beta}_1x_0$, where all are random variables, with the exception of the fixed $x_0$.

One has
$$\widehat{Y}_0 - Y_0 = \widehat{\beta}_0+\widehat{\beta}_1x_0 - (\beta_0 + \beta_1x_0+e_0)\text{.}$$
For computing the variance, keeping the discussion above in mind, we have
$$\text{Var}(\widehat{Y}_0 - Y_0 ) = \text{Var}(\widehat{\beta}_0+\widehat{\beta}_1x_0-e_0)$$
from ignoring the constants. Next, we have that
$$\text{Var}(\widehat{\beta}_0+\widehat{\beta}_1x_0-e_0) = \text{Var}(\widehat\beta_0) + x_0^2\text{Var}(\widehat\beta_1) + \text{Var}(e_0)+2x_0\text{Cov}(\widehat\beta_0, \widehat\beta_1)-2\text{Cov}(\widehat\beta_0, e_0) - x_0\text{Cov}(\widehat\beta_1, e_0)\text{.}$$
We assume independence between the least-squares estimators  and $e_0$, so these covariances are $0$ and thus
$$\begin{align}
\text{Var}(\widehat{\beta}_0+\widehat{\beta}_1x_0-e_0) &= \text{Var}(\widehat\beta_0) + x_0^2\text{Var}(\widehat\beta_1) + \text{Var}(e_0)+2x_0\text{Cov}(\widehat\beta_0, \widehat\beta_1) \\
&= \sigma^2\left(\dfrac{\sum x_i^2}{nS_{xx}} + \dfrac{x_0^2}{S_{xx}} + 1 - 2x_0 \cdot \dfrac{\bar{x}}{S_{xx}} \right)
\end{align}$$
(The above formulas can be easily derived from some algebra based on the equations provided in the Rice text.)

Now
$$\dfrac{\sum x_i^2}{nS_{xx}} = \dfrac{\sum x_i^2 - n\bar{x}^2+n\bar{x}^2}{nS_{xx}} = \dfrac{\sum (x_i - \bar{x})^2+n\bar{x}^2}{nS_{xx}} = \dfrac{S_{xx} + n\bar{x}^2}{nS_{xx}} = \dfrac{1}{n}+\dfrac{\bar{x}^2}{S_{xx}}$$
thus we obtain
$$\text{Var}(\widehat{\beta}_0+\widehat{\beta}_1x_0-e_0) =  \sigma^2\left(\dfrac{1}{n}+\dfrac{\bar{x}^2 + x_0^2 - 2x_0\bar{x}}{S_{xx}} + 1\right) = \sigma^2\left[1 + \dfrac{1}{n} + \dfrac{(x_0 - \bar{x})^2}{S_{xx}} \right]$$
See, for example, https://en.wikipedia.org/wiki/Mean_and_predicted_response#Predicted_response for comparison.


问:
Why this matrix is positive semi-definite？The difference between RLS estimator and OLS estimator with respect to their variance.
It seems not obvious to me and I want to know why the matrix C is positive semi-definited ?

See the source :
http://web.vu.lt/mif/a.buteikis/wp-content/uploads/PE_Book/4-4-Multiple-RLS.html

Let L be a 'r x k' constants matrix and rank(L)= r,
Let X be a 't x k' constants matrix and rank(X)= k;

\begin{aligned}
\mathbb{V}{\rm ar} \left(\widehat{\boldsymbol{\beta}}^{(OLS)} \right) - \mathbb{V}{\rm ar} \left(\widehat{\boldsymbol{\beta}}^{(RLS)} \right) &= \sigma^2 \left( \mathbf{X}^\top  \mathbf{X}\right)^{-1}  \mathbf{L}^\top \left( \mathbf{L}\left( \mathbf{X}^\top \mathbf{X} \right)^{-1} \mathbf{L}^\top \right)^{-1}  \mathbf{L} \left( \mathbf{X}^\top  \mathbf{X}\right)^{-1} = \sigma^2 \mathbf{C}
\end{aligned}

Here the matrix C

答:
$X^\top X$ is positive definite; so is its inverse.

Since $(X^\top X)^{-1}$ is positive definite, we have $v^\top L (X^\top X)^{-1} L^\top v (L^\top v)^\top (X^\top X)^{-1} (L^\top v) \ge 0$ for any $v$. So $L(X^\top X)^{-1} L^\top$ is positive semi-definite.

Based on your expression it seems $L(X^\top X)^{-1} L^\top$ is also invertible. (I don't think this fact can be deduced from the information you provided.) If so, then this inverse is positive definite.

From there, you can conclude that
$$v^\top (X^\top X)^{-1} L^\top (L(X^\top X)^{-1} L^\top)^{-1} L(X^\top X)^{-1} v
 = w^\top (L(X^\top X)^{-1} L^\top)^{-1} w \ge 0$$
for any $v$, where $w := L(X^\top X)^{-1} v$, so your matrix is positive semi-definite.


问:
Triple integral over region in $\mathbb{R}^3$
Integrate over the following region in $\mathbb{R}^3$:
$$V = \lbrace{ (x, y, z): x^2 + y^2 \leq z^2, 0 <z<1\rbrace}$$

My approach:

$$1=\int_0^1\int_0^{z^2}\int_{-\sqrt{z^2-y^2}}^{\sqrt{z^2-y^2}} (f) dxdydz$$

Are my bounds correct? In $\mathbb{R}^3$ this set seems to be some sort of solid cylinder (I think).

答:
$x^2+y^2 \leq z^2$ is an inverted cone with vertex at the origin and cross sections being circles of radius $z$. While I will come to the triple integral, you can easily write the integral as

$ \pi k \displaystyle \int_0^1 z^3 dz$ (this is because the area of cross sections are $\pi z^2$ with radius $z$.

The correct triple  integral should be

$\displaystyle k \int_{0}^1\int_{-z}^{z}\int_{-\sqrt{z^2-y^2}}^{\sqrt{z^2-y^2}} z \ dx \ dy \ dz = \frac{k \pi}{4}$

(Plug in $y = 0$ to get the bounds of $x$ which is $\pm z$).

To make it easier to integrate, you can also convert this into cylindrical coordinates using

$x = r \cos\theta, y = r\sin\theta, z$.

Then rewrite the equation of the cone and you see it is $z = r$ for $z \gt 0$.

At $z = 1, r = 1$.

So you can write the integral as

$\displaystyle k \int_{0}^{2\pi} \int_{0}^{1}\int_{r}^{1} z \ r \ dz \ dr \ d\theta = \frac{k \pi}{4}$


问:
Comparing $\sqrt{1001}+\sqrt{999}\ , \ 2\sqrt{1000}$
Without the use of a calculator, how can we tell which of these are larger (higher in numerical value)?

$$\sqrt{1001}+\sqrt{999}\ , \ 2\sqrt{1000}$$

Using the calculator I can see that the first one is 63.2455453 and the second one is 63.2455532, but can we tell without touching our calculators?

答:
Square, subtract 2000, divide by 2 for both sides, square again and end up with
1001*999 vs 1000*1000 that is  (1000+1)(1000-1) vs 1000*1000 or 1000 000 -1 vs 1000 000  </p>


问:
New coordinate of another point after rotating one point on $S^2$?
As we rotate $p_a = (x_a, y_a, z_a)$ to $p_b = (x_b, y_b, z_b)$ (both are known), how can we find the the new location of $p_c = (x_c, y_c, z_c)$ after this rotation? Can we instead find out the new location of $\overrightarrow{p_a p_c}$ after this rotation? Thanks in advance.

Edit: I can find the rotation axis $r_{p_a p_c}$ of $\overrightarrow{p_a p_c}$ by taking the cross product of $\overrightarrow{p_a}$ and $\overrightarrow{p_c}$ because that axis is sure both perpendicular to both position vectors. But how can we find out the rotation angle to rotate $p_a$ to $p_b$ along $r_{p_a p_c}$?

答:
Let unit vectors
$$\hat{a} = \frac{p_a}{\lVert p_a \rVert} \quad \text{and} \quad \hat{b} = \frac{p_b}{\lVert p_b \rVert}$$
One way to rotate $\hat{a}$ to $\hat{b}$ is to rotate around unit axis vector $\hat{n}$ by angle $\theta$,
$$\begin{aligned}
\vec{n} &= \hat{a} \times \hat{b} \\
\hat{n} &= \frac{\vec{n}}{\lVert\vec{n}\rVert} \\
\cos\theta &= \hat{a} \cdot \hat{b} \\
\end{aligned}$$
where $\times$ denotes vector cross product, and $\cdot$ dot product.


问:
Solve the equation $u_x+(1+y^2)u_y=0$

Solve $u_x+(1+y^2)u_y=0$

I wanted to use characteristic method so I have that $dx/1=dy/(1+y^2)=du/0$

Which gives $dy/dx=1+y^2$ solving gives $-arctan(x)=x+c$

And solving $du/dx=0$ gives $u=g(c)$

Im not sure what I'm supposed to do now.

答:
Since that we need to solve $$\color{blue}{1}\frac{\partial u}{\partial x}(x,y)+\color{blue}{(1+y^{2})}\frac{\partial u}{\partial y}(x,y)=\color{blue}{0}$$
then the Lagrange-Charpit equations are given by $$\frac{dx}{1}=\frac{dy}{1+y^{2}}=\frac{du}{0}$$
Now, we have  $$\frac{dx}{1}=\frac{dy}{1+y^{2}}  \quad [1] \quad \text{and} \quad \frac{dx}{1}=\frac{du}{0} \quad [2]$$
In $[1]$ we can see that $$\int \frac{dx}{1}=\int \frac{dy}{1+y^{2}} \implies \color{blue}{\boxed{x=\arctan(y)+C_{1}}}$$
and in $[2]$ we can see that $$\frac{du}{dx}=0 \implies \color{blue}{\boxed{u=C_{2}}}$$
The last equation gives inmediately $u=C_{2}$.

The general solution is given by $$C_{2}=f(C_{1})$$
where $f$ is an arbitrary function of the single variable $C_{1}$. Substituting $C_{1}$ and $C_{2}$ by their expressions, we finally have that $$\color{blue}{\boxed{u(x,y)=f(x-\arctan(y))}}$$

Title: Solve the equation $u_x+(1+y^2)u_y=0$


问:
I have confusion here in the limit whether I can take out the real function whose value is always greater or equal to 1 or not?
$$\lim_{n\to \infty}\alpha (x_n,x_{n+1})d(x_n,x_{n+1})≤0 $$ where $\alpha (x_n,x_{n+1}): X×X→[1,\infty), x_n=T^n(x)$,as $T:X\to X$,X is complete metric space

Can we imply ,
$$\lim_{n\to\infty}d(x_n,x_{n+1})≤0$$

答:
It follows that $$\lim_{n\to \infty} 1 \cdot d(x_n,x_{n+1}) \leq \lim_{n\to \infty}\alpha (x_n,x_{n+1})d(x_n,x_{n+1})≤0$$
so yes, it does imply that. I am not sure why completeness even matters here, are you missing something?


答:
I'll answer the What happens if $n$ is less than $m$? part differently. Say we have an $m \times n$ matrix $A$ consisting of columns $A_1, \ldots, A_n$. We can think of these columns as vectors in $\mathbb{R}^m$. That is, each column in an $m \times n$ matrix has precisely $m$ real entries. Let's ask the question: What is the column space of $A$? Well, hopefully you know that the column space is, by definition, the span of $\{A_1, \ldots, A_n\}$. That is, the column space of $A$ is the set $$B = \{a_1A_1 + \ldots + a_nA_n: a_i \in \mathbb{R} \ \text{for each} \ i=1, \ldots, n\}$$
Notice that since each of the columns $A_i$ live in $R^m$, the column space $B$ is a subset of $R^m$. However, we are told that not only is $B \subset \mathbb{R}^m$, we are told that $B = \mathbb{R}^m$ exactly. This means that a subset $X$ of $\{A_1, \ldots, A_n\}$ with cardinality $|X| = r \leq n$ is a basis for $\mathbb{R}^m$. If the columns $A_1, \ldots, A_n$ are all linearly independent, then we may simply let $X = \{A_1, \ldots, A_m\}$. Otherwise, remove columns from the set $\{A_1, \ldots, A_n\}$ until you DO get a set of linearly independent columns and call that set $X$. But any basis of $\mathbb{R}^m$ must have exactly $m$ elements. Since $|X| = r \leq n < m$, we have found a basis of $\mathbb{R}^m$ with less than $m$ elements. This is a contradiction.

Title: What is the relationship between the column space of a matrix and its dimensionality?

Body:
The following text is from page 36 of chapter 2 of the book Deep Learning by Ian Goodfellow et al.:

In order for the system $Ax = b$ to have a solution for all values of
$b \in \mathbb{R}^m$, we therefore require that the column space of
$A$ be all of $\mathbb{R}^m$. If any point in $\mathbb{R}^m$ is
excluded from the column space, that point is a potential value of $b$
that has no solution. The requirement that the column space of $A$ be
all of $\mathbb{R}^m$ implies immediately that $A$ must have at least
$m$ columns, that is, $n \ge m$. Otherwise, the dimensionality of the
column space would be less than $m$. For example, consider a $3 \times
 2$ matrix. The target $b$ is 3-D, but $x$ is only 2-D, so modifying
the value of $x$ at best enables us to trace out a 2-D plane within
$\mathbb{R}^3$. The equation has a solution if and only if $b$ lies on
that plane.

I'm not sure I understood this part:

The requirement that the column space of $A$ be all of $\mathbb{R}^m$ implies
immediately that $A$ must have at least $m$ columns, that is, $n \ge m$. Otherwise, the dimensionality of the column space would be less than $m$.

Considering a dataset here then does he mean that the number of observations must be at least the number of fields in that dataset. Otherwise the dimensionality or rank or number of pivot entries or number of linearly independent columns would turn out to be less than the number of components i.e. $m$ involved. What will happen if it is less than $m$?

Later he has given an example. Please comment if my understanding is correct.

The target $b$ is 3-D, but $x$ is only 2-D, so modifying the value of $x$
at best enables us to trace out a 2-D plane within $\mathbb{R}^3$.

For a $3 \times 2$ matrix, the target $b$ is 3-D then that means there is a data-set (say) consisting of 3 observations but by $3 \times 2$ matrix as per book and considering each observation as a column vector then there are total 2 observations with 3 properties each and so 2-D nature of $x$ should be justified.

Have I mixed things? Please help and let me know if there is anything else that you might require for more complete comprehension.


答:
It looks like this is happening.

Suppose the tensor components are $a_{ijk}$ where $i$ tells you which matrix you're talking about, $j$ says which row you're talking about, and $k$ says which column you're talking about. The transpose you presented then has components $a_{kji}$, so transpose seems to reverse the indices, or at least swapp first/last indices.

Of course your $jk$ indices can be swapped without changing $a_{ijk}$ which means $a_{jki}$ is another possibility; you should have made the rows/columns in your choice of $a$ distinguishable so you can better see what the operation is doing.

Title: Transpose of a 3D Tensor

Body:
I'm finding it difficult to wrap my head around how the transpose operation works for Tensors of Rank 3 and above.

Here's an example in PyTorch

I was doing a transpose of tensors of rank 3 and according to transpose rule for rank 2 tensors which follow simple 2D matrix transpose rule. $$ {A_{ij}}^T =A_{ji} $$
But when I transposed a rank 3 tensor I ended up with a different output given below.

Can someone explain to me how is this happening?

```<code>a = torch.tensor(
        [[[1., 1., 1.],
         [1., 1., 1.],
         [1., 1., 1.]],

        [[0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.]],

        [[1., 1., 1.],
         [1., 1., 1.],
         [1., 1., 1.]]])
</code>```

Printing the tensor and the shape gives the following:

```<code>print(a)
print(a.shape)
tensor([[[1., 1., 1.],
         [1., 1., 1.],
         [1., 1., 1.]],

        [[0., 0., 0.],
         [0., 0., 0.],
         [0., 0., 0.]],

        [[1., 1., 1.],
         [1., 1., 1.],
         [1., 1., 1.]]])
torch.Size([3, 3, 3])

</code>```

Transposing with a.T we get

```<code>tensor([[[1., 0., 1.],
         [1., 0., 1.],
         [1., 0., 1.]],

        [[1., 0., 1.],
         [1., 0., 1.],
         [1., 0., 1.]],

        [[1., 0., 1.],
         [1., 0., 1.],
         [1., 0., 1.]]])
</code>```

Edit:
As suggested I'm adding another example with unique values for every entry.

Tensor b

```<code>tensor([[[ 1.,  2.,  3.],
         [ 4.,  5.,  6.],
         [ 7.,  8.,  9.]],

        [[10., 11., 12.],
         [13., 14., 15.],
         [16., 17., 18.]],

        [[19., 20., 21.],
         [22., 23., 24.],
         [25., 26., 27.]]])
</code>```

Transpose of Tensor b ( b.T)

```<code>tensor([[[ 1., 10., 19.],
         [ 4., 13., 22.],
         [ 7., 16., 25.]],

        [[ 2., 11., 20.],
         [ 5., 14., 23.],
         [ 8., 17., 26.]],

        [[ 3., 12., 21.],
         [ 6., 15., 24.],
         [ 9., 18., 27.]]])
<span class="math-container">```
```


答:
Well, for the first part, consider $A=\left(\begin{matrix}|&|&...&|\\a_1&a_2&...&a_n\\|&|&...&|\end{matrix}\right)$ and $x=\left(\begin{matrix}x_1\\x_2\\...\\x_n\end{matrix}\right)$. Then $Ax=\left(\begin{matrix}|\\a_1\\|\end{matrix}\right)x_1+\left(\begin{matrix}|\\a_2\\|\end{matrix}\right)x_2+...+\left(\begin{matrix}|\\a_n\\|\end{matrix}\right)x_n$ where each $\left(\begin{matrix}|\\a\\|\end{matrix}\right)$ has $m$ entries. If $n<m$ it's not possible to span all of $\mathbb R^m$ with a linear combination of $n$ vectors, even if they're all linearly independent. If $n\ge m$, then it's possible to span all of $\mathbb R^m$ (but it's possible that it also doesn't, if the vectors are linearly dependent etc.) Now the $b$ vector in $Ax=b$ has to be in the column space of $A$ for it to be a solution and... I think you can make the connection.

Now look at the $3\times2$ example.

$Ax=\left(\begin{matrix}3&2\\1&2\\4&5\end{matrix}\right)\left(\begin{matrix}x\\y\end{matrix}\right)=\left(\begin{matrix}a\\b\\c\end{matrix}\right)$

$Ax=\left(\begin{matrix}3\\1\\4\end{matrix}\right)x+\left(\begin{matrix}2\\2\\5\end{matrix}\right)y=\left(\begin{matrix}a\\b\\c\end{matrix}\right)$

You can see that you will get a plane through the origin right? If the right hand point/vector is in this plane, then it's a solution. If it's anywhere not on this plane, then it's not a solution.

A general result is that $Ax=b$ has solutions if $dim(C(A))=m$, and may not have solutions if $dim(C(A))<m$

As for your question in the title, the rank of a matrix is the dimension of its column space.


问:
how to find interval of convergence of Taylor series
I have problem with Taylor series of the function $$f(x) = \dfrac{1}{x+4}$$ around x=2. I calculated the derivatives and then subtitute into formula, but I don't know what to do next. Could someone explain it to me step-by-step?

答:
It's easy to see that:
$\displaystyle\frac{1}{x+4}=\frac{1}{x+4+2-2}=\frac{1}{(x-2)+6}=\frac{1}{6[\frac{x-2}{6}+1]}=\frac{1}{6[1-\frac{2-x}{6}]}=\frac{1}{6}\cdot\frac{1}{1-\frac{2-x}{6}}$

Adding the fact that:

$S_n=1+x+x^2+\ldots+x^n$

$x S_n = x+x^2+\ldots+x^{n+1}$

$S_n-xS_n=(1-x)S_n=1-x^{n+1}$

Where we finally get: $S_n=1+x+x^2+\ldots+x^n=\displaystyle\frac{1-x^{n+1}}{1-x}$

Thus $\displaystyle\frac{1}{1-x}=1+x+x^2+\ldots+x^n+\frac{x^{n+1}}{1-x}$

Use the Taylor's subtitution property with $x=\frac{2-x}{6}$, and multiply the whole polynomial by $\frac{1}{6}$.

Then, $\displaystyle T_n\bigg(\frac{1}{x+4},0\bigg)(x)=\frac{1}{6}T_n\bigg(\frac{1}{1-\frac{2-x}{6}},0\bigg)\displaystyle=\frac{1}{6}\sum_{k=0}^n\bigg(\frac{2-x}{6}\bigg)^k+R_n\bigg(\frac{1}{x+4},0\bigg)(x)$

Where $\displaystyle R_n\bigg(\frac{1}{x+4},0\bigg)(x)=\bigg(\frac{2-x}{6}\bigg)^{n+1}\cdot \frac{1}{1-\frac{2-x}{6}}$

Hope it helps.


问:
A specific type of orthogonal bases
In $\mathbb{R}^n$, can we find an orthogonal basis $v_1,v_2,\ldots,v_n$ with $\|v_i\|=1$ such that
$$\|\bar{v}_1\|=\|\bar{v}_2\|= \cdots =\|\bar{v}_n\|$$
where $\bar{v}_i\in\mathbb{R}^m$ is the vector formed by the first $m$ coordinates of $v_i$ with respect to the standard basis and $m$ is a given integer $m<n$.</p>

答:
I only have partial answers: for when $n=2^k$, for when there is an $n\times n$ Hadamard matrix, and for $n=3$.

When $n=2^k$ we can find one such basis that works for every $m<n$.

For $n=2$, we can take $v_1=(1,1)/\sqrt2$ and $v_2=(1,-1)/\sqrt{2}$.

For $k>1$, a suitable basis for $\mathbb{R}^{2^k}$ is given by the $2^k$ vectors $w=w_1\otimes w_2\otimes\dots\otimes w_k$ where $w_j\in \{v_1,v_2\}$ for $1\le j\le k$, and $\otimes$ is the Kronecker product. Every entry of such a vector $w$ is $\pm 1/2^{k/2}$, so $\|\overline w\|=\sqrt{m/2^k}$, regardless of how the $w_k$'s are chosen from $\{v_1,v_2\}$.

This construction is a special case of the following: if you can find an $n\times n$ Hadamard matrix then its columns give a basis of $\mathbb{R}^n$ which you can scale by $1/\sqrt n$ to answer your question in the affirmative. The size of a Hadamard matrix is either $1$, $2$ or a multiple of $4$, and it's conjectured that they exist for every multiple of $4$. (Remark: the same argument shows that if you change the question from $\mathbb{R}^n$ to $\mathbb{C}^n$, then the answer is always yes, because Fourier matrices can be used instead of Hadamard matrices in this argument, and they exist for every $n$.)

An ad hoc calculation for $n=3$ shows that you can find a suitable basis then, although this time my choice of basis depends on whether $m=1$ or $m=2$. For $m=2$ we can take $v_1=(\sqrt{2/3},0,1/\sqrt3)$, $v_2=(1/\sqrt6,1/\sqrt2,-1/\sqrt3)$, $v_3=(1/\sqrt6,-1/\sqrt2,-1/\sqrt3)$ and for $m=1$ you can turn each of these vectors back to front.

Title: A specific type of orthogonal bases


Title: Solve $\sqrt{x+4}-\sqrt{x+1}=1$ for $x$

Body:
Can someone give me some hints on how to start solving $\sqrt{x+4}-\sqrt{x+1}=1$ for x?

Like I tried to factor it expand it, or even multiplying both sides by its conjugate but nothing comes up right.

Body:
HINT:

As $(x+4)-(x+1)=3 \ \ \ \ \ $

$\implies (\sqrt{x+4}-\sqrt{x+1})(\sqrt{x+4}+\sqrt{x+1})=3$

$$\text{As }\sqrt{x+4}-\sqrt{x+1}=1\ \ \ \ \ (1)$$

$$\implies  \sqrt{x+4}+\sqrt{x+1}=3\ \ \ \ \ (2)$$

Add/subtract  $(1)$ and $(2),$ then square

Generalization :

$$\text{As }(ax+b)-(ax+c)=b-c$$

$$\text{If }\sqrt{ax+b}-\sqrt{ax+c}=d \ \ \ \ \ (1) $$

$$\text{As } (ax+b)-(ax+c)=(\sqrt{ax+b}-\sqrt{ax+c})(\sqrt{ax+b}+\sqrt{ax+c})$$

$$\implies \sqrt{ax+b}+\sqrt{ax+c}=\frac{b-c}d\ \ \ \ \ (2)$$

Add/subtract $(1)$ and $(2),$ then square


问:
How to do t-test with multiple probabilities?
I have given some distribution among candy preferences. 30% of people like candy1, 30% of people like candy2, and 40% of people like candy3. The total amount of people is known, e.g. 100.
Now the candy manufacturer says that all his candy flavors are being liked equally. This hypothesis shall be tested with a significance of 5%. I never did such a test with multiple probabilities.

My idea is to compare the mean value with the expected mean value (where 100/3 people would like each candy flavor equally). But I am not sure how to calculate the actual mean value.

答:
Comment following @Ian's first Comment. This is not
a formal answer to your Question, but thinking about
what I have shown may get you started in a useful
direction. [I am not talking about Ian's G test. And a t test is not what you want.]

If the information at the start of your Question is
correct, then preferences of $n = 100$ people might be
as in the vector x below, which I simulated in R.

```<code>set.seed(128)
x = sample(1:3, 100, rep=T, p = c(.3,.3,.4))
table(x)
x
 1  2  3
33 28 39
</code>```

How would you use a chi-squared test to see if these counts are consistent with the manufacturer's null hypothesis that all three flavors are 'liked equally'?

Results from R, are as follows. How is the chi-squared statistic computed in chisq.test? (Can you find it using a calculator?) How is the P-value found? Is the null hypothesis rejected? Do you think $n = 100$ subjects is
enough to investigate whether the null hypothesis is true?

```<code>chisq.test(c(33, 28, 39))

        Chi-squared test for given probabilities

data:  c(33, 28, 39)
X-squared = 1.82, df = 2, p-value = 0.4025
</code>```

Note: If no other probabilities are provided
for chisq.test, the given probabilities are assumed to be
all equal: here $(1/3, 1/3, 1/3).$

Body:
Comment following @Ian's first Comment. This is not
a formal answer to your Question, but thinking about
what I have shown may get you started in a useful
direction. [I am not talking about Ian's G test. And a t test is not what you want.]

If the information at the start of your Question is
correct, then preferences of $n = 100$ people might be
as in the vector x below, which I simulated in R.

set.seed(128)
x = sample(1:3, 100, rep=T, p = c(.3,.3,.4))
table(x)
x
 1  2  3
33 28 39

How would you use a chi-squared test to see if these counts are consistent with the manufacturer's null hypothesis that all three flavors are 'liked equally'?

Results from R, are as follows. How is the chi-squared statistic computed in chisq.test? (Can you find it using a calculator?) How is the P-value found? Is the null hypothesis rejected? Do you think $n = 100$ subjects is
enough to investigate whether the null hypothesis is true?

chisq.test(c(33, 28, 39))

        Chi-squared test for given probabilities

data:  c(33, 28, 39)
X-squared = 1.82, df = 2, p-value = 0.4025

Note: If no other probabilities are provided
for chisq.test, the given probabilities are assumed to be
all equal: here $(1/3, 1/3, 1/3).$


问:
Power series expansion for $ f(x)=\frac{1}{x^2+2x+2} $
I struggle to find the power series expansion of

$$
 f(x)=\frac{1}{x^2+2x+2}
$$

I stopped here
$$
f(x)=\sum_{n=0}^{+\infty}{(-1)^n*(x+1)^{2n}}
$$
but I can't seem to find how to get to $ f(x)=\sum_{n=0}^{+\infty}{ a_n x^{n}} $. is it even possible ?

答:
$$f(x)=\frac{1}{x^2+2x+2}=\frac{1}{(x-a)(x-b)}$$ where $a=-1-i$ and $b=-1+i$. So, using partial fraction decomposition
$$f(x)=\frac 1{a-b} \left(\frac 1{x-a}-\frac 1{x-b}\right)$$ Now, look at the series expansion
$$\frac 1{x-c}=-\sum_{n=0}^\infty c^{-(n+1)}x^n$$

Apply twice, play with the complex numbers to get
$$f(x)=\sum_{n=0}^\infty d_n\,x^n$$ where
$$d_n= 2^{-(n+2)} (1+i)\left((-1+i)^n-i (-1-i)^n\right)$$ which, for sure, are all real.

For sure, you can play with trigonometric functions and have
$$d_n= 2^{-\frac{n}{2}-1} \left(\cos \left(\frac{3 \pi  n}{4}\right)-\sin \left(\frac{3 \pi  n}{4}\right)\right)$$ that you could still simplify.


问:
(Delta-Epsilon) How do i prove this?
So i am trying to practice questions about Delta-Epsilon and i got stuck on this one here, $x^2-8x+14=7$ as x approaches 1.

i know that $|x-1|$<$d$ implies that:

$x^2-8x+14=7$

$x^2 -8x+7$

$(x-1)(x-7)$

So if the absolute value of x-1 is less than 1 then $-1<x-1<1$ and so does that mean that $(x-7)$ is equal to $-7<x-7<-5$? Because if that is true then doesnt it mean that $-5|x-1|<ϵ$

$|x-1|<ϵ/-5$

So how can we have a negative in epsilon? can anyone explain where i got it wrong?

答:
Start with what you are trying to satisfy.  Given an $\epsilon \gt 0$ you want to ensure that $|x^2-8x+7| \lt \epsilon$.  It makes good sense to factor that and get $|(x-7)(x-1)| \lt \epsilon$ but you forgot the absolute value signs.  Now note that you can split apart the absolute value to get $|x-7||x-1| \lt \epsilon$  If you start by stating that $\delta$ will be less than $1$ you can guarantee that $|x-7| \lt 7$ so you can say $\delta =\min(1, \frac \epsilon 7)$ is guaranteed to work.  All the steps are reversible, but you should go in the other order.

Given $\epsilon,$ I choose $\delta$ to be $\min(1, \frac \epsilon 7)$.  If $|x-1| \lt \delta, |x-7| \lt 7$ so $|x-1||x-7| \lt 7 \cdot \frac \epsilon 7=\epsilon$

Title: (Delta-Epsilon) How do i prove this?


问:
A bag contains 7 white balls and 3 red balls. A ball is taken and its colour noted. It is not replaced. A second ball...
The question is: A bag contains 7 white balls and 3 red balls. A ball is taken and its colour noted. It is not replaced. A second ball is taken and its colour noted. Find the probability of obtaining two white balls.

Solution:

Let $A$ be the event 'the first ball is white'.

Let $B$ be the event 'the second ball is white'.

$P(A \cap B)=P(A) P(B \mid A)=\frac{7}{10} \times \frac{6}{9}=\frac{7}{15}$

I don't understand how $P(B \mid A)=\frac{6}{9}$. Intuitively, it makes sense: $\frac{6}{9}$ represents the probability that the second ball is white given that the first ball is white, and this is sampling without replacement.

But $P(B \mid A)=\frac{n(A \cap B)}{n(A)}$, so am I to understand that $n(A)=9$ and $n(A \cap B)=2$? The fact that $n(A)=9$ and $n(A \cap B)=2$ doesn't make sense to me, even though $P(B \mid A)=\frac{6}{9}$ seems intuitively correct. Thanks..

答:
$n(A \cap B)$ and $n(A)$ are not counting the number of balls in the bag. They are counting the number of ways to satisfy the conditions of $A \cap B$ and $A$. That is:

$n(A \cap B)$ is the total number of all possible ways of getting both the first and second ball as whites. There are $7$ possible ways of getting the first white ball; then, after that white ball is removed, there are $6$ possible ways of getting the second white ball. So, $n(A \cap B) = 7 \cdot 6$.

$n(A)$ is the total number of all possible ways of getting the first ball as white. The second ball can be anything. So, there are $7$ ways of getting the first white ball; then, after that first white ball is removed from the bag, $10 - 1 = 9$ balls remain. So there are $9$ ways of getting the second ball. Hence $n(A) = 7 \cdot 9$.

Thus $n(A \cap B) / n(A) = (7 \cdot 6) / (7 \cdot 9) = 6/9$. And this brute force counting approach matches the more "intuitive" $P(B | A) = 6/9$.


问:
Partial derivative vs Total derivative
Are partial derivative and total derivative different for a system with independent variables?
The term $\frac{df(x,y)}{dx} = \frac{\partial f(x,y)}{\partial x}+\frac{\partial f(x,y)}{\partial y}\frac{dy}{dx}$. But as $y$ and $x$ are independent, so $\frac{dy}{dx} = 0$. So, how are two different?

答:
Strictly speaking, the equation you have written down is riddles with notational ambiguities. What is going on is that there are actually three different functions involved:

We have a function $f:\Bbb{R}^2\to\Bbb{R}$. This means it takes in a tuple of numbers as an input and spits out a real number as output.

We then have a function $g:\Bbb{R}\to\Bbb{R}$. This takes in a real number as input and spits out a real number.

Finally, we have a third function $F:\Bbb{R}\to\Bbb{R}$. This function is defined in a very specific way from the previous two functions: we define for each $x\in\Bbb{R}$, $F(x):= f(x,g(x))$. Note that $F$ and $f$ are COMPLETELY DIFFERENT FUNCTIONS (afterall how can two functions be equal if one of them has domain $\Bbb{R}^2$ and the other has domain $\Bbb{R}$). We say that $F$ is obtained from $f$ via composition.

Let me just re-emphasize what the third bullet point means. If you give me a specific real number $x\in\Bbb{R}$, then the quantity $g(x)$ is also a specific real number. The quantity $(x,g(x))$ is a specific tuple of real numbers. So, $f(x,g(x))$ is a specific real number. I'm only emphasizing these things because it is very important to distinguish between a function (which is a "rule") vs the value of a function when evaluated at a point of its domain (which is a certain output in the target space).

Now, what is being claimed is that by the chain rule,
\begin{align}
F'(x)&= (\partial_1f)_{(x,g(x))} + (\partial_2f)_{(x,g(x))}\cdot g'(x) \tag{$*$}
\end{align}
And of course, there is no reason at all to assume $g'=0$ identically.
Here, the notation $\partial_if_{(a,b)}$ means the partial derivative of the function $f$ along the $i^{th}$ coordinate direction, evaluated at the point $(a,b)$. It is important to note that $\partial_if$ is a function, while $(\partial_if)_{(a,b)}$ is a specific real number obtained by evaluating the function on an element of its domain. I think $(*)$ is the most notationally precise and unambiguous way of writing things down. A slightly more common way of writing things is as follows:
\begin{align}
\dfrac{dF}{dx}\bigg|_x &=\dfrac{\partial f}{\partial x}\bigg|_{(x,g(x))} + \dfrac{\partial f}{\partial y}\bigg|_{(x,g(x))}\cdot \dfrac{dg}{dx}\bigg|_{x} \tag{$**$}
\end{align}
This is I think as precise as you can get when using Leibniz's notation.

Hopefully by now it is clear that your confusion arises from a poor notational choice. Wherever you read that equation from, they're reusing the same letters in two different places with two different meanings, which is why you're getting confused:

On the left hand side, they're using the letter $f$ when they should have actually been using $F$.

On the right hand side, the meaning of the $y$ in $\frac{\partial f}{\partial y}$ is different from the meaning of $y$ in $\dfrac{dy}{dx}$.

Also, they're not indicating the point of evaluation of the derivatives.

The most ambiguous (for a beginner) way of writing down this relationship is
\begin{align}
\dfrac{df}{dx}&=\dfrac{\partial f}{\partial x}+\dfrac{\partial f}{\partial y}\dfrac{dy}{dx}. \tag{$***$}
\end{align}

See also this other answer of mine for similar things about varying levels of precision in notation, and this answer, which deals with derivatives in the setting of Lagrangian mechanics.

Title: Partial derivative vs Total derivative


问:
Surjective Function - can some elements in A have image which isn't in B
f : A → B

For f to be a surjective function, for every $b \in B$, there needs to a $a \in A$ such that f(a) = b

However, it is also necessary, that every $a \in A$, $f(a) \in B$?

i.e. can there be elements in A which have an image which is not in B?

答:
Writing $f : A \rightarrow B$ already means that for each $a \in A$ it is $f(a) \in B$.

Saying that a function is surjective implies that you are talking about the previously declared codomain ($B$).


问:
Proof that $\sum 2^{-i}X_i$ converges in distribution to a uniform distribution
Question:

Let $X_1, X_2, \ldots, X_n$ be independent and identically distributed random variables such that: $$P(X_i = 1) = P(X_i = -1) = \frac{1}{2}$$
Derive the moment generating function of $Y_n := \sum^n_{i=1} a_iX_i$ where $a_1, \ldots, a_n$ are constants.
Then, let $a_i = \frac{1}{2^i}$ and show that $Y_n$ converges in distribution to the uniform distribution on $(-1, 1)$.

Attempt:

For the moment generating function:

$$M_{Y_n}(t) = \mathbb{E}(e^{t(a_1x_1 + ... +a_nx_n)}) = \prod_{i=1}^n \mathbb{E}(e^{ta_iX_i}) = \frac{1}{2^n} \prod_{i=1}^n (e^{ta_i} + e^{-ta_i})$$

(Using $\mathbb{E}(e^{ta_iX_i}) = \frac{1}{2} (e^{ta_i} + e^{-ta_i})$.)

However, I'm not sure about the distribution function. So far, I can show that:

$Y_n := \sum^n_{i=1} \frac{1}{2^i} X_i$, and since $-1 \leq X_i \leq 1$,

$-\sum^n_{i=1} \frac{1}{2^i} \leq Y_n \leq \sum^n_{i=1} \frac{1}{2^i} \quad \Rightarrow \quad -1 \leq \lim Y_n \leq 1$.

I'm not sure how to proceed from here, because I feel like my next few lines are lacking rigor. I wrote:

Hence, $\forall x < -1, \quad  \lim P(Y_n \leq x) = 0$, and

$\forall x > 1, \quad \lim P(Y_n \leq x) = 1$

Which is so far consistent with the distribution function of the uniform distribution. However, I am unsure if this is correct, and of how to tackle the case for $-1 \leq x \leq 1$.

Any suggestions and corrections would be appreciated, thank you!

答:
Note : The $X_i$ defined by you, taking values $\pm 1$ with probability half is called a $\color{#e24f}{Rademacher}$ random variable.

One of the important theorems of probability theory, that allows you to show that a certain sequence converges is distribution, is the uniqueness theorem for moments. If you can show two things for a sequence $X_n$ :

The moments of $X_n$ converge to the moments of some random variable $X$.

Any random variable with those moments is uniquely determined.

Then you can conclude that $X_n \to X$ in distribution. In other words, if the MGFs of $X_n$ converge pointwise and the limit is the MGF of a unique random variable, then the random variables themselves converge in distribution.

A very simple theorem, which you can try to prove, is that any bounded distribution is determined by its moments. Therefore, the uniform random variable is determined by its moments, and therefore its MGF.

We look at $M_{Y_n}(t)= \frac 1{2^n} \prod_{i=1}^n (e^{ta_i} + e^{-ta_i})$, and where this is going to converge. Since $a_i = 2^{-i}$ we substitute to get $\frac 1{2^n}\prod_{i=1}^n (e^{t2^{-i}} +e^{-t2^{-i}})$.

At this point, we make an observation super-crucial to Rademacher random variables : $\frac{e^x + e^{-x}}{2} = \cosh(x)$, the hyperbolic cosine function. The reason why $a_i = \frac 1{2^i}$ works so well is that there's a nice identity called Euler's identity, which states that $$
\frac{\sinh(t)}{t} = \prod_{n=1}^{\infty} \cosh\left(\frac{t}{2^n}\right)
$$
and one that you should remember in the context of MGF convergence.

Note that $M_{Y_n}(t) = \prod_{i=1}^n \cosh\left( \frac t{2^i}\right)$. Therefore, by Euler's identity, $M_{Y_n}(t) \to \frac{\sinh(t)}{t}$ for all $t \in \mathbb R$!

Now, what random variable has $\frac{\sinh(t)}{t}$ as its MGF? You can check that $E[e^{tY}] = \frac{\sinh(t)}{t}$ where $Y \sim U(-1,1)$. Thus we complete the problem.

An alternate way of deriving intuition (not a rigorous proof) is to let $Z_i = \frac{X_i + 1}{2}$. Then $Z_i$ are iid Bernoulli$(\frac 12)$ random variables taking values in $\{0,1\}$. In particular, if $Y$ is a random variable that is to be a limit of $Y_n$, then $\frac{Y+1}{2} = \sum_{i=1}^\infty Z_i 2^{-i}$ is precisely the binary expansion of a real number in $[0,1]$ chosen at random i.e. $\frac{Y+1}{2} \sim U(0,1)$. It follows that $Y \sim U(-1,1)$.

You can find far more details on Rademacher variables here.

I provide a standalone proof of the Euler identity I used above.

Note that $\frac{e^{-x} - e^{x}}2 = \frac{(e^{x/2} + e^{-x/2})(e^{x/2} - e^{-x/2})}{2}$ for all $x$, by taking a difference of squares. Therefore, we have : $$
\frac{\sinh(t)}{t} = \frac{e^{t}-e^{-t}}{2t} = \frac{(e^{t/2}-e^{-t/2})(e^{t/2} + e^{-t/2})}{2t} = \frac{e^{t/2} + e^{-t/2}}{2}\frac{e^{t/2} - e^{-t/2}}{t} \\ = \frac{e^{t/2} + e^{-t/2}}{2} \frac{e^{t/4} + e^{-t/4}}{2} \frac{e^{t/4} - e^{-t/4}}{t} = \cosh\left(\frac t2\right) \cosh\left(\frac t4\right)  \frac{e^{t/4} - e^{-t/4}}{2^{-1}t}\\ = ... = \frac{e^{t2^{-n}} - e^{t2^{-n}}}{2^{-n+1}t} \prod_{i=1}^n \cosh\left (\frac t{2^i}\right)
$$

for all $n \in \mathbb N$. So of course we may take $n \to \infty$ on the right hand side, and note that $\lim_{n \to \infty} \frac{e^{t2^{-n}} - e^{t2^{-n}}}{2^{-n+1}t} = 1$ since we may take $u = t2^n$ in that expression and get $\lim_{u \to 0}\frac{e^{u} - e^{-u}}{2u} = 1$, since that's the limit $\lim_{h \to 0} \frac{f(x+h) - f(x-h)}{2h} = f'(x)$ for $f(s) = e^s$ and $x=0$. The identity follows.


问:
A geometric proof for the inequality $\frac{2x}{\pi} \le \sin(x)$
The inequality $\frac{2x}{\pi}\le \sin(x)\le x$ for $0 \le x\le \frac \pi 2$ is well known; it can be proved using calculus.

The second part can be proved for $x\in [0,\pi/2]$ by geometric arguments:

Take unit circle with center origin. Then compare areas of (sector with angle $x$) and (right angled triangle with height $\sin x$).

Q. Can we prove $\frac{2x}{\pi}\le \sin(x)$ for $x\in [0,\pi/2]$ by geometric arguments?

Note: There are proof of first inequality are available using calculus, but I want to know if there is a proof, not based on calculus (Rolle's theorem, or mean value theorem etc.), but with some basic geometric arguments as done in the proof of $\sin(x)\le x$.

答:
Let
$$f(x)=\sin x-\frac{2x}{\pi},x\in[0,\pi/2].$$
Then $$f''(x)=-\sin x\leq 0,x\in[0,\pi/2],$$
which implies $f(x)$ is concave function.

$\textbf{Concavity implies the function is above the secant line.}$

Due to $f(0)=f(\pi/2)=0$, we can get
$$f(x)\geq tf(0)+(1-t)f(\pi/2)=0,x\in[0,\pi/2].$$


问:
Solving $u_x+2u_y=1$, $u(0,y)=e^{-y^{2}}$

Solving $u_x+2u_y=1$, $u(0,y)=e^{-y^{2}}$ for $x\in \mathbb{R},y\in\mathbb{R}$

So I tried to use characteristics method, with $\frac{dx}{1}=\frac{dy}{2}=\frac{du}{1}$

Which gives me $\frac{dy}{dx}=2$, $\frac{du}{dx}=\frac{1}{2}$

Which I solved to get $y=2x+c_1$, $u=\frac{1}{2}x+c_2$

Then taking $G(c_1)=c_2$ I get that $u=\frac{1}{2}x+G(y-2x)$

And using the initial conditions gives $G(y)=e^{-y^{2}}$

So my solution is $u=\frac{1}{2x}+e^{-(y-2x)^{2}}$

答:
Since that we're interested in solving $$\begin{cases}\frac{\partial u}{\partial x}(x,y)+2\frac{\partial u}{\partial y}(x,y)=1 \quad (x,y)\in \Omega\subseteq \mathbb{R}^{2}\\
u(0,y)=e^{-y^{2}}\end{cases}$$
we can use the characteristic method and the Lagrange-Charpit equations are given by $$\frac{dx}{1}=\frac{dy}{2}=\frac{du}{1}$$
From this, we have that $$\frac{dx}{dy}=\frac{1}{2} \quad [1] \quad \text{and} \quad \frac{du}{dy}=\frac{1}{2} \quad [2]$$
Integration of these gives characteristic curves gives us in $[1]$ $$\frac{dx}{dy}=\frac{1}{2} \implies \int 2dx=\int dy \implies \color{blue}{\boxed{2x=y+C_{1}}}$$
and in $[2]$ we have that $$\frac{du}{dy}=\frac{1}{2} \implies \int  du=\int \frac{1}{2} dy \implies \color{blue}{\boxed{u=\frac{1}{2}y+C_{2}}} $$
where $C_{1}$ and $C_{2}$ are arbitrary constants. From the first of the above equation, we have that $$2x-y=C_{1}$$
Spcecifying $C_{2}$ as a function of $C_{1}$ gives a solution surface, $$u=\frac{1}{2}y+C_{2} \implies \color{blue}{\boxed{u(x,y)=\frac{1}{2}y+f\left(2x-y\right)}}$$
where $f(\cdot)$ is an arbitrary function.

Now, since that the initial data is given by $u(0,y)=e^{-y^{2}}$, so we have that $$\left. u(x,y)\right|_{u(0,y)=e^{-y^{2}}} \implies  e^{-y^{2}}=\frac{1}{2}y+f(-y) \implies f(y)=e^{-y^{2}}+\frac{1}{2}y$$

Therefore, the solution is given by $$u(x,y)=\frac{1}{2}y+e^{-(2x-y)^{2}}+\frac{1}{2}(2x-y)\implies \color{red}{\boxed{u(x,y)=e^{-(2x-y)^{2}}+x}}$$

It's clear that $u(x,y)$ complies with 1) $u(0,y)=e^{-y^{2}}$ and 2) $\frac{\partial u}{\partial x}(x,y)+2\frac{\partial u}{\partial y}(x,y)=1$ as desired.


答: If f is the function means every element of A has an image in B (by the definition of function only). So by the definitions of Surjective, Injective, and Bijective mappings, one can examine the nature of mapping in B (one-one or Onto).</p>

Title: Surjective Function - can some elements in A have image which isn't in B

Body:
f : A → B

For f to be a surjective function, for every $b \in B$, there needs to a $a \in A$ such that f(a) = b

However, it is also necessary, that every $a \in A$, $f(a) \in B$?

i.e. can there be elements in A which have an image which is not in B?


问:
Explain why the function $f$: $\mathbb{R} \rightarrow \mathbb{R}$ defined by $f(x) = x^2$ is not surjective.
I encountered this question in a problem set recently. The easiest way to explain why the statement is true is to prove that its range is not equal to its codomain. The range of $f$ is $[0, \infty)$.

Unfortunately, I don't really understand what a codomain is so can someone please explain it to me?

答:
If we define $f : A \to B$, then $B$ is the codomain. The range of $f$ is always a subset of the codomain, i.e. $\mathrm{range}(f) \subseteq B$ (but there need not be equality).

If $f$ is surjective, then $\mathrm{range}(f) = B$ (rather than merely being a subset).

Since $f : \mathbb{R} \to \mathbb{R}$ with $f(x)=x^2$ has $\mathrm{range}(f) = [0,\infty)$ but $\mathrm{codomain}(f) = \Bbb R$ and $[0,\infty) \ne \mathbb{R}$, we would thus say that $f$ is not surjective.

For instance, while $(-1) \in \mathrm{codomain}(f) = \Bbb R$, there is no $x \in \mathrm{domain}(f) = \Bbb R$ for which $f(x) = -1$.


问:
Proving the remainder is $1$ if the square of a prime is divided by $12$
Given, $p$ is a prime number and $p>3$. How do we prove that the remainder $r$ is always $1$ if $p^2$ is divided by $12$?</p>

答:
If $(a,12)=1, (a,3)=1$ and $ (a,2)=1$

$(a,3)=1\implies a\equiv\pm1\pmod 3\implies a^2\equiv1\pmod 3$

$(a,2)=1\implies a$ is odd $=2b+1$(say) where $b$ is some integer

$(2b+1)^2=4b^2+4b+1=8\frac{b(b+1)}2+1\equiv1\pmod 8$

$\implies a^2\equiv1\pmod { \text{lcm}(3,8)}$

Now, lcm $(3,8)=24$


答:
The codomain is where the output of the function lives, in this case, you're given a function $f:\Bbb{R}\to\Bbb{R}$, so the codomain/target space is $\Bbb{R}$. And clearly, $[0,\infty)$ is not the same as $\Bbb{R}$.

The codomain/target space is like "where the outputs all live" (think of a big dart board). The range/image is that portion of the codomain which is actually hit by your function (the points you actually hit on the dart board).

Title: Explain why the function $f$: $\mathbb{R} \rightarrow \mathbb{R}$ defined by $f(x) = x^2$ is not surjective.

Body:
I encountered this question in a problem set recently. The easiest way to explain why the statement is true is to prove that its range is not equal to its codomain. The range of $f$ is $[0, \infty)$.

Unfortunately, I don't really understand what a codomain is so can someone please explain it to me?


问:
Examine convergence of $ \sum^{\infty}_{n=2}\frac{n!(1+\frac{1}{2n})^{n^2}}{n^n}$
I need to examine convergence of the following sum:

$$\displaystyle \sum^{\infty}_{n=2}\frac{n!(1+\frac{1}{2n})^{n^2}}{n^n}$$

I know that:
$$\displaystyle \lim_{n \to \infty}\frac{n!(1+\frac{1}{2n})^{n^2}}{n^n} = 0$$

And that all elements of sequence $a_n$ are positive. Therefore I can use Cauchy's root test:
$$\sqrt[n]{\frac{n!(1+\frac{1}{2n})^{n^2}}{n^n}}= \frac{\sqrt[n]{n!}(1+\frac{1}{2n})^{n}}{n}$$
$$\sqrt[n]{\frac{\sqrt[n]{n!}(1+\frac{1}{2n})^{n}}{n}}= \frac{\sqrt[n^2]{n!}(1+\frac{1}{2n})}{\sqrt[n]{n}}$$

But it gives me noting since I don't know what happens to $\sqrt[n^2]{n!}$ when $n \to \infty$. I tried also d'alembert's ratio test, but it gives me nothing. I think it may be LTC on limits.

答:
Hint:
$$\lim_{n \to \infty} \frac{\sqrt[n]{n!}(1+\frac{1}{2n})^{n}}{n} = \lim_{n \to \infty}\frac{\sqrt[n]{n!}}{n} \lim_{n \to \infty}\left(1+\frac{1}{2n}\right)^{n}$$
To justify the split of limit, you should note that
$$\lim_{n \to \infty}\left(1+\frac{1}{2n}\right)^{n}$$
is a common limit (and I'm sure you can find it). For the first limit, refer to here.


答:
Since $n!^{1/n} \approx n/e$, the n-th root is about

$(n/e)(1+1/(2n))^n/n
\approx e^{1/2}/e
= e^{-1/2}<1$

so the sum converges.

Title: Examine convergence of $ \sum^{\infty}_{n=2}\frac{n!(1+\frac{1}{2n})^{n^2}}{n^n}$

Body:
I need to examine convergence of the following sum:

$$\displaystyle \sum^{\infty}_{n=2}\frac{n!(1+\frac{1}{2n})^{n^2}}{n^n}$$

I know that:
$$\displaystyle \lim_{n \to \infty}\frac{n!(1+\frac{1}{2n})^{n^2}}{n^n} = 0$$

And that all elements of sequence $a_n$ are positive. Therefore I can use Cauchy's root test:
$$\sqrt[n]{\frac{n!(1+\frac{1}{2n})^{n^2}}{n^n}}= \frac{\sqrt[n]{n!}(1+\frac{1}{2n})^{n}}{n}$$
$$\sqrt[n]{\frac{\sqrt[n]{n!}(1+\frac{1}{2n})^{n}}{n}}= \frac{\sqrt[n^2]{n!}(1+\frac{1}{2n})}{\sqrt[n]{n}}$$

But it gives me noting since I don't know what happens to $\sqrt[n^2]{n!}$ when $n \to \infty$. I tried also d'alembert's ratio test, but it gives me nothing. I think it may be LTC on limits.


问:
How many k-dimensional $\mathbb{Z}_q$-submodule over $\mathbb{Z}_q^d$?
Denote $\mathbb{Z}_q$ be the residue ring of module $q$ with $q=p^r$ be a prime power.
Similar to the question for $k$-dimensional vector spaces over finite fields, we can also define a $k$-dimensional $\mathbb{Z}_q$-submodule in $\mathbb{Z}_q^d$ as the following:

$$ V = \mathrm{span}\{v_1,\dots,v_k\} $$
where $v_1,\dots,v_k \in \mathbb{Z}_q^d$ are linearly independent, namely, if there exist $a_1,a_2,\dots,a_k \in \mathbb{Z}_q$ such that $a_1v_1+a_2v_2+\dots+a_kv_k = 0$ then $a_1=a_2=\dots=a_k = 0.$

Question: How many $k-$ dimensional $\mathbb{Z}_q$-submodule in $\mathbb{Z}_q^d$? And, how many bases for a $k$-dimensional submodule?

The related question for the case of finite fields was done, you can follow via the link:
How to count number of bases and subspaces of a given dimension in a vector space over a finite field?

答:
Although my idea is the same as reuns, this is coming from a little nature observability.

It is obvious that $\mathrm{span}\{\mathbf{v}^1,\dots,\mathbf{v}^k\} = \mathrm{span}\{\mathbf{u}^1,\dots,\mathbf{u}^k\}$ if only if there exists exactly one invertible matrix $A$ in $M_{k}\left(\mathbb{Z}_q\right)$ such that
\begin{equation}\label{eq.matrix}
\left(\mathbf{u}^1,\dots,\mathbf{u}^k\right)^T = A \cdot \left(\mathbf{v}^1,\dots,\mathbf{v}^k\right)^T
\end{equation}
Therefore, a $k$-dimensional submodule $V$ has $|\mathrm{GL}_k(\mathbb{Z}_q)|$ bases, where $\mathrm{GL}_k(\mathbb{Z}_q)$ is the sets of invertible matrices in $M_k\left(\mathbb{Z}_q\right)$ (note that a matrix in $M_k\left(\mathbb{Z}_q\right)$ with nonzero determinant may not be in $\mathrm{GL}_k(\mathbb{Z}_q)$). Denote $N$ be the number of $k$-dimensional submodules in $\mathbb{Z}_q^d,$ it follows that
$$ N = \dfrac{|T_k(\mathbb{Z}_q^d)|}{\left|\mathrm{GL}_k(\mathbb{Z}_q)\right|} $$
where $T_k\left(\mathbb{Z}^d_q\right) = \left\{ \left(\mathbf{v}^1,\dots,\mathbf{v}^k\right) \in \left(\mathbb{Z}_q^d\right)^k\,:\, \mathbf{v}^1,\dots,\mathbf{v}^k \text{ are linearly independent}\right\}.$ Since the Kernel of the canonical projection $K$ from $\mathrm{GL}_k(\mathbb{Z}_q)$ to $\mathrm{GL}(\mathbb{Z}_p)$ defined by
$$ K : \quad A \mapsto A \,\,\mbox{mod}\,\,p,$$
has size of $p^{k^2(r-1)},$ we have
$$ \left|\mathrm{GL}_k\left(\mathbb{Z}_q\right)\right| = p^{k^2(r-1)}\left|\mathrm{GL}_k\left(\mathbb{Z}_p\right)\right| = p^{k^2(r-1)}\left(p^k-1\right)\left(p^k-p^2\right)\dots\left(p^k - p^{k-1}\right).$$
Similarly, we also have
$$ \left|T_k\left(\mathbb{Z}_q^d\right)\right| = p^{kd(r-1)} \left|T_k\left(\mathbb{Z}_p^d\right)\right| = p^{kd(r-1)}\left(p^d-1\right)\left(p^d-p^2\right) \dots \left(p^d-p^{k-1}\right).  $$
It follows that
$$   N = \dfrac{p^{kd(r-1)} (p^d-1)(p^d-p^2)\dots (p^d-p^{k-1})}{p^{k^2(r-1)}(p^k-1)(p^k-p^2)\dots (p^{k}-p^{k-1})}.$$


问:
Distribution function that has an infinite number of jumps in $ [0,1] $.
Construct a distribution function that has an infinite number of jumps in $ [0,1] $.

Hello, I need help to build this distribution function, I know that for it to comply with being a distribution it must meet the limits in $ - \infty $ and in $ \infty $
In addition to the monotony and that it is continuous on the right.
But I have problems with the construction, I also know that the jumps must be countable, this could be seen from the partitions?

答: If $X$ is random variable taking value $1,\frac 1 2,\frac 1 3,...$ such that $P(X=\frac  1n)=\frac 1{2^{n}}$ then $F_X$ has jumps at each of the points $\frac  1 n$. An explicit definition of $F_X$ is $F_X(x)=\sum\limits_{n: \frac 1 n \leq x} \frac 1 {2^{n}}$.


问:
Integral sign with circle (AND arrow on the circle) through it
I know from multivariable calculus that the integral sign with circle in its middle means integrating along a closed path.

So when I encountered in complex analysis the above integral sign but with an arrow on the circle to indicate orientation, I automatically assumed oriented closed contour.

But now on reading my textbook carefully, it only says that the arrowed circle actually means oriented contour (and doesn't say anything about whether the contour is necessarily closed).

So what does the arrowed circle really mean? Can it really also refer to a smooth oriented arc (i.e. not a closed curve)?

答: I bet your text defines a contour as a closed curve. :)</p>


问:
Example 9.6 in Loring Tu's An Introduction to manifolds
Example 9.6 is showed as follows in Loring Tu's An Introduction to manifolds:

However, I can't understand the thing that "mainly because". The regular submanifold is defined as follows:

I don't know what is the relation between "vanishing coordinate functions" and "zero set of coordinate functions". I get confused here, can anyone clarify this for me?

答:
I think it mean that the inverse image of a regular value is a submanifold.

About the detail, you can read the do Carmo's Riemannian Geometry or picture below (it also from the do Carmo's Riemannian Geometry).


问:
A Probability problem regarding elections with voters in two villages

The problem

We have Village A and Village B, both having unspecified population. It is known that in every election 49% of the villagers in Village A always vote for Democrats and the rest 51% always vote for Republicans.

Similarly for Village B 51% vote for Democrats and 49% for Republicans.

We randomly select 100 people from each village.

What is the probability that there are more "Democrats" in the 100 selected from Village A when compared to those selected from Village B?

My Attempt

I tried to count the number of favorable cases divided by total number of cases.

Total number of cases would be $${n \choose 100} \times {m \choose 100}$$
Assuming the populations of Village A and B are $n$ and $m$ respectively. I hoped that it would simply off due to presence of $n$ and $m$ in the numerator of the probability.

The total number of favorable cases ended up becoming a long series. Here I assume both $n$ and $m$ are larger than $100$.

$$\sum_{i=1}^{100} \left [ {0.49n \choose i} \times {0.51n \choose 100-i} \sum_{j=0}^{j-1} {0.51m \choose j} \times {0.49m \choose 100-j} \right ]$$

This literally means that whenever I choose $i$ democrats from Village A, I count all possible ways of choosing less than $i$ (i.e. $j$) number of democrats from Village B.

So I think the answer is,

$$P = \frac{\sum_{i=1}^{100} \left [ {0.49n \choose i} \times {0.51n \choose 100-i} \sum_{j=0}^{i-1} {0.51m \choose j} \times {0.49m \choose 100-j} \right ]}{{n \choose 100} \times {m \choose 100}}$$

So this question was asked in a MCQ style online test where my friend had less than 2 mins to solve it. So I am sure there is an elegant solution to this problem. I want to know what the probability is, and if possible how it changes for different percentage values (other than $49$, $51$), if we select an arbitrary number of people, say $x$ people from Village A and $y$ people from Village B.

Thanks.

答:
I guess symmetry in this question helps for an easier solution. Let d(k) and r(k) denote number of Democrats and Republicans respectively from a random sample of 100 from village k. Say

X = Pr (d(A) > d(B)) = Pr (r(A) < r(B))

Y = Pr (d(A) < d(B)) = Pr (r(A) > r(B))

Z = Pr (d(A) = d(B))

Since probability of a Democrat in village A is equal to probability of a Republican in village B; and probability of a Republican in village B is equal to probability of a Democrat in village B, we can say by symmetry that X = Y.

X+Y+Z = 1

2X+Z = 1

Now it just suffices to find Z.

$ Z = \sum_{i=0}^{100} {100 \choose i} * (0.49)^i * (0.51)^{100-i}*{100 \choose i}* (0.51)^i * (0.49)^{100-i} \\
Z = (0.49)^{100} * (0.51)^{100} * \sum_{i=0}^{100} {100 \choose i} {100 \choose i}  $

Using  the fact that $ \sum_{i=0}^{n} {n \choose i} {n \choose i} = {2n \choose n} $

$ Z = {200 \choose 100} * (0.49)^{100} * (0.51)^{100} \\
X = 0.5*{(1- {200 \choose 100} * (0.49)^{100} * (0.51)^{100})} $


问:
Computing turning number of closed curve
I'm trying to compute the turning number of a closed plane curve, which should be a really straight forward computation. But my result is not a whole number, i.e. the total curvature is not a multiple of $2\pi$, which is impossible so I'm making a mistake somewhere. I know from plotting the curve that the turning number should be $-2$. I've been looking for hours but cannot seem to find it. Maybe someone can spot the mistake... Here is my work:

Let $\beta(t) = ((1+2\cos(t))\sin(t), (1+2\cos(t))\cos(t))$ be a regular closed plane curve. To compute the turning number $n_{\beta}$ I want to use the following:

$$n_{\beta} = \frac{1}{2\pi}\int_{0}^{L}K_{\beta}(t)dt\, ,$$

where $L$ is the period of $\beta$ and $K_{\beta}(t)$ is the curvature. I can compute the curvature like this:

$$K_{\beta} = \frac{1}{||\dot{\beta}(t)||^3}\cdot\det({\dot{\beta}(t), \ddot{\beta}(t)})$$

Computations:

$$\dot{\beta}(t) = (\cos t + 2\cos 2t, -\sin t -2\sin 2t)$$
$$\ddot{\beta}(t) = (-\sin t - 4 \sin 2t, -\cos t - 4 \cos 2t)$$
$$||\dot{\beta}(t))|| = (4\cos t + 5)^{1/2}$$
$$\det({\dot{\beta}(t),\ddot{\beta}(t)}) = -6 \cos t - 9$$

This is giving me the curvature

$$K_{\beta}(t) = \frac{-6 \cos t -9}{(4 \cos t + 5)^{3/2}}$$

At this point I integrated the curvature with the help of Wolframalpha, which did it numerically but I'm pretty sure it's $-2\pi-1$, when from the picture it should be $-4\pi$. Oddly enough, if I integrate the curvature without the power of $\frac{3}{2}$ in the denominator i actually get the correct result. Can anyone help me spot my mistake? Thanks a lot!

Edit: Here's a link to see the graph: https://www.desmos.com/calculator/vcxbpj2ios

答:
The signed curvature being
$$k=-\frac{6 \cos (t)+9}{(4 \cos (t) + 5)^{\frac 32}}$$ the curvature is
$$\kappa=\frac{|6 \cos (t)+9|}{(4 \cos (t) + 5)^{\frac 32}}$$
$$\int \kappa \,dt=F\left(\frac{t}{2}|\frac{8}{9}\right)+E\left(\frac{t}{2}|\frac{8}{9}\right)-\frac{4
   \sin (t)}{3 \sqrt{4 \cos (t)+5}}$$ where appear elliptic integrals.
$$n = \frac{1}{2\pi}\int_{0}^{2\pi}\kappa \,dt=\frac{K\left(\frac{8}{9}\right)+E\left(\frac{8}{9}\right)}{\pi }\sim 1.15940$$


问:
Sum of floors inequality
I'm trying to show the following inequality, for $x\geq0$:

$$
\lfloor30x\rfloor+\lfloor x\rfloor\geq\lfloor15x\rfloor+\lfloor10x\rfloor+\lfloor6x\rfloor.
$$

Intuitively this statement looks like it should be true because the LHS has two terms and the RHS has three terms - but I don't know how to formalize it. I am aware that $\lfloor a\rfloor+\lfloor b\rfloor\leq \lfloor a+b\rfloor$, but I don't know I can directly apply that here. Any help would be appreciated!

答:
Let $x=A+a,6x=B+b,10x=C+c,15x=D+d,30x=E+e$ where big letter is the integer part and small letter is the decimal part.

(1) If $a<{1\over30}$ we have $$b=6a\implies B=6A$$ $$c=10a\implies C=10A$$ and so on $D=15A,E=30A$. So $A+E=B+C+D$.

(2) If ${1\over30}\leq a<{1\over 15}$ then we have $B=6A,C=10A,D=15A$ $$e=30a-1\implies E=30A+1$$ so $A+E>B+C+D$

(3) If ${1\over 15}\leq a<{1\over 10}$ then we have $B=6A,C=10A$ $$d=15a-1\implies D=15A+1$$ $$e=30a-2\implies E=30A+2$$ so $A+E>B+C+D$

Can you finish off the remaining two cases?

Title: Sum of floors inequality


问:
Question about index
Sometimes basic elements are not easy to understand. It is well known result that every perfect can be written as  pairwise disjoint  perfect sets. Assume $P\subset\Bbb R$ be  a perfect set. and let $\Bbb P$ be the set of all perfect subsets of $\Bbb R.$ Then, Let $$\mathcal P:=\{P^K_{\xi}\colon \xi<\mathfrak c\ \ \&\ \ K\in\Bbb P\}$$  be a partition of $P$ into perfect sets. I have no problem about that. My question about the indexes:

Does that mean for every $\xi<\mathfrak c$  and for every $K\in\Bbb P$ I have pair $\langle \xi, K\rangle$ index for some perfect set  such that  $P^K_{\xi}$ in $\mathcal P$? Or not. Also I know the partition can be written as $\{P_{\xi}\colon \xi<\mathfrak c\}$ but I am asking in case as in $\mathcal P$. As I said my question seems simiply but I just want to make sure I am in right path.

Any help will be appreciated greatly.

答: Yes, if you gave a set of size $\mathfrak{c}$ (like your partition of $P$) you can index it by another set of size $\mathfrak{c}$ (the product of $\mathfrak{c}$ and $\Bbb P$) and we can devote each member of that partition as some (unique) $P^K_\xi$ as you did. But why one would is unclear, it's more common to just enumerate them as indexed by ordinals (for transfinite recursion e.g.). It could be for a bookkeeeping reason perhaps.

Title: Question about index


答: Hint: $\,3 < p\,$ prime $\,\Rightarrow\, p = 6n\pm 1\,\Rightarrow\, p^2 = 36n^2\pm12n+1$</p>

Title: Proving the remainder is $1$ if the square of a prime is divided by $12$

Body: Given, $p$ is a prime number and $p>3$. How do we prove that the remainder $r$ is always $1$ if $p^2$ is divided by $12$?</p>


问:
Find rate of convergence for $\sqrt{n+1} - \sqrt{n} = 0$ as $n$ goes to infinity
We can use Taylor series to expand $\sqrt{x}$
$$
\sqrt{x} = \sqrt{n} + \frac{1}{2\sqrt{n}}(x-n) - \frac{1}{4n^{3/2}}(x-n)^2 + ...
$$

The solution provided to me uses expansion point around $\sqrt{n}$. And then we are supposed to substitute $x=n+1$

$$
\sqrt{n+1} = \sqrt n + \frac{1}{2\sqrt n}(n + 1 - n) + ...
$$

And we arrive at

$$
\sqrt{n+1} - \sqrt n = (\sqrt n + \frac{1}{2\sqrt n}(n + 1 - n) + ...) - \sqrt n
\\ = O(\frac{1}{\sqrt n})
$$

What I don't understand is how the expansion point is chosen.

答:
You can expand the series at anywhere you like (that make sense). For example, you can even try at $\sqrt{n + 1}$:

$$\sqrt{x} = \sqrt{n+1} + \dfrac{1}{2\sqrt{n+1}} (x - n - 1) + \dfrac{1}{4(n+1)^{3/2}}(x - n - 1)^2 + \cdots$$

and sub $x = n$:

$$\sqrt{n} = \sqrt{n+1} + \dfrac{1}{2\sqrt{n+1}} (-1) + \cdots$$

$$\Rightarrow \sqrt{n+1} - \sqrt{n} = \dfrac{1}{2\sqrt{n+1}} + \cdots = O(1/\sqrt{n+1}) \rightarrow O(1/\sqrt{n})$$

That $n$ goes to infinity as you stated.

It's just for your convenience to expand the series at $x = n$.


问:
$A$ closed if and only if $X-A$ is open.
I was trying to prove that in a topological space $X$, $A$ is closed iff $X-A$ is open using the definitions/theorems. Can I get a verification if this is right or wrong?

Theorem:A subset $U$ of $X$ is open iff for each $x \in U$, there exists an open set $U_x$, with $x \in U_x \subset U$.

Definition:A set $A$ is closed if it contains all of its limit points, that is $A= \bar A$.

Attempt:($\implies$)Assume the set $A$ is closed. Then $\bar A=A$, and $X-A=X- \bar A$. Let $x \in X-\bar A$. Then $x \in X \wedge x \notin \bar A$. Thus, there exists an open set $U$ containing $x$, such that $U \cap A=\varnothing.$ Then $U \subset X- \bar A=X-A$, hence $X-A$ is open.

( $\Longleftarrow$  )Assume the set $X-A$ is open. Then for each $x \in X-A$, there is an open set $U$ containing $x$, such that $U \subset X-A$. Let $y \in \bar A$. Assume $y$ is a limit point of $A$, but $y \notin A$.Then $y \in X-A$, and there exists an open set $V \subset X-A$ containing $y$.Then $V$ is an open set containing $y$ with $A \cap V= \varnothing$. So $y \notin \bar A$, a contradiction. Thus $\bar A=A$.

答:
Your proof seems fine to me.

I would proceed as follows, using your definitions/theorems:

if $A$ is closed so $A=\overline{A}$, then for each $x \notin A$ or $x \in X - A$ we know $x \notin \overline{A}$ so there is an open set $U_x$ such that $U_x \cap A = \emptyset$. But then $x \in U_x \subseteq X-A$ and so $X-A$ is open.

If $X-A$ is open for every $x \notin A$ we have an open neighbourhood (namely $X-A$ itself!) that misses $A$, so $x \notin \overline{A}$ and so $X-A \subseteq X-\overline{A}$, hence $\overline{A} \subseteq A (\subseteq \overline{A})$ so that $A$ is closed.