Wednesday, 19 July 2017

Functional equation: $f(f(x))=k$


If $k\in\Bbb R$ is fixed, find all $f:\Bbb R\to\Bbb R$ that satisfy $f(f(x))=k$ for all real $x$.





If $k\ge 0$, $f(x)=|k+g(x)-g(|x|)|$ is a solution for any $g:\Bbb R\to\Bbb R$.

combinatorics - Prove that $sum_{k=0}^{n-r} binom{r+k}{r} = binom{n+1}{r+1}$



In my combinatorics book I have the following identity:




$$\binom{r}{r} + \binom{r+1}{r} + \binom{r+2}{r} + ... + \binom{n}{r} = \binom{n+1}{r+1}$$



More succinctly:



$$\sum_{k=0}^{n-r} \binom{r+k}{r} = \binom{n+1}{r+1}$$



I'm trying to reason about why this is the case. My textbook actually "proves" this identity (although I'm not convinced).




We break the ways to pick r + 1 members of a committee from n + 1

people into cases depending on who is the last person chosen: the (r +
1)st, the (r + 2)nd, . . . , the (n + 1)st. If the (r + k + 1)st
person is the last chosen, then there are C(r + k, r) ways to pick
the first r members of the committee. [The identity] now follows.
Q.E.D.




So... what are they trying to tell me? I'm guessing we need to partition the committee selection into multiple parts. But what do I partition the committee selection into, and why?



Of course, an algebraic proof is trivial for small examples, but is not practicable for the general case. Can anybody reword my book's committee-selection argument or offer a clearer proof?



Answer



Actually, an algebraic proof is possible, here's an example of one. Fix an integer $r$. We'll make induction over $n$. Of course, we need to have $n \geq r$, so our base case will be $n=r$. In that case, we have to prove



$$\binom{r}{r}=\binom{n+1}{r+1}$$



And it's obvious, because $n=r$ implies $\binom{n+1}{r+1}=\binom{r+1}{r+1}=1$. For the induction step, let's assume



$$\binom{r}{r}+\binom{r+1}{r}+\dots+\binom{n}{r}=\binom{n+1}{r+1} $$



Adding $\binom{n+1}{r}$ on both sides, we have




$$\binom{r}{r}+\binom{r+1}{r}+\dots+\binom{n}{r}+\binom{n+1}{r}=\binom{n+1}{r+1}+\binom{n+1}{r} $$



But $\binom{n+1}{r}+\binom{n+1}{r+1}=\binom{n+2}{r+1}$, which gives us



$$ \binom{r}{r}+\binom{r+1}{r}+\dots+\binom{n}{r}+\binom{n+1}{r} = \binom{n+2}{r+1}=\binom{(n+1)+1}{r+1} $$



So the identity is valid for $n+1$ too. By the Principle of Induction, we have



$$ \binom{r}{r}+\binom{r+1}{r}+\dots+\binom{n}{r}=\binom{n+1}{r+1} $$




for each $r$ integer and $n\geq r$


calculus - Limits with trigonometric functions without using L'Hospital Rule.

I want to find the limits $$\lim_{x\to \pi/2} \frac{\cos x}{x-\pi/2} $$
and
$$\lim_{x\to\pi/4} \frac{\cot x - 1}{x-\pi/4} $$



and

$$\lim_{h\to0} \frac{\sin^2(\pi/4+h)-\frac{1}{2}}{h}$$
without L'Hospital's Rule.



I know the fundamental limits $$\lim_{x\to 0} \frac{\sin x}{x} = 1,\quad \lim_{x\to 0} \frac{\cos x - 1}{x} = 0 $$



Progress



Using $\cos x=\sin\bigg(\dfrac\pi2-x\bigg)$ I got $-1$ for the first limit.

complex analysis - Evaluate $sum_{n=1}^infty frac{(-1)^{n+1}n^2}{n^4+1}$




Evaluate
$$\sum_{n=1}^\infty \frac{(-1)^{n+1}n^2}{n^4+1}$$





Does anyone have any smart ideas how to evaluate such a sum? I know one solution with complex numbers and complex analysis but I'm looking for some more smart or sophisticated methods.


Answer



I would not say that it is elegant, but:



The form $n^4+1$ in the denominator suggests that one should be able to get this series by expanding a combination of a hyperbolic and trigonometric function in a Fourier series.



Indeed, after some trial and error, the following function seems to work:



$$

\begin{gathered}
\left(\cos \left(\frac{\pi }{\sqrt{2}}\right) \sinh \left(\frac{\pi }{\sqrt{2}}\right)-\sin
\left(\frac{\pi }{\sqrt{2}}\right) \cosh \left(\frac{\pi }{\sqrt{2}}\right)\right)\cos \left(\frac{x}{\sqrt{2}}\right) \cosh \left(\frac{x}{\sqrt{2}}\right) \\
+ \left(\cos \left(\frac{\pi }{\sqrt{2}}\right) \sinh \left(\frac{\pi }{\sqrt{2}}\right)+\sin \left(\frac{\pi }{\sqrt{2}}\right) \cosh
\left(\frac{\pi }{\sqrt{2}}\right)\right)\sin \left(\frac{x}{\sqrt{2}}\right) \sinh
\left(\frac{x}{\sqrt{2}}\right)
\end{gathered}
$$



It is even, and its cosine coefficients are

$$
\frac{\sqrt{2}\bigl(\cos(\sqrt{2}\pi)-\cosh(\sqrt{2}\pi)\bigr)(-1)^{n+1} n^2}{\pi(1+n^4)},\quad n\geq 1.
$$
(The zero:th coefficient is also zero). Evaluating at $x=0$ (the series converges pointwise there) gives
$$
\sum_{n=1}^{+\infty}\frac{(-1)^{n+1}n^2}{1+n^4}=
\frac{\pi\left(\sin
\left(\frac{\pi }{\sqrt{2}}\right) \cosh \left(\frac{\pi }{\sqrt{2}}\right)-\cos \left(\frac{\pi }{\sqrt{2}}\right) \sinh \left(\frac{\pi }{\sqrt{2}}\right)\right)}{\sqrt{2}\bigl(\cosh(\sqrt{2}\pi)-\cos(\sqrt{2}\pi)\bigr)}\approx 0.336.
$$


Tuesday, 18 July 2017

probability - How do I show that $ E(g(X))= int_{-infty}^infty g(x)f(x),dx $?

Given that $X$ is a continuous random variable with pdf $f$, and $g(x)$ is a nonnegative function.



How do I show that
$$
E(g(X))= \int_{-\infty}^\infty g(x)f(x)\,dx
$$
using the fact that $E(X) = \int_0^\infty P(X>x)\, dx$.




I attempted to prove this by plugging in g(X) into the second equation instead of just X. And then I took the inverse of g to come up with just a cdf of X, then I rewrote the cdf to its equivalent integral form, giving me an expression with double integral. I have no idea how to move on from here.



Can anyone help me?

probability - Finding expectation and variance of a selection of three balls out of six?



I just asked this question, but worded it wrong so while the given answers are useful, they still leave me confused for where I am in the progression through my stats book.



My problem is I've got 3 balls chosen (with replacement) out of 6, of which 2 of the 6 are blue. What is the expectation and variance of the number of blue balls picked?



In my original question, I included the idea of "chance" (see here: Probability of particular subset of balls occurring in a larger set chosen from a total?), but that lead to a discussion of the binomial theorem, which I have not yet come to in my book, so it can't be expected in the answer (and is a bit ahead of me).




So far, I've covered expectation and variance of random variables, and probability theory. I have a very hard time with probability theory, so that's what is killing me here.



My approach here is that this uses linear combinations of element expectations and variances, but I'm at an almost total loss as to how to find the probabilities of these blue balls in the selection of 3, to establish a probability mass function that can be used for expectation and variance calculations.



In organizing the problem, I've got four conditions, where the number of blue balls is 0, 1, 2, and 3, but how to use combinations for finding the relative probabilities of each leaves me at a blank.



I know I'm choosing 3 out of the 6, so the possible combinations are: 6!/(3!(6-3)!) = 20. However, this being "with replacement" means that we'd be using permutations for establishing the number of possibilities of choosing 3, and not combinations, so this would be 6!/3! = 120, right?



I'm guessing this means that we'd need to find the possible permutations of 3 that include 0 balls, and divide this by 120 to get the probability, and then repeat for 1, 2, and 3? I'm not seeing how to do this part...


Answer





Thanks! That seems to explain it a bit, but I'm confused as this is a question in my book where I have not even touched the binomial distribution. I've just covered linear combinations and expectation of random variables. I did word it slightly differently, where they specifically ask for the expectation and variance of the number of blue balls picked (In slightly rewording it (my mistake), using "chance" might have lead to the binomial distribution discussion. I think its very valuable, but I'm still confused.




Okay.   In this case let $X_i$ be the Boolean indicator that a favoured item is drawn on the $i^{th}$ draw.   Then since there are two favoured items in the population of six, then: $\mathsf E(X_i)= 1/3$ for all draws.   (Interestingly this bit is true whether we are drawing with or without replacement.)



The count of favoured items drawn in a run is the sum of the indicators. $$X=\sum_{i=1}^3 X_i$$



Since expectation is linear the expected count of favoured items in the run is the sum of the expected value of these indicators.
$$\begin{align}\mathsf E(X) & = \mathsf E(\sum_{i=1}^3 X_i) \\ & = \sum_{i=1}^3 \mathsf E(X_i) \\ & = 1\end{align}$$




The expected square of the count is slightly more involved.



$$\begin{align}
\mathsf E(X^2) & = \mathsf E(\sum_{i=1}^3 X_i \sum_{j=1}^3 X_j)
\\[1ex] & = \mathsf E\left(\sum_{i\in\{1,2,3\}} X_i^2 + \mathop{\sum\sum}_{
\substack{
i\in\{1,2,3\}\\[0ex]
j\in \{1,2,3\}\setminus\{i\}}} X_iX_j\right)
\\[1ex] & = 3\mathsf E(X_i^2) + 6\mathsf E(X_iX_j\mid i\neq j)

\\[1ex] & = 3(\tfrac 1 3) +6(\tfrac 1 9)
\\[2ex] & = \tfrac 5 3
\end{align}$$



The second last step trips people up when the first encounter it.
$$\begin{align}
\mathsf E(X_i^2) & = 1^2\;\mathsf P(X_i=1) + 0^2\;\mathsf P(X_i=0)
\\[1ex] & = \tfrac 1 3
\\[2ex]
\mathsf E(X_iX_j\mid i\neq j) & = 1\cdot\mathsf P(X_i=1\cap X_j=1)+ 0\cdot\mathsf P(X_i=0 \cup X_j=0)

\\[1ex] & = \tfrac 1 9
\end{align}$$



You know have the mean and enough to find the variance, since $\mathsf{Var}(X)=\mathsf E(X)^2-\mathsf E(X)^2$






NB: If we are drawing without replacement then $$
\begin{align}
\mathsf E(X_iX_j\mid i\neq j) & = \dfrac {\quad\binom{2}{2}\quad}{\binom{6}{2}}

\\[1ex] & = \tfrac 1 {15}
\\[2ex]
\therefore \mathsf E(X^2) & = \tfrac 7 5
\end{align}$$


How can I show vectors are parallel and perpendicular using complex variables?




I have a question which asks:



If vectors $v_1$ and $v_2$ have associated complex numbers $z_1$ and $z_2$ respectively then express, in terms of $z_1$ and $z_2$, the fact that the two vectors are a) parallel and b) perpendicular. Then, using this information, find the conditions necessary for 4 points, $z_1,z_2,z_3,z_4$ to constitute a parallelogram.





This should be super easy but I'm getting hung up.



My attempt at a solution:



If the vectors are perpendicular, ${z_1}\cdot{z_2} = 0$ so $x_1x_2+y_1y_2=0$ or $\frac{\operatorname*{Re}(z_1)}{\operatorname*{Im}(z_1)}=-\frac{\operatorname*{Im}(z_2)}{\operatorname*{Re}(z_2)}$. I think this is fine, but I could be wrong.



If two vectors are parallel, their slopes should be equal, namely $\frac{\operatorname*{Im}(z_2)}{\operatorname*{Im}(z_1)}=\frac{\operatorname*{Re}(z_2)}{\operatorname*{Re}(z_1)}$. I also believe this is correct, but I could still be mistaken.



The parallelogram part is where I'm getting confused. Suppose for convention that the line joining $z_1$ and $z_3$ is parallel to the line joining $z_2$ and $z_4$. Similarly for the line joining $z_1$ and $z_2$, and $z_3$ and $z_4$. For there to be a parallelogram, I know that the lengths of the sides must be equal, so $|z_4-z_2| = |z_3-z_1|$ and $|z_4-z_3| = |z_2-z_1|$. This is fine.
However, how do I make sure the vectors constituting the parallel sides are, indeed, parallel?




Is it okay to use the parallel condition I used above if the vectors dont start at the origin? So, should I say that $\frac{\operatorname*{Im}(z_4-z_2)}{\operatorname*{Im}(z_3-z_1)}=\frac{\operatorname*{Re}(z_4-z_2)}{\operatorname*{Re}(z_3-z_1)}$ for one pair of sides,and a similar expression for the other pair?



If I can make anything clearer please let me know.


Answer




If the vectors are perpendicular, ${z_1}\cdot{z_2} = 0$ so $x_1x_2+y_1y_2=0$ or $\frac{\operatorname*{Re}(z_1)}{\operatorname*{Im}(z_1)}=-\frac{\operatorname*{Im}(z_2)}{\operatorname*{Re}(z_2)}$.




This can also be written as $\operatorname{Re}(z_1 \bar z_2) = 0\,$, which is the same as $\arg(z_1)-\arg(z_2) = \pm \pi /2\,$.





If two vectors are parallel, their slopes should be equal, namely $\frac{\operatorname*{Im}(z_2)}{\operatorname*{Im}(z_1)}=\frac{\operatorname*{Re}(z_2)}{\operatorname*{Re}(z_1)}$.




This can also be written as $\operatorname{Im}(z_1 \bar z_2) = 0\,$, same as $\arg(z_1)-\arg(z_2) = 0$ or $\pi$.




The parallelogram part is where I'm getting confused.





A quadrilateral is a parallelogram iff two opposite sides are parallel and equal. For $z_1\,z_2\,z_3\,z_4$ to be the vertices of a parallelogram (in this order) the necessary and sufficient condition is $z_2-z_1=z_4-z_3\,$. Another way to write it is $z_1+z_3=z_2+z_4\,$ which corresponds to the condition that the diagonals intersect in their respective midpoints.


real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...