TITLE: Suppose $\{x_n\}$ is a monotonically increasing sequence and the subsequence $\{x_{2n}\}$ is convergent. Justify $\{x_n\}$ is convergent.
QUESTION [5 upvotes]: I think I did this correctly:
Since $\{x_{2n}\}$ is convergent, it is bounded. Since $\{x_{2n}\}$ is a bounded subsequence of $\{x_{n}\}$, $\{x_{n}\}$ is also bounded. Hence, $\{x_{n}\}$ is monotone and bounded. Therefore, $\{x_{n}\}$ is convergent by the monotone convergence theorem.
I'm just not sure about this statement: "Since $\{x_{2n}\}$ is a bounded subsequence of $\{x_{n}\}$, $\{x_{n}\}$ is also bounded."

REPLY [1 votes]: Your hypotheses can be weakened.
Instead of using
$\{x_{2n}\}$,
you can use
$\{x_{n_i}\}$,
where
$(n_i)_{i=1}^{\infty}$
is any strictly increasing
sequence of positive integers
(such as $2_i$,
$i^2$,
or
$2^{2^{...^2}}$
with $i$ levels of exponents).


TITLE: Precision and performance of Euclidean distance
QUESTION [8 upvotes]: The usual formula for euclidean distance that everybody uses is
$$d(x,y):=\sqrt{\sum (x_i - y_i)^2}$$
Now as far as I know, the sum-of-squares usually come with some problems wrt. numerical precision.
There is an obviously equivalent formula:
$$d(x,y):= c \sqrt{\sum \left(\frac{x_i - y_i}{c}\right)^2}$$
Where it seems to be a common practise to choose $c = \max_i |x_i - y_i|$.
For 2d, this simplifies to a formula of the form: $d(x,y):= c \sqrt{1 + \frac{b}{c}^2}$
Some questions here:

How big is the gain in precision of doing this, in particular for high dimensionalities?
How much does it increate computational costs?
Is this choice of $c$ optimal?
To compute $c$, this needs two passes over the data. However, it should be possible in a single pass, by starting with $c_0=1$, and then adjusting it when necessary for optimal precision.
E.g. let $c_0=1$, $c_i=\max_{j\leq i} |x_i-y_i|$. Then $$S_i:=\sum_{j\leq i} \left(\frac{x_i - y_i}{c_i}\right)^2 = \sum_{j\leq i-1} \left(\frac{x_i - y_i}{c_{i-1}}\right)^2 \cdot \frac{c_{i-1}^2}{c_i^2}+\left(\frac{x_i - y_i}{c_i}\right)^2 = S_{i-1} \cdot \left(\frac{c_{i-1}}{c_i}\right)^2+\left(\frac{x_i - y_i}{c_i}\right)^2$$
This should allow single-pass computation of this formula, right?

Any comments in particular on the computational cost and precision benefits of computing Euclidean distance this way? Why is everybody using the naive way, is the gain in precision too small for low dimensionality and the associated computational cost too high?
P.S. At least to my understanding, the usual formula should be precise up to the value range of sqrt(Double.MAX_VALUE) to sqrt(Double.MIN_NORMAL), which covers around e+-154, at most divided by the dimensionality - so even for 1000 dimensions, that should be fine for most uses of a distance function ...

REPLY [3 votes]: I'm no numerics expert, but the only advantage you can possibly get from the rescaling is to avoid arithmetic overflow/underflow if the input values are extreme. If the straightforward formula can be evaluated without overflow or underflow, it is no less precise than your embellished one.
In particular, if (a) you're doing the arithmetic in double precision, (b) you know that the true result cannot be larger than googol, and (c) you're willing to have the result be too small when the true result is less than a googolth, then bothering with rescaling will bring you no benefits.
General-purpose libraries typically cannot afford the last two assumptions, so they do need to rescale. On the other hand, one situation where these assumptions are guaranteed to be true is if the input coordinates are given as single precision floats (which can represent neither googol nor googolth).
If you do rescale, be sure to pick a $c$ that is a power of 2; then the scaling operations can be done with no rounding error (and possibly faster, if implemented with, say, ldexp() in C).


TITLE: Does finite fourth moment imply finite third absolute moment?
QUESTION [5 upvotes]: This may be a silly question, but, for a random variable $X$ defined on reals, I am wondering if the existence of the finite fourth central moment $E[(X-E[X])^4]$ implies the existence of the finite third absolute moment $E[|X-E[X]|^3]$?  Formally, does the following statement hold:
$$E[(X-E[X])^4]<\infty\Rightarrow E[|X-E[X]|^3]<\infty$$
The reason for my question is that, while trying to apply the Berry-Esseen Theorem to bound the total variation distance between the distribution of the (appropriately normalized) mean of $n$ i.i.d. random variables and the standard normal distribution, I am finding that the fourth central moment of the i.i.d. random variables the distribution of whose average is being approximated is much easier to compute than their third absolute moment...

REPLY [7 votes]: Split the random variable into the following regions

$ |X - E[X]| > 1 $. In this region, $|X-E[X]|^3 < |X-E[X]|^4$
$|X - E[X]| \leq 1$. In this region, $|X-E[X]|^3 \leq 1 $.

Hence conclude that $E\left[|X-E[X]|^3\right] < E\left[|X-E[X]|^4\right] + 1$

REPLY [7 votes]: Yes.

Proof: Apply the inequality $|x|^3\leqslant1+x^4$ to $x=X-E[X]$ and integrate.


TITLE: Formula for partial sum of binoms: $\sum_{k=0}^{\lfloor n/2 \rfloor} \binom nk \binom mk$
QUESTION [1 upvotes]: I am dealing with some expressions containing combinatoric numbers. Does anybody know a formula for this?
$$\displaystyle\sum_{k=0}^{\left\lfloor \dfrac{n}{2} \right\rfloor} \binom{n}{k}\binom{m}{k}$$

REPLY [1 votes]: We can     find  a  closed form expression   in    case $m\leq  \left\lfloor\frac{n}{2}\right\rfloor$. We use the coefficient of operator $[z^k]$ to denote the coefficient of $z^k$ in a series. This way we can write for instance
\begin{align*}
\binom{n}{k}=[z^k](1+z)^n
\end{align*}

We obtain for $m\leq  \left\lfloor\frac{n}{2}\right\rfloor$:
  \begin{align*}
\color{blue}{\sum_{k=0}^{\left\lfloor\frac{n}{2}\right\rfloor}\binom{n}{k}\binom{m}{k}}
&=\sum_{k=0}^m\binom{m}{k}\binom{n}{k}\\
&=\sum_{k=0}^m\binom{m}{k}[z^k](1+z)^n\\
&=[z^0](1+z)^n\sum_{k=0}^m\binom{m}{k}z^{-k}\\
&=[z^0](1+z)^n\left(1+\frac{1}{z}\right)^m\\
&=[z^m](1+z)^{m+n}\\
&\,\,\color{blue}{=\binom{m+n}{m}}
\end{align*}


TITLE: Euler's method for concave and monotonic increasing functions?
QUESTION [1 upvotes]: Will Euler's method (implicit or explicit) always approximate a function on or above the real solution, if the function is concave and monotonous increasing?
It looks like that in my examples (all separable differential equations), and it makes sense, but I cannot find proof for it.

REPLY [1 votes]: The line from $(x_n,y_n)$ to $(x_{n+1},y_{n+1})$ is always a tangent to an exact solution,

for the explicit method it is the tangent to the exact solution through $(x_n,y_n)$,
for the implicit method it is the tangent to the exact solution through $(x_{n+1},y_{n+1})$.

If the whole family of exact solutions consists of concave functions, then the tangent lines are always above the exact solution they are tangent to. This now means that the series of iteration points

of the explicit method moves upwards in the family of exact solutions, and
of the implicit method moves downwards.

This means that the explicit method gives a sequence above the exact solution and the implicit method below. Convergence order one implies the convergence towards the exact solution with the step size getting smaller.


TITLE: Show that $e^{x+2y}$ is differentiable in $(2,2)$ using the definition of differentiability
QUESTION [1 upvotes]: I kind of understand the rough technique, but the above example was to hard for me. I understand that to show that a function $f(x,y)$ is differentiable at point $(a,b)$ I have to show:
$$
\lim_{(h,k) \to (0,0)}\frac{f(a+h,b+k)-f(a,b)-f_x'(a,b)h-f_y'(a,b)k}{\sqrt{h^2+k^2}}=0
$$
So with $(a,b)=(2,2)$ and $f(x,y)=e^{x+2y}$, I get:
$$
e^6\lim_{(h,k) \to (0,0)}\frac{e^{h+2k}-1-(h+2k)}{\sqrt{h^2+k^2}}
$$
Several uninteresting intermediate calculations have been omitted. Like $f_x'(2,2)=e^6$ and $f_y'(2,2)=2e^6$.
I don't know how to continue here. I have attempted the substitution $x=h+2k$, $y=h-2k$ which gives me:
$$
4e^6\lim_{(x,y)\to(0,0)}\frac{e^x-1-x}{\sqrt{5x^2+5y^2+6xy}}$$
In P.F:
$$
4e^6\lim_{r \to 0}\frac{e^{r\cos\theta}-r\cos\theta-1}{\sqrt{5r^2+6r^2\cos\theta\sin\theta}}
\iff
4e^6\lim_{r \to 0}\frac{e^{r\cos\theta}-r\cos\theta-1}{r\sqrt{5+3\sin2\theta}}
$$
What should I do to proceed?

REPLY [2 votes]: Note that $|h+2k|\leq\sqrt{5}\sqrt{h^2+k^2}$, by Schwarz' inequality. Furthermore, since $\exp$ is differentiable at $6$ with $\exp'(6)=e^6$ there is a function $u\mapsto r(u)$ with $\lim_{u\to0} r(u)=0$ such that
$$e^{6+u}=e^6+e^6\, u+ u\, r(u)\qquad(u\to0)\ .\tag{1}$$
Let $f(x,y):=e^{x+2y}$. Putting $u:=h+2k$ in $(1)$ then gives
$$e^{(2+h)+2(2+k)}=e^{6+h+2k}=e^6+e^6(h+2k)+(h+2k)r(h+2k)\ .$$
It follows that
$${f(2+h,2+k)-f(2,2)-e^6(h+2k)\over\sqrt{h^2+k^2}}={h+2k\over\sqrt{h^2+k^2}}r(h+2k)\ .$$
Here the first factor on the RHS is $\leq\sqrt{5}$ in absolute value, and the second converges to $0$ when $(h,k)\to(0,0)$. This proves that $f$ is differentiable at $(2,2)$, and that $\nabla f(2,2)=(e^6,2e^6)$.
Note that the differentiability of $f$ follows from "general principles", since $f=\exp\circ\,\psi$, whereby both $\exp$ and $\psi:\>(x,y)\mapsto x+2y$ are differentiable.


text:
In this subsection, first we apply the classical kernel regression method to the problem under consideration, then a new kernel regression estimator involving the Hellinger distance is introduced and, finally, some perspectives of improvement are suggested.

\subsubsection{Classical kernel regression}
	\label{section:KernelRegression}
	Let $\xx_0\in\X$ and $f_0=G(\xx_0,\bullet)$. We suppose that the sample set $\XX_N=\set{\left(\xx_i,f_i\right)}{i=1,\dots,N}\subset(\X\times\F)^N$ is available. We want to estimate $f_0$ by $\hat{f}_0\in\F$, knowing $\XX_N$. However, forcing $\hat{f}_0$ to be in $\F$ can be difficult in practice. We propose a first estimator given by
	\begin{equation*}
		\hat{f}_0=\sum\limits_{i=1}^N\alpha_if_i
	\end{equation*}
	where $\alpha_i\in\xR$ ($i=1,\ldots, N$). In order to have $\hat{f}_0$ in $\F$, we impose
	\begin{align*}
		\alpha_i & \geq0\quad\left(i=1,\ldots, N\right),\\
		\sum\limits_{i=1}^N\alpha_i & =1.
	\end{align*}
	The \emph{non-parametric kernel regression} verifies the previous constraints. This estimator, introduced in \cite{nadaraya1964,watson1964}, can be written as follows:
	\begin{equation}
		\label{eq:KR}
 		\hat{f}_0=\sum\limits_{i=1}^N\Frac{K_H(\xx_i,\xx_0)}{\sum\limits_{j=1}^NK_H(\xx_j,\xx_0)}f_i,
	\end{equation}
	where $K_H:\xR^d \times \xR^d \rightarrow \xR$ is a \emph{kernel function}. In the following, the \emph{Gaussian kernel} is used:
	\begin{equation*}
 		K_H(\xx,\yy)= \frac{1}{\sqrt{2\pi\det(H)}}e^{ -(\xx-\yy)^\tr H^{-1}(\xx-\yy)}\quad\left(\xx,\yy\in\xR^d\right),
	\end{equation*}
	where
	\begin{eqnarray*}
 		H=\operatorname{diag}(h_1,\ldots, h_d)
	\end{eqnarray*}
	is the (diagonal) \emph{bandwidth matrix}, with $h_1,\ldots, h_d\in\xR_+$. The higher $h_j$ is, the more points $\xx_i$ are taken into account in the regression in the direction $j$. The method relies on the intuition that if $\xx_0$ is close to $\xx_i$ then $f_0$ will be more influenced by the probability density function $f_i$ (see Figure \ref{figure:gauss:2}).
	\begin{figure}
		\center

		\includegraphics[width = \textwidth, bb=0 0 956 512]{fig_gauss_2.pdf}
		\caption{Left: the spots correspond to design points in $\X$. Right: the associated probability density functions given by the code $G$ defined in the introduction. The probability density function associated to the black square (dashed line) in left Figure seems to be closer to the probability density function represented in green than to the others.}
		\label{figure:gauss:2}
	\end{figure}
	We want that the bandwidth matrix $H^\ast$ minimizes the global error of estimation. That means finding $H^\ast=\operatorname{diag}(h_1^\ast,\dots,h_d^\ast)$ such that
	\begin{equation*}
		\operatorname{diag}(h_1^\ast,\ldots,h_d^\ast)\in\argmin_{h_1,\ldots,h_d\in\xR_+}\int_{\X}\norm{\hat{f}_0-f_0}_{\xLn{2}}^2\xdif{\xx_0}.
	\end{equation*}
	In order to get an approximation of $H^*$, one uses the \emph{leave-one-out cross-validation}, as proposed in Hardle and Marron \cite{Hardle1985}. Then
	\begin{equation*}
 		H^{\ast}\in\argmin_{h_1,\ldots,h_d\in\xR_+}\sum\limits_{i=1}^N\norm{\hat{f}_{-i}-f_i}_{\xLn{2}}^2,
	\end{equation*}
	with
	\begin{align*}
		\hat{f}_{-i} & =\sum\limits_{\substack{j=1\\j\neq i}}^N\alpha_j^{-i}f_j
		\\\alpha_j^{-i}&=\Frac{e^{-(\xx_i-\xx_j)^t H^{-1}(\xx_i-\xx_j)}}{\displaystyle{\sum\limits_{\substack{l=1\\l\neq i}}^Ne^{-(\xx_i-\xx_l)^t H^{-1}(\xx_i-\xx_l)}}}.
	\end{align*}
	This optimization problem is solved with the L-BFGS-B algorithm developed by Byrd et al. \cite{Byrd1995}. Finally, the kernel regression metamodel is given by
	\begin{equation}
		\label{eq:L2:1}
		\hat{f}_0=\sum\limits_{i=1}^N\alpha_{i,H^{\ast}}f_i,
	\end{equation}
	with
	\begin{equation*}
  		\alpha_{i,H^{\ast}} = \frac{ e^{-(\xx_0-\xx_i)^T (H^\ast)^{-1}(\xx_0-\xx_i)}}{\displaystyle{\sum\limits_{j=1}^N e^{-(\xx_0-\xx_j)^T (H^\ast)^{-1}(\xx_0-\xx_j)}}}.
	\end{equation*}

\subsubsection{Kernel regression with the Hellinger distance}
	\label{section:KernelRegressionHellinger}
	The kernel regression introduced in equation \eqref{eq:KR} can be considered as a minimization problem. The estimator of the function $f_0$ corresponding to the point $\xx_0$ is as follows:
	\begin{equation}
		\label{eq:KR2}
		 \hat{f}_0=\argmin_{f\in\F}\sum_{i=1}^NK_H(\xx_i,\xx_0)\int\limits_I\left(f_i-f\right)^2.
	\end{equation}
	The kernel regression is therefore a locally weighted constant regression, which is fitted by minimizing weighted least squares.
	The equivalence between estimators \eqref{eq:KR} and \eqref{eq:KR2} is proven in Appendix \ref{section:L2.kernel.equivalence}.
	We observe that the $\xLn{2}$ distances between the sample functions and the unknown function appear in the objective function of the minimization problem \eqref{eq:KR2}.

	Another classical example of distance between probability density functions is the Hellinger distance.
	We derived a new kernel regression estimator with respect to this distance replacing the $\xLn{2}$ distance by the Hellinger distance in equation \eqref{eq:KR2}.
	The kernel estimator thus takes the following form:

	\begin{align}
  		\hat f_0 = \argmin_{f\in\mathcal F} \sum_{i=1}^N K_H(\xx_i,\xx_0)\int\limits_I\left(\sqrt{f_i(t)} - \sqrt{f(t)}\right)^2\xdif{t}.
  		\label{eq:Hellinger:2}
	\end{align}
	The following analytical expression can be derived for this Hellinger distance-based estimator:
	\begin{equation}
		\label{eq:Hellinger:1}
		\hat{f}_0=\Frac{\displaystyle\left(\sum\limits_{i=1}^NK_H(\xx_i,\xx_0)\sqrt{f_i}\right)^2}{\displaystyle\int\limits_I\left(\sum\limits_{i=1}^N K_H(\xx_i,\xx_0)\sqrt{f_i}\right)^2}.
	\end{equation}
	The calculation that leads to \eqref{eq:Hellinger:1} is provided in Appendix \ref{section:Hellinger.kernel.equivalence}.

	\begin{figure}
		\center
		\includegraphics[scale=0.4, bb=0 0 619 417]{fig_hellingerkernel_exemple.pdf}
		\caption{The orange curve is the Hellinger kernel prediction for the (unknown) output in black, built from the dark blue, red, light blue and green learning probability density functions ($N=4$).}
		\label{figure:Hellinger.kernel.example}
	\end{figure}

	From now on, we will denote $\hat{f}_{0,\xLn{2}}$ and $\hat{f}_{0,\mathrm{He}}$ the estimators given by equations \eqref{eq:L2:1} and \eqref{eq:Hellinger:1} respectively.
	Let us illustrate the Hellinger kernel regression on the four gaussian density functions given on Figure \ref{figure:gauss:2}.
	On Figure \ref{figure:Hellinger.kernel.example} the same $N=4$ learning curves (in dark blue, red, light blue and green) are represented, along with an unknown output $f_0$ (in dashed black) and its associated Hellinger kernel estimator $\hat{f}_{0,\mathrm{He}}$ (in orange).
	We can observe that, although the output is not very well estimated, most of the weight is given to the curve corresponding to the closest vector of parameters (in green).

\subsubsection{Perspectives}

	One of the well-known major drawbacks of the kernel regression is due to the curse of dimensionality.
	The bandwidth estimation quality is deteriorating as the dimension $d$ of the problem increases for a constant sample size.
	First, as the sample points are sparsely distributed in high dimension, the local averaging performs poorly.
	Second, the optimization problem to find the optimal bandwidth is more complex in higher dimension.
	In the presented work, kernel regression has been used with a fixed bandwidth for all sample points.
	The Adaptive or "Variable-bandwidth" kernel estimation techniques have been proposed in the literature to use varying bandwidth over the domain of the parameters $\mathcal X$.
	See Muller and Stadtmuller \cite{Muller1987} and Terrell and Scott \cite{Terrell1992} for more details on these methods. Terrell and Scott \cite{Terrell1992} review several adaptive methods and compare their asymptotic mean squared error, while Muller and Stadtmuller \cite{Muller1987} propose a varying bandwidth selection method.
	In numerous cases, using non-constant bandwidths leads to better estimates as it enables to better capture the different features of the curves.
	Hence, the quality of the proposed methods could be improved by using adaptive kernel regression.
	However, the use of kernel regression is not advised in high dimension.

config: arxiv


TITLE: What are the “moment conditions” in the GMM method? Also: GMM vs IV vs 2-stage least squares?
QUESTION [1 upvotes]: GMM = generalized method of moments
IV = instrumental variables
2SLS = Two stage least squares
OLS = ordinary least squares
I keep seeing talk of 'moment conditions' or 'moment equations', but don't exactly understand the context.
Consider a very standard regression model:
$$y_i = \beta x_i + u_i $$
where  $u_i$ is an error term, and suppose all the classic linear regression assumptions hold.
If I relax the exogeneity assumption,i.e., $\mathbb{E}(u|x) \neq 0$ (also side question: Why does this imply that $\mathbb{E}(u_i x_i)\neq0$?), then using OLS here will produce biased estimates right?
Is $\mathbb{E}(u_i | x_i)=0$ the 'moment condition' in OLS? Is it $\mathbb{E}(u_i x_i) =0$ ?
My second question is whether GMM, 2SLS, and IV are specifically distinct from one another.
My book says that when we have $K$ endogeneous regressors and $K$ instruments (exactly identified) we use IV.
In the case of being over-identified, and we have $J>K$ IVs, we use GMM.
What about for the under-identified case?
Finally, What's the best way to distinguish between these different methods?
For instance, what is the difference in using GMM in an over-identified case vs trying to use IV in that case?
Thanks for any help.

REPLY [1 votes]: The moment condition is
$$
\mathbb{E}[u_i x_i] = 0 = \mathbb{E}[(y_i - \beta x_i)x_i].
$$
This is also called an orthogonality condition. It is used as a method of moments estimator by using the sample version,
$$
(y-X \beta)X = 0,
$$
and you solve for $\beta$ to get
$$
\hat{\beta} = (X'X)^{-1} X'y,
$$
the same as the OLS estimator.
Second question: GMM is the generalized method of moments. The standard method of moments is to pick sample moments that converge in probability to the true moment. For example, the sample mean is a method of moments estimator of the population mean by a weak law of large numbers. In GMM, the model can be non-linear, so that you have a population model
$$
\mathbb{E}[g(X,\mu)] =0
$$
and are trying to pick $\mu$ to get the sample version to fit:
$$
\dfrac{1}{N}\sum_{i=1}^N g(x_i,\mu) =0.
$$
Instrumental variables is a tool for solving endogeneity or omitted variables bias or measurement error problems. In the linear framework, you have
\begin{eqnarray}
x = \pi' Z + \eta \\
y = \beta' x + \varepsilon
\end{eqnarray}
with $cov(\eta, \varepsilon) \neq 0$, OLS is biased.
It is an independent concept of GMM, although you can use a GMM-IV framework to estimate models, which is nice because it gives a J-test of overidentification (which shows up later in your question). IV uses a different orthogonality condition,
$$
(y-\beta X) Z =0
$$
where $Z$ are the instruments, and the IV estimator is
$$
\hat{\beta} = (X'Z)^{-1}Z'y.
$$
2SLS is a way of getting the IV estimator with the least pain possible.  You run OLS of $X$ on $Z$ to get $\hat{X}$, then regress $y$ on $\hat{X}$ instead of $X$ to get an unbiased estimate of $\hat{\beta}$.  It is not GMM, just another way to do IV, although they are asymptotically (maybe even numerically?) equivalent.
If your model is under-identified, you don't have enough variables to solve the orthogonality condition. There are an infinite number of possible $\hat{\beta}$'s that solve whatever you are looking at. Don't do this, or look into the LASSO.
There is a category error in your last question.  GMM is a method of finding and proving properties of estimators, like maximum likelihood. IV is a framework for estimating systems that violate the independence assumptions of OLS. The tests come out of the frameworks.
It sounds like you are reading Hayashi's book before you are ready. Try Greene or Kennedy, or Mostly Harmless Econometrics to get a background on this stuff.


TITLE: Exam question: Showing $z = \left(\frac{1 +z}{\left|1 + z\right|} \right)^2$ for $z\in\mathbb{C}$ and $\left| z \right| = 1$
QUESTION [0 upvotes]: The following was a midterm exam question in an abstract algebra course I was not able to solve:

Let $z \in \mathbb{C}$ with $\left| z \right| = 1$ and $z \neq -1$.
  Show that the following holds true:
$z = \left(\frac{1 +z}{\left|1 + z\right|} \right)^2$
Hint: This is a possible definition for a "principal root" of $z$.

In the exam, I tried to attack this using the fact that if $\left| z \right| = 1$ holds true, I can write $z$ as $\exp(it)$ for some $t\in \left[0, 2\pi \right[$. I tried to work on the left side of the equation using the properties of $\exp$, but didn't know how to deal with the norm in the denominator.
In hindsight, how can this be solved? Is the hint actually helpful?

REPLY [2 votes]: Your approach failed probably because you're trying to simplify and deal directly with the quantity $|\exp(it)+1|$, which is however very difficult, as you have the sum of $1$ and a complex number in polar notation. That's in general not going to give you something helpful, and polar coordinates will usually only help you when you're multiplying two such numbers, since the indices can then add up. Of course, there are tricks you can employ to make this work in this case (see the other answers), but I think in general it's not going to be your first approach.
Here there's a very simple observation to make: that $|1+z|$, the denominator, is just the magnitude (i.e. modulus) of $1+z$, the numerator. Hence, it has unit length, the same as $z$ by assumption. The other thing to do now is to verify that they have the same direction, which is equivalent to the argument of $(1+z)$ (the angle between it and the real axis on the complex plane) being half of that of $z$.
Draw this out on the complex plane. You will see that the points $0,z,(1+z)$ form an isosceles triangle. After that, you will be able to drive that the angle formed by the line joining $0$ and $(1+z)$ with the positive real axis is exactly half of the angle formed by the line joining $0$ and $z$ with the positive real axis.
Of course, the simpler way to do this would be to just substitute $z=x+iy$ assuming $x^2+y^2=1$, then do a lot of simplifications, or equivalently substitute $z=\cos\theta+i\sin\theta$, and indeed that is probably the expected answer. But I think this approach gives a nice geometric intuition.


TITLE: Probability of tossing coins
QUESTION [0 upvotes]: Suppose there are 10 coins laid out in front of you. All of the coins are fair (i.e. have an equal chance of heads or tails) except one, which flips to heads every time. You draw one coin at random and flip it 5 times. If each of the 5 flips results in heads, then the probability that this coin is fair can be written as $\frac{a}{b}$, where a and b are coprime positive integers. What is the value of a+b?

I tried it like this:
chance of getting all head in fair coin = $\frac{1}{2^5}$ = $\frac{1}{32}$
chance of selecting fair coin = $\frac{9}{10}$
chance of getting all head in unfair coin = 1
chance of selecting unfair coin = $\frac{1}{10}$
I calculated the answer as
$$
\left(\frac{1}{32} \cdot \frac{9}{10}\right)+\left(1 \cdot\frac {1}{10}\right) =\frac{41}{320} \implies a+b=361$$
Is this answer correct?

REPLY [7 votes]: I'm afraid not.  The problem is an exercise in Bayes' theorem.
Let $F$ be the event that he coin is fair, and $5H$ be the event of getting $5$ heads.
$$P(F) = 9/10$$
$$P(5H|F) = 1/32$$
$$P(5H|\bar{F}) = 1$$
The problem asks for the probability that, given that you got $5$ heads, that the coin is fair, which is $P(F|5H)$.  Bayes' Theorem then states that
$$P(F|5H) = \frac{P(5H|F) P(F)}{P(5H|F) P(F)+P(5H|\bar{F})P(\bar{F})}$$
Plugging in the numbers, I get $P(F|5H)=9/41$.


TITLE: Is building your own reflector telescope worth it?
QUESTION [14 upvotes]: I have always fancied building my own reflector telescope. I am wondering - For a certain budget, can you get better results with a home made rig? Or is this a folly, and really it would be better to buy a ready made unit?

REPLY [1 votes]: I started building reflectors in the 1950s and apart from being a labour of love it provides great satisfaction. In these days I polished my mirrors with jewlers rouge, that red stuff ! After making half a dozen scopes or so finished up making a 6"schmit-cassegrain which took me all of 8 years off and on..Still got that one.I'm sure its not 1/4 wave but it produces awesome images!!  So I wonder how you got on with your project...Writing from Scotland where viewing is limited by weather..Anyway good luck !!


TITLE: Continuous uniform distribution question
QUESTION [0 upvotes]: The location of a mollusc is uniformly distributed with minimum -1 and maximum +2 metres from the high-tide line. Their daily energy intake (in kcals) is 1 + 25% of their squared location.
(a) What is the cdf of the daily energy intake?
I'm assuming that to calculate this, we need to find out (b) first, then use $F(x) = \int f(x)$ ?
(b) What is the pdf of the daily energy intake?
Knowing that the pdf of the distribution of mollusc is $f(x) = 1/(2-(-1)) = 1/3$ , how do I find the pdf of the daily energy intake?
(c) What is the expected daily energy intake?
Because the probability to find a mollusc with energy intakes that are in the 0 to 1 (and consequently, 0 to -1) zone is higher, this means that the expectation isn't simply $(2-(-1))/2$ , right?

REPLY [1 votes]: Guide:
Let the energy be $$E= 1 + \frac14 X^2$$
Let $y \in (1,2)$,
Compute $Pr(E \le y)=Pr(1+\frac14X^2 \le y)$
Convert that expression to function of CDF of $X$  to evaluate it.
Edit:
\begin{align}
Pr(E \le y) &= Pr(1+\frac14 X^2 \le y)\\
&=Pr(X^2 \le 4(y-1)) \\
&= Pr (-2\sqrt{y-1} \le X \le 2 \sqrt{y-1}) \\
&= Pr(X \le 2 \sqrt{y-1})-Pr(X <-2\sqrt{y-1}) \\
&= \begin{cases} Pr(X \le 2 \sqrt{y-1})-Pr(X <-2\sqrt{y-1}) & , y \in (1, \frac54) \\
Pr(X \le 2 \sqrt{y-1}) - 0 &, y \in [ \frac54, 2)\end{cases} \\
&= \begin{cases} \frac{2 \sqrt{y-1}+1}3-\frac{-2\sqrt{y-1}}3 & , y \in (1, \frac54) \\
\frac{2 \sqrt{y-1}+1}3  &, y \in [ \frac54, 2)\end{cases} \\
&= \begin{cases} \frac{2 \sqrt{y-1}+1}3-\frac{-2\sqrt{y-1}+1}3 & , y \in (1, \frac54) \\
\frac{2 \sqrt{y-1}+1}3  &, y \in [ \frac54, 2)\end{cases} \\
&= \begin{cases} \frac{4 \sqrt{y-1}}3 & , y \in (1, \frac54) \\
\frac{2 \sqrt{y-1}+1}3  &, y \in [ \frac54, 2)\end{cases} \\
\end{align}


TITLE: question on homeomorphisms of $\mathbb{R}^2$
QUESTION [2 upvotes]: Let $R$ be the set of rectangles with sides parallel to axes.
Let $h$ be a homeomorphism of $\mathbb{R}^2$ such that $h(r)\in R$ for any $r\in R$.
Does it imply that $h(x,y)=(f(x),g(y))$ or $h(x,y)=(g(y),f(x))$ for $f,g$ being homeomorphisms of $\mathbb{R}$?

REPLY [3 votes]: Let $h\colon\mathbb{R}^2\to\mathbb{R}^2$ be a homeomorphism that preserves $R$. Observe that we can characterise straight line segments as intersections of rectangles: If we have a straight line segment $L$ parallel to one of the axes, then there are $r,r'\in R$ such that their interiors are disjoint and their intersection is $L$. On the other hand every such intersection is either a point or a straight line segment. Since $h$ preserves $R$ and is a homeomorphism, it also preserves line segments parallel to one of the axes.
Now let $h\colon\mathbb{R}^2\to\mathbb{R}^2$ be a map that preserves lines parallel to the $y$-axis. Then there is a map $f\colon\mathbb{R}\to\mathbb{R}$ such that the $x$-coordinate of $h$ is given by
$f(x)$, that is $h(x,y)=(f(x),y')$ for some $y'$. This is just a reformulation of what it means to preserve lines parallel to the $y$-axis.
In conclusion, up to switching the $x$ and $y$ axis, we may assume that $h$ preserves lines parallel to both axes seperately. Then by the above, there are maps $f$ and $g$ that give the $x$ and $y$ coordinate of $h$, i.e. $h(x,y)=(f(x),g(y))$.
In the other case we get that $h(x,y)=(f(y),g(x))$.


TITLE: I am unsure about raising e to the natural log of an absolute value (simple differential equation example)
QUESTION [2 upvotes]: I am unsure what happens to the absolute value when solving this equation.
The original question was asking:
Find a particular solution to
$\frac{dy}{dx} = 2y; y(1) = 3$
I have simplified it to the stage of $ln|y| = 2x+C$
What I am unsure about is what happens when I raise both sides to $e$.
 What happens to the absolute value?
Thanks.

REPLY [1 votes]: $|y|$ is just a real number, which means that to begin with, if $\ln |y| = 2x + C$, it certainly follows that $|y| = e^{2x + C}$.  There is no problem so far.
The confusing part comes after taking $\exp$ to both sides, if you want to eliminate the absolute value signs from $y$.  To do so, you need a bit of a more sophisticated argument.  Essentially you say $y = \pm e^{2x + C}$ for each $x$, and then by continuity it will need to be the same $+$ or $-$ for all $x$.
As LutzL says, we often set $A = \pm e^C$ so that the solution becomes $y = A e^{2x}$ for some $A \in \mathbb{R}$.


TITLE: Diffusion always present?
QUESTION [0 upvotes]: Simply asked: Is diffusion always and everywhere present? Let's reduce the question to the macroscopic world.
Anytime, when two materials touch each other (air <-> wall, tea <-> cup, chair <-> floor), will a diffusion process always be present then?
As far as I understand a diffusion covers only the transport of atoms and the like between materials, not within.
edit: According to Vadim's comment, I'd like to stick to diffusion between materials.

REPLY [4 votes]: When two materials A and B are placed in contact with one another, molecules of A will diffuse across the interface into B, and molecules of B will diffuse across the interface into A.  The highest concentration of B in A will be at the interface, and the B concentration will decrease with distance from the interface.  So diffusion of B molecules will be driven by the concentration gradient into A.  The extent of the region where this occurs will increase as time progresses.
In cases where A and B are not mutually miscible, A will first dissolve into B at the interface, and then diffuse inward; similarly for B into A.  This dissolution at the interface will typically be described by Henry's law for gas dissolution in a solid or liquid.

REPLY [3 votes]: I do not understand the reason for making a difference between the diffusion between or within materials. Of course, there are different diffusion mechanisms, but I do not think those differences are relevant at the level of the present question.
The answer is yes, at least as a qualitative answer. However, the quantitative answer may correspond to a no in practice.
The reason for the unavoidable presence of diffusion even in the presence of solid materials is the equally unavoidable presence of thermal fluctuations and of many kinds of defects in real solids. The presence of such mechanisms opens different possibilities for atomic diffusion. In some cases, such possibilities may have negligible probability, in other cases, they can provide effective mechanisms for diffusion.


TITLE: Combination problem with balls and colors, how many ways?
QUESTION [0 upvotes]: A bag contains 40 balls from 4 different colors: red, white, black and green. There are 10 balls
numbered (1, 2, 3, ..., 10) from each color. 5 balls are randomly selected from the bag.
In how many ways can 5 balls be chosen so that no more then 2 balls are of the same color?
Can you help me with this? I know that there are 2 cases, 1: 2 balls with same color & 3 balls with different colors 2: 2 balls with same color, another 2 balls with same color and 1 ball with different color. However, I could not understand my instructor's explanation.

REPLY [1 votes]: Responding to comment:
The reason why your attempt is incorrect is because you are double counting. For instance,
"black 1, black 2, red 4, red 3, and green 7"
and
"red 4, red 3, black 1, black 2, and green 7"
are counted separately in your method, due to the $\binom{4}{1} \binom{3}{1}$ computation. If you divide your answer by $2$ to account for this, you match your instructor's solution.


TITLE: How to derive the chances of getting the Jackpot in NY Mega Millions with the given answer?
QUESTION [1 upvotes]: The chances is 1 in 258,890,850: http://nylottery.ny.gov/wps/portal/!ut/p/c5/04_SB8K8xLLM9MSSzPy8xBz9CP0os_jggBC3kDBPE0MLC0dnA09vT0fLQDNvA0dfU30_j_zcVP1I_ShzXKoCgw30I3NS0xOTK_ULst0cAYmfjdU!/dl3/d3/L0lJSklna21BL0lKakFBRXlBQkVSQ0pBISEvNEZHZ3NvMFZ2emE5SUFnIS83X1NQVEZUVkk0MTg4QUMwSUtJQTlRNkswUVMwL3VOY3IwMTMwNDAwMDU!/?PC_7_SPTFTVI4188AC0IKIA9Q6K0QS0_WCM_CONTEXT=/wps/wcm/connect/NYSL+Content+Library/NYSL+Internet+Site/Home/Jackpot+Games/MEGA+MILLIONS/MegaMillions+-+Chances+of+Winning
How to derive the chances of getting the Jackpot in NY Mega Millions with the given answer? please check your answer!

REPLY [2 votes]: You choose 5  numbers from within  the set {$1,2,...,75$}, in $75C5=17259390$  ("75 choose 5") ways. Then you multiply by 15 , because you can choose the additional ball in 15 ways. Then you have $17259390)(15)=258890850$


TITLE: Find the sum of the series $1+\frac12 z^2+\frac{1\cdot3}{2\cdot4}z^4+....$
QUESTION [2 upvotes]: Find the sum of the series $1+\frac12 z^2+\frac{1\cdot3}{2\cdot4}z^4+....$. We can rewrite n-th term as $a_n=\frac{(n-1)(n-3)\cdot...\cdot1}{n(n-2)\cdot..\cdot2}z^n=\frac{(2n)!}{2^{2n}\cdot(n!)^2}z^n$. But I don't know what should I do now. Consider the ratio $|\frac{a_n}{a_{n+1}}|$?

REPLY [2 votes]: Due to De Moivre's formula $\cos\theta=\frac{e^{i\theta}+e^{-i\theta}}{2}$, the binomial theorem and the orthogonality relation $\int_{0}^{2\pi}e^{ni\theta}e^{-mi\theta}\,d\theta=2\pi\delta(m,n)$ we have
$$ \int_{0}^{2\pi}\left(\cos\theta\right)^{2n}\,d\theta = 2\pi\frac{(2n)!}{4^n n!^2}\tag{1}$$
for any $n\in\mathbb{N}$, hence
$$\sum_{n\geq 0}\binom{2n}{n}\frac{z^n}{4^n}=\frac{1}{2\pi}\int_{0}^{2\pi}\frac{d\theta}{1-z\cos^2\theta}=\frac{2}{\pi}\int_{0}^{\pi/2}\frac{d\theta}{1-z\cos^2\theta}=\frac{2}{\pi}\int_{0}^{+\infty}\frac{du}{(1-z)+u^2}\tag{2}$$
and $\sum_{n\geq 0}\binom{2n}{n}\frac{z^n}{4^n}=\frac{1}{\sqrt{1-z}}$ holds for any $z\in(-1,1)$. As an interesting consequence, by squaring both sides we get
$$\forall n\in\mathbb{N},\qquad \sum_{m=0}^{n}\binom{2m}{m}\binom{2n-2m}{n-m}=4^n.\tag{3} $$
You may also go in the opposite direction: a combinatorial proof of $(3)$ leads to $\sum_{n\geq 0}\binom{2n}{n}\frac{z^n}{4^n}=\frac{1}{\sqrt{1-z}}$ almost immediately.


TITLE: Show there exists a sequence of polynomials which converge uniformly to a continuous $f$.
QUESTION [0 upvotes]: Let $f : [0,1] \to \mathbb{R}$ be a continuous function that vanishes at $x = 1.$  Show that there exists a sequence of polynomials, each vanishing at $x = 1$, which converges to $f$ uniformly on $[0,1].$
It feels like a Stone-Weierstrass question, but after looking over the Stone-Weierstrass proof several times I am not sure if it truly applies.
My second thought is Arzela-Ascoli - namely that the family of functions you consider are the collection of polynomials, call this collection $P$, that vanish at $x = 1.$  My problem then becomes that this family is not uniformly bound over the interval, and I do not know if we can assert that a sequence of these polynomials converges to a specific $f,$ I think Arzela-Ascoli only proves that a uniformly convergent sequence in $P$ exists.
Anyone have any insight?  Thanks in advance.

REPLY [2 votes]: Another trick may be the following one: take a sequence of polynomials $q_1(x),q_2(x),\ldots$ that uniformly approximate $g(x)=\frac{f(x)}{1-x}$ over $(0,1)$ then consider $p_n(x)=(1-x)q_n(x)$. It is very easy to show that the sequence $p_1(x),p_2(x),\ldots$ meets the given constraints.


TITLE: Use Jensen's inequality to show $\frac{2x}{2+x} < \log(1+x) < \frac{2x+x^2}{2+2x}$ for $x>0$
QUESTION [4 upvotes]: Use Jensen's inequality to show $\frac{2x}{2+x} < \log(1+x) < \frac{2x+x^2}{2+2x}$ for $x>0$.
I can show this without Jensen's inequality, but I'd like to see what that form of the proof looks like.
Without Jensen's, start with the inequality $\log(1+x) < x$ for $x>0$, integrate both sides to arrive at the upper bound. Also, $\log(1+x) > 1-\frac{1}{x+1}$ for $x>0$ (by substituting $x=1/u-1$ into the previous inequality). Integrate both sides to arrive at the lower bound.

REPLY [2 votes]: Hermite-Hadamard inequality :

if a function $ƒ : [a, b] → R$ is convex, then the following chain of inequalities hold:
    $$f\Big(\frac{a+b}{2}\Big)\leq \frac{1}{b-a}\int_{a}^{b}f(x)dx\leq \frac{f(a)+f(b)}{2}$$

Now take $f(x)=\frac{1}{x}$ and $a=1$ and $b=x+1$ to get a lower and a upper bound . Without this refinement I think it's hopeless .


TITLE: Sum of percentages not equal to original sum
QUESTION [0 upvotes]: For example, let's say I have a sum of money equal to $150,246.76, of which 85%, 10% and 5% need to add up to the original amount, exactly. Calculating each percentage of the total separately does not work. Each percentage must take into account the other percentages otherwise the result is higher than the original amount.
$$0.85x + 0.1x + 0.05x\gt x $$
How do I find the individual values associated with each percentage, so that the total is equal to the original sum?
Worth mentioning, I'm using Excel for calculations.

REPLY [2 votes]: This is related to the apportionment problem, which bedevils the U.S. every ten years: the exact fractions are not integer multiples of a penny, so they need to be rounded in some way. There is no unique "fair" way of doing so. Using the numbers from Ariel Serranoni's answer, it may seem clear that $7512.338$ should be rounded up to $7512.34$, and that one of $15024.676$ and $127709.746$ should be rounded up and the other rounded down, but it's not obvious how to make that choice. The theory of apportionment is surprisingly nuanced (and the politics is historically contentious).


TITLE: Prove or disprove: if the limit of $a_{n}$ goes to $\infty$, then $a_{n}$ has a minimum number.
QUESTION [1 upvotes]: Prove or disprove: if the limit of $a_{n}$ goes to $\infty$, then $a_{n}$ has a minimum number.
Well I know from the definition of a series that goes to $\infty$ that there is a number $K>0$ that from a certain place $a_{n}>K$.But is $K$ the minimum here or is there other numbers smaller than it?

REPLY [1 votes]: Yes, it has a minimum number, if $a_n \rightarrow \infty$ then as you said for any $K > 0$ there is an $N$ such that for all $n \geq N$ implies $a_n > K$. Then the minimum is  $\min \{a_1, \dots, a_N\}$