Are all mathematicians human calculators? I asked my dad why he did not major in math he said "because he is not good at math".
I think I like math, and I think I'm ok at it, but I'm not gifted or anything like that, I just like math. I think I'd like to major in math, but I see all these documentaries about great mathematicians and they can all multiply and divide numbers off the top of their heads and I certainly cannot. I realize that we have calculators, but somehow I don't think I should go into math.

  As a forum/site of math people, what do you think?

Sorry if this is kind of a random question with no definite answer and probably out of place. My tags are probably wrong too, sorry.

EDIT: Mostly, i think I'm worried that I don't have a high enough IQ to ever contribute anything to the field of mathematics. I think I'll only study the work of others and never have my own work. It seems like people who are successful in mathematics are people who are talented by nature, like they have a really high IQ (yes, IQ is just a number, but you know what I mean) and math comes easily to them. For those people, it seems like math is effortless, but I wouldn't know.

Replace the captions in the below comic with "math fan" and "mathematician" and it will convey the spirit of the truth (link to original) :

The number of famous mathematicians in history who were also great mental calculators are few and far between.  Euler, who became blind in his latter years, is said to have been able to perform calculations in his head.  One story is that Euler passed away while he was mentally calculating the orbit of the moon.  Emilie du Chatelet is also another famous example.  It has been determined from his extant notes that Newton was not a mental calculator, though he did enjoy working out numerical calculations to something like 50 decimal places.  Gauss has also been named as a calculating prodigy.  Doron Zeilberger, though, has recently brought to light that Gauss' famous boyhood deduction of summing consecutive integers up to 100 was actually determined with inductive examples (as shown in his Tagebuch, i.e. diary) and not by other more direct means (as had previously been promulgated).  The reader should take caution that we are talking about famous people in history with many admirers and followers who very likely would not fall short of exaggerating their accomplishments.  In the 20th century, we have Alexander Aitken and John von Neumann.  There are several anecdotes about von Neumann, who was able to solve the two trains and a fly problem the long way by summing geometric series in his head, according to Eugene Wigner.   Feynman was perhaps not a calculating prodigy in the same league as a real mental calculator, but he did explain some of his tricks and techniques with regards to mental calculations.


Find the condition that one root of $ax^2+bx+c=0$ be the reciprocal of a root of $a_1x^2+b_1x+c_1=0$. Find the condition that one root of $ax^2+bx+c=0$ be the reciprocal of a root of $a_1x^2+b_1x+c_1=0$.

My Attempt:

Let $x_1$ and $x_2$ be the roots of the equation $ax^2+bx+c=0$. Then,
$$x_1=\dfrac {-b+\sqrt {b^2-4ac}}{2a}$$
 $$x_2=\dfrac {-b-\sqrt {b^2-4ac}}{2a}$$
Again, Let $x'_1$ and $x'_2$ be the roots of $a_1x^2+b_1x+c_1=0$. Then,
$$x'_1=\dfrac {-b_1+\sqrt {{b_1}^2-4a_1c_1}}{2a_1}$$
$$x'_2=\dfrac {-b_2+\sqrt {{b_2}^2-4a_2c_2}}{2a_2}$$

How do I proceed further?

In general if $\alpha$ and $\beta$ are the roots of equation $ax^2+bx+c=0$, then,

Sum of the roots, $\alpha+\beta=-\dfrac{b}{a}$, and Multiplication of roots, $\alpha\beta=\dfrac{c}{a}$.

So, $\dfrac{\alpha+\beta}{\alpha\beta}=\dfrac{-b/a}{c/a}=\dfrac{-b}{c}\implies\dfrac{1}{\alpha}+\dfrac{1}{\beta}=\dfrac{-b}{c}$, and $\dfrac{1}{\alpha\beta}=\dfrac{a}{c}\ \hspace{20pt}\cdots(\text{i})$

Let, $\alpha_1$ and $\beta_1$ are the roots of equation $a_1x^2+b_1x+c_1=0$  such that $\alpha_1=\dfrac{1}{\alpha}$ and $\beta_1=\dfrac{1}{\beta}$, as they are reciprocal.

Now from (i) we can write that $\alpha_1+\beta_1=-\dfrac{b}{c}$ and $\alpha_1\beta_1=\dfrac{a}{c}$.

So the equation whose sum of roots is $=-\dfrac{b}{c}$ and multiplication of roots is $=\dfrac{a}{c}$ can be written as: $x^2-(\alpha_1+\beta_1)x+\alpha_1\beta_1=0\implies x^2+\dfrac{b}{c}x+\dfrac{a}{c}=0\implies cx^2+bx+a=0$. Now this final equation $cx^2+bx+a=0$ and $a_1x^2+b_1x+c_1=0$ are same.

So comparing we get, $\dfrac{a_1}{c}=\dfrac{b_1}{b}=\dfrac{c_1}{a}$.


Topology: Opens vs Neighborhoods Disclaimer: This thread is meant informative and therefore written in Q&A style. The problems are highlighted in bold face.

The axiomatization of topology can be done in various ways all of them having their own advantage. Here I would like to investigate two of them specifically.

There's the one by open sets usually given:
$$\bullet \#I<\infty:\quad A_i\in\mathcal{T}\implies \bigcap_{i\in I}A\in\mathcal{T}\\
\bullet \#I\leq\infty:\quad A_i\in\mathcal{T}\implies\bigcup_{i\in I}A_i\in\mathcal{T}$$
and the one by neighborhoods introduced by Felix Hausdorff:
$$\bullet A\subseteq B:\quad A\in\mathcal{N}(x)\implies B\in\mathcal{N}(x)\\
\bullet A,B\in\mathcal{N}(x)\implies A\cap B\in\mathcal{N}(x)\\
\bullet \forall x\in X:\quad\mathcal{N}(x)\neq\{\}\\
\bullet A\in\mathcal{N}(x)\implies x\in A\\
\bullet A\in\mathcal{N}(x)\implies\exists C_0\in\mathcal{N}:\quad A\in\mathcal{N}(c)\text{ for all }c\in C_0(x)$$
Prove that any family of open sets give rise to a neighborhood system via:
$$A\in\mathcal{N_T}(x):\iff\exists U_0\in\mathcal{T}:\quad x\in U_0\subseteq A\quad$$
and that any neighborhood system gives rise to a family of open sets via:
$$A\in\mathcal{T_N}:\iff\forall a\in A:\quad A\in\mathcal{N}(a)$$
Moreover prove that their equivalent in the sense:
$$\mathcal{T}\mapsto\mathcal{N_T}\mapsto\mathcal{T}\text{ and }\mathcal{N}\mapsto\mathcal{T_N}\mapsto\mathcal{N}$$
(Note that both must be checked in order to ensure injectivity and surjectivity.)

So we can switch back and forth between both descriptions for topology. Here are two situations where this is exploited:

a. The interior is defined via neighborhoods:
$$A^\circ:=\{z:A\in\mathcal{N}(z)\}$$
It is contained and open (see Topology: Interior):
$$A^\circ\subseteq A\text{ and }A^\circ\in\mathcal{N}(z)\text{ for all }z\in A^\circ$$
Therefore neighborhoods have nonempty interior:
$$A^\circ=\bigcup_{A\supseteq U\in\mathcal{T}}U$$
b. Continuity is defined via neighborhoods:
$$N\in\mathcal{N}(f(x))\implies f^{-1}N\in\mathcal{N}(x)$$
Thus in locally convex spaces topology is entailed fully in any point:
$$N\in\mathcal{N}(x)\iff N+a\in\mathcal{N}(x+a)$$

So while open sets reflect general aspects of topology correlations between space itself and topology become lucid via neighborhoods.

For better reading I left out the details...

Any family of open sets gives rise to a neighborhood system since:
$$\bullet\left(A\in\mathcal{N_T}(x)\right)\implies\left(U_0\subseteq A\quad x\in U_0\in\mathcal{T}\right)\\\implies\left(U_0\subseteq B\quad x\in U_0\in\mathcal{T}\right)\implies\left(B\in\mathcal{N_T}(x)\right)\quad A\subseteq B\\
\bullet\left(A,B\in\mathcal{N_T}(x)\right)\implies\left(U_A\subseteq A,U_B\subseteq B\quad x\in U_A,U_B\in\mathcal{T}\right)\\\implies\left(U_A\cap U_B\subseteq A\cap B\quad x\in U_A\cap U_B\in\mathcal{T}\right)\implies\left(A\cap B\in\mathcal{N_T}(x)\right)\\
\bullet\left(X\in\mathcal{T}:\quad x\in X\subseteq X\right)\implies\left(X\in\mathcal{N_T}(x)\right)\\
\bullet\left(A\in\mathcal{N_T}(x)\right)\implies\left(U_0\subseteq A\quad x\in U_0\in\mathcal{T}\right)\implies\left(x\in U_0\subseteq A\right)\\
\bullet\left(A\in\mathcal{N_T}(x)\right)\implies\left(U_0\subseteq A\quad x\in U_0\in\mathcal{T}\right)\\\implies\left(U_0\subseteq A,U_0\subseteq U_0\quad u,x\in U_0\in\mathcal{T}\right)\implies\left(A\in\mathcal{N}(u)\quad u\in U_0\in\mathcal{N_T}(x)\right)$$

Any family of open sets gives rise to a neighborhood system since:
$$\left(A,B\in\mathcal{T_N}\right)\implies\left(A\in\mathcal{N}(a),B\in\mathcal{N}(b)\quad a\in A,b\in B\right)\\\implies\left(A\cap B\in\mathcal{N}(c)\quad c\in A\cap B\right)\implies\left(A\cap B\in\mathcal{T_N}\right)\\
\left(A_i\in\mathcal{T_N}\right)\implies\left(A_i\in\mathcal{N}(a_i)\quad a_i\in A_i\right)\\\implies\left(\bigcup_{i\in I}A_i\in\mathcal{N}(c)\quad c\in\bigcup_{i\in I}A_i\right)\implies\left(\bigcup_{i\in I}A_i\in\mathcal{T_N}\right)\\
\left(\varnothing\in\mathcal{N}(x)\quad x\in\varnothing\right)\implies\left(\varnothing\in\mathcal{T_N}\right)\\
\left(\mathcal{N}(x)\neq\{\}\quad x\in X\right)\implies\left(X\in\mathcal{N}(x)\quad x\in X\right)\implies\left(X\in\mathcal{T_N}\right)$$

Not that the interior is contained and open:
$$A^\circ\subseteq A\text{ and }A^\circ\in\mathcal{N}(z)\quad z\in A^\circ$$
(Its precise definition, statement and proof can be found in Topology: Interior.)

Moreover their equivalent since:
$$\left(A\in\mathcal{N_T}(x)\right)\implies\left(U_0\subseteq A\quad x\in U_0\in\mathcal{T_N}\right)\\\implies\left(U_0\subseteq A\quad x\in U_0\in\mathcal{N}(u)\quad u\in U_0\right)\implies\left(U_0\subseteq A\quad U_0\in\mathcal{N}(x)\right)\implies\left(A\in\mathcal{N}(x)\right)\\
\left(A\in\mathcal{N}(x)\right)\implies\left(A^\circ\subseteq A\quad x\in A^\circ\in\mathcal{N}(z)\quad z\in A^\circ\right)\\\implies\left(A^\circ\subseteq A\quad x\in A^\circ\in\mathcal{T_N}\right)\implies\left(A\in\mathcal{N_T}(x)\right)$$
$$\left(A\in\mathcal{T_N}\right)\implies\left(A\in\mathcal{N_T}(a)\quad a\in A\right)\\\implies\left(U_a\subseteq A\quad a\in U_a\in\mathcal{T}\quad a\in A\right)\implies\left(A=\bigcup_{a\in A}U_a\in\mathcal{T}\right)\\
\left(A\in\mathcal{T}\right)\implies\left(A\subseteq A\quad a\in A\in\mathcal{T}\quad a\in A\right)\implies\left(A\in\mathcal{N_T}(a)\quad a\in A\right)\implies\left(A\in\mathcal{T_N}\right)$$


Is the Banach-Tarski paradox realistic? Why is Volume not an invariant? Banach-Tarski says that given a glass ball, we can break it into two glass balls of equal volume to the original (plus other generalizations). The explanations I have found for this paradoxical notion is that volume is not an invariant when we do these operations.

But, surely volume should be an invariant, right? "In reality," is it not realistic to expect that the volume doesn't change (unless we are dealing with some chemical property here, which I assume not since it is a mathematical paradox)?

So, my question is: is it possible, given whatever machinery we want to invent (something to break the glass exactly into what shape pieces we want, etc.), to actually perform this "paradox?" If not, then what is the "trick" behind the paradox which makes the math work out? What abstraction from reality do the hypotheses assume?

N.B. I've done extensive googling (especially on this site) of the subject and none of the answers have satisfied my question. I do realize there are a lot of questions about Banach-Tarski on this website already, but I do believe that my question is not a "duplicate."

The main crux of the Banach-Tarski construction is that you can break up a measurable set into non-measurable sets. Measure is, in a certain sense, analogous to volume. Non-measurable sets are somewhat strange and it can be shown that under mild axiomatic assumptions that it is consistent that there are no non-measurable sets. So in that sense, there is a "reality" where the Banach-Tarski paradox doesn't exist.

The paradox is about volume not mass. Is possible to produce even more than two glass balls that will equal the  first that you broke because you can make a hollow sphere of glass therefore create an object of the same volume. It will have half the mass but will occupy the same amount of space.


In a bridge game, North and South have 9 spades between them. Find the probability that either East or West has no spades. I am a complete novice in playing card games and I am unable to solve problems of this type . However I have tried to solve it as shown below:

Firstly we select $9$ cards out of $13$ spades and $17$ non spade cards out of $39$ non spade cards. These make a total of $26$ cards. Now we try to divide these $26$ cards between North and South. Now for each of these possible cases we try to choose $13$ non spade cards from $22$ non spade cards for either of East or West . Two such ways shall be possible i.e. either for East or for West. So the total number of favourable outcomes(m):

13C9 ×39C17×((26!)/(13!)^2)×22C13×2!

Total number of possible outcomes(n):
(52!)/(13!)^4

Required probability $=\frac{m}{n}\approx7.036337939\times10^{-3}$

But the answer given in book is not matching.( It is given as $=\frac{11}{115}$ , I am not sure whether the answer given is book is wrong or that of mine is wrong.)

Please help me out.

We have 4 spades and 22 others to distribute between East and West.  Let's suppose we deal the cards out, one by one, with the first 13 going to East and the second 13 going to West.  We will consider the order of the cards to be significant, so this can be done in $26!$ ways, all of which are equally likely.

We want to count the number of sequences in which East or West gets all 4 spades.  There are $2$ ways to choose East/West, then there are $\binom{13}{4}$ ways to choose the locations of the spades within the chosen hand, $4!$ ways to sequence the spades, and $22!$ ways to sequence all the remaining cards.  So all together, there are
$$2 \times \binom{13}{4} \times 4! \times 22!$$
ways to sequence the cards in which either East or West gets all the spades.

So the probability that either East or West gets all the spades is
$$\frac{2 \times \binom{13}{4} \times 4! \times 22!}{26!} = \frac{11}{115}$$

Since this problem asks only about spades, there is no reason to say anything about "non-spade cards".  If North and South, together, have 9 spades then East and West, together, have 13- 9= 4 spades.  The probability any one of those 4 spades is in East's hand is 1/2.  The probability all 4 are in East's hand is $(1/2)^4= 1/16$.  Similarly the probability all 4 are in West's hand is $(1/2)^4= 1/16$.  The probability that "either East or West has no spades" which is the same as the probability "either East has all 4 remaining spades or West has all 4 remaining spades" is 1/16+ 1/16= 2/16= 1/8.


Complemented Banach spaces. Let $X$ be  Banach space and $Y$ a closed subspace of $X$. Assume that there exist a closed "subset" $Z$ of $X$ with the properties:

$Z\cap Y=\{0\}$ and every $x\in X$  can be written in a unique form as $x=y+z$ with $y\in Y$ and $z\in Z$

Can we conclude that $Y$ is complemented in $X$?

Edit: I'm not asking if $Z$ is a complement of $Y$ in $X$. Indeed, $Z$ does not need to be linear. What I am asking is if we can find a set closed linear $W\subset X$ such that $W$ is a complement of $Y$ in $X$.

comment

Take $X = \mathbb R^2$ with your favorite norm (say $l^2$ norm).  Let $Y$ be the $y$-axis, a closed linear subspace.  Let $Z$ be the graph of a continuous function $h$ with $h(0)=0$.  Say $h(x) = x^3$.  Every point of $X$ is uniquely the sum of a point on the graph plus a point of $Y$.  SO ... the set $Z$ need not be the complement.

Can we imitate this using $X$ a Banach space and $Y$ a non-complemented subspace?  Make a function $h$ choosing one element from each equivalence class?

added
phrase this variant in a different way ...
If $T : X \to U$ is a surjective continuous linear map of Banach spaces, and if there is a continuous section (that is, a continuous $V : U \to X$ with $V(T(u))=u$ for all $u$), then must there exist also a continuous linear section?


Show that $R_P$ has a unique maximal ideal Problem is:

  Let $R$   be a commutative ring and let $P$   be a prime ideal.

  (a) Prove that the set of non-units in $R_{P}$   is the ideal $P_{P}$.

  (b) Deduce that $R_{P}$   has a unique maximal ideal.

I tried (a) as:

Let $u$
  be a non-unit in $R_{p}$
  and $p$
  be any elements in $R_{p}.$
  Then, since $u$
  is not unit, $up\neq1$
  and $pu\neq1.$
  Suppose that $up$
  or $pu$
  is a unit in $R_{p}.$
  Then there exists $q$
  such that, say, $upq=1.$
  Then $u(pq)=1.$
  So, $u$
  is a unit in $R_{p}.$
  This is contradiction. So, the set of non-units in $R_{p}$
  is an ideal in $R_{P}.$

So, I have to show that the set of non-units is equal to $P_P$ and (b)

But I am stuck at this point.

The ideal $P_P$ is
$$
P_P=\left\{\frac{a}{s}: a\in P, s\in R\setminus P\right\}
$$
Let's prove that no element of $P_P$ is a unit. Suppose $a\in P$, $s\in S=R\setminus P$, $x\in R$ and $t\in S$ be such that
$$
\frac{a}{s}\frac{x}{t}=\frac{1}{1}
$$
By definition there exists $u\in S$ with $u(ax-st)=0$ or $uax=ust$. This is a contradiction because $uax\in P$, but $ust\in S$.

On the other hand, every element of $R_P$ not in $P_P$ is a unit. Indeed, if $a/s\notin P_P$, we have $a\notin P$, so $(a/s)^{-1}=s/a$.

Therefore the set of nonunits is an ideal and the ring is local, by general results. The maximal ideal is the set of nonunits, which we proved to be $P_P$.

Part (a) is Lemma 5.20 of the Sharp's book, "Steps in Commutative Algebra" (page 89):

It is easy to see that $I$ is an ideal of $R_P$.
Sharp proves that $R_p\setminus I$ is the set of units. One direction is easy: for any $a/s\notin I,$ one has $a\in S$, so $\dfrac{a}{s}\dfrac{s}{a}=\dfrac{1}{1}.$
On the other hand, if $b/t$ is a unit, say $\dfrac{b}{t}\dfrac{c}{v}=\dfrac{1}{1},$ then there exists $w\in S$ such that $wbc=wtv\in R\setminus P.$ Hence $b\notin P,$ which means $b/t\notin I.$

For part (b), note that a ring is local if and only if the set of non-units of the ring is an ideal (this is lemma 3.13 of the book).


When is the product of two quotient maps a quotient map? It is not true in general that the product of two quotient maps is a quotient maps (I don't know any examples though).

Are any weaker statements true? For example, if $X, Y, Z$ are spaces and $f : X \to Y$ is a quotient map, is it true that $ f \times {\rm id} : X \times Z \to Y \times Z$ is a quotient map?

Your weaker statement is almost true.

If $f: X \to Y$ is a quotient map and $Z$ is locally compact, then $f \times \operatorname{id}$ is a quotient map.  I believe that this result is due to Whitehead.

More generally, if $f: X \to Y$ and $g: Z \to W$ are quotient maps and $Y$ and $Z$ are locally compact, then the product $f \times g: X \times Z \to Y \times W$ is a quotient map.

Why?  Use the Whitehead theorem twice, since $f \times g = (\operatorname{id} \times g) \circ (f \times \operatorname{id})$.

See Munkres $\S 22$ for counterexamples.

In above cases, the results follow (easily) from the good behavior of compact open topology (related with locally compact topology, and with the category of compactly generated spaces  respectively).


How find this integral $\int\frac{\sqrt{x-1}\arctan{(x\sqrt{x-1})}}{x}dx$ Find this integral
$$\int\dfrac{\sqrt{x-1}\arctan{(x\sqrt{x-1})}}{x}dx$$

My try: let
$$\arctan{(x\sqrt{x-1})}=t$$
and that's very ugly,Thank you

This problem is not really very hard yet it is messy since one needs to deal with roots of third order polynomials. Yet all what is involved in here is one substitution, then integration by parts and then decomposition into partial fractions. We have:
\begin{equation}
\int \frac{\sqrt{x-1}}{x} \arctan\left[ x \sqrt{x-1}\right] dx =
\int\frac{2 u^2}{1+u^2} \arctan\left[ u(1+u^2)\right] du
\end{equation}
where we substituted for $u=\sqrt{x-1}$. Now we integrate by parts:
\begin{eqnarray}
\int\frac{2 u^2}{1+u^2} \arctan\left[ u(1+u^2)\right] du = 2(u-\arctan(u)) \cdot \arctan\left[ u(1+u^2) \right] - 2 \int\frac{u-\arctan(u)}{1+(1+u^2)^2 u^2} (1+3 u^2) du
\end{eqnarray}
where we used the fact that $\int (2 u^2)/(1+u^2) du = 2(u-\arctan(u))$.

Now there are two integrals to be computed .

Let us start from the easier one:
\begin{eqnarray}
&&\int \frac{u(1+3 u^2)}{1+(1+u^2)^2 u^2} du =\\
&& u \arctan\left[ u(1+u^2)\right] - \int \arctan\left[ u(1+u^2) \right]du=\\
&& u \arctan\left[ u(1+u^2)\right] -\frac{\pi}{2} u- \frac{1}{2 \imath} \sum\limits_{\xi=1}^3 \log(u-u^{(+)}_\xi) (u-u^{(+)}_\xi)+ \frac{1}{2 \imath} \sum\limits_{\xi=1}^3 \log(u-u^{(-)}_\xi) (u-u^{(-)}_\xi)
\end{eqnarray}
where in the last line we used the identity $\arctan(x)= 1/(2 \imath) \log[(1+\imath x)/(1-\imath x)]$.

Here $\left\{ u^{(+)}_\xi\right\}_{\xi=1}^3$ are roots of the equation $u^3+u-\imath=0$ and $\left\{ u^{(-)}_\xi\right\}_{\xi=1}^3$ are roots of the equation $u^3+u+\imath=0$.

Now the second integral:
\begin{eqnarray}
&&\int\frac{(1+3 u^2) \arctan[u]}{1+(1+u^2)^2 u^2} du=\\
&&\arctan[u(1+u^2)] \arctan[u] - \frac{\pi}{2} \arctan[u] + \frac{1}{4} \sum\limits_{\xi=1}^3 \sum\limits_{\eta \in\{-1,1\}} \sum\limits_{\eta_1 \in\{-1,1\}}
F^{(u^{(\eta)}_\xi,-\eta_1 \imath)}(u)\\
\end{eqnarray}
where
\begin{equation}
F^{(a,b)}(u):=\log(a+u) \log[\frac{x+b}{b-a}] + Li_2\left[ \frac{x+a}{a-b}\right]
\end{equation}

Bringing everything together we have:
\begin{eqnarray}
&&\int\frac{\sqrt{x-1}}{x} \arctan\left[ x \sqrt{x-1}\right] dx=\pi \left( \sqrt{x-1} - \arctan[\sqrt{x-1}]\right)+\\
&&
-\imath \sum\limits_{\xi=1}^3 \left(\log[\sqrt{x-1}-u^{(+)}_\xi](\sqrt{x-1}-u^{(+)}_\xi)-
 \log[\sqrt{x-1}-u^{(-)}_\xi](\sqrt{x-1}-u^{(-)}_\xi)\right)+\\
&&\frac{1}{2} \sum\limits_{\xi=1}^3 \sum\limits_{\eta \in\{-1,1\}} \sum\limits_{\eta_1 \in\{-1,1\}}
F^{(u^{(\eta)}_\xi,-\eta_1 \imath)}(\sqrt{x-1})
\end{eqnarray}

In[1296]:= x =.;
eX = D[Pi Sqrt[x - 1] - Pi ArcTan[Sqrt[x - 1]] -
     I Sum[Log[
          Sqrt[x - 1] - Root[#^3 + # - I &, xi]] (Sqrt[x - 1] -
           Root[#^3 + # - I &, xi]) -
        Log[Sqrt[x - 1] - Root[#^3 + # + I &, xi]] (Sqrt[x - 1] -
           Root[#^3 + # + I &, xi]), {xi, 1, 3}] +
     1/2 Sum[eta eta1 (F[-Root[#^3 + # - eta I &, xi], -eta1 I, Sqrt[
          x - 1]]), {xi, 1, 3}, {eta, -1, 1, 2}, {eta1, -1, 1, 2}],
    x] - Sqrt[x - 1]/x ArcTan[x Sqrt[x - 1]];
x = RandomReal[{0, 10}, WorkingPrecision -> 50];
N[eX, 50]

Out[1299]= 0.*10^-50 + 0.*10^-50 I

$\because$ according to http://integrals.wolfram.com/index.jsp?expr=%28x-1%29%5E%281%2F2%29%2Fx&random=false, $\int\dfrac{\sqrt{x-1}}{x}dx=2\sqrt{x-1}-2\tan^{-1}\sqrt{x-1}+C$

$\therefore\int\dfrac{\sqrt{x-1}\tan^{-1}(x\sqrt{x-1})}{x}dx$

$=\int\tan^{-1}(x\sqrt{x-1})~d(2\sqrt{x-1}-2\tan^{-1}\sqrt{x-1})$

$=(2\sqrt{x-1}-2\tan^{-1}\sqrt{x-1})\tan^{-1}(x\sqrt{x-1})-\int(2\sqrt{x-1}-2\tan^{-1}\sqrt{x-1})~d(\tan^{-1}(x\sqrt{x-1}))$

$\because$ according to http://www.wolframalpha.com/input/?i=d%2Fdx%28arctan%28x%28x-1%29%5E%281%2F2%29%29%29, $\dfrac{d}{dx}(\tan^{-1}(x\sqrt{x-1}))=\dfrac{3x-2}{2\sqrt{x-1}(x^3-x^2+1)}$

$\therefore(2\sqrt{x-1}-2\tan^{-1}\sqrt{x-1})\tan^{-1}(x\sqrt{x-1})-\int(2\sqrt{x-1}-2\tan^{-1}\sqrt{x-1})~d(\tan^{-1}(x\sqrt{x-1}))$

$=2\sqrt{x-1}\tan^{-1}(x\sqrt{x-1})-2\tan^{-1}\sqrt{x-1}\tan^{-1}(x\sqrt{x-1})-\int(2\sqrt{x-1}-2\tan^{-1}\sqrt{x-1})\dfrac{3x-2}{2\sqrt{x-1}(x^3-x^2+1)}dx$

$=2\sqrt{x-1}\tan^{-1}(x\sqrt{x-1})-2\tan^{-1}\sqrt{x-1}\tan^{-1}(x\sqrt{x-1})-\int\dfrac{3x-2}{x^3-x^2+1}dx+\int\dfrac{(3x-2)\tan^{-1}\sqrt{x-1}}{\sqrt{x-1}(x^3-x^2+1)}dx$

$\int\dfrac{3x-2}{x^3-x^2+1}dx$ is just an integral of rational functions and should have close form.

For $\int\dfrac{(3x-2)\tan^{-1}\sqrt{x-1}}{\sqrt{x-1}(x^3-x^2+1)}dx$ ,

Let $u=\sqrt{x-1}$ ,

Then $x=u^2+1$

$dx=2u~du$

$\therefore\int\dfrac{(3x-2)\tan^{-1}\sqrt{x-1}}{\sqrt{x-1}(x^3-x^2+1)}dx$

$=\int\dfrac{2(3u^2+1)\tan^{-1}u}{(u^2+1)^3-(u^2+1)^2+1}du$

Then you can separate it to the terms of $\int\dfrac{\tan^{-1}u}{au+b}du$ or $\int\dfrac{\tan^{-1}u}{pu^2+qu+r}du$ by partial fraction. According to http://pi.physik.uni-bonn.de/~dieckman/IntegralsIndefinite/IndefInt.html, they relate to the polylogarithm function.


A question about Gauss Bonnet theorem If $S$ is a surface which is the complement of finitely many points in a compact surface, and the metric in $S$ is complete, then is Gauss-Bonnet theorem still valid for $S$?

No.

Take the sphere $S^2$ and remove one point, giving you a surface $S$ diffeomorphic to $\mathbb{R}^2$.  So we can equip $S$ with a metric making it isometric to $\mathbb{R}^2$, which is certainly complete.  $\mathbb{R}^2$ has zero curvature but its Euler characteristic is $1$, so
$$ 0 = \int_{\mathbb{R}^2} K dVol \ne \chi(\mathbb{R}^2) = 1.$$

No.

If you remove a finite set of points from a compact surface, it will no longer be complete. If you change the metric so that you do have a complete surface, you cannot apply the Gauss Bonnet theorem anyway, because the surface isn't compact.


Continuity of a function as in real analysis The usual $\varepsilon-\delta$ definition of a continuous function is -
$\mathrm{Definition : }$ $~ L e t ~ $(X, d) and $\left(Y, d^{\prime}\right)$ be two metric spaces. A function $f: X \rightarrow Y$ is said to be continuous at $a \in X$ if for each   $\varepsilon>0$ , there exists $\delta>0$ such that whenever $x \in X$ satisfies $d(x, a)$ $<\delta,$ we have $d^{\prime}(f(x), f(a))<\varepsilon$.
Consider the function $f(x): X \rightarrow Y$ with $X$ and $Y$  two open disks, of radius $R$, in $2$D Euclidean space. $a$ is the centre of $X$ and $f(a)$ of $Y$. $f$ has the property, apart from  mapping the centre of $X$ to the centre of $Y$, that it maps a circular ring (of radius $r1$) in $X$ to a ring in $Y$ with radius $r2$ such that $r2 \rightarrow R$ when $r1 \rightarrow 0$ and $r2 \rightarrow 0$ when $r1 \rightarrow R$. In other words, $f$ maps a ring in $X$, with radius going from $R$ to $0$, to a ring in $Y$ with radius going from $0$ to $R$ ($R$ and $0$ obviously not included).

My question - The function satisfies the condition for continuity at $a$ with $\delta = R$, but $f(x)$ moves 'discontinuously' in $Y$ as we move slightly away from $a$ in $X$. Do we say the function is continuous at $a$ ?
Please correct me if there is any flaw in the thought process.

The function is discontinuous at $a$: Consider $\varepsilon>0$ with $\varepsilon < R$. Then no matter how small we choose $\delta>0,$ any $\delta$-ball around $a$ will include some $x$ lying on a circle of sufficiently small radius $r_1$ for which $f(x)$ lies on a circle of radius $r_2>\varepsilon$.
(Let me know if I should elaborate on this answer)

Short answer: no.  It is not the case that once you pick an $\varepsilon \ll R$ that all the points of $X$ are mapped within $\varepsilon$ of $f(a)$.  $a$ is mapped to $f(a)$ and the rest of a small disk around $a$ are mapped to an annulus with inner radius $\gg \varepsilon$.  That is, there are points within $R$ of $a$ that are not mapped within $\varepsilon$ of $f(a)$.  Any one of these points is a witness to failure of the implication in the definition of continuity.

I note that you make no requirement that the mapping of rings be continuous in terms of the radius.  You specify that a small enough annulus in $X$ is sent to a large enough annulus in $Y$ and vice versa, but make no constraint on radii in the "middle".  As currently specified, these could be randomly shuffled entirely discontinuously.  In such a case, one can inspect the function $r_2(r_1)$, the image radius of each domain ring, for discontinuities.  But even if this function has no discontinuities (and even if the individual rings are oriented and distorted to give continuity on $X \smallsetminus \{a\}$)...

The obvious place to look for a discontinuity is in a neighborhood of the center(s) since the open ball of small radius is sent to the center of the image disk and to an annulus on the edge of the image disk.
It is a bit of a cheat that you have used "$a$" to be both the generic point in the definition of continuity and the center of one disk.  For continuity, the definition has to hold for every point on the disk, not just the center.  Nevertheless let $a = a$.  (That is, let us inspect the continuity around the center of $X$.)
Consider $r_2(r_1)$, the function representing the image ring radius in $Y$ of the domain ring in $X$ of radius $r_1$.  As per the discussion above the horizontal rule, we have already allowed this function to be continuous, so this is a continuous, strictly monotonically decreasing function of $r_1$.  (To see this, note injectivity, then apply the intermediate value theorem.)  This means it intersects the line $1 \cdot r_1 + 0$ exactly once.  That intersection corresponds to the one ring whose domain radius equals its image radius.  Call that radius, $r$.
Let $\varepsilon \in (0, r)$ and let $U$ be the disk in $X$, centered at $a$, of radius $\varepsilon$.  The image of $U$ is $\{f(a)\}$ union an annulus of inner radius greater than $r$.  Call that annulus $V$.
Now, make any choice of $\delta$ (including your proposed choice, $\delta = R$).  Then there is a point, $b$, in the disk of radius $\delta$ centered at $a$ that is also in $U \smallsetminus \{a\}$.  (We have intersected two open disks centered at the same point.  This gives an open disk with the smaller radius, which necessarily contains at least one point that is not the center.)  We have $d(a,b) < \delta$.  Of course, $f(b)$ is in $V$, so $d(a,f(b) >r > \varepsilon$, so we have found a witness to discontinuity.


How to adjust the diagonal so that a matrix is on the stability threshold? I am working on the stability of food webs, which can be represented by a Jacobian matrix showing the interaction strengths between species. I know that a matrix is locally stable if all real parts of the eigenvalues are negative, and I know how to find these eigenvalues.

I now want to adjust the diagonal of my matrix so that the matrix is on the threshold of stability: it is stable, but any loss of intraspecific interaction - which are the values on the diagonal - will result in an unstable matrix. Mathematically speaking I think I want a matrix with an adjusted diagonal so that all eigenvalues are zero - does this makes sense?

Is there a method to find out what my diagonal should look like if I want all my eigenvalues to be zero? The starting point for the transformation can be any diagonal (i.e. all values are -1, or all values differ according to some biological data).

In literature I found "An eigenvalue $\lambda_{i}$ can be linearly transformed by the amount that must be subtracted from $a_{ii}$ to allow the eigenvalue to be 0 (by $-|\lambda_{i}-a_{ii}|)"$, but I'm not sure how to implement this.

I hope this is the right way of asking the question; first time I use this platform!

To be on the boundary of instability, you don't need all eigenvalues to be zero, you just need the largest occuring real part to be zero (so that the “rightmost” eigenvalue(s) is (are) on the imaginary axis).

This you can do by adding $cI$ to your matrix (where I is the identity matrix, and $c$ is a suitable constant); this will add $c$ to all the eigenvalues, i.e., shift them $c$ steps to the right in the complex plane.


Why Is The Manual Summation Of An n log n Equation Not Equal To The Programmatic Summation Of An θ(n log n) for Loop? There is an algorithm text book that I'm reading to teach myself asymptotic analysis. To demonstrate that not all two-level nested for loops are $\Theta(n^2)$, the book presents the following code to be analyzed...

/* θ(n log n) */
sum = 0;
for(int i = 1; i <=n; i*= 2)
    for(int j = 1; j <=n; j++)
        sum++;

The book calculated that the running-time of the above implementation would be $\Theta(n \log n)$. The book arrived at the $\Theta(n \log n)$ running-time, after first suggesting that the intermediate Sigma notation is $\sum_{i=1}^{\log n} n = n \log n$.

Before I ask my question, I'll first set up the context of my question by showing another block of code with $\Theta(n^2)$ running-time — whose corresponding Sigma notation is $\sum_{i=1}^{n} i = \frac{n(n-1)}{2}$...

/* θ(n^2) */
sum = 0;
for(int i = 0; i <=n-1; i++)
    for(int j = n-1; j > i; j--)
        sum++;

If the above-listed $\Theta(n^2)$ code were run with $n = 8$, then the value of the variable sum, would end up being 36. Correspondingly, the manual calculation of the $\Theta(n^2)$  closed-form summation equation ($\frac{n(n-1)}{2}$) would work out to be 36 if you were to plug the value 8 into its $n$.

If — on the other hand — the above listed $\Theta(n \log n)$ code were run with $n = 8$, then the value of its sum variable would end up being 32. However, the manual calculation of $\Theta(n \log n)$ — where $n = 8$ — would work out to be 24. Because asymptotic analysis always assumes $log_2$, then $\log 8 = 3$. And $8 \cdot 3 = 24$.

So now, here are my questions:

How come the $\Theta(n^2)$ code's summation and the summation of its
corresponding Sigma notation's closed form equation both work out to
be 36 — but the $\Theta(n \log n)$ Sigma notation equation
calculation does not jibe with the value calculated by the
corresponding $\Theta(n \log n)$ code listed above?
What is the relationship between the 24 that comes out of the
$\Theta(n \log n)$ Sigma notation equation calculation and the
corresponding code listed above?
What would I need to change in the above-listed $\Theta(n \log n)$
code, to make the final value of the summation, equal to the
summation calculated in its corresponding Sigma notation equation?
What would the the $\Theta(n \log n)$ Sigma's closed-form equation
($n \log n$) look like fully expanded — where $n = 8$?

Thank you in advance for your answers.

EDIT: Please, don't let my use of MathJax fool you into thinking I'm some kind of Math dude. 'Coz I'm not. I suck at Math. Which is the very reason why I couldn't answer the question on my own. I also suck at Math jargon. Therefore, I would not be offended in the least if any answers and comments used ELI5-level plain English. In fact, I'm gonna have to insist on jargon-less, ELI5-level plain English. Please? Thanks.

The notation $\sum_{i=1}^{\log n}$ confuses you. The outer loop in the first example executes with indices $2^k$, where $k \in [0, n]$. Number of executions of such a loop will be $log(n) + 1$, but not $log(n)$.

Of course, asymptotic time complexity of this piece of code will still be $\Theta(n \log n)$.

On further reading (and rereading...and rereading) of the book I referred to in my OP, it eventually registered that not only does the author write: "The first code fragment has its outer for loop executed log n + 1 times...(see pg 71)", but he also talks about a second Sigma summation function: $\sum_{i=0}^{\log n} n$,  which looks at first glance, virtually identical to the $\sum_{i=1}^{\log n} n$ summation that I originally asked about. (Notice the different values for the lower bound $i$).

The two summation functions (see pg 30 & pg 71) look so similar to my naïve mathematical eyes, that I blew off the differences between the $i=0$ and the $i=1$ lower bounds, as being just a minor typo. But on a whim, I plugged $\sum_{i=0}^{\log n} n$ into Wolfram-Alpha. And out pops...

$$\sum_{i=0}^{\log n} n = n(\log n + 1)$$

The teacher's working through a step-by-step example of the summation of a constant (starting @6.24) offers a clear, ELI5-level demonstration of expanding a summation. The key mathematical concepts to take away from that ELI5-level video, are...

when there's a constant in a Sigma notation, the index does not
affect the constant.
for a constant, $c$ and for an outer bound $n$, the closed form of
the Sigma notation, is simply expressed as, $=cn$. And most
importantly...
the closed form is evaluated only the one time; NOT $n$ times; as
one might naïvely think at first.
the "Summation Of A Constant" approach to arriving at a sum, is a general mathematical concept. As such, it is no more synonymous with the topic of computer
science, than it is with the price of tea in China.

So with that, I submit this corrected ELI5-level solution to my "fully expanded equation" question #4...

$$\log_2 8 = 3$$

$$n(\log n + 1)$$

$$= 8(3 + 1)$$

$$= 8(4)$$

$$= 32$$

I'll also take a stab at answering my own, question #1...

  How come...the $\Theta(n \log n)$ Sigma notation equation calculation
  does not jibe with the value calculated by the corresponding $\Theta(n \log n)$ code listed above?

Referring to page 71 of the above-mentioned book, the author actually says, "...the total cost for the first code fragment can be expressed as $\sum_{i=0}^{\log n} n$...". So that summation's closed-form equation — $\sum_{i=0}^{\log n} n = n(\log n + 1)$ — is what should have been used to do the summation. Not the $\sum_{i=1}^{\log n} n = n \log n$ one that I mistakenly used at first.

As the above "fully expanded equation" answer to question #4 shows, as long as you follow the "Summation Of A Constant" approach, then the value $32$ calculated by the book's $for$ loop, and the value $32$ calculated by the "fully expanded equation" answer above, actually do "jibe" — to put it in ELI5 vocab.

Having answered my own mathematics-related questions #1 and #4 to my own ELI5-level satisfaction, the other two mathematics-related questions (#2 & #3) disappear by osmosis.

I am prepared to graciously defer to other more expertly-informed answers to any of the original questions. All's I ask is to ELI5 ;¬)


Find the least squares solution for rank deficient system Find the least squares solution to the system
$$x - y = 4$$
$$x - y = 6$$

Normally if I knew what the matrix $A$ was and what $b$ was I could just do $(A^TA)^{-1} A^Tb$, but in this case I'm not sure how to set up my matrices. How can I find the least square solution to the system?

Problem statement: underdetermined system

Start with the linear system
$$
\begin{align}
\mathbf{A} x &= b \\
%
\left[
\begin{array}{cc}
 1 & -1 \\
 1 & -1 \\
\end{array}
\right]
%
\left[
\begin{array}{c}
 x \\
 y
\end{array}
\right]
%
&=
%
\left[
\begin{array}{c}
 4 \\
 6
\end{array}
\right]
%
\end{align}
$$

The system has matrix rank $\rho = 1$; therefore, if a solution exists, it will not be unique.

Provided $b\notin \color{red}{\mathcal{N} \left( \mathbf{A}^{*} \right)}$, we are guaranteed a least squares solution
$$
  x_{LS} = \left\{ x\in\mathbb{C}^{2} \colon \lVert \mathbf{A} x_{LS} - b \rVert_{2}^{2} \text{ is minimized} \right\}
\tag{1}
$$

Subspace resolution

By inspection, we see that the row space is resolved as
$$
\color{blue}{\mathcal{R} \left( \mathbf{A}^{*} \right)} \oplus
    \color{red}{\mathcal{N} \left( \mathbf{A} \right)}
=
\color{blue}{\left[
\begin{array}{r}
  1 \\
 -1
\end{array}
\right]} \oplus
    \color{red}{\left[
\begin{array}{c}
  1 \\
  1
\end{array}
\right]}
$$
The column space is resolved as
$$
\color{blue}{\mathcal{R} \left( \mathbf{A} \right)} \oplus
    \color{red}{\mathcal{N} \left( \mathbf{A}^{*} \right)}
=
\color{blue}{\left[
\begin{array}{c}
  1 \\
  1
\end{array}
\right]} \oplus
    \color{red}{\left[
\begin{array}{r}
  -1 \\
   1
\end{array}
\right]}
$$

The coloring indicates vectors in the $\color{blue}{range}$ space and the $\color{red}{null}$ space.

Finding the least squares solution

Since there is only one vector in $\color{blue}{\mathcal{R} \left( \mathbf{A}^{*} \right)}$, the solution vector will have the form
$$
 \color{blue}{x_{LS}} = \alpha
\color{blue}{\left[
\begin{array}{r}
  1 \\
 -1
\end{array}
\right]}
$$
The goal is to find the constant $\alpha$ to minimize (1):
$$
 \color{red}{r}^{2} = \color{red}{r} \cdot \color{red}{r} =
\lVert
 \color{blue}{\mathbf{A} x_{LS}} - b
\rVert_{2}^{2}
=
8 \alpha ^2-40 \alpha +52
$$
The minimum of the polynomial is at
$$
 \alpha = \frac{5}{2}
$$

Least squares solution

The set of least squares minimizers in (1) is then the affine set given by
$$
 x_{LS} = \frac{5}{2}
\color{blue}{\left[
\begin{array}{r}
  1 \\
 -1
\end{array}
\right]}
+
\xi
\color{red}{\left[
\begin{array}{r}
  1 \\
  1
\end{array}
\right]}, \qquad \xi\in\mathbb{C}
$$

The plot below shows how the total error $\lVert \mathbf{A} x_{LS} - b \rVert_{2}^{2}$ varies with the fit parameters. The blue dot is the particular solution, the dashed line homogeneous solution as well as the $0$ contour - the exact solution.

Addendum: Existence of the Least Squares Solution

To address the insightful question of @RodrigodeAzevedo, consider the linear system:

$$
\begin{align}
\mathbf{A} x &= b \\
%
\left[
\begin{array}{cc}
 1 & 0 \\
 0 & 0 \\
\end{array}
\right]
%
\left[
\begin{array}{c}
 x \\
 y
\end{array}
\right]
%
&=
%
\left[
\begin{array}{c}
 0 \\
 1
\end{array}
\right]
%
\end{align}
$$

The data vector $b$ is entirely in the null space of $\mathbf{A}^{*}$:
$b\in \color{red}{\mathcal{N} \left( \mathbf{A}^{*} \right)}$

As pointed out, the system matrix has the singular value decomposition. One instance is:
$$\mathbf{A} = \mathbf{U}\, \Sigma\, \mathbf{V}^{*} = \mathbf{I}_{2}
\left[
\begin{array}{cc}
 1 & 0 \\
 0 & 0 \\
\end{array}
\right]
\mathbf{I}_{2}$$
and the concomitant pseudoinverse,
$$\mathbf{A}^{\dagger} = \mathbf{V}\, \Sigma^{\dagger} \mathbf{U}^{*} =
\mathbf{I}_{2}
\left[
\begin{array}{cc}
 1 & 0 \\
 0 & 0 \\
\end{array}
\right]
\mathbf{I}_{2} = \mathbf{A}$$

Following least squares canon, the particular solution to the least squares problem is computed as
$$
\color{blue}{x_{LS}} = \mathbf{A}^{\dagger} b =
\color{red}{\left[
\begin{array}{c}
 0 \\
 0 \\
\end{array}
\right]}
\qquad \Rightarrow\Leftarrow
$$
The color collision (null space [red] = range space [blue]) indicates a problem. There is no component of a particular solution vector in a range space!

Mathematicians habitually exclude the $0$ vector a solution to linear problems.

Your matrix is just the coefficients of your system of equations.  In this case
$$ x-y = 4  $$
$$ x-y = 6  $$
leads to
$$
\begin{bmatrix}
1 & -1 \\ 1 & -1
\end{bmatrix}
\begin{bmatrix}
x \\ y
\end{bmatrix}
=
\begin{bmatrix}
4 \\ 6
\end{bmatrix}
$$
but you should see that there is no solution to this since you can't have $x-y$ be both $4$ and $6$...


Splitting $3$ boys and $7$ girls into 3 groups with restrictions There are $ 3 $ boys and $ 7 $ girls. How many ways can we divide them
  into three unlabeled groups such that each group has a boy, two groups have
  three people, and the third group has four people?

I think that the answer is $\frac{3!\times \binom{7}{2} \times \binom{5}{2}}{2}=630$, but other people said that it is $\frac{3\times \binom{7}{2} \times \binom{5}{2}}{3}=210$.

Edit: I did wrote something incorrect.

You're just identifying which of the girls go along with each boy.

So there are 3 ways to choose which of the boys is in the bigger group, and then $\binom73$ ways to choose whose his partners are.  Then there are $\binom42$ ways to choose which of the remaining girls goes with the older of the remaining boys.  Thus, the total is $3\cdot\binom73\binom42=3\cdot35\cdot6=630$.

The reason we don't need to do any dividing is because every grouping we are making are distinct.  If Adam, Ben, and Carl are the three boys, then putting Ben with Jane and Kim and Carl with Laura and Mary is a different grouping than if put Ben with Laura and Mary and Carl with Jane and Kim.  Each of the three groups CAN be distinguished -- by which boy is in the group -- so there is no need to worry about overcounting.

Choose 1 boy from 3, the 2 girls from 7 and 2 girls from 5 and then 3 girls from the 3 left.

So, total combinations: $ ^3C_1 \times ^7C_2 \times ^5C_2 =630$


What's wrong with this random variable proof? Let $X$ be a Binomial random variable $\sim B(p, n)$. Show that for
  $\lambda > 0$ and $\epsilon > 0$, $P(X - np > n\epsilon) \le
 \mathbb{E}\{\displaystyle e^{\lambda(X - np - n\epsilon)}\}$

I tried like this:

Let $A = \{ \omega \in \Omega: X(\omega) > n(\epsilon + p)\}$.
Then note that

$$e^{\lambda(X(\omega) - np - n\epsilon)} \ge 1_A(\omega)$$

In fact it is obvious if $\omega \notin A$, and if $\omega \in A$ the right hand side is $1$, and the left hand side is raised to a power $> 0$ so it is itself $> 1$.

So takig the mean both sides yields

$$\mathbb{E}\{\displaystyle e^{\lambda(X - np - n\epsilon)}\} \ge P(A) = P(X - np > n\epsilon)$$ which is what I wanted to prove.

(Because $\mathbb{E}\{1_A\} = P(A)$)

Something has to be wrong though, because I used nowhere the fact that $X$ is a binomial random variable!

What's wrong with it?

You've proven a specific case of what Wikipedia calls the exponential version of Chebyshev's inequality. Note you can pull a $e^{-\lambda n\epsilon}$ out of your expected value on the right hand side; you're equivalently showing:
$$
  P(X - np > n\epsilon) \le e^{-\lambda n\epsilon} E[e^{\lambda(X-np)}],
$$
which is the form given on Wikipedia (and other references, of course) where the RV you're acting on is $Z=X-np$, $\lambda = t$, and your epsilon is $n\epsilon$.  This inequality doesn't require that $X$ be binomial, so there's nothing wrong, even though you didn't use that fact.

Hint:Markov's inequaliy for random variables can be applies to get the result..


Conditional binomial expectactation and variance For example, we have standard case $X~B(n;p)$

How can we find $E(X|X>=1)$ and $Var(X|X>=1)$

I'd be glad to provide my work, but I'm  really stuck, I've only seen  problems, involving another variables.

We can integrate the expression $pdf*x$ with the limits from 1 to infinity right?
But this value goes to infinity, and I don't know what to do, again :(

I give you the solutino for the expectation value, hope you can find the solution for the variance yourself:

$$E[X|x\geq 1]=\frac{\int_1^\infty p(x)\cdot x dx}{\int_1^\infty p(x)dx}$$

Why do we divide by $\int_0^\infty p(x)dx$?
Lets take the finite case with a dice, what is the expectation if we know, that we rolled higher than 2? All the outcomes have the same porbability, i.e. $\frac14$. I we didn't know anything about the outcome, each number had the same probability $\frac16$. We normalize, such that the total probability is again $1$.


Calculate $\pi$ precisely using integrals? This is probably a very stupid question, but I just learned about integrals so I was wondering what happens if we calculate the integral of $\sqrt{1 - x^2}$ from $-1$ to $1$.

We would get the surface of the semi-circle, which would equal to $\pi/2$.

Would it be possible to calculate $\pi$ this way?

If you want to calculate $\pi$ in this way, note that the expansion of

$$\sqrt{1-x^2} = 1 - \sum_{n=1}^\infty \frac{(2n)!}{(2n-1)2^{2n}(n!)^2} x^{2n} $$

and so if we integrate term by term and evaluate from $-1$ to $1$ we will end up with the following formula for $\pi$:

$$ \pi = 4 \left\lbrace 1 - \sum_{n=1}^\infty \frac{(2n)!}{(4n^2-1)2^{2n}(n!)^2} \right\rbrace .$$

Want to calculate $PI$ through methods of Calculus?

Here are the steps to follow:

First, we need to calculate the distance of a line
Then we need to geometrically look at the graph of any arbitrary curve
From there, we can assign points and derive equations to approximate individual line segments between two points with the same $dx$ value.
After this we will algebraically manipulate the distance formula into a form with respect to $dx$.
Now we need to apply the Mean Value Theorem to our modified distance formula.
Next we'll use Summations to approximate the length of that curve.
Once we have our Summation in the form we want; we can replace it with a Riemann Integral.
After that, we need to gather some information about $pi$ and relate it to our Reimann Integral.
We can find the lower and upper bounds quite easily from the unit circle.
We can use the general equation of the circle that is fixed at the origin $(0,0)$
Here we need to find $y$ then we can convert it to a function $f(x)$.
Before we can use it, we first need to find its derivative.
Once we have the derivative we can plug it into our Integral.
Finally, we can go through the steps of Integration and evaluate it and see that we do in fact end up with $pi$.

To calculate the length of a line we can use the Distance Formula or basically the Pythagorean Theorem: $$L = \sqrt{\left(x_2 - x_1\right)^2 + \left(y_2 - y_1\right)^2}$$
This is simple for a straight line, so how do we go about finding the length of a curved line?

Take a look at the following graph of an arbitrary curved defined by some function $f(x)$.

The graph above shows the formula for finding the approximate length of each of the line segments $P_{i-1}P_i$. We can approximate the total length of the curve through summation by the following formula.
$$L\approx\sum_{i=1}^n \lvert{P_{i-1}P_i}\rvert$$
We can write the distance formula as:
$$\lvert P_{i-1}P_i\rvert = \sqrt{\left(\Delta x\right)^2 + \left(\Delta y\right)^2}$$
We know that $\Delta x = x_i-x_{i-1}$ and $\Delta y = y_i-y_{i-1}$.
However, we know that for every $\Delta x$ its length doesn't change, but for every $\Delta y$ it depends on $\Delta x$.
Let $\Delta y_i = y_i-y_{i-1}$ and the distance formula now becomes:
$$\lvert P_{i-1}P_i\rvert = \sqrt{\left(\Delta x\right)^2 + \left(\Delta y_i\right)^2}$$
With the distance formula written in this form we can now use the Mean Value Theorem show below:

Therefore:
$$f'\left(x_i^*\right) = \frac{\Delta y_i}{\Delta x}$$
$$\Delta y_i = f'\left(x_i^*\right)\Delta x$$
Now the distance formula becomes:
$$ = \sqrt{\left(\Delta x\right)^2 + \left(f'\left(x_i^*\right)\Delta x\right)^2}$$
$$ = \sqrt{\left(\Delta x\right)^2 + \left[1 + \left[f'x_i^*\right]^2\right]}$$
Since $\Delta x$ is positive
$$ = \Delta x\sqrt{1 + \left(f'\left(x_i^*\right)\right)^2}$$
$$ = \sqrt{1 + \left(f'\left(x_i^*\right)\right)^2}\Delta x$$
Where this calculates the length of a single line segment based on $\Delta x$.
Since this summation
$$L\approx\sum_{i=1}^n \lvert P_{i-1}P_i\rvert$$
is an approximation of all of the line segments, can we do better than this?
Yes, we can! We can apply limits!

We can now apply limits to the number of line segments $\left(n\right)$
By taking the limits we can now write our length formula as:
$$L = \lim\limits_{n \to \infty}\sum_{i=1}^n\sqrt{1 + \left[f'\left(x_i^*\right)\right]^2}\Delta x$$
The above is a Riemann Integral therefore:
$$ = \int_a^b\sqrt{1+\left(f'\left(x\right)\right)^2}dx$$
This will give us an accurate length of a curve by a given function $f\left(x\right)$ based on its derivative $f'\left(x\right)$.
We can use this to accurately calculate $\pi$.

Before using the above to calculate $\pi$ we need to consider what $\pi$ is. We know that the circumference of a circle is defined by $c = 2\pi r$. We can let $r = 1$. This will simply give us $2\pi$ for the circumference of the Unit Circle.
We need a function for the curve to use in our integral above. We know that the arc length of the full circle is $2\pi$ so we know that $\frac{1}{2}$ of this will be $\pi$ which is what we are looking for. The equation of an arc length is $s = r\theta$. We know that $r = 1$ and $\theta = \pi$ radians. This doesn't help us with the above equation. We need two points $a$ and $b$.
There are two properties about the unit circle that we can use here. First, we know that the diameter of the circle along the $x-axis$ contains the points $\left(1,0\right)$ and $\left(-1,0\right)$. We also know that a straight line has an angle of $180°$ which is $\pi$ radians.This is nice an all but we need a function.
We know that the general equation of a circle is defined as
$$\left(x-h\right)^2 + \left(y-k\right)^2 = r^2$$
where $\left(h,k\right)$ is the center point to the circle. We are going to fix the unit circle at the origin $\left(0,0\right)$. This will give us
$$x^2 + y^2 = r^2$$
which is basically a form of our Distance Formula or the Pythagorean Theorem that we started with. So how does this help us?
It's quite simple, we know that the radius of the unit circle is $(1)$.
We can set this in our equation above. $x^2 + y^2 = (1)^2$ which simplifies to $x^2 + y^2 = 1$. Since we need a function with respect to $x$, we can solve this equation for $y$.
$$x^2 + y^2 = 1$$
$$-x^2      = -x^2$$
$$      y^2 = 1-x^2$$
and since $y^2$ will result in a $+$ value we can just simply take the square root of both sides
$$y=\sqrt{1-x^2}$$
then convert it to a function of $x$
$$f(x)=\sqrt{1-x^2}$$
Now we are ready to use it, except for one more step. The integral above requires the derivative of the curve that we need so we need to find the derivative of the above function.
$$f'\left(x\right) = \frac{d}{dx}\left[\sqrt{1-x^2}\right]$$
$$ = \frac{1}{2} \left(1-x^2\right)^{\frac{1}{2}-1}*\frac{d}{x}\left[1-x^2\right]$$
$$ = \cfrac{\frac{d}{dx}\left[1\right] - \frac{d}{dx}\left[x^2\right]}{2\sqrt{1-x^2}}$$
$$ = \cfrac{0-2x}{2\sqrt{1-x^2}}$$
$$ = -\cfrac{x}{\sqrt{1-x^2}}$$
Now that we have our derivative with respect to $x$ and we know the $x$ values from the two points are $1$ and $-1$ we can use these in our integral.
$$\pi = \int_{-1}^1\sqrt{1+\left(f'\left(x\right)\right)^2}dx$$
$$\pi = \int_{-1}^1\sqrt{1+\left(\cfrac{-x}{\sqrt{1-x^2}}\right)^2}dx$$
Now we can solve - evaluate our integral.
Problem:
$$\arcsin(x) + C$$
Rewrite/simplyfy
$$ = \int\sqrt{\cfrac{x^2}{1-x^2}+1}dx$$
This is standard integral:
$$ = \arcsin(x)$$
The Problem is solved:
$$\int\cfrac{1}{\sqrt{1-x^2}}dx$$
$$ i\ln\left(\left|\sqrt{x^2-1}+x\right|\right) + C$$
And this approximates $\pi$ with a value of $3.141592653589793$
Here's a graph of the approximate integral since computers can not perform infinite limits.


If $N$ is a normal subgroup of $G$ and if $x^2 \in N$ for all $x\in G$, prove that every nonidentity element of $G/N$ has order $2$. I've been trying to solve this proof for a while and couldn't figure out how to prove that $(gN)^2=eN$. I've tried to set up an equation where $gN \cdot g^{-1}N=eN$ but couldn't get to the end result.

An alternative, but perhaps more intuitive formulation of Tsemo Aristide's answer:
A non-identity element of $G/N$ is a coset $gN$ for $g\notin N$. The binary operation on $G/N$ is given by $(gN)(hN)=(gh)N$, and thus $(gN)^2=(gN)(gN)=g^2N$, but by assumption $g^2\in N$, so $(gN)^2=g^2N=N$, which is the identity element of $G/N$, so $gN$ has order 2. Since $gN$ was an arbitrary choice of non-identity element, any non-identity element has order 2.

Let $g\in G, n,n'\in N$. We have: $gngn'=gg(g^{-1}ng)n'$ since $g^{-1}ng\in N$ and $g^2\in N$, we deduce that $gngn'\in N$.


plot any irrational number on number line. I have a basic question:
Can we plot any irrational number on a number line? I can plot all integers and rational numbers on it but how can I plot any irrational number, such as $\sqrt2$,$\sqrt3$ etc.?

Choosing a unit length, you can use the spiral of Theodorus to find any length of the form $\sqrt{n}$ in which n is an integer:

As a matter of fact, as shown in the picture below, using a similarity argument we can deduce that
$CH^2=AH\times BH$, which means by choosing AH to be the unit lenght, we can construct $\sqrt{BH}$. You just have to find a way to construct such a triangel (Hint: Use a semicircle!).

For other irrational numbers, it depends on the number AND the tools you are allowed to use. For example, it has been proved that these numbers are not constructible  using just a straight edge and compass: $2^{\frac{1}{3}}$, $\pi$, $e$. But, if you're allowd to use a tool to construct a hyperbola and another for a parabola, then you can construct $2^{\frac{1}{3}}$.

First of all draw the number line. Mark point 'A' as 0 and ponit 'B' as 1. This means A,B = 1 unit.Now, at B, draw BX perpendicular to AB. Cut off BC = 1 unit. Join AC. By Pythagoras Theorem in right triangle ABC, we get AC= root 2 units. Now with radius AC and center A, mark a point on the number line. Let the marked point be M.M represents root 2 on the number line.


Can mathematics get from other sciences what it got from physics? Throughout history, physics has been an unparalleled source of '' inspiration'' for discovering/inventing mathematical ideas, which is due to its ability to describe the physical world. But can this connection be made as profoundly with other fields of science like biology? Can other fields deepen our understanding of mathematics and generate new discoveries/inventions in it? Has this already happened? How so?

Of course from economics, as already said, think of Game Theory or Utility Theory.

In the 1940s-1950s a new field called Mathematical Psychology emerged, basic questions of measurement theory(*) (under what conditions and to what extend could qualitative data quantified, and what operations are permissable on that gathered data), of artificial intelligence, learning (for which Markov models where applied). Artificial intelligence is nowadays a part of its own, from connectionistic models, data mining, pattern matching etc all borrow ideas from mathematics.

Also in the 1940s-1950s information theory emerged, which stems some ideas and analogies from thermodynmaics, but essentially has its origin in coding and transmission, so was motivated by electrical engineering.

Last but not least computer science, modelling programs, domain theory, database theory, verification borrowes much from logic and computability theory and also created much theory for themselves (non-hausdorff topology, reasoning about programs by calculus). But also Formal Language Theory, for example finite machines could be interpreted as monoids which opens a whole new door to the mathematical investigation of languages (see Eilenberg, J.E.Pin and many others who created a whole new mathematical theory around that). By the way, formal language theory has its origins also in psychological considerations (see Chomsky, who asked questions about a universal grammar "hard-wired in our brains", to said it simply). Also you might search for Donald Knuth, who wrote a multi-volume compendium on mathematics as applied to computer science, where much of combinatorics is applied to the analysis of algorithms.

And let me add, one of the oldest books, Euclids elements, where not directly motivated by solving physical problems (other then that our physical world permit counting), indeed the platonian view was that mathematical ideas exist outside the physical reality and so mathematics could in theory be done without any appeal to reality.

There are also problems from music, apart form such physical question at what is sound, vibrations, but more concerned with the structure of music itself and not its medium, which motivate new mathematical ideas, look for a guy called Guerino Mazzola who uses Category Theory in Music.

(*) by the way this is not measure theory which is applied in probability and integration,

Yes, and I think that psychology has a great potential here. Perhaps not many scientist are devoted to this combination, but a "Newton" might be born somewhere in the jungle of category theory?

Human mind as such has probably absolutely nothing to do with mathematics and my intuition here is directed to the human way of thinking and making decisions. And since there initially could be no better objects to study than the mathematicians themselves, experts of thinking as they are, perhaps some day a light will start to twinkle and enlightening some darkness in human mind?

The benefit would be to extract and classify the patterns of human thinking and their consequences, possibilities and drawbacks. Not in vague philosophical ways or with statistics, but as mathematical models of categories of thinking.

When analyzing the constructive way of thinking, mathematically, the less valuable and even delusive patterns may appear more clear for psychologists and psychiatrists. But also, the study would lead mathematics forward if restraints in our thinking become clear and new examples from reality enriches the theories.

I'm especially interested in qualitative mathematical-psychological theories. The quantitative theories from the 19's and the 20's seems uninteresting and elusive.

I think that mathematics is just as much about inner world as about outer world and might be considered as an extension or product of those two worlds together.

I recently found topics like this

Characterizing projective geometry of binocular visual space by Möbius transformation

Which seems interesting both from the perspective of psychology and of mathematics.


"Least trivial" function preserving rationality Is there a "non-trivial" function $f(x,y)$ such that

$$f(x,y) \in \mathbb{Q} \iff x,y\in \mathbb{Q}?$$

An example of a "trivial" function would be

$$f(x,y) = \begin{cases} 0 & x,y\in \mathbb{Q}\\ \pi & \text{otherwise} \end{cases}$$
or any other $f$ which effectively uses a cases function.

The motivation is just my curiosity. Obviously, operations which preserve one direction of the $\iff$ are plentiful and well-studied. I was wondering how onerous the condition of the additional direction is on the choice of $f$. This question on mathoverflow seems related.

Perhaps a slightly less trivial example would be the function $f$ that interleaves the decimal digits of $x$ and $y$: that is, if
\begin{align}
x&=0.x_1x_2x_3\dots \\
y&=0.y_1y_2y_3\dots
\end{align}
are decimal expansions of $x$ and $y$, then
$$
f(x,y)=0.x_1y_1x_2y_2x_3y_3\dots
$$

You can make this definition unambiguous by deciding to always (or never) take finite decimal expansions when they are available.

Then $f(x,y)$ has a repeating decimal expansion if and only if both $x$ and $y$ do, and so it satisfies your condition.

I think the function f must be understood to be from $\mathbb{R}^2$ to $\mathbb{R}$ so I choose


Why does $(1 + x)^{1/x} $ approach $e$ as $x$ approaches $0$? For smaller and smaller values of x in the expression $(1 + x)^{1/x} $, its value seems to approach the constant $e$,

$(1 + 1E-10)^{1E10} = 2.71828182832313114395...   $
$(1 + 1E-20)^{1E20} = 2.718281828459045235347$

but how can it be proven that:
$$\lim_{x\to 0}(1 + x)^{1/x}  = e$$
I was first introduced to e with this definition
$$\frac{d(e^x)}{dx}=e^x$$

Hints:

With L'Hospital show that $ \frac{\ln(1+x)}{x} \to 1$ as $x \to 0.$

We have $(1+x)^{1/x}= e^{\frac{\ln(1+x)}{x}}.$


Limit of a function with two variables: when do we stop looking for another value? So for instance we have this limit of a function $\displaystyle\lim_{(x,y)\to(0,0)}{xy\over \sqrt{2x^2+y^2}}$, and the function isn't continuous at the point $(0,0)$. Now we can try to find the limit, and there's a possibility that it doesn't exist in case we find that the function approaches different values from different paths. Is that correct?

So for instance I tried approaching the point from y-axis ($x=0$) and x-axis ($y=0$), as well as $y=x$. The limit for all these is $0$. So it seems like the limit of the function as $(x,y)$ approach $(0,0)$ is $0$, but how do I know I haven't missed some other path, from which we might have approached different value?

One can use paths, or particular sequences $(x_n,y_n)\to(0,0)$, in order to prove that such a limit does not exist. Producing  a single path or sequence where the limit does not exist, or  two different paths or sequences with different limits of the expression in question closes the case.

But in the case at hand you (correctly) conjecture that the limit does exist, and you want to prove this. Under these circumstances it is of no help considering paths: You would have to prove that the limit is the same for all paths, but there are just to many of them. In addition I'm sure you can't even imagine how complicated a path towards $(0,0)$ can look like.

Instead we have to use the actual definition of convergence in this case. This definition works with $\epsilon$, $\delta$, and neighborhoods. Fortunately you have a definite idea what the limit is, namely $0$. You therefore have to prove the following: Given an $\epsilon>0$ there is a $\delta=\delta(\epsilon)>0$ such that $$0\leq r:=\sqrt{x^2+y^2}<\delta\qquad\Longrightarrow\qquad \bigl|f(x,y)\bigr|<\epsilon\ .$$
Of course it is allowed to use standard limit theorems, like the squeeze theorem, instead of $\epsilon$ and $\delta$. In the case at hand one has
$$|f(x,y)|={r^2\>|\cos\phi\sin\phi| \over r \sqrt{2\cos^2\phi+\sin^2\phi}}\leq r\ ,$$
and this implies $\lim_{(x,y)\to0} f(x,y)=0$.

You can use polar coordinates to evaluate your limit which becomes

  $$\lim_{r\to 0} \frac{r^2\cos \theta \sin \theta}{r\ \sqrt{2\cos^2 \theta +\sin^2 \theta}}   = \lim_{r\to 0} \frac{r \cos \theta \sin \theta}{ \sqrt{2\cos^2 \theta +\sin^2 \theta}} =0 $$


calculate probability for rain Last night was new year's eve, and it poured rain.
A friend said, what are the odds for that?
And me, as a student for probability class, thought it would be easy to calculate.

But so far, I'm kinda confused with how to use known facts in my calculations.
I checked online, and got that my city has $5.4$ days of rain in december.

My first thought was denote $P(\text{rain on any day in december}) = 5.4/31 = 0.174$.
But how do I continue from here? Let's suppose rain days are independent, should I do:

$$P(31.12) P(\text{any other 4 days}) \implies P(\text{rain}) (31-1)C_4 P^{4} (1-P)^{31-5} ? $$

Of course these are very easy assumptions to make. If anyone knows how to actually calculate that, I'll be glad to hear.

Happy New Year!

The 5.4 you get from the website is some average over a certain amount of years of the number of rainy days in December. That does not mean though, that you need to calculate for exactly 5 rainy days. Instead, your first approach seems correct (assuming independence which is probably wrong) and you would conclude that the probability is equal to $0.174$.

So it seems my initial thought was correct: No. of December rainy days / No. of days in December = 5.4 / 31 = 0.174 (While assuming every rainy is independent of the others. Wrong in "real life" terms).


Is this an equivalent statement to the Fundamental Theorem of Algebra? Is the following equivalent to the usual statement of the fundamental theorem of algebra:

Let $$f(z)=c_nz^n+\cdots+c_1z+c_0$$

be a polynomial with complex coefficients. For all but finitely many $w \in \mathbb C$, $f(z)-w$ has $n$ distinct roots in $\mathbb C$.

This seems different to just saying that $f(z)$ has, including multiplicities, $n$ roots. Because this statement does not leave the possibility that there could be finitely many points $w\in\mathbb C$ such that $f(z)=c_nz^n+\cdots+c_1z+(c_0-w)$ will not have $n$ roots. Any insight is appreciated!

A polynomial is separable (has distinct roots) if it shares no zeroes with its formal derivative. If $ P(X) - w $ is a polynomial of degree $ n $ for $ w $ a constant, then its formal derivative $P'(X) $ is a polynomial of degree at most $ n-1 $ and does not depend on $ w $. Let the distinct zeroes of the formal derivative be $ z_1, z_2, \ldots, z_r $ where $r \leq n-1 $; then $ P $ can only be inseparable if it has one of these as a root. But this requires $ w \in \{P(z_1), P(z_2), \ldots, P(z_r) \}$, and there are only finitely many elements of this set; which means $ P(X) - w $ has $ n $ distinct roots for all $ w $ outside of this set.

For the reverse implication, note that if $ P(X) $ was a polynomial with no roots, then $|P(X)| $ would have a nonzero minimum value (this is guaranteed by the growth lemma), say $ r $. In that case, we would have that $ |P(X) + q| \geq ||P(X)| - q| \geq r/2 $ for all $ 0 \leq q \leq r/2 $, meaning that none of these polynomials can have any roots in $ \mathbb{C} $. This violates our hypothesis, since there were only finitely many such polynomials which did not have $ n $ distinct roots.

ok, Let's look at the statemt that says

  For all but finitely many $w \in C$, $f(z)-w$ has $n$ distinct roots in $\mathbb C$.

As written, that statement doesn't say there are any roots at all when $w$ is one of those finitely many exceptions.  Thus it falls short of entailing the fundamental theorem, which says there is always at least one root.

You wrote "including multiplicities, $n$ dinstinct roots". Maybe you're missing the meaning of the word "distinct".  If any of the roots has multiplicity more than $1$, and the sum of the multiplicities is $n$, then the $n$ roots that you have (including multiplicities) are not distinct.

Regardless of the value of $w$, there will be $n$ roots if you count them by multiplicities, i.e. the sum of the multiplicities will always be $n$.  But for finitely many values of $w$, the roots will not be distinct.

You ask whether the statement is "equivalent" to the "fundamental theorem of algebra".  If "equivalent" means they are either both true or both false, then they are.  If equivalence is to be defined relative to a specified axiom system in which the axioms are not enough to decide whether either statement is true or false, then it can make sense to say what "equivalent" means.

But if "equivalent" means the deduction of either as a corollary of the other is quick and simple, then "equivalent" is not all that precisely defined.  Sometimes it means somebody has proved that either both are true or both are false, without saying which.

Obviously if there are $n$ roots, counted by multiplicities, then there is at least one root, and that's what the fundamental theorem says.

On the other hand, if the fundamental theorem is true (and it's not really a theorem of algebra as we usually understand that term today), then a simple theorem in algebra says we can write
$$
f(z) = (z-z_1) g(z)
$$
where $z_1$ is a zero of $f(z)$, and then applying the fundamental theorem and that simple theorem of algebra again, we get
$$
f(z) = (z-z_1)(z-z_2)h(z)
$$
and so on. So you get $n$ roots, counted by multiplicities.  You can make this into a precisely stated proof by mathematical induction.


The square of n+1-th prime is less than the product of the first n primes. I wanted to prove the following question in an elementary way not using Bertrand postulate or analytic estimates like $x/\log x$. The question is
$$
p_{n+1}^2<p_1p_2\cdots p_n,\qquad(n\geq4)
$$

I made the following argument. Does anyone have some opinion or simpler ideas to complete.

We consider two cases:
Case 1: $N=p_1p_2\cdots p_n-1$ is composite: then there will be a prime factor  $q\leq\sqrt{N}$, and of course $q$ is not any of the $p_i$'s. therefore $p_{n+1}\leq q\leq\sqrt{N}$. So $p_{n+1}^2<N+1$.

Case 2: $N=p_1p_2\cdots p_n-1$ is prime. Then???

The inequality
$$p_{n+1}^2<p_1p_2\cdots p_n$$
for $n>3$  is called Bonse inequality, and Bonse gave a completely elementary proof in
 Bonse, H. (1907). "Über eine bekannte Eigenschaft der Zahl 30 und ihre Verallgemeinerung". Archiv der Mathematik und Physik 3 (12): 292–295. It is also proved in the book of Uspensky and Heaslet, Elementary Number Theory,
on pages 87-89.
An online solution can be found at art of problem solving. A further online proof is in this book, Theorem 13.
Basically the proof uses
$$
n-m+1<p_m
$$
for $m=[n/2]$, and $p_{n+1}<p_1\cdots p_m$. Then
\begin{align*}
p_{n+1}^2 & < (p_1\cdots p_m)(p_1\cdots p_m) \\
 & < (p_1\cdots p_m)(p_{m+1}p_{m+2}-p_{2m})\\
 & < p_1\cdots p_n.
\end{align*}

Consider $a = p_1 p_2 p_3 \dots p_n p_{n+1}$

All the prime divisors of $a$ must be less than $< a^{\frac{1}{2}}$

Therefore $p_{n+1} < a^{\frac{1}{2}} = (p_1 p_2 p_3 \dots p_{n} p_{n+1})^{\frac{1}{2}}$

Conclusion : $(p_{n+1})^2 < p_1 p_2 p_3 \dots p_n p_{n+1}$


Tough multivariable inequality: Minimize $a^2 + b^3 + c^4$ given $a + b^2 + c^3 = \frac{325}{9}$ Let $a,$ $b,$ and $c$ be positive real numbers such that $a + b^2 + c^3 = \frac{325}{9}.$ Find the minimum value of
$a^2 + b^3 + c^4.$

Note that for the surface $a^2 + b^3 + c^4=k$ to have the minimum value $k$, it is tangential to the surface $a + b^2 + c^3 = \frac{325}{9}$. Calculate their normal vectors
$(1,2b,3c^2)$ and $(2a,3b^2,4c^3)$, and match them to get

$$\frac{2a}1=\frac{3b}2=\frac{4c}3$$

Then, plug $b= \frac43a$ and $c=\frac32a$ into $a + b^2 + c^3 = \frac{325}{9}$ to obtain the tangential point at

$$a=2,\>\>\>b = \frac83,\>\>\>c=3$$

As a result, the minimum value is

$$a^2 + b^3 + c^4=2^2+\left(\frac83\right)^3+3^4=\frac{2807}{27}$$

Have you tried considering the Lagrangean $$\mathcal L(a, b, c) = a^2 + b^3 + c^4 + \lambda\left(a + b^2 + c^3 - \frac{325}9\right)?$$


Does it make any sense to prove $0.999\ldots=1$? I have read this post which contains many proofs of $0.999\ldots=1$.

Background

The main motivation of the question was philosophical and not mathematical. If you read the next section of the post then you will see that I have asked for a "meaning" of the symbol $0.999\ldots$ other than defining it to be $1$. Now here is a epistemological problem and this is mainly the problem from which the question arose. Suppose you know that $1$ is a real number. Now I give you a symbol, say $0.999\ldots$ which from now on I will denote as $x$. Now I ask you whether $x$ is a real number. To answer this, if you define $x=1$ then you are already attributing the properties of $1$ to $x$ among which one is it being a real number without proving whether to $x$ we can indeed attribute the properties of $1$.

A common response to this question has been to define the symbol $x$ as the limit of the sequence $\left(\displaystyle\sum_{i=1}^n \dfrac{9}{10^i}\right)_{n\in\mathbb{N}}$ and then prove that the limit of this sum is indeed $1$. But again the problem is that you are defining the symbol $x$ to be a real number and hence are assuming a priori that the symbol $x$ denotes a real number.

As per the discussion that has been conducted with Simply Beautiful Art let me state my position again in brief,

  Also let me say that I do not disallow $0.999…$ to be a real number. My impression that if you assume $0.999…$ to be a real number then there is no sense in proving that $0.999…$ is indeed equal to $1$ because either you define it to be $1$ or you prove the equality as a theorem. But if you are going to use the limit definition of $0.999…$ then what you are a priori assuming it to be a real number which is an assumption that I don't allow. What can be allowed is that $0.999…$ is a number (but not necessarily a real number).

Question

My question is,

  Does it make any sense to prove this equality?

Can one give any "meaning" of the symbol $0.999\ldots$ other than defining it to be $1$?

We have to agree about what the symbols

$$
0.99999\dots
$$

are supposed to mean. The symbols capture an intuitive idea, but it doesn't have meaning unless we agree on what that meaning is. When you write these symbols down, everyone will agree that what you mean is the following:

$$
.9 + .09 + .009 + \dots = \frac{9}{10} + \frac{9}{100} + \frac{9}{100} + \dots = \sum_{i = 1}^\infty \frac{9}{10^i}
$$

There is no proof of that -- it is an agreement.

If you wrote this, perhaps similar-looking, string of symbols down

$$
\begin{aligned}
0.00000\dots1\\
\end{aligned}
$$

then there is no agreement on what you mean. You would seem to be talking about a real number which is smaller than all other real numbers -- an object that doesn't exist.

So what string of symbols means what, rigorously, is a matter of agreement. Usually we elide that fact when it seems intuitive what we mean, but we do not all share the same intuition (or the same knowledge of how to express that intuition), so we must drag it out on occasions like now.

Anyway, the content of a proof of $0.9999\dots = 1$ is not that we must agree to define $0.9999\dots$ as $1$. The content is to define $0.9999\dots$ as the sum above, then by deduction show this sum is equal to $1$.

We don't simply define $0.9999.... $ to be equal to 1.

We do a lot of background analysis first which involves constructing the real numbers out of the rational numbers.

In very short summary:

Consider this basic fact about rational numbers:  no matter how close together two rational numbers are we can find a rational number between them (which also means for any value greater than zero, no matter how small, you can find a smaller one between it and zero).

This is nice.  It means we can get as close as we like to any value using rational numbers.

Now consider this monkey wrench:  There are many values we can't express (for example: pi and the square root of 2).  [This is weird because we can get as close as we like to to these values by the statement above.]

And consider this horrible result:  Between any two rationals no matter how close we get, there is always one of the inexpressible holes between them!

So how can we think of these ... irrational values...

Well, a lot of subtle analysis and picayune debating we notice that in the rational numbers we can have an infinite set of rationals, where all the rationals are within a range, but the set needn't have a biggest value.  For example: {all the rational numbers less than pi}; all these values are less than 3 1/3 so it's bounded, but there is no precise rational upper bound to this set.

(Another such set is all the numbers $.9, .99, .999, .9999$ etc.  It's infinite but each term is rational.  It has no biggest value.  And all values are less than 1.)

So the issue was can we come up with a bigger system of numbers than the rationals, where every set will have a precise upper bound? Mathematicians decided they could and it was called the Real numbers[1].

Now here is the definition of the real numbers and how the were created (it's very subtle):  Every real number is the least upper bound limit of a bounded set of rational numbers.  And every bounded set of rational numbers has a real number as an upper bound.

That's the definition of the real numbers.

So {.9, .99, .999, .9999,.....} is an bounded infinite set of rational numbers.  By definition it has a real number least upper bound limit.  We call that real number .999999999999......

Okay, we have defined .99999...... and we DIDN'T define it as 1.  So now we can prove that it does equal 1.

The general idea is that if .99999......= c < 1  then can find a finite number in {.9, .99, .999, .9999,.....}  that is bigger than c.  So we were wrong about c being an upper bound of {.9, .99, .999, .9999,.....}  So .9999....... $\ge$ 1.  But 1 is bigger than any of the {.9, .99, .999, .9999,.....}. So .99999.......  $\not >$ 1.  The only consistent option left is .99999.... = 1.

[1] Well, the didn't just wave their hands and declare it.  They had to prove constructing such a number system was possible.  The proof is ... abstract.  And tedious.  And abstract.

===== 2nd answer: Different approach and philosophy====

The OP has a point that we don't really "need" to prove .999.... = 1.  If .999... equals anything at all, showing that it must by 1 is trivially easy.  The idea of proving .999.... = 1 misses the point.  The point really is how do we know that .999.... equals anything at all.

The OP isn't entirely accurate in stating we defined .999... to be 1.  We defined .999.... to be something that can be shown to be 1.  (Slight difference but a difference with ramifications.)  Other comments claim we make an assumption via definitions that .999... is a limit of bounded sequence of rational numbers and another assumption via definition that limits of bounded sequence of rational numbers are real numbers.

These aren't entirely accurate either.  The definitions weren't assumptions.  They were analysis as to what the real numbers are and the discoveries came along the way.

Suppose we know nothing about the real numbers.  ... well,  not nothing but suppose we have no real sense of them.

With or without real numbers we do have to define $ 0.9999....$ as $ \sum_{n = 1}^{\infty} \frac{9}{10^n}$.  But we don't really know anything about it.  It's possible that it's unbounded and "blows up".  (Actually, we can show that can't happen but I don't want to get into that yet.)  It's possible that it adds up to an actual number.  It could be rational or it could be one of those numbers that can't be written as a rational like square root of two or pi.

But the natural concern is that it might simply never resolve into anything.

To me, the surprising and subtle thing about analyzing the real numbers is the realization that the very nature of the real numbers means that this "simply never resolving into anything" is impossible.  Everything in the reals that is bounded resolves to something, and every real is a resolution of something.  This really astounded me when I finally wrapped my head ahead.  I mean it really really surprised me!  (Yes, I'm that much a geek.)

Okay, so this leads to the fundamental question:  Real Numbers.  What the Heck are they?

We know that we can measure discrete units via integers, like $n$.  And we know we can chop these discrete units into $m$ pieces as $1/m$ and as $m$ can be arbitrarily large, these $1/m$ can be arbitrarily precise and this collection of ratios, so all the possible $n/m; m \ne 0$ form a system of arbitrarily precise measurements that span every possible range.  So these Rationals can measure anything to arbitrary precision.

That ought to be enough.

But it isn't.  Because we know there are always numbers like $\sqrt{2}$ and $\pi$ that can't be written as any Rational = $m/n$ where $m$ and $n$ are integers.

So w have gone for a thousand years with a number system that we don't really understand and cant describe.  What are these "holes" and what do we know about them?

Enter the Dedekind cut.

An example:  Let's "cut" the rationals into two sets.  Set $A = ${all the rational numbers, $r$, such that $r^2 < 2$} and $B = ${all the rational numbers, $s$, such that $s^2 < 2$}.  Several things we note about these sets:

1) they are completely disjoint and neither are empty; 2) all the elements or 1 are smaller than all the elements of the other; 3) A does not have a largest element and B does not have a smallest element; and 4) They are arbitrarily close together.  (That is, for any number $e > 0$ no matter how small we can always find an $a \in A$ and a $b \in B$ so that $b - a < e$.  Always.)

Any "procedure" that can cut the Rational numbers into two sets with those 4 properties is called a "cut" and we can, for sake of vocabulary, refer to such cut as $\overline x$ and the two sets as $A\overline x$ and $B\overline x$.

And we can consider the collection of all such cuttings. One thing is about these cuts is that we don't necessarily need to know how to describe them for them to exist.

One such cut could be $\overline \omega$ such that $A\overline \omega = $ {all rationals less than some .99...9} and $B\overline \omega = $ {all rationals larger than all .99...9}.  [That's not actually true and I pulled a fast one on you.  A brownie point to any one who can figure out my deception.]

Now the astute reader might have noticed that although these cuts cut the rational in two, the two sets don't always contain all the rationals.  Ex: A = {all rationals < 27 1/2} and B = {all rationals > 27 1/2} is a cut.  But the rational number 27 1/2 is not in either A nor B.  This is okay.  The sets don't have to contain all the rationals.  But notice, 27 1/2 is the only rational that is not in either set.

We can say a cut like that one cuts the rationals "on" a rational number and others cut the rationals "between" rational numbers.  There is a correspondence between the rational numbers and the cuts that cut on the rational numbers and we can refer to such a cut as $\overline{1/2}$ as the cut that cuts on 1/2.

The other cuts that cut between rational numbers are extra cuts.

So... back to the collection of all possible cuts...

They form a number system.

For two cuts $\overline x$ and $\overline y$ we say $\overline x < \overline y$ if $A\overline x \subset A\overline y$.  We note that if we define $\alpha$ = $A\overline x + A\overline y = $ {all rationals that are sums of two rationals one in $A\overline x$ and the other in $A\overline y$} and $\beta$ = {all the rationals that are bigger than all the rationals in $\alpha$}, then $\alpha$ and $\beta$ perform a cut.

[Again, I'm pulling a fast one.  Another brownie point to whoever finds it.  It's the same as the fast one I pulled above.]

We define $\overline x + \overline y$ as finding that type of cut.

Similarly we define subtraction, multiplication, and division.  (Divisions kind of a pain to define but we do it.)

So the collection of all cuts form a number system.  What's more, the cuts that cut "on" rational numbers behave equivalently as the rational numbers do.

These "cuts" are the real numbers.  Every real number is a point at which we "cut" the rational numbers into two sets.  If we cut "on" a rational number that point is the rational number, if we cut "between" rational numbers that point is some irrational number.

That's it.  That's what the heck Real Numbers are.

... deep sigh and coffee break....

Okay, WHAT THE #@&! DOES THAT HAVE TO DO WITH .9999....?

Notice that we now have discovered (NOT "defined"; NOT "assumed") that every real number cuts the rationals in two.  So every bounded sequence of rationals can be fit into the $A\overline x$ set of some cut $\overline x$ and we can find precisely the lowest cut that will do that.  And that cut point is a precise and unique real number.

Thus the FUNDAMENTAL PROPERTY OF REAL NUMBERS!!!!  Every real number is a limit of a sequence of rational numbers and every bounded sequence of rational numbers has a real number limit.  And this real number is the point that cuts the rational numbers at precisely the "edge" of the sequence.

So let's look at $.9999...... = \sum_{n = 1}^{\infty} \frac{9}{10^n}$ and let's look at this bounded sequence of rational numbers: {.9; .99; .999; etc.} and let's look at the number $1$ which is larger than all the elements of the sequence.

So we know:

1)There is a cut $\overline {\omega}$ where $A\overline{\omega}$ = {all the rationals that are less than or equal to sum .999...9}

2)This cut occurs at a real number, $\omega$.

3)$\omega = \lim $ of the sequence {.9;.99;.999; etc.}

4).999.... "lingers" between the elements of $A\overline {\omega}$ and the elements of $B\overline{\omega}$.

Therefore we can conclude $.999.... = \omega$.

And that's it:

$.9999..... = \sum 9/10^n = \lim \{.9'.99;.999;...\}$ is a real number.

Now it's trivial to prove $.99999..... = 1$.

And there was not a single assumption or circular definition.


We break a unit length rod into two pieces at a uniformly chosen point. Find the expected length of the smaller piece We break a unit length rod into two pieces at a uniformly chosen point. Find the
expected length of the smaller piece

The length function is $f(x) = \min ( x,1-x )$ as you found.  This is $x$ on the interval $[0,0.5]$ and $1-x$ on the interval $[0.5,1]$.

We are ultimately trying to find $E(f(X))$, the expected length.  By the "law of the unconscious statistician," and since the distribution of the random variable $X$ is uniform:

$$E(f(X)) = \int_0^1 f(x) \cdot 1 \;dx = \int_0^{0.5} x \;dx + \int_{0.5}^1 (1-x) \;dx = \frac{1}{4}$$

Or you could just measure the area under the curve without integrating by noticing the graph forms a triangle with base $1$ and height $0.5$.

Length of the shorter stick is uniformly distributed between 0 and 0.5, hence the answer is a mean of uniform distribution which is a midpoint, here it is 0.25.


Correlation between two linear sums of random variables I understand how to create random variables with a prespecified correlational structure using a Cholsesky decomposition. But I would like to be able to solve the inverse problem: Given random variables $X_1, X_3, \dots X_n$ ,and two different linear sums of those variables $V_1=a_{11}X_1+a_{12}X_2+\dots a_{1n}X_n$, and  $V_2=a_{21}X_1 + a_{22}X_2 +\dots+a_{2n}X_n$, I wish to calculate the correlation between the $V_1$ and $V_2$.

I have searched for terms like "linear combination random variables correlation" and have found plenty of material discussing how the correlation affects the variance of the sum of random variables. Unfortunately I have found nothing that seems to relate to the problem described. I would appreciate any information at all, including either an appropriate book chapter or web page reference.

The covariance is bilinear, hence
$$
\mathrm{Corr}(V_1,V_2)=\frac{\mathrm{Cov}(V_1,V_2)}{\sqrt{\mathrm{Var}(V_1)\mathrm{Var}(V_2)}}=\frac{\sum\limits_{j=1}^n\sum\limits_{k=1}^na_{1j}a_{2k}\mathrm{Cov}(X_j,X_k)}{\sqrt{\mathrm{Var}(V_1)\mathrm{Var}(V_2)}},
$$
where, for $i=1$ and $i=2$,
$$
\mathrm{Var}(V_i)=\sum\limits_{j=1}^n\sum\limits_{k=1}^na_{ij}a_{ik}\mathrm{Cov}(X_j,X_k).
$$

to directly answer the question ....

COR(aX+bY,cW+dZ) =

[ac*COR(X,W)+ad*COR(X,Z)+bc*COR(Y,W)+bd*COR(Y,Z)] / [(a^2+b^2)(c^2+d^2)]^.5

(where a,b,c,d are constants and X,Y,W,Z are random variables)


Length of Hilbert Curve in 3 Dimensions The Hilbert Curve is a continuous space filling curve. The length of the $n^{th}$ iteration in two dimensions can be calculated by $2^n-\frac{1}{2^n}$. The curve can be generalized to fill volumes; what is the length of the $n^{th}$ iteration of the Hilbert Curve in three dimensions?

Here is a screenshot of part of the first page of Hilbert's 1891 paper defining his curve:

At the $n^{\text{th}}$ level, we see that the square is broken into $4^n$ subsquares and the polygonal approximation to the ultimate space-filling curve consists of $4^n-1$ segments of length $1/2^n$. Thus, the length of the approximating curve at stage $n$ is $(4^n-1)/2^n$.

This same approach can be used to find the length of the three-dimensional version.  For concreteness, the approximations might looks something like so:

At level $n$, the cube is now partitioned into $8^n$ sub-cubes and the path consists of $8^n-1$ segments of length $1/2^n$ leading to a length of $(8^n-1)/2^n$. Note that this computation agrees with the expression reached in one of the comments to the OP empirically.

In $2$ dimensions the square is divided into $2^n$ by $2^n$ smaller squares ($n$ is the iteration). The majority of squares contain $2$ lines of length $1/2^n$ except for two, giving us $2(2^n * 2^n -1)/2^n$.

In 3 dimensions there is still $2$ lines in the majority of cubes so wee need only adjust things to account for the $3$rd axis, giving $2(2^n \cdot 2^n \cdot 2^n -1)/2^n$.

In general we have $2(2^dn-1)/2^n$, where $d$ stands for the number of dimensions.


Finding the equation of line given the two intersecting lines of planes I have an idea that in order to get the equation given only the lines, it requires to do cross product and solving for the coordinates that satisfies the given two lines.
The problem is that only intersecting lines of planes are given. I have no problem for the cross product but I am confused for finding the coordinates since the answer would be infinite solution. What could be another way to find the points?
The original problem goes this way.

Determine an equation for each of the lines described below.

line of intersection of the planes 2x - y + z = -1 and x + 4y - z = 2.

Crossing the normal vectors to the plane, you’ll get the direction vector of the line, i.e. $$(2,-1,1) \times (1,4,-1) =(-3,3,9) $$
Now, you need any one point that lies on the line. This will be any point that lies on both the planes. One variable is arbitrary. Let’s take $z=0$. Then you get $$2x-y=-1 \\ x+4y =2 \\ \implies x =-\frac 29, y= \frac 59$$ and thus, the equation of the line is $$\vec r = \left( -\frac 29, \frac 59, 0 \right) +\lambda(-3,3,9)$$
Crossing the normal vectors to the plane, you’ll get the direction vector of the line, i.e. $$(2,-1,1) \times (1,4,-1) =(-3,3,9) $$
Now, you need any one point that lies on the line. This will be any point that lies on both the planes. One variable is arbitrary. Let’s take $z=0$. Then you get $$2x-y=-1 \\ x+4y =2 \\ \implies x =-\frac 29, y= \frac 59$$ and thus, the equation of the line is $$\vec r = \left( -\frac 29, \frac 59, 0 \right) +\lambda(-3,3,9)$$


Is L' context free language? Given context free grammar :   G=(V,T,P,S).

and  L'={a $\in$ (V $\cup$T)* | S$\Rightarrow$*a}   when $\Sigma$=V $\cup$ T

Is L' context free language ?

I think no because for the grammer:

G=(S,{a,b},P,S)   ,P={ S$\rightarrow$aSb|ab}

we will get that L' is:

L'={$a^nS^nb^n$}$\cup${$a^nb^n$} and L'  is not context free language.

Given context-free grammar $G = (V, T, P, S)$, define $G' = (V, T \cup V', P \cup P', S)$, such that $V'$ has one element for each element of $V$,

$$ V' = \{ v' \mid v \in V \} \enspace, $$

and, for each element $v \in V$, $P'$ contains the production $v \rightarrow v'$.  The language of $G'$ is context-free, and is isomorphic to $L'$.

Your initial definition:
$$
L'= \{a \in (V \cup T)^* \mid S \Rightarrow^* a \}   \quad \text{when } \Sigma =V \cup T \quad (*)
$$
seems to use $V$ as set of non-terminals and $T$ as set of terminals.
$L'$ consists of all words $a \in \Sigma^*$ which can be produced via $P$ from the start symbol $S\in V$ in finite many steps.

The language generated from $G=(V, T, P, S)$ is
$$
L(G) = \{ a \in T^* \mid S \Rightarrow^* a \} \quad (**)
$$
To have $L'$ be context-free, one has to provide a context-free grammar $G'=(V', T', P', S')$ which generates it similar to $(**)$.

Solution:

We have $T' = V \cup T$ from the definition of $L'$ and comparison to $(**)$.

The requirement $\emptyset = V' \cap T'$ needs us to come up with a $V'$ disjoint with $V$. As $S \in V$, $S' \in V'$ this means $S' \ne S$.

$P$ contains the production rules $\alpha_i \to \beta_i$ with $\alpha_i \in V$ and $\beta_i \in (V \cup T)^*$.

If $a \in L'$ then $a \in (V\cup T)^*$ and we have $S = u_1 \Rightarrow \dotsb \Rightarrow u_k = a$ for $k \ge 1, k\in \mathbb{N}$, $u_i \in (V\cup T)^*$ because the productions from $P$ are used:

$u \Rightarrow v$ means there is a production rule $\alpha \to \beta$ and prefix $p$, suffix $s$ such that $u = p \alpha s$ and $v = p \beta s$.

We now choose some set $V'$ disjoint with $V$ but with the same number of elements, as $V$ is finite, this should always be possible.
We choose some bijection $f$ between $V$ and $V'$:
$$
v' = f(v) \quad (v \in V)
$$
Then $V' = f(V)$, $S' = f(S)$.

For each production $\alpha \to \beta$ from $P$,
we define a production $\alpha' \to \beta'$ for $P'$, where $\alpha' = f(\alpha)$ and $\beta'$ such that each symbol $s$ from $\beta$ with $s\in V$ is replaced by $s'=f(s)\in V'$, while the symbols $s\in T$ will be kept. A little bit sloppy, we write this as $\beta'=f(\beta)$.

This $G'$ so far will generate (in the sense of $(*)$) all words $a' = f(a)$ where $a\in L'$. These $a'$ might contain non-terminal symbols from $V'$, $a' \ne a$ might occur, so we add production rules $v' \to v = f^{-1}(v')$ for each $v' \in V$ to $P'$.

This should give
$$
L' = L(G')
$$
according to $(*)$.

Example:

$$
G = (V=\{S\}, T=\{a,b\}, P, S)
$$
with production rules $P$:
$$
S\to aSa \mid bSb \mid \varepsilon
$$
Then
$$
L' = \{ wSw^R \mid w \in T^* \} \cup \{ ww^R \mid w \in T^* \}
$$
Then
$$
G' = (V'=\{ S' \}, T'=\{ S, a, b \}, P', S)
$$
with $P'$:
$$
S' \to aS'a \mid bS'b \mid \varepsilon \mid S
$$
The first three productions will generate (in the sense of $(*)$)
$$
f(L') = \{ wS'w^R \mid w \in T^* \} \cup \{ ww^R \mid w \in T^* \}
$$
the last one extends to
$$
\{ wS'w^R \mid w \in T^* \} \cup \{ wSw^R \mid w \in T^* \} \cup \{ ww^R \mid w \in T^* \}
$$
however generated in the sense of $(**)$, thus restricted to $T'=\{ S, a, b \}$ we get $L'$.


smallest number for given sum of digits I am trying to find the smallest number if we are given the sum of its digits. Suppose that sum of digits  is 9 then it should be 9 instead of 18,36,63 and similarly if sum of digits is  11 then desired answer is 29 not 92 or any other number bigger than 29.I tried to write sum of all numbers upto 53 and got this but i am not able to come up with a general formula.
                        from 1 to 9 it is just 9.FROM 10 to 18 it is 19,29,39,...... and for 19(1+9) it is 199  that is increase by 100.
from 19 to 27 it is 199,299,399,499.... and for 28 it is 1999 that is increase by 1000.
from 29 to 36 it is 29999,39999,49999,..... for 37 it is 19999 (increse by 10000).
for 38 to 45 it is it is 29999,39999,49999,........999999 and for 46 it is 199999 (increased by 100000)

In our so-called positional numeration system, the digits get a weight that increases from right to left, following the powers of ten (units, tens, hundreds, thousands...).

So to minimize the number you will allocate the budget in priority to the positions with the smallest weight.

This is why the solution is by putting as many $9$s to the right as you can, preceded by the remainder of the budget. There will be $b\text{ div }9$ nines and the digit $b\bmod9$, forming the number

$$(b\bmod 9)10^{b\text{ div }9}+10^{b\text{ div }9}-1=(b\bmod 9+1)10^{b\text{ div }9}-1.$$

If on the opposite you want to maximize the sum, then you must forbid the digit $0$ (because you could insert them "for free"), and the solution is formed by a maximum of $9$s followed by the remainder, i.e.

$$10\,(10^{b\text{ div }9}-1)+b\bmod9$$ unless $b\bmod9=0$, then

$$10^{b\text{ div }9}-1.$$

I have found a general formula to find the smallest number whose digits sum up to S and has M digits. Here is a python implementation of it:

def bla(M,S):
    n=(S+7)//9
    sl=9*n -7
    c=10**(n-1)
    b=10**(M-1)
    p=int((2+S-sl)*c -1)
    return p+b

If you have any doubts please comment below.


A more technical definition of an Affine Variety My textbook states that an affine variety is

Definition. Let $k$ be a field and let $f_1,...,f_s$ be polynomials in $k[x_1,...,x_n]$. Then we set $$V(f_1,...,f_s)=\{(a_1,...,a_n) \in k^n : f_i(a_1,...,a_n)=0, \forall 1 \leq i \leq s\}$$
We call $V(f_1,...,f_s)$ the affine variety defined by $f_1,...,f_s$.
(Ideals, Varieties and Algorithms by Cox, Little and O'Shea)

My question is, simply, must an affine variety contain "ALL" the solutions to each $f_1,...,f_s$? So say, for simplicity I try to find a variety $V=V(f)$ for some $f$ then, can $V$ still be referred to as an "affine variety" while containing maybe only partial solutions?
I think the answer is no, and it MUST contain all solutions(otherwise, a particular variety will not be unique) but it's just that the definition above doesn't seem to (to me) make that very obvious. It seems like there's no problem letting it be the set with only "some" solutions too.
Can anyone point out which part of the definition makes this clear? Thank you in advance

Yes, $V(f_1,\dots,f_s)$ contains all the solutions.  That is exactly what its definition means.  When you define a set $V$ by writing $V=\{x\in X:P(x)\}$, this means that $V$ is the set of all elements $x\in X$ such that $P(x)$ is true.  In this case, $X=k^n$, $x=(a_1,\dots,a_n)$ is written as an $n$-tuple, and $P(x)$ is the statement "$f_i(a_1,...,a_n)=0, \forall 1 \leq i \leq s$".

Usually $k$ is assumed to be algebraically closed, so that there is a correspondence between varieties and systems of equations (or rather the radical ideal defined by the polynomials).   For non-alg-closed fields or rings $K$ you talk about the $K$-points of the variety but the set of points is not considered to be (or to define) the variety.

For example, high degree polynomial equations $P(x,y)=0$ tend to have have an empty set of points over $K=\mathbb{Q}$, but they still can be thought of as curves and attributes of curves such as automorphisms, points at infinity, self-intersections, etc, can be useful in understanding the equation.  One does not think of the variety corresponding to the equation as "the empty set", but a field- or ring-dependent set of points that happens to be empty in some special cases.