TITLE: Number problems, repeating digits without zeros
QUESTION [3 upvotes]: What is the sum of all four digit numbers with out zeros

REPLY [2 votes]: We use a pairing argument.
There are $9^4$ such numbers. Let
$$a=10(10)^3+(10)(10^2)+(10)(10^1)+(10)(10^0)=11110.$$
It is easy to see by ordinary subtraction that if $x$ is one of our numbers, then $a-x$ also is, and that $a-(a-x)=x$. (The digits of $a-x$ are the "$10$'s complements" of the digits of $x$.)
So our numbers are (almost) divided into pairs with sum $11110$, except that $5555$ is paired with itself.
Thus there are $\dfrac{9^4-1}{2}$ "real" pairs, and the lonely $5555$. The sum is therefore
$$(11110)\left( \frac{9^4-1}{2}\right)+5555.$$
This is $(5555)(9^4)$.
Remark: If each digit can omly be used once, the situation is even simpler. There are then $(9)(8)(7)(6)$ numbers. The pairing is the same as before, but now no one is lonely, so the sum is $(11110)\left(\dfrac{(9)(8)(7)(6)}{2}  \right)$.


TITLE: (Strong) Duality for the integer programming for $\text{gcd}(c_1, c_2, \ldots, c_n)$
QUESTION [2 upvotes]: It is known that (quoted from CLRS, 3rd edition)

If $a$ and $b$ are any integers, not both zero, then $\text{gcd}(a, b)$ is the smallest positive element of the set $\{ax + by: x, y \in \mathbb{Z}\}$ of linear combinations of $a$ and $b$.

Generally, we can formulate the problem of computing $x = \text{gcd}(c_1, c_2, \ldots, c_n)$ as an integer programming ($P$), as done in JOTA1977:
\begin{align*}
\max & \quad x, \\
\text{subject to } & \quad c_j/x = y_j, \qquad j = 1, 2, \ldots, n, \\
& \quad y_j \in \mathbb{Z}, \qquad j = 1, 2, \ldots, n.
\end{align*}
Its dual ($D$) is given as:
\begin{align*}
\min & \quad \sum_{j=1}^{n} c_j z_j, \\
\text{subject to } & \quad \sum_{j=1}^{n} c_j z_j > 0, \\
& \quad z_j \in \mathbb{Z}, \qquad j = 1, 2, \ldots, n.
\end{align*}
Then JOTA1977 reads,

When the $c_j$'s are all integers and $c \neq 0$, it is noted by Greenberg (Ref. 3) that the greatest common divisor of the $c_j$'s is the minimum of $cz$, subject to $cz \ge 1$ and $z$ integer.

I have no access to Greenberg (Ref. 3).
I have computed the dual of the integer programming above and I got $yz \ge 1$ instead of $cz \ge 1$.
How to obtain the dual of the integer programming for $\text{gcd}$?

(Added 1: I compute the dual by the method of Lagrange Multipliers. (I use it in LP, but I am not sure whether this is valid for ILP.) Multiplying $c_j = x y_j$ by $z_i$, summing the $n$ equality constraints, and letting it be an upper bound for $x$: $x \le cz = yzx$.)
(Added 2: I realized that the integer programming above is not linear due to $c_j/x = y_j$.)

REPLY [0 votes]: Converting Misha Lavrov's help comment into an answer:
Looking over the Meyer and Fleisher paper (1) it doesn't claim that Greenberg uses duality at all, so I assume that they are just citing a description of the Euclidean algorithm, and (2) they prove strong duality right there in Theorem 2.1.


TITLE: Calculate $f_X(x)$ and $f_Y(y)$ given a pair $(X,Y)$ of continuous random variables with a joint PDF of...
QUESTION [0 upvotes]: Calculate $f_X(x)$ and $f_Y(y)$ given a pair (X,Y) of continuous random variables with a joint PDF of:
$f(x,y)=$
\begin{cases}
      3 & 0\leq x \leq 1 & 0\leq y \leq x^2 \\
      0 & \text{otherwise}
   \end{cases}
This problem was given to me as a review for an upcoming exam.
My current workings:
$f_X(x) = \int_{-\infty}^{\infty} f(x,y) dy$
$f_Y(y) = \int_{-\infty}^{\infty} f(x,y) dx$
I'm not exactly sure how to use the f(x,y) in the integral. For $f_X(x)$ do I plug in $x^2$ into the integral and 1 for $f_Y(y)$? If someone can point in the correct direction on what to integrate I should be able to continue from there.
Updated attempt:
$f_X(x) = \int_{0}^{x^2} 3 dy = 3x^2$
$f_Y(y) = \int_{\sqrt{y}}^{1} 3 dx = 3-3\sqrt{y}$
$f_X(x) =$
\begin{cases}
      3x^2 & 0\leq x \leq 1 \\
      0 & \text{otherwise}
   \end{cases}
$f_Y(y) =$
\begin{cases}
      3-3\sqrt{y} & 0\leq y \leq 1 \\
      0 & \text{otherwise}
   \end{cases}

REPLY [2 votes]: Hint
according the the definition of $f_{XY}(x,y)$ we obtain $$f_X(x)=\int_{y=0}^{y=x^2}f_{XY}(x,y)dy$$and$$f_Y(y)=\int_{x=\sqrt y}^{x=1}f_{XY}(x,y)dy$$


TITLE: How to find the solution to a multi-inifite summation?
QUESTION [1 upvotes]: I'm familiar with techniques to solve a single infinite sum such as:
$$
\sum_{i=1}^{\infty} (1 + i) \cdot \frac{1}{2^i}
$$
Which ends up being equal to $3$, but I'm having trouble figuring out how to tackle a multi summation such as this:
$$
\sum_{i=0}^\infty \sum_{j=0}^\infty (3 + i +j) \cdot \left( \frac{1}{3} \right)^{(1+i)} \cdot \left( \frac{2}{3} \right)^{(1+j)}
$$
For the first sum I was able to find a pattern in the partial sums.  But with this double summation, I don't think that will work as easily.  Does anyone know of a technique to solve this second summation analytically? Thanks

REPLY [3 votes]: A key to calculate this double sum lies in the fact that for absolutely convergent series $\sum_{i=0}^{\infty}a_i$ and $\sum_{j=0}^{\infty}b_j$ we have
$$\left(\sum_{i=0}^{\infty}a_i\right)\left(\sum_{j=0}^{\infty}b_j\right)=\sum_{i=0}^{\infty}\sum_{j=0}^{\infty}a_ib_j = \sum_{j=0}^{\infty}\sum_{i=0}^{\infty}a_ib_j$$
Now, you can just split up the given series and apply above fact
$$\sum_{i=0}^\infty \sum_{j=0}^\infty (3 + i +j) \left( \frac{1}{3} \right)^{(1+i)} \left( \frac{2}{3} \right)^{(1+j)}$$ $$= \underbrace{3\sum_{i=0}^\infty \sum_{j=0}^\infty \left( \frac{1}{3} \right)^{(1+i)} \left( \frac{2}{3} \right)^{(1+j)}}_{=S_1} + \underbrace{\sum_{i=0}^\infty \sum_{j=0}^\infty i  \left( \frac{1}{3} \right)^{(1+i)} \left( \frac{2}{3} \right)^{(1+j)}}_{=S_2} + \underbrace{\sum_{i=0}^\infty \sum_{j=0}^\infty j\left( \frac{1}{3} \right)^{(1+i)} \left( \frac{2}{3} \right)^{(1+j)}}_{=S_3}$$
$$S_1 = 3\cdot \frac 13 \cdot \frac 23 \left(\sum_{i=0}^{\infty}\left( \frac{1}{3} \right)^{i}\right)\left(\sum_{j=0}^{\infty}\left( \frac{2}{3} \right)^{j}\right) = \frac 23\cdot \frac 32 \cdot 3=3$$
$$S_2 =  \frac 23 \left(\sum_{i=0}^{\infty}i\left( \frac{1}{3} \right)^{(1+i)}\right)\left(\sum_{j=0}^{\infty}\left( \frac{2}{3} \right)^{j}\right) \stackrel{\sum_{i=0}^{\infty}i x^{i+1} =\frac{x^2}{(1-x)^2}}{=} \frac 23\cdot \frac 14 \cdot 3 = \frac 12$$
$$S_3 =  \frac 13 \left(\sum_{i=0}^{\infty}\left( \frac{1}{3} \right)^{i}\right)\left(\sum_{j=0}^{\infty}j\left( \frac{2}{3} \right)^{(1+j)}\right) \stackrel{\sum_{j=0}^{\infty}j x^{j+1} =\frac{x^2}{(1-x)^2}}{=} \frac 13\cdot \frac 32 \cdot 4 = 2$$
So, you get
$$\sum_{i=0}^\infty \sum_{j=0}^\infty (3 + i +j) \left( \frac{1}{3} \right)^{(1+i)} \left( \frac{2}{3} \right)^{(1+j)} = S_1  +S_2 + S_3 = \boxed{\frac{11}{2}}$$


TITLE: $\int_{0}^{\frac{\pi}{4}}{\frac{\cos(2x)}{\cos x+\sin x}dx}$
QUESTION [2 upvotes]: $$\int_{0}^{\frac{\pi}{4}}{\frac{\cos(2x)}{\cos x+\sin x}dx}$$
I don't know how to evaluate this integral. This is a path that I've tried:
$$\int_{0}^{\frac{\pi}{4}}{\frac{\cos(2x)}{\cos x+\sin x}dx} =$$
$$= \int_{0}^{\frac{\pi}{4}}{\frac{\cos^2x - \sin^2x}{\cos x+\sin x}dx} =$$
$$= \int_{0}^{\frac{\pi}{4}}{\frac{1-2\sin^2x}{\cos x+\sin x}dx}$$
My idea was: let $t = \sin x$. Then $dt = \cos x dx$. But I only have $\frac{1}{\cos x}$. Any hints as to how to proceed from there?
This integral is giving me a hard time.

REPLY [6 votes]: Hint: Notice, that:
$$\int_0^{\frac{\pi}{4}}\frac{\cos^2x - \sin^2x}{\cos{x}+\sin{x}}dx=
\int_0^{\frac{\pi}{4}}\frac{(\cos{x} - \sin{x})(\cos{x}+\sin{x})}{\cos{x}+\sin{x}}dx=
\int_0^{\frac{\pi}{4}}\left(\cos{x}-\sin{x}\right)dx$$


TITLE: Showing that $O$ is the only nilpotent matrix in $\langle A \rangle$ where $A$ is diagonalizable
QUESTION [1 upvotes]: I have the following task:

Let $A\in \mathcal{M}_n(K)$ be a diagonalizable square matrix. Show
  using the spectral decomposition of $A$  that the only nilpotent
  matrix in $\langle A\rangle =\{p(A)=c_0A^k+\cdots+c_{k-1}A+c_kI\mid
 c_i\in K\}$ is zero matrix $O$. $K$ is a field.

The spectral decomposition of $A$ is $A=\sum_{i=1}^n \lambda_i E_i,$
where $\lambda_i$s are the eigenvalues of $A$ and the matrices $E_i$ are idempotent pairwise orthogonal matrices.
I have tried to solving this task, but I'm in a dead end at the moment. Thank you for your help!

REPLY [3 votes]: Hint: show that all

matrices in $\langle A\rangle$ are diagonalizable, and that
the only nilpotent diagonalizable matrix is the zero matrix.