问:
A question on Lie Groups
Let $G$ be a Lie group.
(a) Let $m : G \times G \to G$ denote the multiplication map. Using Proposition
3.14 of john lee smooth manifolds (The Tangent Space to a Product Manifold) to identify $T_{(e,e)}(G \times G)$ with $T_e(G) \bigoplus T_e(G)$, Show that:

(a) the differential $dm_(e,e)(X,Y)=X + Y$

(b) Let $i: G \to G$ denote the invertion map. show that $di_e: T_eG \to T_eG$ is given by $di_e(X)= -X$

This is problem 7-2 of John Lee Smooth Manifolds.

I already solved this wanna see if my solution is correct or not. thanks.

Here is my solution:

We have :

$dm_{(e,e)}(X,Y) = dm_{(e,e)}(X,0)+dm_{(e,e)}(0,Y)=d(m^{1})_e(X)+d(m^{2})_e(Y)$

Which $m^1:G \to G $ is defined by $x \mapsto m(x,e)$ , $m^2:G \to G $ defined by $y \mapsto m(e,y)$, but $m^1 = m^2 = Id_G$ ,so $dm_{(e,e)}(X,Y)=X+Y$ this proves (a). Put $ n= m \circ p \circ s$ which $s :G \to G \times G$ is defined by $x \mapsto (x,x)$ and $p:G \times G \to G \times G$ is defined by $(x,y) \mapsto (x,i(y))$ then $n$ is a constant map ,so:
\begin{align}
0 = dn_e(X)=dm_{(e,e)}(dp_{(e,e)}(ds_e(X)))=dm_{(e,e)}(dp_{(e,e)}(X,X))&=dm_{(e,e)}(X,di_e(X))\\&=X+di_e(X)
\end{align}

so $di_e(X)=-X$

答:
I think your proof is very neat! It works :)

Maybe you could argue a bit better why $dm_{(e, e)} (x, 0) = (d m_1) _e(X) $, which follows in your compositional style by writing $m(x, e) = m \circ i_1$. Here $i_1 : G \to G \times G$ is defined by $i_1(x) = (x, e) $.

Title: A question on Lie Groups


问:
what values of $j$ makes this congruence solvable?
For what values of $j$ is this congruence solvable?

$$0 \equiv xp^{a+s-b}j + yp^t\pmod{p^b} $$ where $p$ is an odd prime and $x,y$ are not divisible by $p.$ and $s,a$ are any integers.

Since the given congruence above is equivalent to $xp^{a+s−b}j + yp^t = k p^b $ for some $k$; and then I have to divide both sides by $p^m$ where $m= \operatorname{min} \{a+s−b,t,b\}$, then how can I know the values of $j$ that makes this congruence solvable (what stuck me is that the value of $m$ is not clearly specified)? could you please help me in answering this question?

EDIT:
I assumed that $a \geq b.$

答:
Since you do not know which of the quantities is minimal you can split the problem up into different cases. I presume we can assume that $a+s-b\ge 0$.

If $m=b$

Then the equation is satisfied for all $j$.

If $m\ne b, a+s-b=m$

Then $xj + yp^{t-m} = k p^{b-m}$ and the equation can be solved if and only if $j$ is a multiple of $p^n$, where $n$ is the minimum of $t-m$ and $b-m$.

If $m\ne b, a+s-b\ne m$

Then $xjp^{a+s-b-m} + y = k p^{b-m}$ and since $p$ is not a factor of $y$ there are no solutions.

ContentLicense: CC BY-SA 4.0


问:
finding nth term
Let
  3,8,17,32,57 . . . . .
be a pattern.How do we find the nth number?My brains are completely jammed,I am tired.I do not even recognize the pattern.I calculated a few ways,but all I want is a little hint,not the whole solution.</p>

答:
Note: I just added a derivation of an explicit formula
for the terms as the OP requested.

From 3,8,17,32,57,
if the term is n,
the next term is 2n+k
where k = 2, 1, -2, -7.

The differences of k are
-1, -3, -5.

If we assume that the next difference is -7,
the next k is -7-7=-14
and the next term is 2*57-14 = 100.

To get a formula from this,
since the sum of the odd numbers are the squares,
the values of k are $2-m^2$
starting with $m = 0$.

Letting $s(0) = 3$,
$s(n+1) = 2s(n)+2-n^2$.
This is made explicit below.

Check:
$s(1) = 2*3+2-0 = 8$,
$s(2) = 2*8+2-1 = 17$,
$s(3) = 2*17+2-4 = 32$,
$s(4) = 2*32+2-9 = 57$.

To get an explicit form for
$s(0) = 3$,
$s(n+1) = 2s(n)+2-n^2$
let $s(n) = 2^n t(n)$.
Then $2^{n+1}t(n+1) = 2^{n+1}t(n)+2-n^2$,
or
$t(n+1) = t(n) + 1/2^{n}-n^2/2^n$,
so
$t(n+1) - t(n) = 1/2^{n}-n^2/2^n$.

Summing this,
$t(m)-t(0) = \sum_{n=0}^{m-1} (t(n+1) - t(n))
= \sum_{n=0}^{m-1} (1/2^{n}-n^2/2^n)
= 1-1/2^m - \sum_{n=0}^{m-1}n^2/2^n
$.

To evaluate the last sum,
let $f(x) = \sum_{n=0}^{m-1} x^n
= (1-x^m)/(1-x)
$.
Then $x f'(x) = \sum_{n=0}^{m-1}  nx^n$
and $x (x f'(x))' = \sum_{n=0}^{m-1}  n^2 x^n$.

We want $x (x f'(x))'$ at $x = 1/2$.

Note that $x (x f'(x))'
= x (f'(x) + x f''(x))
= x f'(x) + x^2 f''(x)
$.

I'm feeling lazy, so I won't bother getting
$f'$ and $f''$.

ContentLicense: CC BY-SA 3.0

Title: finding nth term


问:
Intersection of a set of matrices nonzero over a finite field
Let $\mathbb{F}$ be a finite field of $q=2^k$ elements, $n$ be an odd number. Consider a set of $n$ by $n$ symmetric matrices $\mathbf{Q}_1,\cdots,\mathbf{Q}_n$ whose entries are randomly selected from the field $\mathbb{F}$, and the diagonals are all zero. (assume they are all of rank $n-1$).

I would like to compute the probability that $\bigcap_{i=1}^n \text{Im}\mathbf{Q}_i$ is nonzero.

I know that a vector is in  the Image of a matrix if and only if it is in the column space of that matrix.

Moreover, for a nonzero vector $\mathbf{v}$, the probability that it is in $\text{Im}\mathbf{Q}_i$ is $\frac{q^{n-1}-1}{q^n}\approx 1/q$.

But it is clear that first several intersections will not be $\{\mathbf{0}\}$ by the formula $\dim(U\cap V)=\dim(U)+\dim(V)-\dim(U+V)$.

答:
Due to the questions mentioned in the comments about how exactly the matrix entries are selected randomly while ensuring that the resulting matrices have rank $n-1$, I cannot say anything about the probabilities you are trying to compute. But I can give some insight to the the general problem about when a collection of $n$ subspaces of dimension $n-1$ have a trivial intersection.

If $Q$ is an $n\times n$ matrix with rank $n-1$, then $\mathrm{Im}(Q)$ is a hyperplane of $\mathbb{F}^{n}$. If we have a hyperplane $H$ and $U$ is any subspace, then
$$\dim(U \cap H) = \begin{cases} \dim(U) & \ U \subseteq H\\ \dim(U) -1 & \mbox{ otherwise} \end{cases}.$$

Putting $H_{i} = \mathrm{Im}(Q_{i})$ for $1\leq i \leq n$, we see that the only way for $\cap_{i=1}^{n} H_{i} = \{0\}$ is for each $1 \leq k \leq n$,
$$\cap_{i=1}^{k-1}H_{i} \not\subseteq H_{k},$$
or equivalently, for all $1 \leq k \leq n$,
$$\dim\left(\cap_{i=1}^{k}H_{i}\right) = n-k.$$
This what we mean when we say the hyperplanes $H_{1}, \ldots, H_{n}$ must be in
general position.

A good way to determine whether hyperplanes are in general position is to work in the dual space; we replace each hyperplane $H_{i}$ with $H_{i}^{\perp}$, if we have $H_{i} = \mathrm{Im}(Q_{i})$ (you say you are working with the column space here) then $H_{i}^{\perp} = \mathrm{null}(Q_{i}^{T}) = \mathrm{null}(Q_{i}^{T})$ (here we are working with the right null space) since your matrices are symmetric. Each null space is one-dimensional (I prefer to think of them as points in the projective space).

Now, the correspondence $U \mapsto U^{\perp}$ is an inclusion-reversing map on the subspaces of $\mathbb{F}^{n}$, and we have the correspondence
$$(U_{1} \cap U_{2})^{\perp} = \langle U_{1}^{\perp}, U_{2}^{\perp} \rangle$$
(where $\langle \ldots \rangle$ denotes the span), so having
$$\dim\left(\cap_{i=1}^{k}H_{i}\right) = n-k$$
for all $k$ is equivalent to having
$$\dim\left(\langle H_{1}^{\perp}, \ldots, H_{k}^{\perp}\rangle\right) = k$$
for all $k$, in other words, if we take $v_{i}$ such that $\langle v_{i} \rangle = \mathrm{null}(Q_{i})$ for $1 \leq i \leq n$, then
$$\dim\left( \cap_{i=1}^{n} \mathrm{Im}(Q_{i})\right) = \{0\}$$
if and only if $\{v_{1}, \ldots, v_{n}\}$ is linearly independent.


问:
Schröder–Bernstein Theorem proof help
In Understanding Analysis, there's is a guided Schröder–Bernstein Theorem proof as an exercise.

I'm trying to prove it on my own but I believe I'm confused on several points and would appreciate some aid and corrections where necessary. Here's what I have so far:

a) By partitioning the domains, if we prove that $f$ from $A$ to $B$ and $g$ from $B'$ to $A'$ are bijective, then we can write a function:
$$h(x)=\begin{cases} f(x)\text{ if}\ x\in A \\ g^{-1}(x)\text { if}\ x\in A'\\ \end{cases}$$
that is bijective and concludes the proof.

b) We know that $A_1=X\backslash g(Y)$ and all subsequent $A_n$s are $A_n\subseteq g(Y)$. Thus $A_1\ne A_2$ and inductively, as $f$ is 1-1 and so $f(Z)\ne f(Z')$ when $Z\ne Z'$ and the same goes for $g$, we have $g(f(Z))\ne g(f(Z'))$ when $Z\ne Z'$ and so $g(f(A_n))\ne g(f(A_{n-1}))$.
Thus the $A$s are disjoint pairwise and with the same logic the $B$s are also disjoint.

c) I don't get that, it seems true by definition to me...

d)For every $x\in B'$, $x$ can't be in any $f(A_n)$ for all $n$ and for all $g(x)$, as one generation of $A$ feeds the next and $g(x)$ not in $A_1$, then $g(x)$ not in any $A_n$.
(I'm not very happy about d. to be honest).

答:
Question c

I agree that there is not much to say here... Maybe that $f$ is well defined as the $A_n$ are supposed to be disjoint. And onto as $B$ is a union of images of subsets of $X$ under $f$.

Question d

Take $a^\prime \in A^\prime$. $a^\prime$ has at least a preimage $b^\prime$ under $g$ as otherwise it would belong to $A_1 = X \setminus g(Y)$. If $b^\prime$ belong to $B$, it exists $N \ge 1$ such that $b^\prime \in f(A_N)$ and then $a \in A_N$ with $b^\prime = f(a)$. Which implies the contradiction $a^\prime = g(b^\prime) = g(f(a)) \in A_{N+1}$. Therefore $b^\prime$ belongs to $B^\prime$ and $g : B^\prime \to A^\prime$  is onto.

Title: Schröder–Bernstein Theorem proof help


问:
Question about algebraic elements and minimal polynomial
I am struggling with a problem of Galois Theory. It says the following:

Let $L$ be a field, $G$ a finite subgroup of the automorphisms group of $L$ and let $K = L^G$
the field of fixed points of $G$. Prove that every element $a$ in $L\setminus K$ is algebraic over
$K$ and the minimal polynomial of $a$ over $K$ is $(x - a_1)(x - a_2) \dotsm(x - a_r)$, where
$a_1,\dots, a_r$ are distinct, $r = |G|$ and $\{a_1,\dots, a_r\} = \{g(a) : \text{ for all $g$ in $G$}\}$.

Any help would be fine for me in order to finish this exercise. Thanks.

答: You do not need to prove that the extension is finite, if $a\in L$, the coefficients of $P_a(X)=\Pi_{g\in G}(X-g(a))$ are in $K$, since for every $h\in G$, $P^h_a(X)=\Pi_{g\in G}(X-hg(a))=P_a(X)$.


问:
Submodule of a isotypic component
I'm reading Sophie Morel's notes about representation theory (see http://perso.ens-lyon.fr/sophie.morel/rep_theory_notes.pdf).
Let $R$ be a ring.
We write $S(R)$ for the set  of isomorphism classes of simple $R$-modules.

Theorem I.1.7.2.  Let $M$ be a semisimple $R$-module.
For every $S \in S(R)$, let $M_S$ be the sum of all the submodules of $M$ that are isomorphic to $S$.
Then :

(i) We have $M = \oplus_{S \in S(R)} M_S$.

(ii) There exist sets $I_S$ such that $M_S \simeq \oplus_{i \in I_S} S$ for every $S \in S(R)$.

(iii) Let $N$ be a submodule of $M$.
If we write $N = \oplus{S \in S(R)} N_S$ and $N_S \simeq \oplus_{S \in J_S} S$ as in (i) and (ii), then, for every $S \in S(R)$, $N_S = M_S \cap M$ for every $S \in S(R)$ and we can find an
injection $J_S \longrightarrow I_S$.

Lemma I.1.7.3. Let $M$ be a $R$-module, and suppose that there exists a simple $R$-module $S$ and a set $I$ and an isomorphism $M \simeq \oplus_{i \in I} S$.
Then every simple R-submodule of $M$ is isomorphic to $S$.

In the proof of (i) and (ii), it is use that every simple submodule of $M_S$ is isomorphic to $S$.
It follows from the lemma if we use (ii) and I think that (ii) is a consequence of the proof of the equivalence: a $R$-module $P$ is the direct sum of a family of simple modules $\iff$ $P$ is the sum of a family of simple modules (see Theorem I.1.3.4). Is that correct?
Can we prove that every simple submodule of $M_S$ is isomorphic to $S$ without using (ii)?

答: Let $M$ be a semisimple $R$-module and $S \in S(R)$ and $V' \subseteq M$ a simple $R$-submodule not in $S$. As $M$ is semisimple, we have $M = V' \oplus M'$ for some submodule $M'$. Now, let $V \subseteq M$ be a simple submodule in $S$ (and thus in $M_S$). The projection $M = V' \oplus M' \to V'$ restricts to a map $V \to V'$ and since $V$ and $V'$ are non-isomorphic and simple, this map is necessarily trivial. It follows that $V \subseteq M'$ and thus $M_S \subseteq M'$. In particular, $V'$ is not contained in $M_S$ and thus every simple submodule of $M_S$ lies in $S$.

Title: Submodule of a isotypic component


问:
Create a number by multi by $2$ and divide by $3$ (integer part)
How can I create a given postitive integer $N$ by multi by $2$ and divide by $3$ (integer part) ?

(Write a computer program is allowed)
For example:
$$100 = 2*2*2*2*2*2*2*2*2*2*2/3/3/3/3*2*2$$

(The numbers of $2, 3$ need to be minimum)

($/3$ mean $\text{div}\ 3$, eg: $2/3 = 0, 4/3 = 1...$)

Is solving equation

$$\left \lfloor{\frac {2^a}{3^b} }\right \rfloor *2^c = N$$
help ?

If it help then, how to solve
$$\left \lfloor{\frac {2^a}{3^b} }\right \rfloor *2^c = N$$

such that $a > c, a+b+c$ is minimum.

答:
I hope I did not miss it somewhere in the many wonderful comments and partial answers above, but did you try a brute-force forward approach?

For instance, the following python lines:

```<code>from collections import deque

Q = deque([(2,"2")])
seen = {}
consecutive=-1

def eval(s): # to check results
        i=0
        resu=1
        while i<len(s):
                if s[i]=='2':
                        resu *= 2
                else:
                        resu /= 3
                i+=1
        return(resu)

while True:
        (x,s) = Q.popleft()
        if x not in seen:
                seen[x] = s
                Q.append((x*2,s+"2"))
                Q.append((int(x/3),s+"3"))
                while x==consecutive+1 and x in seen:
                        assert(x==eval(seen[x]))
                        print x,seen[x]
                        consecutive+=1
                        seen[x]="" # to save space
                        x += 1
</code>```

enumerate all possible solutions in increasing length order, and output them in increasing value order, if I am correct.

It reaches 1434 in seconds on my laptop, and then get stuck (because of memory limitations, I think, and because 1435 has a significantly longer decomposition). It goes above 2400 in minutes on my server with more memory, then gets stuck for a while, then goes above 4400, then gets stuck.

BTW, it finds a decompositions, but there may be several decompositions of same, minimal length.

Once this minimal length is known for a given number $N$, another brute-force approach consists in sampling random decompositions of this length and check if they are decompositions of $N$. For instance, after establishing with Gottfried (see comments) that the shortest decompositions of 4535 have length 77, I sampled 20 billions decompositions (in a few minutes) and obtained the following decompositions of 4535:

```<code>22222322223323222232222232323322223222232222222223222233322233233223333222233
22222322232232322232232222323232222322232232222223232233222233222233222333233
22223222322232322232232222322232232232322232222222333223322233232223322322233
</code>```

They were obtained only once each, suggesting that there are many more solutions, and is consistent with the fact that we are far from sampling all $2^{77} > 10^{23}$ possible decompositions.

This is a terrible waste of computational resources, of course!

Body:
I hope I did not miss it somewhere in the many wonderful comments and partial answers above, but did you try a brute-force forward approach?

For instance, the following python lines:

from collections import deque

Q = deque([(2,"2")])
seen = {}
consecutive=-1

def eval(s): # to check results
        i=0
        resu=1
        while i<len(s):
                if s[i]=='2':
                        resu *= 2
                else:
                        resu /= 3
                i+=1
        return(resu)

while True:
        (x,s) = Q.popleft()
        if x not in seen:
                seen[x] = s
                Q.append((x*2,s+"2"))
                Q.append((int(x/3),s+"3"))
                while x==consecutive+1 and x in seen:
                        assert(x==eval(seen[x]))
                        print x,seen[x]
                        consecutive+=1
                        seen[x]="" # to save space
                        x += 1

enumerate all possible solutions in increasing length order, and output them in increasing value order, if I am correct.

It reaches 1434 in seconds on my laptop, and then get stuck (because of memory limitations, I think, and because 1435 has a significantly longer decomposition). It goes above 2400 in minutes on my server with more memory, then gets stuck for a while, then goes above 4400, then gets stuck.

BTW, it finds a decompositions, but there may be several decompositions of same, minimal length.

Once this minimal length is known for a given number $N$, another brute-force approach consists in sampling random decompositions of this length and check if they are decompositions of $N$. For instance, after establishing with Gottfried (see comments) that the shortest decompositions of 4535 have length 77, I sampled 20 billions decompositions (in a few minutes) and obtained the following decompositions of 4535:

22222322223323222232222232323322223222232222222223222233322233233223333222233
22222322232232322232232222323232222322232232222223232233222233222233222333233
22223222322232322232232222322232232232322232222222333223322233232223322322233

They were obtained only once each, suggesting that there are many more solutions, and is consistent with the fact that we are far from sampling all $2^{77} > 10^{23}$ possible decompositions.

This is a terrible waste of computational resources, of course!


问:
Does $J$ represent finite set in most occasions?
There are some commonly used letters that have the same meaning in topology, like:

$I$ represent index set

$G,U$ open set

$F$ closed set

$K$ compact set

$N$ neighborhood

But are there any commonly used letters for finite, countable and uncountable sets?

答:
Finite sets are often represented by $S$, countable sets by $N$ and uncountable sets by $A$, $I$ or $\Gamma$ depending on who is doing the writing.

Much of the standard set notation that you describe comes from the mathematicians working in early Set Theory -- Cantor, Hausdorff, Bolzano -- and topology (or Analysis Situs as it was first known) -- Poincaré and so the traditional letters tend to stand for French or German terms.  In particular:

G -- Geöffnete ('open' in German)

F -- Fermé     ('closed' in French)

K -- Kompakte  ('compact' in German)

U -- Umgebung  ('neighbourhood' in German)

Using $N$ for neighbourhood appears to be a later innovation and might (I am not an expert on this history of this) have become more common after ${\mathbb N}$ started being used for the natural numbers since there is a potential for confusion otherwise.

$A$ is a capital letter $\alpha$ rather than a Latin $a$ and appears to be used as lower-case Greek letters are used for ordinals ($\alpha$, $\beta$) which in turn are typically used to index nets in topological spaces (which generalise sequences).  $S$ simply stands for set as you will have guessed and seems to be used for finite sets as introductions to set theory (e.g. Jech) usually start with finite sets called $S$.

$I$ and $J$ are both used to indicate uncountable ordered index sets (typically there is little wrong in considering $I$ to stand for interval as well) and $J$ is used because it is the successor of $I$ whenever we need to sub-interval it.

$\Gamma$ gets used as the uncountable index set by functional analysts (e.g. $c_0(\Gamma), l_1(\Gamma)$ and $l_\infty (\Gamma)$) though I've not encountered any reason for this choice so far (Day's book uses it and undoubtedly helped popularise it, but doesn't explain it).

As always with notation though, provided you clearly explain what you're intending by it (at the start) and you're not obviously abusing it ("Let $n(\varepsilon)$ be small and approach $0$ as $\varepsilon$ grows without bound..."), you are free to choose your own, and maybe even create a standard.


问:
I can't solve this integral ( $\int 3\sec^4(3x)\;dx$ ). Is there something wrong with the problem?
$\displaystyle\int 3\sec^4(3x)\;dx$
I couldn't solve this integral

I've tried a lot

But it don't know how to solve it

答:
Alternatively we can do this without substitution, a method I generally would like to avoid.

We will use the identity
$$1+\tan^2\theta\equiv\sec^2\theta$$
as well as the standard integral
$$\int\sec^2x~dx=\tan x+C$$

Now for the integral. We will use integration by parts, with
$$u=\sec^2x,~~~\frac{dv}{dx}=\sec^2x$$
in the standard integration by parts formula:
$$\int u\frac{dv}{dx} ~dx=uv-\int v\frac{du}{dx} ~dx$$
Note that
$$\int\sec^4x~dx=\int(\sec^2x)\sec^2x~dx=\tan x\sec^2 x-\int2\sec^2x\tan^2x~dx$$
But
$$\int\sec^2x\tan^2x~dx=\int\sec^2x(\sec^2x-1)~dx= \int\sec^4x-\sec^2x~dx$$

Hence

$$\int\sec^4x~dx=\tan x\sec^2 x-2\int\sec^4x-\sec^2x~dx=\tan x\sec^2 x-2\int\sec^4x~dx+2\int\sec^2x~dx$$
$$=\tan x\sec^2 x-2\int\sec^4x~dx+2\tan x +C$$
Rearranging gives
$$3\int\sec^4x~dx=\int3\sec^4x~dx=\tan x\sec^2 x+2\tan x +C$$

BOOM!

And we are done :)


问:
If $(X,\tau)$ is a $T_1$-space, and every infinite subset of $X$ is dense in $X$, then$ (X,\tau)$ is the closed finite topology.
Let $(X,\tau)$ be a topological space. Prove that $\tau$ is the finite-closed topology on $X$ if and only if (i)$(X,\tau)$ is a $T_1$-space, and (ii) every infinite subset of $X$ is dense in $X$.

I already proved the forward direction but I'm stuck on the backward direction. We know that everyone singleton is closed because of i) and from ii) every open set intersects any infinite set non trivially. Now I need to figure out how to show that every open set are just infinite sets with countably finite points removed, thus the topology is finite-closed.

答:
You have to prove that, under hypothesis $(i),(ii)$, a non-trivial set (i.e. non-empnty and not $X$) is closed if and only if it is finite.

Any closed set different from $X$ is not dense (because it coincides with its closure). Then by $(ii)$ it is not infinite, hence it is finite. Conversely, any finite set is finite union of points, that are closed because of $(i)$, so it is closed.


问:
On the definition of distributions
Lars Hormander, The Analysis of Linear Partial Differential Operators I, chapter II:

Let $X$ be an open set in $\mathbb {R}^n$.
A distribution $u$ in $X$ is a linear form of $C_0^\infty(X)$ such that for every compact $K \subset X$ there exist constants $C$ and $k$ such that
$$ |u(\phi)| \leq C \sum_{|\alpha| \leq k } {\rm sup} |\partial ^{\alpha} \phi|, \hspace{1cm} \forall \phi \in C_0^\infty (K) $$

My question is. How does this definition even come to mind? Is there a reason to define a distribution like that?

答:
A locally convex space $X$ is a linear space with a topology generated by a family of seminorms. A seminorm is a function $p:X\rightarrow [0,\infty)$ with $p(x+y)\leq p(x)+p(y)$ but where $p(x) = 0$ does not necessarily imply that $x = 0$.

Now for such spaces, a linear functional $l:X\rightarrow \mathbb{C}$ is continuous if and only if

$|l(x)|\leq C\sum_{k\in 1}^{n}p_k(x)$

for some finite collection of seminorms which generate the topology. See for instance Theorem IV.3.1 in John B. Conways book on functional analysis.

The principle is the same as for normed spaces (which is a locally convex space generated by one seminorm), where the continuous linear functionals are those that satisfy

$$|l(x)|\leq C|x|$$
for all $x$.

Distributions are simply the continuous linear functionals acting on the space of test functions, with topology generated by the family of seminorms $\{p_\alpha\}$ where

$$p_{\alpha}(\phi) = \sup |\partial^\alpha \phi|.$$

For more on this one can have a look at Chapter IV in the book by John B. Conway

Title: On the definition of distributions


问:
Inequality of sum of error functions
I am stuck with proving the following. Let $A\geq0
, B>0$, and $\alpha \in (0,1)$. I would like to show that
$$
\text{erf}\left(\frac{\alpha A+x}{\sqrt{2} \alpha  B}\right)+\text{erf}\left(\frac{A-x}{\sqrt{2} B}\right)-\text{erf}\left(\frac{\alpha A-x}{\sqrt{2} \alpha  B}\right)-\text{erf}\left(\frac{A+x}{\sqrt{2} B}\right)\geq 0,\quad \mbox{for all } x\geq0,$$ where erf($\cdot$) denotes the error function.

In my numerical experiments I have not found a single counterexample for this inequality, but I have not been able yet to prove it (e.g., via known bounds for the error function). Anyone a clue?

答:
@Yves Daoust gave the good hint.

Keeping your notations, at least small values of the arguments, we have for the expression
$$f(x)=2 \sqrt{\frac{2}{\pi }}\,\frac {(1-\alpha)}{\alpha B}\,e^{-\frac{A^2}{2 B^2}}\,  \Bigg[1+\sum_{n=1}^\infty\frac{ a_n}{(2 n+1)! \,\left(\alpha  B^2\right)^{2 n} }\, x^{2n}\Bigg]\,x$$ with
$$a_1=\left(\alpha ^2+\alpha +1\right) (A^2-B^2) $$
$$a_2=\left(\alpha ^4+\alpha ^3+\alpha ^2+\alpha +1\right) \left(A^4-6 A^2 B^2+3 B^4\right)$$
$$a_2=\left(\alpha ^6+\alpha ^5+\alpha ^4+\alpha ^3+\alpha ^2+\alpha +1\right) \left(A^6-15 A^4 B^2+45 A^2 B^4-15 B^6\right)$$

Title: Inequality of sum of error functions


问:
Gauss law from physics
I would like to apologise for the question that I am going to pose; and for my curiosity.

Q: How to evaluate the integral below of the function $E(x, y, z) $over $\Omega$ which is the surface of a ball or sphere. Suppose that the radius of sphere is 1; and that it is set at the origin. Define:

$$\vec{E} = \frac{1}{4\pi \varepsilon_0 \varepsilon} \frac{Q} {r^3} \frac{\vec{r}}{r} $$

Gauss law in physics is based on the divergence theorem, stating that
$$\iint_\Omega \vec{E} d\vec{S} =  \frac{Q}{\varepsilon_0}$$
where $\vec{E} $ is the intensity of the electrical field defined by the Coulomb law as $\vec{F} = q\vec{E} $. This question is all about math. From this, we get the definition of DIV by the limit operation:
$$\operatorname{div} \vec{F} = \lim_{\varepsilon \to 0} \frac{1}{V_\varepsilon}\iint_{\Omega_\varepsilon} \vec{F} d\vec{S} $$

答: Your formula for $E$ has one too many factors of $1/r$: you can either write $\frac{Q}{4\pi\varepsilon_0r^2}\frac{\vec{r}}{r}$ or $\frac{Q}{4\pi\varepsilon_0r^3}\vec{r}$. In terms of infinitesimal solid angle $d\Omega$, for a radius-$r$ circle centred on the origin$$d\vec{S}=r\vec{r}d\Omega\implies\vec{E}\cdot d\vec{S}=\frac{Q}{4\pi\varepsilon_0}d\Omega\implies\int\vec{E}\cdot d\vec{S}=\frac{Q}{\varepsilon_0}.$$

Title: Gauss law from physics


问:
Question about rank of a smooth map.
Suppose $M$ is a compact smooth manifold without boundary of dimension $n$, and given a smooth map $f:M\to \mathbb{R}^n$. Prove that there at least one point $p$ on $M$, s.t. the rank of $f$ on $p$ is smaller than $n$.

Here is my attempt. If all point on $M$ has full rank, then $f$ is a map with constant rank $n$. By rank theorem, every point on $M$ is the image of a section $s_i$. Since $M$ is compact, it's closed, and $f(M)$ is closed by rank theorem. We can choose finite sections {$s_i$}, whose images cover $M$. And the closure of the union of their domains is a manifold with boundary in $\mathbb{R}^n$, which is also $f(M)$. But this is impossible because $M$ has no boundary.

I am not sure about my argument. Hope someone could help. Thanks!

答: Your argument looks roughly ok, but there are simplifications that can be made that will make this cleaner. First of all, $f(M)$ is compact simply because $M$ is. Choosing a point of $f(M)$ of maximal distance from the origin, it must be a boundary point. At this point, $f$ fails to be a local homeomorphism, and so it will fail to have full rank somewhere (for the reasons you already stated).

Title: Question about rank of a smooth map.


答:
I'm not sure about your argument, at least in this formulation. Of course, the boundaryless assumption is crucial in this statement, but I would rather use a direct argument instead of a contradiction agument.

Recall that if $g : M \to \mathbb{R}$ is continuous and if $M$ is compact, then it has a global maximum. If $M$ has no boundary and if $g$ is smooth, then at this point, say $p$, is a critical point, i.e $\mathrm{d}g(p) = 0$.

Write the function $f$ as
$
f = \left(f_1,\ldots,f_n\right)
$ where $f_i : M \to \mathbb{R}$ is smooth. Then in this way of writing things
$$
\mathrm{d}f = \left(\mathrm{d}f_1,\ldots,\mathrm{d}f_n \right),
$$
and the rank of $\mathrm{d}f(x)$ at a point $x$ is at most the sum of the ranks of each $\mathrm{d}f_i(x)$.
As $M$ is compact and $f_1$ is continuous, it achieves its maximum at a point $x \in M$. As $M$ is without boundary, at such $x \in M$, $\mathrm{d}f_1(x) : T_xM \to \mathbb{R}$ is the zero linear function ($x$ is a critical point of $f_1$). Thus, at $x$, the rank of $\mathrm{d}f(x)$ is at most $n-1$.

Edit Here is a proof by contradiction that looks a -very little- bit like yours. Suppose $f : M^n \to \mathbb{R}^n$ is smooth, with $M$ compact without boundary. Suppose by contradiction that for every $x \in M$, the rank of $\mathrm{d}f(x)$ is $n$. By the inverse function theorem, $f(M)$ is open in $\mathbb{R}^n$. But as $M$ is compact, $f(M)$ is compact, hence closed in $\mathbb{R}^n$. Thus, $f(M)$ is open and closed, an non-empty: by connectedness, $f(M) = \mathbb{R}^n$. But $M$ is compact, so is $f(M)$, which leads to a contradiction.

Title: Question about rank of a smooth map.

Body:
Suppose $M$ is a compact smooth manifold without boundary of dimension $n$, and given a smooth map $f:M\to \mathbb{R}^n$. Prove that there at least one point $p$ on $M$, s.t. the rank of $f$ on $p$ is smaller than $n$.

Here is my attempt. If all point on $M$ has full rank, then $f$ is a map with constant rank $n$. By rank theorem, every point on $M$ is the image of a section $s_i$. Since $M$ is compact, it's closed, and $f(M)$ is closed by rank theorem. We can choose finite sections {$s_i$}, whose images cover $M$. And the closure of the union of their domains is a manifold with boundary in $\mathbb{R}^n$, which is also $f(M)$. But this is impossible because $M$ has no boundary.

I am not sure about my argument. Hope someone could help. Thanks!


问:
Three concurrent line segments
Can you provide a proof for the following claim:

Claim. Given an arbitrary $\triangle ABC$. The  $\triangle ADB$ , $\triangle BEC$ and $\triangle CFA$ are constructed on the sides of the  $\triangle ABC$ externally , such that $\angle BAD=\angle ECB$ , $\angle DBA=\angle ACF$ and $\angle CBE=\angle FAC$ . Let $H_1$,$H_2$,$H_3$ be the orthocenters of the $\triangle ADB$ , $\triangle BEC$, $\triangle CFA$, respectively. Then the line segments $AH_2$, $BH_3$ and $CH_1$ concur at the point $P$.

GeoGebra applet that demonstrates this problem can be found here.

My idea is to apply Jacobi's theorem on this problem. In order to do that we need to prove the following identities $\angle BAH_1=\angle H_3AC$, $\angle H_1BA=\angle CBH_2$ and $\angle H_2CB=\angle ACH_3$ but I don't know how this can be done. Any hints are welcomed.

答:
Clearly in $\triangle BDC$, $\angle HBE$ is complementary to $\angle ACB$.

Hence in the OP's diagram, $\angle H_3AC = 90 - \angle ACF = 90 - \angle DBA = \angle BAH_1$.

Same for others.

Title: Three concurrent line segments


问:
With this definition of local charts and submanifolds, are the transition maps differentiable?
My teacher defined submanifold in $\mathbb{R}^n$ as:
a subset $S \subset \mathbb{R}^n$ is a submanifold of dimension $m$ of $\mathbb{R}^n$ if for every $ x $ there is an open neighborhood $U$ of $x$ and an application $f: U \rightarrow \mathbb{R}^m \oplus \mathbb{R}^{n-m}$ such that

$f(U)$ is open in $\mathbb{R}^n$,

$f: U \rightarrow f(U)$ is a diffeomorphism,

$f(U\cap S) =f(U)\cap (\mathbb{R}^m \times \{0\})$ where $0 = (0,\cdots,0)$ $n-m$ times.

then he defined a coordinate system in the submanifold $S$: a coordinate system in $S$ is a pair $ (U, \phi) $  where

$U \subset \mathbb{R}^m$ is open,

$\phi: U \rightarrow \mathbb{R}^n$ is immersion,

Exists open set $V \subset \mathbb{R}^n$ such that $\phi(U) = V \cap S$ and $\phi: U \rightarrow \phi(U)$ is a homeomorphism.

My question is whether with the definitions above the result below remains true, if it does, how to prove it?

Theorem: Let $S \subset \mathbb{R}^n$ is a submanifold of dimension $m$ of $\mathbb{R}^n$. If $x \in S$ and $(U_1, \phi_1)$, $(U_2, \phi_2)$ are coordinates systems such that $\phi_1(U_1) = V_1\cap S$ and $\phi_1(U_1)=V_2\cap S$ with $x \in V_1 \cap V_2$, then
$$\phi_2^{-1} \circ \phi_1: U_1 \cap \phi_1^{-1}(V_2) \rightarrow \mathbb{R}^m$$
is differentiable.

he made a sketch of proof using the definition of submanifold to conclude that in a small
neighborhood of $x$,

$$ \phi_2^{-1} \circ \phi_1 = (f \circ \phi_2)^{-1} \circ (f \circ \phi_1)$$
and its a composite of diferentiable functions. I agree that $(f \circ \phi_1)$ because $f$ is diffeomorphism by definition of submanifold and $\phi_1$ is differentiable. but I don't see why $(f \circ \phi_2)^{-1}$ be differentiable.

So I was wondering if the result is really true, or if there is a flaw in the demonstration, or even if I understood something incorrectly myself. Thanks for the help!

Remark: a manifold was defined as a set $M \neq \emptyset$ with a maximal atlas,
we did not impose that $ M $ be Hausdorff or second-countable, ideas of topology of the manifold came later. The atlas is defined as a collection of pairs $ (U_{\lambda}, x_{\lambda}) $ such that

$\bigcup_{\lambda} U_{\lambda} = M,$ with $U_{\lambda} \subset M,$

$x_{\lambda}: U_{\lambda} \rightarrow x_{\lambda}( U_{\lambda}) \subset \mathbb{R}^m $ are bijections with open sets in $\mathbb{R}^m $ and $x_{\lambda}( U_{\lambda} \cap U_{\beta})$ is open $\forall \lambda, \, \beta.$

$x_{\beta} \circ  x_{\lambda}^{-1}: x_{\lambda}( U_{\lambda} \cap U_{\beta}) \rightarrow x_{\beta}( U_{\lambda} \cap U_{\beta})$ are diffeomorphisms $\forall \lambda, \, \beta.$

答:
In your question you define an atlas on a set $M$ as a collection of bijections $x_\lambda : U_\lambda \to V_\lambda \subset \mathbb R^n$ with open $V_\lambda$ such that suitable conditions are satisfied. This induces a unique topology on $M$ such that all $U_\lambda$ are open in $M$ all all $x_\lambda$ are homeomorphisms. Thus an alternative approach is to start with a topological space $M$ and define an atlas on $M$ as a collection of homeomorphisms $x_\lambda : U_\lambda \to V_\lambda$ between open subsets $U_\lambda$ of $M$ and open subsets $V_\lambda$ of $\mathbb R^n$  such that

$\bigcup U_\lambda = M$

$x_{\beta} \circ  x_{\lambda}^{-1}: x_{\lambda}( U_{\lambda} \cap U_{\beta}) \rightarrow x_{\beta}( U_{\lambda} \cap U_{\beta})$ are differentiable $\forall \lambda, \, \beta.$

Note that $x_{\lambda}( U_{\lambda} \cap U_{\beta})$ is automatically open in $\mathbb  R^n$ since $x_\lambda$ is a homeomorphism and $U_{\lambda} \cap U_{\beta}$ is open in $M$. Moreover note that the $x_{\beta} \circ  x_{\lambda}^{-1}$ are automatically diffeomorphisms because $(x_{\beta} \circ  x_{\lambda}^{-1})^{-1} = x_{\lambda} \circ  x_{\beta}^{-1}$ is also differentiable.

For $S$ you introduce the concept of a coordinate system $(U,\phi)$. The collection of all $\phi^{-1} : U' = \phi(U) \to U$ forms an differentiable atlas on the space $S$. Clearly the $\phi^{-1}$ are homeomorphisms between open subsets of $S$ and open subsets of $\mathbb R^m$ (recall that $\phi(U) = V \cap S$ with an open $V \subset \mathbb R^n$). It is easy to see that the $\phi(U)$ cover $S$, but that does not belong to your question. So let us show that the transition functions $\phi_{21} = \phi_2^{-1} \circ ( \phi_1^{-1})^{-1} = \phi_2^{-1} \circ \phi_1 : \phi_1^{-1}(U'_1 \cap U'_2) \to \phi_2^{-1}(U'_1 \cap U'_2)$ are differentiable. Recall that the $\phi_i : \phi_i^{-1}(U'_1 \cap U'_2) \to U'_1 \cap U'_2$ are homeomorphisms.

Given a coordinate system $(U,\phi)$ and $x \in U$, consider $p = \phi(x) \in S$. There exist an open neigborhood $O$ of $p$ in $\mathbb R^n$ and a diffeomorphism $f : O \to f(O) \subset \mathbb R^n$ such that $f(O\cap S) = f(O)\cap (\mathbb{R}^m \times \{0\})$; w.l.o.g. we may assume that $O \cap S \subset U' = \phi(U)$. Let $\pi : \mathbb R^n \to \mathbb R^m$ denote the projection onto the first $m$ coordinates and $j: \mathbb R^m \to \mathbb R^n, j(x) = (x,0)$. Define
$$\phi^* : \phi^{-1}(O) \stackrel{\phi}{\to} O \stackrel{f}{\to} \mathbb R^n ,$$
$$\phi^\# = \pi \circ \phi^* : \phi^{-1}(O) \to \mathbb R^m ,$$
$$f^* :  O \cap S \stackrel{f}{\to} f(O) \cap ( \mathbb R^m \times \{0\}) \stackrel{\pi}{\to} \pi(f(O) \cap ( \mathbb R^m \times \{0\}) = O^* .$$
Note that $f^*$ is a homeomorphism such that $f^*(\phi(\xi)) = \phi^\#(\xi)$. Moreover we have $j \circ \phi^\# = \phi^*$ because $\phi(\phi^{-1}(O)) \subset S$, thus $\phi^*(\phi^{-1}(O)) \subset \mathbb R^m \times \{0\}$. The map $\phi^\#$ is differentiable. Since $\phi$ is an immersion and $f$ is a diffeomorphism, the derivative $d\phi^*(x)$ of $\phi^*$ at $x$ has rank $m$. This implies that also $d\phi^\#(x)$ has rank $m$; if it were $< m$, then also $d\phi^*(x) = d(j \circ \phi^\#)(x)$ would have rank $< m$. This implies that $\phi^\#$ maps some open neigborhood $W$ of $x$ in $\phi^{-1}(O)$ diffeomorphically onto an open $W' \subset \mathbb R^m$.

Now let us come back to $\phi_{21}$. It suffices to find for each $x_1 \in \phi_1^{-1}(U'_1 \cap U'_2) \subset \mathbb R^m$ an open neigborhood $G$ in $\mathbb R^m$ such that $G \subset \phi_1^{-1}(U'_1 \cap U'_2)$ and $\phi_{21} \mid_G$ is differentiable. Let $p = \phi_1(x_1) \in U'_1 \cap U'_2 \subset S$. There exist an open neigborhood $O$ of $p$ in $\mathbb R^n$ and a diffeomorphism $f : O \to f(O) \subset \mathbb R^n$ such that $f(O\cap S) = f(O)\cap (\mathbb{R}^m \times \{0\})$; w.l.o.g. we may assume that $O \cap S \subset U'_1 \cap U'_2$. Because $f^*$ is a homeomorphism, we have
$$\phi_{12} = (f^* \circ \phi_2)^{-1} \circ (f^* \circ \phi_1) .$$
Clearly $f^* \circ \phi_1 = \phi_1^\#$ is differentiable. Moreover $f^* \circ \phi_2  =  \phi_2^\#$ maps some neigborhood of $x_2 = \phi_{21}(x_1)$ diffeomorphically onto some neigborhood of $(f^* \circ \phi_2)(x_2) = f^*(p)$, thus $(f^* \circ \phi_2)^{-1}$ is differentiable on some neighborhood of $f^*(p) = (f^* \circ \phi_1)(x_1)$. This gives us the desired $G$.


问:
Is my programming for loop equivalent correct if I want to state this in mathematical terms?
Would the mathematical equivalent for this for loop:

```<code>var runningTotal = 0;
for( i = 12; i >= 2; i-- )
{
    runningTotal += i;
}
</code>```

be:

$$
\text{runningTotal} = \sum_{i=12}^{i=2} f(i)
$$

Or does something need to be stated in the f(i) to state "add i12 to i11 to i10..."

答:
Obviously, you could just write $runningTotal = 77$

or you could write $\sum_{i=2}^{12}i$ or $\frac{(12+2)(12-2+1)}{2}$

But a recursive definition seems more fitting to me:

$S_{12} = 12$

$S_{i-1} = S_{i} + i - 1$

$runningTotal = S_2$


问:
$\lim_{x\to \pi/2} \;\frac 1{\sec x+ \tan x}$
how to solve it answer is $0$, but $\frac 1{\infty + \infty}$ is indeterminate form

$$\lim_{x \to \pi/2} \frac 1{\sec x + \tan x}$$

答:
We have for $x$ with $\cos x \ne 0$
\begin{align*}
  \frac 1{\tan x + \sec x} &= \frac 1{\frac{\sin x}{\cos x} + \frac 1{\cos x}}\\
   &= \frac{\cos x}{1 + \sin x}
\end{align*}
And hence
\[ \lim_{x \to \frac \pi 2} f(x) = \lim_{x\to\frac\pi 2} \frac{\cos x}{1 + \sin x} = \frac{\cos \frac \pi 2}{1 + \sin \frac \pi 2} = \frac{0}{1 + 1} = 0. \]</p>


问:
Definition of $ \arcsin $
The definition I knew for the inverse of the sin, is the following:

for $ x\in [-\pi/2,\pi/2] $ we have:

$ \sin x=y $ $ \iff $ $ x=\arcsin y+2\pi k $.

But recently I've seen that we could also define

$ \sin x=y $ $\iff $ $ x=\pi-\arcsin y+2\pi k $.

How's this two definitions correlate? when do you we choose the first one and when do we chose the other? why does it lead to the same result ?

Thanks in advance.

Title: Definition of $ \arcsin $

Body:
$$\sin(x)=\sin(\pi-x)$$
$${}{}$$


问:
Combinations - The number of ways of distributing n identical objects among r persons such that each person gets at least one object
So I came across this question and was unable to figure out the logic. Question -

Statement-1:
The number of ways of distributing 10 identical balls in 4 distinct boxes such that no box is empty is C(9,3)

Statement-2:
The number of ways of choosing any 3 places from 9 different places is C(9,3)

According to my answer key and the internet, both these statements are true. But I don't understand how.

Shouldn't the number of ways of distributing 10 identical balls in 4 distinct boxes such that no box is empty be C(10, 4) instead of C(9,3) ?

答: Think about it that way: we lay down the ten balls in a line, now instead of putting them into 4 boxes we place three walls anywhere between those balls. This is equivalent to putting them into 4 boxes(2 walls or a wall and one end of the line form a "box".) Now as we assume the 4 boxes to be nonempty we do not want to walls to be next to each other without a ball between them and similary we do not want a wall at an end of the line. (|....|....|.. would not be allowed, whereas .|..|....|... is legit.) Now how many possibilities are there to place these walls? Well thats simple: we have 9 places(anywhere between the ten balls without the ends) and we have to place 3 walls, so the answer is $\binom{9}{3}$.


答:
As per divergence theorem,

$\displaystyle \iint_\Omega \vec{E} \cdot d\vec{S} =  \iiint_V div(\vec{E}) \ dV$

If we take a single point charge at the origin, $\displaystyle \vec{E} = \frac{1}{4\pi \varepsilon_0} \frac{q} {r^2} \hat{r} \ $ where $\hat{r} = \frac{\vec{r}}{r}$ is a unit normal vector.

Now the outward unit normal vector for a sphere of radius $1$ centered at the origin is $\hat{r}$.

So the surface integral $\iint_\Omega \vec{E} \cdot d\vec{S} = \displaystyle \int_0^{2\pi} \int_0^{\pi} \frac{q}{4\pi \varepsilon_0} \hat{r} \cdot \hat{r} \sin \phi \ d\phi \ d\theta$

$ = \displaystyle \int_0^{2\pi} \int_0^{\pi} \frac{q}{4\pi \varepsilon_0} \sin \phi \ d\phi \ d\theta = \frac{q}{\varepsilon_0}$

If you are applying divergence theorem, in spherical coordinates,

$\displaystyle \iint_\Omega \vec{E} \cdot d\vec{S} =  \frac{q}{4 \pi \varepsilon_0} \iiint_V \nabla \cdot \big(\frac{\vec{r}}{r^2}\big) \ dV = \frac{q}{4 \pi \varepsilon_0} \int_0^{2 \pi} \int_0^{\pi} \int_0^1 \nabla \cdot \big(\frac{\vec{r}}{r^2}\big) \ r^2 \ \sin \phi \ dr \ d\phi \ d\theta$

$\displaystyle  = \frac{q}{\varepsilon_0}$

EDIT: one of the things I forgot to add in my original answer as to how the volume integral comes to that when the vector field has singularity at the origin. In fact the whole contribution to the flux is from the origin and it is zero everywhere else. For that you have to refer to Dirac Delta function. Let me know if you need more details on that.

Title: Gauss law from physics

Body:
I would like to apologise for the question that I am going to pose; and for my curiosity.

Q: How to evaluate the integral below of the function $E(x, y, z) $over $\Omega$ which is the surface of a ball or sphere. Suppose that the radius of sphere is 1; and that it is set at the origin. Define:

$$\vec{E} = \frac{1}{4\pi \varepsilon_0 \varepsilon} \frac{Q} {r^3} \frac{\vec{r}}{r} $$

Gauss law in physics is based on the divergence theorem, stating that
$$\iint_\Omega \vec{E} d\vec{S} =  \frac{Q}{\varepsilon_0}$$
where $\vec{E} $ is the intensity of the electrical field defined by the Coulomb law as $\vec{F} = q\vec{E} $. This question is all about math. From this, we get the definition of DIV by the limit operation:
$$\operatorname{div} \vec{F} = \lim_{\varepsilon \to 0} \frac{1}{V_\varepsilon}\iint_{\Omega_\varepsilon} \vec{F} d\vec{S} $$


问:
$n$ divides $\phi(a^n -1)$ where $a, n$ are positive integer.

Let $n$ and $a$ be positive integers with $a > 1$. I need to show that $n$ divides $\phi(a^n -1)$.

Here, $\phi$ denotes the Euler totient function.

Could any one give me a hint?

答:
A group theoretic solution can be given, (though this solution requires some advanced concepts yet it is very elegant and beautiful).

Let $m= a^n-1$.

Consider the group $G = (\mathbb{Z} / m\mathbb{Z})^*$ or rather $(\mathbb{Z}_m)^*$.

This group has $\phi(m)$ elements or rather the order of the group is $\phi(m)$.

Let $\bar a \in \mathbb{Z} / m \mathbb{Z}$ be the remainder class of the integer $a$ modulo $m$. Then, $\bar a \in G$, as $\gcd(a,m) = \gcd(a,a^n-1)=1$.

Consider the subgroup $H=\left<\bar a\right>$ that is the subgroup generated by $\bar a$.

Now $a^n\equiv 1 \mod m$ (where $m=a^n-1$ and $n$ is the smallest integer with this property), but no positive integer $i<n$ satisfies $a^i \equiv 1 \mod m$ (since $a^i - 1$ is a positive integer smaller than $m$). This implies that order of $H$ equals $n$.

Now as the order of a subgroup always divides the order of a group we have $n\mid\phi(a^n-1)$ .


问:
Why will repeated betting on a fair coin toss lose you money in the most cases? And how can you calculate it?
Imagine you play a game where you can set a certain amount of money, and you have a 50% chance of doubling your bet and 50 % of losing your bet. (To make the game interesting to play you can also give a chance of winning higher than 50%). You can play the game multiple times but once you lost all your money the game is over. This can also be compared to day trading were you bet on rising or falling stock prices, and you hope to have over 50 % success to make some gains.

To hedge your risk you won’t set all your money in the first round. So you decide to set only 50% of your money you have at every moment in the game (I know, you would get the highest possible expected value if you would always bet 100%, but for most people this is to risky).

What intrigued me is that in this case you most of the time lose money. Here is an example with $100 start capital, and we always bet 50% and play 2 rounds to illustrate this.

These are the possible scenarios:

Win-Win:    225   (100 + 50 + 75)

Lose-Win:   75   (100 - 50 + 25)

Win-Lose:   75   (100 + 50 - 75)

Lose-Lose:  25   (100 - 50 - 25)

As you can see we have an expected value of 100 which makes sense, but in three of four cases we lost money. I am now wondering from the eyes from a person who doesn't care about expected value but just doesn't want to lose money; what must be the chance of winning that I make profit to 50 %.

I am interested if there is a method to calculate the chance of making profit for different parameters (rounds played, percentage of money bet, chance of winning). I simulated different scenarios with R, but I am looking now for a mathematical solution.

答:
In fact your starting capital is multiplied by $(1/2)^i(3/2)^{n-i}$ in $n$ rounds by probability of $\binom{n}{i}/2^n$,

disregarding the order of loses and wins.

Since it can never become $1$, you can never return to any of your previous positions, including
"quit with no loss or profit".

Suppose $j = \underset{(1/2)^i(3/2)^{n-i}>1}{\max}(i)$, so you profit by chance of $p_j = \sum_{i=0}^j \binom{n}{i}/2^n$, and lose by chance of $1-p_j = \sum_{i=j+1}^n \binom{n}{i}/2^n$.

Also you can use $\min$ function similarly, if you like:

Suppose $k = \underset{(1/2)^i(3/2)^{n-i}<1}{\min}(i)$, so you lose by chance of $p_k = \sum_{i=k}^n \binom{n}{i}/2^n$, and profit by chance of $1-p_k = \sum_{i=0}^{k-1} \binom{n}{i}/2^n$.


答:
When it comes to real-valued functions, $\arcsin$ is the inverse of the function $\left.\sin\right\rvert_{\left[-\frac\pi2,\frac\pi2\right]}:\left[-\frac\pi2,\frac\pi2\right]\to[-1,1]$, i.e. the section of $\sin$ with domain $[-1,1]$ and range in $\left[-\frac\pi2,\frac\pi2\right]$.

As for solving $\sin y=x$ in $y$ for some $x\in[-1,1]$, we have $$\sin y=x\Leftrightarrow \exists k\in\Bbb Z,(y=2k\pi+\arcsin x\lor y=(2k+1)\pi-\arcsin x)$$

which essentially covers the fact that for all $x\in[-1,1]$ there are two real numbers $\alpha\in [0,2\pi)$ such that $\sin \alpha=x$.

For instance, if you want the ones in $[0,2\pi)$, you'll have to consider $\arcsin x$ and $\pi-\arcsin x$ if $x\ge0$, or $2\pi+\arcsin x$ and $\pi-\arcsin x$ if $x<0$.

Title: Definition of $ \arcsin $

Body:
The definition I knew for the inverse of the sin, is the following:

for $ x\in [-\pi/2,\pi/2] $ we have:

$ \sin x=y $ $ \iff $ $ x=\arcsin y+2\pi k $.

But recently I've seen that we could also define

$ \sin x=y $ $\iff $ $ x=\pi-\arcsin y+2\pi k $.

How's this two definitions correlate? when do you we choose the first one and when do we chose the other? why does it lead to the same result ?

Thanks in advance.


问:
Is there a way to map $[0, \infty[ $ onto $]- \infty, \infty[$ and vice versa?
As the title says. I'm actually writing a program and a part of it has to do these mappings. I just wish to do something like 2 functions f(x) and g(x), where the first maps $[0, \infty[ $ to $[- \infty, \infty]$ and g(x) does the opposite, preferably in an uncomplicated way. It does not have to be continuous.

答:
Take
$$f(x) = \begin{cases}
\ln(x) & \text{if } x \in (0,+\infty)\\
0 & x = 0
\end{cases}.$$


答:
There should be plenty of ways, but here's mine:
Given a number $x$ write this value as $n + q$ where $n$ is the integer part. Then define $ f(n+q) = -n -2q$ for $q \in (0,0.5]$ and f(n + q) = n + 2q for $n\in (0.5,1]$. Just make sure that if say you had $f(6)$ this needs to be written as $f(5 + 1)$. It's quite easy from this to work out your other function $g$, and also the inverses of these functions.

Title: Is there a way to map $[0, \infty[ $ onto $]- \infty, \infty[$ and vice versa?

Body: As the title says. I'm actually writing a program and a part of it has to do these mappings. I just wish to do something like 2 functions f(x) and g(x), where the first maps $[0, \infty[ $ to $[- \infty, \infty]$ and g(x) does the opposite, preferably in an uncomplicated way. It does not have to be continuous.


问:
What is the domain of $x^x$ when $ x<0$
I know that $x^x$ for all $x>0$

but what is negative values for that function which give a real number

for example  $$f(-1)=(-1)^{-1}=-1\in R$$

I try to put sequence for that but i faild

is there any help

thanks for all

答:
For negative values of $x$, when $x$ is not an integer, you run into surly problems involving complex numbers.  These entail a study of the complex log function and its branches.  </p>

<p>Clearly, $x\mapsto x^x$ makes sense for positive $x$.  It also makes sense for negative integer values of $x$.  It is not defined at $0$.  </p>

Title: What is the domain of $x^x$ when $ x<0$

Body:
For negative values of $x$, when $x$ is not an integer, you run into surly problems involving complex numbers.  These entail a study of the complex log function and its branches.

Clearly, $x\mapsto x^x$ makes sense for positive $x$.  It also makes sense for negative integer values of $x$.  It is not defined at $0$.


答:
I propose $f(x)=\begin{cases}\frac x{x-1}&x\in[0,\infty)\setminus\{1\}\\1& x=1\end{cases}$ for $f:[0,+\infty)\to\mathbb R$

Unfortunately for the other direction, this is not as simple as Martin R's comment pointed out.

We have to proceed in two steps $\mathbb R\overset{g_1}{\mapsto}(0,+\infty)\overset{g_2}{\mapsto}[0,+\infty)$

For instance $g_1(x)=e^x$ and $g_2(x)=\begin{cases}x-1&x\in\mathbb N\\x& \text{otherwise}\end{cases}$

Note: we do not have $f^{-1}=g_2\circ g_1$, but if you need a proper reciprocal, you can proceed the same way with $f_1(x)=\ln(x)$, can you see what $f_2$ should be in this case.


问:
rank(A) $≤ 2 \iff A = U.V^T$
Let $A \in M_{n×n}(\mathbb R)$, with $n ≥ 2$ a positive integer. Show that the following statements are equivalent :

i) rank(A) $≤ 2$.

ii) $\exists U,V ∈ M_{n×2}(\mathbb R)$ such that $A = U.V^T$

I honestly struggled to show both ways of the equivalence but I have a few guesses (I had the idea for ii $\implies$ i while writing this):

i $\implies$ ii : If rank(A) $≤ 2$ then there are $0,1$ or $2$ independent columns in A. We want to write A as a product of two nx2 matrixes. (I tried to take 4x4 matrixes of rank 2 and tried to write them in the form we are asking. I took U to be the independent columns, and V formed by the image of the canonic basis vectors and by pure luck it worked but this is not a proof).

ii $\implies$ i : We know that $rank(A)=rank(U.V^T) ≤ min(rank(U), rank(V^T))$, U and $V^T$'s ranks are clearly $\leq 2$ so rank(A) $\leq 2$

Can someone help me to write a solid proof for i $\implies$ ii instead of a lucky one ?

答:
I think the easiest way to do that exercise is to interpret matrices as linear maps instead of something like two-dimensional arrays that can be added and multiplied.

In that case the statements become:

$\operatorname{rank}(A)\leq 2$, i.e. the image of $A$ has dimension at most $2$.

$A:\Bbb R^n\to\Bbb R^n$ factors as $\Bbb R^n\xrightarrow{V^T}\Bbb R^2\xrightarrow{U}\Bbb R^n$.

Now (I would say) the proof becomes simpler. First it is clear, that if $A$ factors as in $2$ then the image of $A$ has dimension at most $2$ (because it is contained in the image of $U$) (this is basically what you already have).

For the other direction assume that $\operatorname{rank}A=2$ (the other cases are similar, we just need fewer basis vectors). Choose a basis $v_1,v_2$ of the image of $A$. Let $\Bbb R^n\to \operatorname{im}A$ be the restricion of $A$. Composing this with the isomorphism $\operatorname{im}A\to \Bbb R^2$, $v_i\mapsto e_i$ will get us the map $V^T$. Now $U$ is just the map $e_i\mapsto v_i$. We see that $$\operatorname{im}A\to\Bbb R^2\xrightarrow{U}\Bbb R^n$$
is just the inclusion of the image of $A$ into $\Bbb R^n$. So in total the composition of $U$ and $V^T$ is just $A$ (as linear maps). Now if you represent $U,V^T$ in terms of the standard basis we get matrices that satisfy $A=UV^T$ (As matrix multiplication)

(Here I wrote $A,U,V^T$ for both the matrices and their linear maps)

Title: rank(A) $≤ 2 \iff A = U.V^T$


问:
Stability of Solutions to Linear ODE
The questions is: Check the stability of the solutions to the following equation:
$$
y^{(11)}-|cos(t)|y^{(10)} +3t^3ArcTan(t)y=1
$$
My take: --- Solved--
I used Abel's formula $$ \dot W=|Cos(t)|W$$ and got that (edit: it's wrong)$$ W(t) = W(0) \cdot e^{|sint|} $$

I'm not sure if it's enough to show that $W \not \xrightarrow[t\to\infty]{} \infty $
in order to ensure stability of the ODE.

Edit: the Wronskian is NOT what I stated: $W(0) \cdot e^{|Sin(t)|}$
because the integral: $$\int_{0}^{t} |Cos(s)| ds \not =|sin(t)| $$  the limit of that integral when t approaches infinity is $\infty$,
$$, W\xrightarrow[t\to\infty]{} e^\infty =\infty$$
from that we can infer that one of the columns of the fundemental matrix is not bounded (because the determinant of that matrix (the Wronskian) is approaching infinity).
and from that we can say that one solution is not stable, so every other solution is not stable. - (if I made a mistake please correct me)

答:
the Wronskian is NOT what I stated: $W(0) \cdot e^{|Sin(t)|}$
because the integral: $$\int_{0}^{t} |Cos(s)| ds \not =|sin(t)| $$
the term for the wronskian is:$$W= W(0)\cdot e^{\int_{0}^{t} |Cos(s)| ds}$$  the limit of that integral when t approaches infinity is $\infty$\ (always summing positive values),
$$W \xrightarrow[t\to\infty]{} e^\infty =\infty$$
from that we can infer that one of the columns of the fundemental matrix is not bounded (because the determinant of that matrix (the Wronskian) is not bounded).
and from that we can say that at least one solution approaches infinity and thus not stable, so every other solution is not stable.

Title: Stability of Solutions to Linear ODE


问:
Does $\lim_{x\to 0}(\frac{1}{x}-\frac{\sin x}{x^2})$ exist?
$$\lim_{x\to0}\left(\frac{1}{x}-\frac{\sin x}{x^2}\right)=\lim_{x\to0}\left(\frac{x-\sin x}{x^2}\right)$$
By L'Hopital's Rule, we have
$$\lim_{x\to0}\left(\frac{x-\sin x}{x^2}\right)=\lim_{x\to0}\frac{1-\cos x}{2x}=\lim_{x\to0}\frac{\sin x}{2}=0$$
This is what I did, but the answer in my textbook says that the limit does not exist. Can someone explain to me where have I done it wrong? Thx!

答:
Yes, there exists the limit of $\frac{1}{x}-\frac{\sin(x)}{x^{2}}$ as $x\to 0$ or  as $x\to \infty$ and the both case the answer in zero.

Your solution:
\begin{eqnarray*}
\lim_{x\to 0} \left(\frac{1}{x}-\frac{\sin(x)}{x^{2}}\right)&=&\lim_{x \to 0} \left(\frac{x-\sin(x)}{x^{2}} \right) \quad [\color{blue}{\text{correct}}]\\
&=&\lim_{x\to0}\frac{1-\cos x}{2x} \quad [\color{blue}{\text{correct}}]\\
&=&\lim_{x\to0}\frac{\sin x}{2} \quad [\color{blue}{\text{correct}}]\\
&=&0. \quad [\color{blue}{\text{correct}}]\\
\end{eqnarray*}

On the other hand, notice that in $$\lim_{x\to \infty} \left(\frac{1}{x}-\frac{\sin(x)}{x^{2}}\right)$$
we can see that $$\lim_{x\to \infty} \frac{1}{x^{2}}=0 \quad \text{and} \quad \lim_{x\to \infty} \frac{\sin(x)}{x^{2}}=0$$
since that $-1\leq \sin(x) \leq 1$ for all $x\in  \mathbb{R}$.

Therefore, we can conclude that $$\lim_{x\to \infty} \left(\frac{1}{x}-\frac{\sin(x)}{x^{2}}\right)=0.$$


问:
definition of an array
I'm teaching a programming class in Python, and I'd like to start with the mathematical definition of an array before discussing how arrays/lists work in Python.

Can someone give me a definition?

答:
An array is a tuple with elements taken from a specific set $S$. When the array can contain variables of a specific type, then the set is the set $S$ consists of all possible values of this type.

This is the most general definition, as a mathematician I don't talk about implementation details like the memory structure or the complexity of operations on the array.

It may be useful to consider more specific examples: If you fix a field $k$, consider a $k$ vector space $V$ of dimension $n$ and accept a specific data type of Pyhton as a representation of elements of $k$, you can interpret an one-dimensional $k$-array of length $n$ as a representation of a vector in $V$ (with respect to a fixed basis that is left implicit).

Similarly, one could interpret a two dimensional array of length n*n as representing a matrix, i.e. a linear transformation of $V$ etc.

Title: definition of an array


问:
Weak* convergence in $L^\infty$ and the strong convergence in $L^2$ of a mollification?
I feel like this should be obvious to me but I'm blanking.

Let $\Omega$ be an open bounded subset of $\mathbb R^n$. Let $f_n\in C^\infty_c(\Omega)$ and $f\in L^\infty(\Omega)$ be such that
$$ f_n\overset*\rightharpoonup f \text{ in }L^\infty
 .$$
Now let $\rho\in C^\infty_c(\mathbb R^n)$. Extending all functions by $0$ to functions defined on $\mathbb R^n$, is it true that (up to a subsequence, if you must)
$$ \rho*f_n \to \rho *f \text{ in } L^2?$$
I suspect this is indeed true. Although it is not quite my setting, if I use the Fourier basis $e_n(\theta) := e^{in\theta}$ of $\mathbb T = \mathbb R/2\pi \mathbb Z$ which converges weak* to $0$ in $L^\infty$ (which is just Riemann-Lebesgue lemma), then for $\rho\in C^\infty(\mathbb T)$,
$$ \rho* e_n (\theta) = \int_{\mathbb T}\rho(\alpha)e^{in(\theta-\alpha)} d\alpha = e^{in\theta}  \hat \rho (n) \to 0  \text{ uniformly in $\theta$,} $$
and therefore in $L^2$ (and other $L^p$ too.) But  I do not know how to prove a general result. By routine symbol pushing, $\rho*f_n$ converges weakly* in $L^\infty$ and weakly in $L^2$. (Sketches or counterexamples are welcome)

答:
Let $f=0$. Then we want to prove
$$
\int_{\mathbb R^n} \left(\int_\Omega \rho(x-y)f_n(y)dy\right)^2 dx \to0.
$$
Since $\Omega$ is bounded, $f_n\rightharpoonup0$ in $L^2(\Omega)$, so  $\int_\Omega \rho(x-y)f_n(y)dy \to 0$ for all $x$. That is, the integrand in the integral above converges pointwise to zero. In addition,
$$
|\int_\Omega \rho(x-y)f_n(y)dy| \le |\Omega|\|\rho\|_{L^\infty} \sup_n \|f\|_{L^\infty}
$$
for all $x$, which is a square-integrable pointwise upper bound. Then convergence follows by dominated convergence.

This is some kind of compactness result for the simple integral operator $f\mapsto \rho *f$ from $L^2(\Omega)$ to $L^2(\Omega)$.


问:
A new(?) expression for the prime counting function
I recently found the expression

$$\pi(n)=\sum_{k=1}^n\left\lfloor 2^{m(k)}\right\rfloor,\tag1 \label{eq1}$$
where $$m(k)=2k-1-\sum_{j=1}^{k}\gcd(j,k).$$

I found this by designing a characteristic function for the primes $\chi_{\Bbb P}(n)$. We can write
$$p\text{ is prime }\iff \sum_{j=1}^p\gcd(j,p)=2p-1.$$
This comes from $\gcd(j,p)=1$ for all $j<p$. Then we can also write $$p\text{ is not prime }\iff \sum_{j=1}^p\gcd(j,p)>2p-1.$$
Thus the function $m(p)$ is $0$ for prime $p$ and negative for composite $p$. This being the case, $2^{m(p)}=1$ for prime $p$, and $0<2^{m(p)}<1$ for composite $p$. Taking the floor function of $2^{m(p)}$ then gives a working expression for $\chi_{\Bbb P}(p)$. Clearly, $\sum_{p\le n}\chi_{\Bbb P}(p)=\left|\left\{p\in\Bbb P:p\le n\right\}\right|=:\pi(n)$.

Since this is so simple I doubt it is new, but I can't find it anywhere. Is this because it is simply not useful? Or is there some other reason? Any sources which contain \eqref{eq1} or equivalent expressions would be appreciated. :)

答:
This kind of formulas are common. May be this exact variant is new, but there are many others based on $\chi_{\mathbb P}$. For example, for $n>1$ we have $$\chi_{\mathbb P}(n)=\left\lfloor \cos^2\left(\frac{(n-1)!+1}{n}\pi\right)\right\rfloor$$
or
$$\chi_{\mathbb P}(n)=\left\lfloor\frac{2}{\sum_{k=1}^n(\lfloor\frac{n}{k}\rfloor-\lfloor\frac{n-1}{k}\rfloor)}\right\rfloor$$

And you guessed right, this kind of formulas are not useful, and that's why they are usually not found in textbooks. I remember to have seen the first one in a book as an exercise after the section of Wilson's theorem.


问:
Show that $|u(x)|\leq C \|u\|_{W^{1,p}(I)}$
Let $I\subseteq \mathbb{R}$ be an open bounded interval. Show that any $u\in W^{1,p}(I)$ satisfies $|u(x)|\leq C \|u\|_{W^{1,p}(I)}$, where $C>0$ is independent of $u$.

I don't have a lot of high powered inequalities to work with, other than Holder or Minkowski (Young's inequality is probably OK).

I know by FTC that $$u(x) = \int_y^x u'(t) \, dt+u(y).$$ We also have the definition of $\|u\|^p_{W^{1,p}}=\|u\|_{L^p}^p+\|u'\|^p_{L^p}$

And finally we also know (by Minkowski) that for any functions in $L^P(I)$ we have $\|f+g\|_p\leq\|f\|_p+\|g\|_p,$ and that $|a+b|^p\leq 2^p(a^p+b^p)$, and thus $\|f+g\|_p^p\leq(\|f\|_p+\|g\|_p)^p\leq2^p(\|f\|_p^p+\|g\|_p^p)$

I feel like these are the right ingredients to prove the needed result, but I'm struggling to see how I should put them together.

Any thoughts would be greatly appreciated. Thanks in advance.

答:
From the fundamental theorem, we get (putting absolute values everywhere and enlarge integration region from $(x,y)$ to $I$)
$$
|u(x)| \le \left| \int_y^x u'(t)dt + u(y)\right| \le \int_y^x |u'(t)|dt +|
 u(y)| \le \int_I |u'|dt + |u(y)|.
$$
Let $L$ be the length of the interval.
Now integrate with respect to $y$:
$$
L|u(x)| \le   \int_I L |u'| + |u| dt \le \max(1,L) \int_I  |u'| + |u| dt .
$$
In that way, the left-hand side contains the evaluation in $x$, where on the right-hand side we only have integrals.
This proves the claim for $p=1$. Apply Hoelder inequality to get the estimate for $p>1$.


问:
Check if two lines intersect
I have a non-linear line with these coordinates:

```<code>(1,50)(2,40)(3,45)(4,40)(5,60)(6,30)
</code>```

When I draw the line passing through each of these points, noted line A, I can visually see that another straight line drawn from last to first point only - from (1,50) to (6,30) - noted line B, would intersect/cross line A.

My goal is to be able to mathematically check that line B does NOT intersects with line A, is there some equation or approach I could go with to check that?

EDIT:
Sorry for the misleading "line" word I use, I should have used curve. Here is the representation of what I meant (credits to Joffan):

答:
To find out if a line segment $(x_1, y_1) - (x_2, y_2)$ intersects a line segment $(\chi_1, \gamma_1) - (\chi_2, \gamma_2)$, parametrise the two line segments using $0 \le t \le 1$ and $0 \le \tau \le 1$,
$$\left\lbrace \; \begin{aligned}
x(t) &= (1 - t) x_1 + t x_2 = x_1 + t (x_2 - x_1) \\
y(t) &= (1 - t) y_1 + t y_2 = y_1 + t (y_2 - y_1) \\
\end{aligned} \right.$$
$$\left\lbrace \; \begin{aligned}
\chi(\tau) &= (1 - \tau) \chi_1 + \tau \chi_2 = \chi_1 + \tau (\chi_2 - \chi_1) \\
\gamma(\tau) &= (1 - \tau) \gamma_1 + \tau \gamma_2 = \gamma_1 + \tau (\gamma_2 - \gamma_1) \\
\end{aligned} \right.$$
and solving $x(t) = \chi(\tau)$ and $y(t) = \gamma(\tau)$ for $t$ and $\tau$.  If $0 \le t \le 1$ and $0 \le \tau \le 1$, the line segments intersect, otherwise they do not intersect.

Note that if any of the following are true, the two line segments cannot intersect:
$$\begin{aligned}
\max(x_1 , x_2) &\lt \min(\chi_1 , \chi_2) \\
\min(x_1 , x_2) &\gt \max(\chi_1 , \chi_2) \\
\max(y_1 , y_2) &\lt \min(\gamma_1 , \gamma_2) \\
\min(y_1 , y_2) &\gt \max(\gamma_1 , \gamma_2) \\
\end{aligned}$$
If none of the four are true, then the axis-aligned bounding boxes for the two line segments overlap.  If any of the four are true, then they do not.

Instead of calculating $t$ and $\tau$, we can avoid a division if we instead use $t^\prime = t D$ and $\tau^\prime = \tau D$, and verify $t^\prime$ and $\tau^\prime$ are between $0$ and $D$, noting that $D$ may be positive or negative:
$$\begin{aligned}
D &= ( x_1 - x_2 ) ( \gamma_2 - \gamma_1 ) - ( \chi_1 - \chi_2 ) ( y_2 - y_1 ) \\
t^\prime &= x_1 ( \gamma_2 - \gamma_1 ) + \chi_1 ( y_1 - \gamma_2 ) + \chi_2 ( \gamma_1 - y_1 ) \\
\tau^\prime &= x_1 ( y_2 - \gamma_1 ) + x_2 ( \gamma_1 - y_1 ) + \chi_1 ( y_1 - y_2 ) \\
\end{aligned}\tag{1}\label{G1}$$
but note that $D = 0$ if the two lines are parallel.

My preferred solution in the parallel line case is to rotate the coordinate system, bringing one of the lines horizontal.  Then, it is relatively straightforward to check if they overlap.

Rotation matrix $\mathbf{R}_{12}$ that brings the line segment $(x_1, y_1) - (x_2, y_2)$ horizontal is
$$\mathbf{R}_{12} = \frac{1}{\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}}\left[ \begin{matrix}
x_2 - x_1 & y_2 - y_1 \\
y_2 - y_1 & x_1 - x_2 \\
\end{matrix} \right ]$$
but in this case, the scaling factor can be omitted; then, the transformed coordinates are just scaled by the length of the first line segment.

Here is an example implementation on Python:

```<code>def intersect(x1,y1,x2,y2, x3,y3,x4,y4):

    # No intersection if axis-aligned bounding boxes do not overlap.
    if (max(x1, x2) < min(x3, x4) or
        min(x1, x2) > max(x3, x4) or
        max(y1, y2) < min(y3, y4) or
        min(y1, y2) > max(y3, y4)):
        return False

    d = (x1-x2)*(y4-y3) - (x3-x4)*(y2-y1)
    if d > 0:
        t12 = x1*(y4-y3) + x3*(y1-y4) + x4*(y3-y1)
        if t12 < 0 or t12 > d:
            return False

        t34 = x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2)
        if t34 < 0 or t34 > d:
            return False

        return True

    elif d < 0:
        t12 = x1*(y4-y3) + x3*(y1-y4) + x4*(y3-y1)
        if t12 > 0 or t12 < d:
            return False

        t34 = x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2)
        if t34 > 0 or t34 < d:
            return False

        return True

    # d == 0, and the two line segments are parallel.

    # Transform coordinate system so that
    # (x1,y1)-(x2,y2) becomes (0,0)-(L,0), and
    # (x3,y3)-(x4,y4) becomes (xa,ya)-(xb,yb),
    # or vice versa.

    # Which of the two line segments is longer?
    x12 = x2-x1
    y12 = y2-y1
    x34 = x4-x3
    y34 = y4-y3
    L12 = x12*x12 + y12*y12
    L34 = x34*x34 + y34*y34
    if L12 > L34:
        x31 = x3 - x1
        y31 = y3 - y1
        x41 = x4 - x1
        y41 = y4 - y1
        ya = y12*x31 - x12*y31
        yb = y12*x41 - x12*y41

        # If both endpoints of the second line are on the same side,
        # we assume it is outside.  Any other case is within rounding error.
        if (ya < 0 and yb < 0) or (ya > 0 and yb > 0):
            return False

        xa = x12*x31 + y12*y31
        xb = x12*x41 + y12*y41
        return min(xa, xb) <= L12 and max(xa, xb) >= 0

    elif L34 > 0:
        x13 = x1 - x3
        y13 = y1 - y3
        x23 = x2 - x3
        y23 = y2 - y3
        ya = y34*x13 - x34*y13
        yb = y34*x23 - x34*y23

        # If both endpoints of the second line are on the same side,
        # we assume it is outside.  Any other case is within rounding error.
        if (ya < 0 and yb < 0) or (ya > 0 and yb > 0):
            return False

        xa = x34*x13 + y34*y13
        xb = x34*x23 + y34*y23
        return min(xa, xb) <= L34 and max(xa, xb) >= 0

    # Both line segments are degenerate; zero length.
    return (x1 == x3) and (y1 == y3)

if __name__ == '__main__':
    from random import Random
    prng = Random()

    rows = 40
    cols = 8
    color = { True:"#FF0000", False:"#0000FF" }

    print("""<!DOCTYPE html><head><title>Intersections</title><meta http-equiv="Content-Type" content="html;charset=UTF-8"><style type="text/css">
html, body { background: #ffffff; color: #000000; margin: 0 0 0 0; border: 0px none; padding: 0 0 0 0; }
table { margin: 0 0 0 0; border: 0px none; padding: 0 0 0 0; border-collapse: collapse; }
tbody, tr { margin: 0 0 0 0; border: 0px none; padding: 0 0 0 0; }
td { margin: 0 0 0 0; border: 0px none; padding: 0.5em 0.5em 0.5em 0.5em; }
svg { margin: 0 0 0 0; border: 1px solid #999999; padding: 0 0 0 0; }
</style><body><table>""")
    for r in range(0, rows):
        print("<tr>")
        for c in range (0,cols):
            x1 = prng.uniform(0.1, 9.9)
            y1 = prng.uniform(0.1, 9.9)
            x2 = prng.uniform(0.1, 9.9)
            y2 = prng.uniform(0.1, 9.9)
            x3 = prng.uniform(0.1, 9.9)
            y3 = prng.uniform(0.1, 9.9)
            x4 = prng.uniform(0.1, 9.9)
            y4 = prng.uniform(0.1, 9.9)
            isect = intersect(x1,y1,x2,y2,x3,y3,x4,y4)
            print("""<td><svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 10 10">
<rect x="0" y="0" width="10" height="10" fill="#ffffff" stroke="none"/>
<path d="M%.6f%+.6f L%.6f%+.6f M%.6f%+.6f L%.6f%+.6f" fill="none" stroke="%s" stroke-width="0.1"/>
</svg></td>""" % (x1,y1,x2,y2,x3,y3,x4,y4,color[isect]))
        print("</tr>")
    print("</table></body></html>")
</code>```

When run, it emits an HTML page with 320 random tests.  Non-intersecting line pairs are in blue, and intersecting line pairs in red.  Redirect the output to a file, say python3 above.py > results.html, and you can open the file in your favourite browser to see the test results.

Title: Check if two lines intersect

Body:
To find out if a line segment $(x_1, y_1) - (x_2, y_2)$ intersects a line segment $(\chi_1, \gamma_1) - (\chi_2, \gamma_2)$, parametrise the two line segments using $0 \le t \le 1$ and $0 \le \tau \le 1$,
$$\left\lbrace \; \begin{aligned}
x(t) &= (1 - t) x_1 + t x_2 = x_1 + t (x_2 - x_1) \\
y(t) &= (1 - t) y_1 + t y_2 = y_1 + t (y_2 - y_1) \\
\end{aligned} \right.$$
$$\left\lbrace \; \begin{aligned}
\chi(\tau) &= (1 - \tau) \chi_1 + \tau \chi_2 = \chi_1 + \tau (\chi_2 - \chi_1) \\
\gamma(\tau) &= (1 - \tau) \gamma_1 + \tau \gamma_2 = \gamma_1 + \tau (\gamma_2 - \gamma_1) \\
\end{aligned} \right.$$
and solving $x(t) = \chi(\tau)$ and $y(t) = \gamma(\tau)$ for $t$ and $\tau$.  If $0 \le t \le 1$ and $0 \le \tau \le 1$, the line segments intersect, otherwise they do not intersect.

Note that if any of the following are true, the two line segments cannot intersect:
$$\begin{aligned}
\max(x_1 , x_2) &\lt \min(\chi_1 , \chi_2) \\
\min(x_1 , x_2) &\gt \max(\chi_1 , \chi_2) \\
\max(y_1 , y_2) &\lt \min(\gamma_1 , \gamma_2) \\
\min(y_1 , y_2) &\gt \max(\gamma_1 , \gamma_2) \\
\end{aligned}$$
If none of the four are true, then the axis-aligned bounding boxes for the two line segments overlap.  If any of the four are true, then they do not.

Instead of calculating $t$ and $\tau$, we can avoid a division if we instead use $t^\prime = t D$ and $\tau^\prime = \tau D$, and verify $t^\prime$ and $\tau^\prime$ are between $0$ and $D$, noting that $D$ may be positive or negative:
$$\begin{aligned}
D &= ( x_1 - x_2 ) ( \gamma_2 - \gamma_1 ) - ( \chi_1 - \chi_2 ) ( y_2 - y_1 ) \\
t^\prime &= x_1 ( \gamma_2 - \gamma_1 ) + \chi_1 ( y_1 - \gamma_2 ) + \chi_2 ( \gamma_1 - y_1 ) \\
\tau^\prime &= x_1 ( y_2 - \gamma_1 ) + x_2 ( \gamma_1 - y_1 ) + \chi_1 ( y_1 - y_2 ) \\
\end{aligned}\tag{1}\label{G1}$$
but note that $D = 0$ if the two lines are parallel.

My preferred solution in the parallel line case is to rotate the coordinate system, bringing one of the lines horizontal.  Then, it is relatively straightforward to check if they overlap.

Rotation matrix $\mathbf{R}_{12}$ that brings the line segment $(x_1, y_1) - (x_2, y_2)$ horizontal is
$$\mathbf{R}_{12} = \frac{1}{\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}}\left[ \begin{matrix}
x_2 - x_1 & y_2 - y_1 \\
y_2 - y_1 & x_1 - x_2 \\
\end{matrix} \right ]$$
but in this case, the scaling factor can be omitted; then, the transformed coordinates are just scaled by the length of the first line segment.

Here is an example implementation on Python:

def intersect(x1,y1,x2,y2, x3,y3,x4,y4):

    # No intersection if axis-aligned bounding boxes do not overlap.
    if (max(x1, x2) < min(x3, x4) or
        min(x1, x2) > max(x3, x4) or
        max(y1, y2) < min(y3, y4) or
        min(y1, y2) > max(y3, y4)):
        return False

    d = (x1-x2)*(y4-y3) - (x3-x4)*(y2-y1)
    if d > 0:
        t12 = x1*(y4-y3) + x3*(y1-y4) + x4*(y3-y1)
        if t12 < 0 or t12 > d:
            return False

        t34 = x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2)
        if t34 < 0 or t34 > d:
            return False

        return True

    elif d < 0:
        t12 = x1*(y4-y3) + x3*(y1-y4) + x4*(y3-y1)
        if t12 > 0 or t12 < d:
            return False

        t34 = x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2)
        if t34 > 0 or t34 < d:
            return False

        return True

    # d == 0, and the two line segments are parallel.

    # Transform coordinate system so that
    # (x1,y1)-(x2,y2) becomes (0,0)-(L,0), and
    # (x3,y3)-(x4,y4) becomes (xa,ya)-(xb,yb),
    # or vice versa.

    # Which of the two line segments is longer?
    x12 = x2-x1
    y12 = y2-y1
    x34 = x4-x3
    y34 = y4-y3
    L12 = x12*x12 + y12*y12
    L34 = x34*x34 + y34*y34
    if L12 > L34:
        x31 = x3 - x1
        y31 = y3 - y1
        x41 = x4 - x1
        y41 = y4 - y1
        ya = y12*x31 - x12*y31
        yb = y12*x41 - x12*y41

        # If both endpoints of the second line are on the same side,
        # we assume it is outside.  Any other case is within rounding error.
        if (ya < 0 and yb < 0) or (ya > 0 and yb > 0):
            return False

        xa = x12*x31 + y12*y31
        xb = x12*x41 + y12*y41
        return min(xa, xb) <= L12 and max(xa, xb) >= 0

    elif L34 > 0:
        x13 = x1 - x3
        y13 = y1 - y3
        x23 = x2 - x3
        y23 = y2 - y3
        ya = y34*x13 - x34*y13
        yb = y34*x23 - x34*y23

        # If both endpoints of the second line are on the same side,
        # we assume it is outside.  Any other case is within rounding error.
        if (ya < 0 and yb < 0) or (ya > 0 and yb > 0):
            return False

        xa = x34*x13 + y34*y13
        xb = x34*x23 + y34*y23
        return min(xa, xb) <= L34 and max(xa, xb) >= 0

    # Both line segments are degenerate; zero length.
    return (x1 == x3) and (y1 == y3)

if __name__ == '__main__':
    from random import Random
    prng = Random()

    rows = 40
    cols = 8
    color = { True:"#FF0000", False:"#0000FF" }

    print("""<!DOCTYPE html><head><title>Intersections</title><meta http-equiv="Content-Type" content="html;charset=UTF-8"><style type="text/css">
html, body { background: #ffffff; color: #000000; margin: 0 0 0 0; border: 0px none; padding: 0 0 0 0; }
table { margin: 0 0 0 0; border: 0px none; padding: 0 0 0 0; border-collapse: collapse; }
tbody, tr { margin: 0 0 0 0; border: 0px none; padding: 0 0 0 0; }
td { margin: 0 0 0 0; border: 0px none; padding: 0.5em 0.5em 0.5em 0.5em; }
svg { margin: 0 0 0 0; border: 1px solid #999999; padding: 0 0 0 0; }
</style><body><table>""")
    for r in range(0, rows):
        print("<tr>")
        for c in range (0,cols):
            x1 = prng.uniform(0.1, 9.9)
            y1 = prng.uniform(0.1, 9.9)
            x2 = prng.uniform(0.1, 9.9)
            y2 = prng.uniform(0.1, 9.9)
            x3 = prng.uniform(0.1, 9.9)
            y3 = prng.uniform(0.1, 9.9)
            x4 = prng.uniform(0.1, 9.9)
            y4 = prng.uniform(0.1, 9.9)
            isect = intersect(x1,y1,x2,y2,x3,y3,x4,y4)
            print("""<td><svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 10 10">
<rect x="0" y="0" width="10" height="10" fill="#ffffff" stroke="none"/>
<path d="M%.6f%+.6f L%.6f%+.6f M%.6f%+.6f L%.6f%+.6f" fill="none" stroke="%s" stroke-width="0.1"/>
</svg></td>""" % (x1,y1,x2,y2,x3,y3,x4,y4,color[isect]))
        print("</tr>")
    print("</table></body></html>")

When run, it emits an HTML page with 320 random tests.  Non-intersecting line pairs are in blue, and intersecting line pairs in red.  Redirect the output to a file, say python3 above.py > results.html, and you can open the file in your favourite browser to see the test results.


答:
Speaking of digital programming, there is a maximum and minimum in any signed or unsigned data type. Some data types support the representation of infinity, but not all of them.
It is practical to think of a linear mapping such as $f:[0,M) \rightarrow (m,M)$ defined by
$$f(x) =  \frac{M - m}{M}x + m$$
where $m$ and $M$ is the smallest and the largest number the data type can represent. It has good properties to handle; linear, continuous, and bijective. Furthermore, it is efficient in the sense of computational overhead.


问:
Logical Equivalence for Quantified Statement
I have the following predicate:

P(x,y) = x is better than y

and was given the following quantified statement for the sentence "exactly one person is better than Sam":

$$\exists x [P(x, Sam) \land (\neg \exists y P(y, Sam)\land (y \neq x))]$$

I am wondering if this is logically equivalent to:

$$\exists x \exists y[(P(x,Sam) \land P(y,Sam)) \rightarrow (x = y)]$$

Intuitively I can't see why they are not, but am having a difficult time converting one to the other via logical laws.

答:
No. $\neg \exists y \phi \not \equiv \exists y \neg \phi$, so you can not apply the negation just to the conjunction and move the existential quantifier out. What is the negated is the existence of other better persons. Note also that the $\exists y$ is supposed to scope over the whole second conjunction; it's $P(y,Sam) \land (y \neq x)$ which belongs together, but in your second sentence you changed the bracketing structure so as to $P(x,Sam)$ to belong to the first part and applying the negation just to $y \neq x$.

The second sentence can be satisfied in a structure where noone is better than Sam. Because then for arbitrary choices of $x$ and $y$ the conjunction becomes false so the implication becomes true so the existential statement becomes true, which is not the intended meaning.

The first sentence entails the second, but not vice versa, so they are not equivalent.

A logically equivalent transformation via logical laws is

$\begin{align*}
& \exists x [P(x, Sam) \land \neg \exists y [P(y, Sam) \land (y \neq x))]\\
\equiv\ & \exists x [P(x, Sam) \land \forall y \neg [P(y, Sam)\land (y \neq x)]]\\
\equiv\ & \exists x [P(x, Sam) \land \forall y [P(y, Sam) \to (y = x)]]\\
\end{align*}$


答: $x^x$ is well defined as a real function for $$(0,\infty) \cup \{ -\frac{m}{2n+1}| m, n \in {\mathbb N} \}$$</p>

Title: What is the domain of $x^x$ when $ x<0$

Body:
I know that $x^x$ for all $x>0$

but what is negative values for that function which give a real number

for example  $$f(-1)=(-1)^{-1}=-1\in R$$

I try to put sequence for that but i faild

is there any help

thanks for all


问:
Are the entries of diag($xx^T$) given by $x^Tx$?
If $x$ is a $n \times 1$ vector, are the entries of diag($xx^T$) given by $x^Tx$?

答: $x^Tx$ is a $1\times1$ matrix. It can't contain the $n$ diagonal values you seek. Instead, their sum is $(x^Tx)_{11}$. Using Einstein notation,$$(x^Tx)_{11}=x_ix^i=\operatorname{diag}(xx^T)_i^i=\operatorname{Trace}(xx^T),$$because $\operatorname{diag}(xx^T)_i^j=x_ix^j$.


问:
Discontinuous linear mapping on $\mathcal{C}([0;1], \mathbb{R})$
Let endow $\mathcal{C}([0;1], \mathbb{R})$ with the $L^1$-norm.

Let $L$ be a mapping from $\mathcal{C}([0;1], \mathbb{R})$ to $\mathbb{R}$ such that:

$\forall f \in \mathcal{C}([0;1], \mathbb{R}), L(f)=f(a)$ where $a \in [0;1]$.

Show that $L$ is a discontinuous mapping.

I tried to prove it by contradiction but I ended up with an equality that is true. I can't manage to find a contradiction. I was also thinking about finding a sequence of function that violates the sequential characterization of continuity, but I could not find one. Any help would be appreciated!

答:
Note that $L$ depends on $a$: it’s the evaluation function at $a$, so I’ll call it $L_a$. So you’re asked to show that all maps $L_a$ where $a \in [0,1]$ are discontinuous (they are linear by definition of the operations on $C([0,1])$).

For $L_0$ consider maps like $f \in C([0,1])$ that are defined by

$$f_n(x) = \begin{cases} -nx + 1 & 0 \le x \le \frac1n\\
                                              0 & \frac1n \le x \le 1\\
\end{cases}$$

We have $\|f_n\|_1 = \frac{1}{2n} \to 0$ so that $f_n \to 0$ in the $L^1$-norm while $L_0(f_n) = 1$ all the time and $L_0$ is $0$ at the limit... Try to apply this idea for any $a$ to prove all of them discontinuous...


答:
Set $y = -x$.

Thus, we have:

$x^x = (-y)^{-y}$ when $y \ge 0$

Or equivalently,

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

Which can be simplified to:

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

Therefore, the domain of $x^x$ consists of both reals and complex numbers depending on the value of $(-1)^y$ or to be more precise depending on the value of $y$.

Title: What is the domain of $x^x$ when $ x<0$


问:
Asymptotic behavior of a monotone function
Assume that $f:(0,1)\to(0,1)$ is a monotonically increasing function with $f(0)=0$. No further smoothness of $f$ is known. Assume there exists a sequence $(x_{k})_{k}$ with $\lim_{k\to\infty}x_k=0$, such that
\begin{eqnarray*}
\lim_{k\to\infty}\frac{f(x_k)}{f(2 x_k)}\,= 0.
\end{eqnarray*}
Is it possible to derive any estimate for $f$ close to $x=0$?

答:
Because $f(x_k)/f(2x_k) \to 0$ you can find $n$ such that $f(x_k)/f(2x_k) < \frac{1}{2}$ for all $k \geqslant n$.  Now select a subsequence $\{\xi_j\}$ of the $\{x_k\}$ as follows:

define $\xi_0 = x_n$;

for each $j > 0$ choose $n_j > n_{j-1}$ such that $x_{n_j} < \frac{1}{2} \xi_{j-1}$, possible because the $x_k$ tend to zero, and then define $\xi_j = x_{n_j}$.

We thus have a subsequence, also approaching zero, in which $\xi_n < \frac{1}{2} \xi_{n-1}$ and for all $\xi_n$, $f(\xi_n) < \frac{1}{2}f(2\xi_n)$.  It then follows, by induction if need be, that $f(\xi_n) < 2^{-n} f(\xi_0)$.

This is enough to show that $f(x) \to 0$ as $x \to 0$.  For any $\varepsilon$ we can find $n$ such that $2^{-n}f(\xi_0) < \varepsilon$ and so for all $x < \xi_n$, because $f$ is monotonically increasing,
$$ 0 < f(x) < f(\xi_n) < 2^{-n}f(\xi_0) < \varepsilon$$


答:
To explore whether the limit exists or not proceed with calculating the Left Hand Limit and the Right Hand Limit.

Say, we approach the limit from values slightly greater than $0$ i.e. $x$ approaches $0^+$ where $0^+$ denotes values that are slightly greater than $0$. This is known as the Right Hand Limit (RHL):
$$\lim_{x\to0^+}\left(\frac{1}{x}-\frac{\sin x}{x^2}\right)=\lim_{x\to0^+}\left(\frac{x-\sin x}{x^2}\right)$$
Since, $x\to0^+$, we can use the substitution $x=0+h$ ($x$ approaches $0$ from slightly higher value). As, $x\to0$, $h\to0$. So the problem becomes:
$$\lim_{h\to0}\left(\frac{1}{h}-\frac{\sin h}{h^2}\right)=\lim_{h\to0}\left(\frac{h-\sin h}{h^2}\right)$$
$$\lim_{h\to0}\frac{h-(h-\frac{h^3}{3!}+\frac{h^5}{5!}...)}{h^2}=\lim_{h\to0}{\frac{\frac{h^3}{3!}-\frac{h^5}{5!}+\frac{h^7}{7!}}{h^2}}=0$$

Similarly, you can calculate the Left Hand Limit by assuming, $x\to0^-$ ($x$ approaches $0$ from values slighltly less than $0$). The LHL becomes:
$$\lim_{x\to0^-}\left(\frac{1}{x}-\frac{\sin x}{x^2}\right)=\lim_{x\to0^-}\left(\frac{x-\sin x}{x^2}\right)$$
Use substitution, $x=0-h$. So, as $x\to0^-$,$h\to0$. The LHL becomes:
$$\lim_{h\to0}\left(\frac{1}{-h}-\frac{\sin (-h)}{(-h)^2}\right)=\lim_{h\to0}\left(\frac{-h+\sin h}{h^2}\right)$$
$$\lim_{h\to0}\frac{-h+(h-\frac{h^3}{3!}+\frac{h^5}{5!}-\frac{h^7}{7!})}{h^2}=\lim_{h\to0}\frac{\frac{-h^3}{3!}+\frac{h^5}{5!}...}{h^2}=0$$

You can see that the LHL = RHL, therefore the limit exists and is equal to $0$. Your method is correct as well but this method always let you see whether the limits exist or not. I hope this helps...

Title: Does $\lim_{x\to 0}(\frac{1}{x}-\frac{\sin x}{x^2})$ exist?

Body:
$$\lim_{x\to0}\left(\frac{1}{x}-\frac{\sin x}{x^2}\right)=\lim_{x\to0}\left(\frac{x-\sin x}{x^2}\right)$$
By L'Hopital's Rule, we have
$$\lim_{x\to0}\left(\frac{x-\sin x}{x^2}\right)=\lim_{x\to0}\frac{1-\cos x}{2x}=\lim_{x\to0}\frac{\sin x}{2}=0$$
This is what I did, but the answer in my textbook says that the limit does not exist. Can someone explain to me where have I done it wrong? Thx!


问:
What is the best approach to find the nearest line segment (x1,y1), (x2,y2) from a point (x,y)?
Let's suppose the are three line segments in a plane, each line segment has coordinates (x1, y1) and (x2, y2). What is the best approach to find out the nearest line segment from a point (x, y)?

Hint: use vectors dot product.

答:
The distance from a point to a line is given by the projection of a line from the point to some point on the line onto a unit vector orthogonal to the line.

First we need same data.

```<code>lines = Partition[RandomReal[{-1, 1}, {6, 2}], 2]
point = RandomReal[{-1, 1}, 2]
Graphics[{Line[lines], PointSize[0.02], Red, Point[point]},
 Axes -> True]
</code>```

Then we need unit vectors orthogonal to our lines:

```<code>ortho = Normalize /@ (Subtract @@@ lines).{{0, 1}, {-1, 0}};
</code>```

The distance from the point to the lines is now given by the absolute value of the projection of the line from point to the start of the lines onto the orthogonal unit vector:

```<code>dist = MapThread[(Abs[(point - #1).#2]) &, {lines[[All, 1]], ortho}]
(*{0.0292868, 0.260295, 0.347937}*)
</code>```

It is obvious, for our example, that the first line is closest to the point.

OwnerDisplayName: Ahmad Shakir

Body:
The distance from a point to a line is given by the projection of a line from the point to some point on the line onto a unit vector orthogonal to the line.

First we need same data.

lines = Partition[RandomReal[{-1, 1}, {6, 2}], 2]
point = RandomReal[{-1, 1}, 2]
Graphics[{Line[lines], PointSize[0.02], Red, Point[point]},
 Axes -> True]

Then we need unit vectors orthogonal to our lines:

ortho = Normalize /@ (Subtract @@@ lines).{{0, 1}, {-1, 0}};

The distance from the point to the lines is now given by the absolute value of the projection of the line from point to the start of the lines onto the orthogonal unit vector:

dist = MapThread[(Abs[(point - #1).#2]) &, {lines[[All, 1]], ortho}]
(*{0.0292868, 0.260295, 0.347937}*)

It is obvious, for our example, that the first line is closest to the point.

OwnerDisplayName: Daniel Huber


答:
Let's think about the problem in geometric terms. The given point and the two points defining any one of the lines form a triangle. One of the altitudes of that triangle is the distance from the given point to the chosen line. So the problem reduces to finding the relevant altitudes of three triangles and selecting the shortest one.

In V12, Wolfram introduced the function TriangleConstruct into Mathematica which, when given a list of tree points (coordinate pairs) representing a triangle, can compute many properties of that triangle. One of those properties is its altitude.

Once we have the altitudes for thee triangles, we can order the altitudes by length and use the ordering to identify the line we are looking for.

Here is some code that does what I have described.

```<code>SeedRandom[6]

pt = {0, 0}; (* the given point *)
lines = Partition[RandomReal[{-1, 1}, {6, 2}], 2];
triangles = {pt, #[[1]], #[[2]]} & /@ lines;
altitudes = TriangleConstruct[#, {"Altitude", pt}] & /@ triangles;
ordering = OrderingBy[altitudes, Apply[EuclideanDistance, First[#]] &];
lines[[ordering[[1]]]] (* the line closest to the given point *)
</code>```

```<code>{{0.446885, 0.440912}, {0.612913, -0.86427}}
</code>```

Here is a visualization of the geometry created by the above code.

```<code>Graphics[
  {InfiniteLine /@ lines,
   {Dashed, altitudes},
   {AbsolutePointSize[8],
     {Red,
        Point[pt],
        TriangleConstruct[triangles[[ordering[[1]]]], {"Foot", pt}]},
     {Black, Point /@ lines}},
     Block[{x1, x2},
       {x1, x2} = (lines[[ordering[[1]]]][[#]] & /@ {1, 2});
       {Text[Style[#, 8], # + {.28, .05}] & /@ {x1, x2}}]},
   PlotRange -> {{-1, 1}, Automatic},
   PlotRangePadding -> {{Automatic, .2}, Automatic},
   Frame -> True]
</code>```

Notes

Fixing the given point at the origin induces no loss of generality.

The red point from which the three (dashed) altitudes radiate is the given point.

The other red point is the foot of the shortest altitude.

Title: What is the best approach to find the nearest line segment (x1,y1), (x2,y2) from a point (x,y)?

Body:
Let's suppose the are three line segments in a plane, each line segment has coordinates (x1, y1) and (x2, y2). What is the best approach to find out the nearest line segment from a point (x, y)?

Hint: use vectors dot product.

Body:
Let's think about the problem in geometric terms. The given point and the two points defining any one of the lines form a triangle. One of the altitudes of that triangle is the distance from the given point to the chosen line. So the problem reduces to finding the relevant altitudes of three triangles and selecting the shortest one.

In V12, Wolfram introduced the function TriangleConstruct into Mathematica which, when given a list of tree points (coordinate pairs) representing a triangle, can compute many properties of that triangle. One of those properties is its altitude.

Once we have the altitudes for thee triangles, we can order the altitudes by length and use the ordering to identify the line we are looking for.

Here is some code that does what I have described.

SeedRandom[6]

pt = {0, 0}; (* the given point *)
lines = Partition[RandomReal[{-1, 1}, {6, 2}], 2];
triangles = {pt, #[[1]], #[[2]]} & /@ lines;
altitudes = TriangleConstruct[#, {"Altitude", pt}] & /@ triangles;
ordering = OrderingBy[altitudes, Apply[EuclideanDistance, First[#]] &];
lines[[ordering[[1]]]] (* the line closest to the given point *)

{{0.446885, 0.440912}, {0.612913, -0.86427}}

Here is a visualization of the geometry created by the above code.

Graphics[
  {InfiniteLine /@ lines,
   {Dashed, altitudes},
   {AbsolutePointSize[8],
     {Red,
        Point[pt],
        TriangleConstruct[triangles[[ordering[[1]]]], {"Foot", pt}]},
     {Black, Point /@ lines}},
     Block[{x1, x2},
       {x1, x2} = (lines[[ordering[[1]]]][[#]] & /@ {1, 2});
       {Text[Style[#, 8], # + {.28, .05}] & /@ {x1, x2}}]},
   PlotRange -> {{-1, 1}, Automatic},
   PlotRangePadding -> {{Automatic, .2}, Automatic},
   Frame -> True]

Notes

Fixing the given point at the origin induces no loss of generality.

The red point from which the three (dashed) altitudes radiate is the given point.

The other red point is the foot of the shortest altitude.


答:
For three line segment instead of infinite line. Here we use Line instead of InfiniteLine.

```<code>pairs = RandomReal[{-4, 4}, {3, 2, 2}];
pt = RandomReal[{-3, 3}, 2];
result = {Line[#], RegionNearest[Line[#], pt],
    RegionDistance[Line[#], pt]} & /@ pairs
point = TakeSmallestBy[result, Last, 1][[1, 2]];
Graphics[{Line /@ pairs, {PointSize[Large], Red, Point[pt]},
  Line[{pt, point}], {PointSize[Large], Blue, Point[point]}}]
</code>```

Body:
For three line segment instead of infinite line. Here we use Line instead of InfiniteLine.

pairs = RandomReal[{-4, 4}, {3, 2, 2}];
pt = RandomReal[{-3, 3}, 2];
result = {Line[#], RegionNearest[Line[#], pt],
    RegionDistance[Line[#], pt]} & /@ pairs
point = TakeSmallestBy[result, Last, 1][[1, 2]];
Graphics[{Line /@ pairs, {PointSize[Large], Red, Point[pt]},
  Line[{pt, point}], {PointSize[Large], Blue, Point[point]}}]

OwnerDisplayName: cvgmt


问:
Number of permutations of $X=\{x_1, x_2, ..., x_n\}$ and $Y=\{y_1, y_2, ... , y_m\}$ where $X$ is finished before $Y$ and $y_1$ occurs after $X$.
I'm trying to solve a problem where I need to calculate all the permutations of m+n objects with some different conditions:

$X$ is finished before $Y$ and $y_1$ occurs after $X$ And the last $X$ is not $x_1$

$x_1$ and $y_m$ occurs before $X$ and $Y$ are both emptied or $x_1$ is the last one.

For the first one I made this equation:
$$
Y_1+Y_2+\cdots+Y_n+Y_{n+1}+Y_{n+2}=m-1
$$
$$
\forall i Y_i\geq 0
$$
Where $Y_1,...,Y_{n+1}$ is the space between two $x_i$ and $Y_{n+2}$ is the space after occurrence of $y_m$. If I multiple this by the number of correct permutations, we have:
$$
(n-1)(n-1)!(m-1)!C(m+n,n+1)=(n-1)(n-1)!(m-1)!\frac{(m+n)!}{(n+1)!(m-1)!}=\frac{(n-1)(m+n)!}{n(n+1)}
$$
But I know that since the probability of this permutations is dependent to $m$, this not the correct answer. What am I doing wrong? How can I count these conditions?

答:
For the first condition

There are $(m+n)!$ permutations in total.

For any such combination consider just the $x_i$s and $y_1$. There are $n+1$ equally likely possibilities for the last of these and since we require this to be $y_1$  we divide the total by $n+1$.

Now consider just the $x_i$s. The last one must not be $x_1$ and so we multiply the total by $(n-1)/n$.

Your answer of $\frac{(n-1)(m+n)!}{n(n+1)}$ is therefore correct. The probability you mention is just $\frac{(n-1)}{n(n+1)}$ and does not depend upon $m$ since the arrangement of the $y_i$s other than $y_1$ indeed do not affect this probability.

For the second condition

This condition seems to be just that $y_m$ is not the last and so the answer is $(m+n-1)(m+n-1)!$


问:
How to solve this integral in terms of $c$?
Let $c>0$, is there a "closed form" solution of the integral

$$
\int_0^1 \exp\left(-\frac{1}{cx(1-x)}\right) dx
$$

or a special function (of $c$) giving the solution of the integral above? So far, I've only managed to obtain some upper bounds, for example by
$$
\int_0^1 \frac{1}{x^2}\exp\left(-\frac{1}{cx}\right) dx = c (1-e^{-1/c}),
$$
or lower bounds, for example by
$$
\int_0^{1/2}\exp\left( -\frac{1}{cx^2}\right)dx +\int_{1/2}^1 \exp\left( -\frac{1}{c(1-x)^2}\right)dx=2a\left(
\frac{\text{erf}(2/\sqrt{c})-1}{\sqrt{c}}
\right)+e^{-4/c}
$$
where $a=1.77245$ and $\text{erf}(\cdot)$ is the Gauss error function, which might be not so sharp. Any ideas/known results?

EDIT: my primary interest is to determine the rate at which the integral converges to $1$ as $c\to \infty$, thus also approximate solutions/sharp bounds would be appreciated.

答:
As OP wanted the behaviour of the solution at infinity, starting from amazing Professor Vector solution, I expanded it at $c=\infty$
and got
$$\frac{2}{c} e^{-2/c} \left(K_1\left(\frac{2}{c}\right)-K_0\left(\frac{2}{c}\right)\right)\sim \frac{2 \gamma }{c}-\frac{2}{c}-\frac{2 \log c}{c}+1$$
Where $\gamma$ in Euler-Mascheroni constant.

Hope this helps


问:
How to show that $-x^2\mathrm{d}\left(\frac{y}{x}\right) = y\mathrm{d}x-x\mathrm{d}y$?
I thought of replacing $\frac{y}{x}$ with a variable $z$ but this only got me into further confusion. I am very unfamiliar with manipulating single $\mathrm{d}$'s as opposed to ratios of them where your product rule and chain rule can come in useful. Any help would be appreciated.

答: Just apply Leibniz rule, $d(f_1 f_2) = df_1 f_2 + f_1 d f_2$. You know $d\left(\frac{1}{x} \right) = - \frac{1}{x^2} dx$ then it automatically solves.


答:
We have $y=y(x)$, then

$$\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{y(x)}{x}\right)= \frac{xy'(x)-y(x)}{x^2}.$$

Hence

$$-x^2\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{y(x)}{x}\right)=y(x)-xy'(x).$$

Title: How to show that $-x^2\mathrm{d}\left(\frac{y}{x}\right) = y\mathrm{d}x-x\mathrm{d}y$?

Body: I thought of replacing $\frac{y}{x}$ with a variable $z$ but this only got me into further confusion. I am very unfamiliar with manipulating single $\mathrm{d}$'s as opposed to ratios of them where your product rule and chain rule can come in useful. Any help would be appreciated.


问:
Compute this integral (multivar. calc.)
So i have the following question:

Compute
$$\int_{C}(x^2+y)dx + (z+x)dy + (x+2y)dz$$
where $C$ is the intersection of the cylinder $x^2+y^2=4 $ and the plane $x+y=z$

So my thoughts are to parametrise it to make get $$r(t) = 2cos(t) i + 2sin(t)j + (2cos(t) + 2sin(t) ) k$$

and then use this along with $r'(t)$ to calculate

$$\int_{0}^{2\pi} F(r(t)) \cdot r'(t) dt $$

Which when I computed it all, came out to be $$-8\pi$$

I was hoping someone could either verify this method, along with the answer or help me to find out the solution (through tips)

Thank you

答:
Yes you have parametrized the surface correctly but your answer is incorrect.

$r(t) = (2 \cos t,  2 \sin t, 2 \cos t + 2 \sin t)$

So, $dx = -2 \sin t \ dt, \ dy = 2 \cos t \ dt, \ dz = (-2 \sin t + 2 \cos t) \ dt$

$x^2 + y = 4 \cos^2 t + 2 \sin t, x + z = 4 \cos t + 2 \sin t, x + 2y = 2 \cos t + 4 \sin t$

So $\ \displaystyle  \int_C \ (x^2+y) \ dx + (z+x) \ dy + (x+2y) \ dz = \int_0^{2 \pi} (12 \cos 2t + 4 \sin 2t - 8 \cos^2t \ \sin t) \ dt = 0$

Title: Compute this integral (multivar. calc.)


问:
Linear programming, why Lagrangian sets lower bound for the value function of original
Suppose we have the following linear programming problem in standard form:

$$ \min c^Tx $$
$$ \text{s.t.}\quad  Ax=b, x\ge 0 $$

Make the above problem unconstrained via the Lagrangian method, with multiplier $p$

$$\min c^Tx + p^T(b-Ax) $$
$$ \text{s.t.}\quad x\ge 0$$

My question:

Why does the relaxed (i.e. Lagrangian) problem's value function is weakly less than the value function of the original problem (see below)? Can someone explain this intuitively or geometrically?

$$h(p)=\min\,[c^Tx+p^T(b-Ax)]\,\leq\, c^Tx^*+p^T(b-Ax^*)=c^Tx^*$$

答:
The following equivalent form allows a natural economical interpretation.

$$
\min c^\top x \\
s.t.  \ \ A x \geq b, x \geq 0
$$

This form is similar to the famous "diet problem".

The vector x represents different types of food ingredients that must be bought in order to produce meals that satisfy basic nutritional requirements, represented by each row of $A x \geq b$.

In the diet problem, these would represent minimum amounts of calories, proteins, different vitamins, etc.

The producer wants to meet these requirements as cheaply as possible. While doing that, it could happen that some requirements are exceeded - for instance, the cheapest diet is tight on protein, but has spare vitamins, iron, etc, above the minimum amount.

Now, imagine that a vitamin company comes along and proposes to purchase for a positive price $p_i$ any excess nutrients $a_i x - b_i$ the producer might have ($a_i$ is the ith row of A).

Can you see that this business proposition is always beneficial to the producer? The income from excess nutrients possibly reduces the cost objective, while not increasing it. The worst it can happen is that we have zero prices for the nutrients in excess. In this case, the costs are the same.