# Does Simplex work for all standard-max problems?

Tags:
1. Jan 4, 2019

### Ben2

Mentor note: Fixed the LaTeX
1. The problem statement, all variables and given/known data

Maximize $5x_1 + 7x_2 + 3x_3$ subject to $x_1 + x_2 + x_3 \le 28, x_2 \le2 x_1$ and $x_1 \le x_3$.

2. Relevant Equations
$x_1\ge 0, x_2\ge 0, x_3\ge 0$.
3. The attempt at a solution Problem is workable by graphic methods, but the writer has been unable to
successfully apply the standard-max simplex algorithm. My interest is in finding a workable simplex solution and/or in determining why standard-max simplex won't work here. Thanks for the attention of all posters and site professionals!

Last edited by a moderator: Jan 4, 2019
2. Jan 4, 2019

### Staff: Mentor

Caveat: I havent done any linear programming problems for many years. I haven't set up this problem, but it seems like a standard linear programming example.
The first three constraints should be rewritten as
$x_1 + x_2 + x_3 \le 28$
$-x_1 + x_2 \le 0$
$x_1 - x_3 \le 0$
and $x_1\ge 0, x_2\ge 0, x_3\ge 0$.

LaTeX Tips -- Use a pair of # characters at the beginning and end of a math expression to be rendered for inline LaTeX. Use a pair of \$ characters at the beginning and end of a math expression to be rendered for standalone LaTeX.

For inequalities, use \le, not \leq, and \ge, not \geq.

3. Jan 4, 2019

### Ray Vickson

State the problem as one having 3 variables and 3 constraints (plus non-negativity):
$$\begin{array}{rcl} \max & Z = & 5 x_1 + 7 x_2 + 3 x_3 \\ \text{s.t.}&&x_1 + x_2 + x_3 \leq 28 \\ &&- 2x_1 + x_2 \leq 0 \\ && x_1 - x_3 \leq 0 \\ &&x_1,x_2, x_3 \geq 0 \end{array}$$
So, if $s_1, s_2, s_3$ are the slack variables for constraints 1--3 and we write the objective equation as $Z - 5 x_1 - 7 x_2 - 3 x_3 = 0$ , the initial tableau for the problem is
$$\begin{array}{ccccccc|c} Z & x_1 & x_2 & x_3 & s_1 & s_2 & s_3 & \text{RHS} \\ \hline 1 & -5 & -7 & -3 & 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 1 & 1 & 0 & 0 & 28\\ 0 & -2 & 1 & 0 & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & -1 & 0 & 0 & 1 & 0 \end{array}$$

The simplex method works perfectly well here. If you do not think so, you need to show us your work and indicate where the method fails.

Note that in this problem some simplex steps may involve "degenerate" pivots, where the objective does not change from one iteration to the next, due to having some basic variables equal to 0; essentially, we change a 0 basic variable in one tableau into a non-basic variable (still zero) in another tableau. The simplex method may be "slowed down" a bit here, because it may need to pass through several such degenerate solutions on the way to the final, non-degenerate solution having no basic variables equal to zero.

Last edited: Jan 4, 2019
4. Jan 4, 2019

### Ray Vickson

The commands "\leq" and "\geq" are TeX/LaTeX standards, and work perfectly well in the PF implementation; I use them all the time without any problems.

5. Jan 4, 2019

### Staff: Mentor

OK, thanks -- didn't know that. The \le and \ge operators work in MathJax, and have the advantage of requiring slightly less typing.

6. Jan 4, 2019

### WWGD

The title of this thread does not seem to agree with the question in the OP. The title is , it seems, much more general while the question seems to refer to a specific question. AFAIK, the Simplex method requires some conditions for convergence. I will look them up ASAP.

7. Jan 4, 2019

### Ray Vickson

Right. But let's wait until the OP responds, and shows the difficulties he/she is facing.

Anyway, there are simple "rules" that can be applied that guarantee the convergence in finitely many steps of the simplex method to an optimal resolution (either showing infeasibility or unboundedness of the problem if these properties apply, or else determining an optimal solution).

8. Jan 4, 2019

### kimbyd

1) This is exactly the kind of problem that the Simplex algorithm was designed to solve.
2) In some cases, however, the Simplex algorithm may stall due to degeneracy, and has worst-case exponential time complexity. Wikipedia describes these issues here.

From my reading, it should be efficient for many inputs similar to your example above, but there may be complicated situations where the algorithm stalls out and wastes quite a lot of time.

9. Jan 4, 2019

### Ray Vickson

Nevertheless, companies and other organizations have, for many years, been solving problems having many thousands of variables and many thousands of constraints, using Simplex. For much larger problems (say involving millions of variables and hundreds of thousands to millions of constraints), solvers sometimes use interior-point methods instead of Simplex. Some really big problems (having several hundred million variables) have been solved due to their special "network" structure, using network-flow implementations of the simplex method. Needless to say, simple textbook rules and prescriptions are not good enough for these really big cases.

10. Jan 5, 2019

### FactChecker

You should recheck your Simplex calculations.
Using the Simplex implementation at https://www.zweigmedia.com/RealWorld/simplex.html, I got a solution.

The input format is:
Maximize z=5x1+7x2+3x3 subject to
x1+x2+x3<=28
-2x1+x2<=0
x1-x3<=0

It shows four Tableaus, ending with the solution
x3=7
x2=14
x1=7
z=154

Last edited: Jan 5, 2019
11. Jan 5, 2019

### Ben2

My thanks for the Mentor's corrections. I found the LaTeX inequality-symbol equivalents on this site's own "how-to" primer,
but will try to use them on this site.
FactChecker has the problem-formulation I intended. Let me apologize to anyone thrown off by my original statement.
I've recently gotten the final tableau referenced by FactChecker, with one intermediate tableau. However, the first pivot-element
was a "0" where the constant/element quotient was 0/0. I'm not sure if I'm familiar with all the "rules" mentioned in Ray
Vickson's second post.
The standard Simplex method I've seen in Finite-Math texts seemed to guarantee that each new tableau of
standard-max simplex automatically represents a basic feasible solution. My hand calculations on the given problem, mistake-ridden
though they may have been, prompt me to question that.
Re WWGD's comment, I tried setting this up as a mixed-constraint problem before finally getting the standard-max solution referenced above.
Thanks to all posters for extremely informative comments, and will access "bad" cases referenced by kimbyd.
Ben2

12. Jan 5, 2019

### FactChecker

Usually some artificial variables are added which are driven out (using artificially high cost values) to arrive at a feasible solution that only uses the original variables. I am not familiar with any other way to guarantee that a feasible solution can be found.

13. Jan 5, 2019

### Ray Vickson

Modern industrial-scale computer implementations of the simplex method avoid artificial variables, but instead consider starting at infeasible bases and trying to get rid of infeasibilites first, before optimizing. For example, consider the problem
$$\begin{array}{ccl} \max & Z = & 4 x_1 + 6 x_2 - x_3 \\ \text{s.t.}&&5 x_1 + 2 x_2 + 8 x_3 = 80\\ &&4 x_1 + 9 x_2 +3 x_3 \leq 60\\ &&6 x_1 + 4 x_2 + 5 x_3 \geq 60\\ && x_1, x_2, x_3 \geq 0 \end{array}$$
If we introduce a slack variable $s_1$ for the first inequality and a surplus variable $s_2$ for the second one, our problem can be written as that of maximizing $Z$ over the non-negative variables $x_1, x_2, x_3, s_1, s_2$ that are related by the equations
$$\begin{array}{ccc} Z- 4 x_1 - 6x_2 + x_3 &=&0\\ 5 x_1 + 2 x_2 + 8 x_3 &= &80\\ 4x_1 + 9x_2 + 3x_3 + s_1 &=& 60\\ 6x_1 + 4 x_2 + 5 x_3 - s_2 &=& 60 \end{array}$$
We don't even know if the problem is feasible, so determining that is the first order of business. We do not yet have an LP basis.

Without worrying about feasibility, let us choose an initial basis in which the basic variables are $x_1, s_2, s_3$. The equations can be re-written by putting basic variables on the left and non-basic variables on the right:
$$\begin{array}{ccl} Z&=& 64 +(22/5) x_2 - (37/5) x_3 \\ x_1 &=& 16 -(2/5) x_2 - (8/5) x_3 \\ s_1 &=& -4 -(27/5) x_2 + (17/5) x_3 \\ s_2&=& 36 +(8/5) x_2 - (2/5) x_3 \end{array}$$
This basis is infeasible because it has $s_1 = -4 < 0$. Temporarily, we can think of this as a problem of trying to maximize $s_1$ (so as to drive it up towards zero), and for that reason we choose to increase $x_3$. Using the usual minimum-ratio rules to maintain feasibility of $x_1, s_2$ and to try to achieve feasibility of $s_1$, the ratios are
$$\begin{array}{l} s_1 \;\text{ratio} = (-4)/(-17/5) = 1.176\\ s_2 \;\text{ratio} = 36/(23/5) = 7.826\\ x_1 \; \text{ratio} = 16/(8/5) = 10 \end{array}$$
The minimum ratio is for $s_1$, so $s_1$ leaves the basis and $x_3$ enters. The new equations are
$$\begin{array}{ccl} Z &=& 940/17 -(199/17) x_2 - (37/17) s_1\\ x_1 &=&240/17 -(66/17) x_2+-(8/17) s_1\\ x_3 &=& 20/17+(37/17) x_2+(5/17)s_1 \\ s_2 &=& 520/17-(143/17) x_2 - (23/17) s_1 \end{array}$$
This gives us a feasible solution $Z = 940/17, x_1 = 240/17, x_3 = 20/17, s_2 = 520/17.$ The current $Z$-equation also shows that this solution is optimal

By the way: what would happen if we had a truly infeasible problem but did not use artificial variables? In this case the above method would eventually contain an equation something like $$\text{basic variable}\; x = -2 - 4 u_1 - 3 u_2 - \cdots$$ where $u_1, u_2, u_3 \ldots$ are the current non-basic variables. Note that the right-had-side is negative, and all the coefficients on the right are non-positive. That is, we have a negative basic variable, and increasing any of the non-basic variables up from 0 will not help (and may even make matters worse). This says that the basic variable $x$ cannot be larger than -2, so certainly cannot be non-negative. Our problem would be detected as being infeasible.

14. Jan 5, 2019

### FactChecker

That is true after an initial feasible solution has been found. The Simplex method will move from one feasible corner solution to another. But finding an initial feasible solution takes some tricks. Some variables ("slack" and "surplus") can be added which make it easy to start from a "psudo-feasible" solution with those variables. Then an initial Simplex phase can proceed to feasible solutions which use the original variables. The initial phase is very similar to the regular Simplex method that follows.

Last edited: Jan 6, 2019
15. Jan 7, 2019

### kimbyd

That makes good sense. From my reading, it sounds like Simplex "just works" most of the time, but if you're going to have any sort of system depend upon it, you have to be careful that it can stall out at times, and deal with those cases appropriately. There are solutions for those cases, so it's not a deal-breaker. It's just a little extra complexity that needs to be managed.

Edit:
And for any simple problem you should encounter, you should expect Simplex to work quite efficiently. Especially a textbook problem. You should only expect to encounter the pathological behavior if you're building a large-scale system designed to run a lot of Simplex calculations on a lot of different inputs.

If you try Simplex, and the answer is wrong, then there's a bug in how you're using/implementing the algorithm.

If you try Simplex, and you find it keeps cycling, then you might have hit a stall mentioned above. This shouldn't occur in textbook problems. The algorithm should eventually find a result even in this case, but it may take a little while. Still, if your number of inputs is small, even exponential-time complexity will run quickly in a computer If they're asking you to do it by hand, then it's either an error in your calculations or an error in the textbook (many textbooks have errata, so you might try to look those up if you think the textbook might have a mistake).

Last edited: Jan 7, 2019
16. Jan 7, 2019

### FactChecker

There are techniques to detect and move on from a stall. I would expect any well-used, reputable program to include such a technique. I would hesitate to recommend that a person deal with a stall himself on a very large problem. That would be extremely difficult. I find that even following the calculations on a small problem to be difficult. I could not imagine doing that with a thousand variables.

17. Jan 7, 2019

### kimbyd

I definitely wasn't suggesting a person deal with the stall by hand, hence the statement that such a stall indicates a textbook error. Obviously the complexity has to be managed at the software implementation level.

18. Jan 7, 2019

### Ray Vickson

It is possible for the Simplex method (if naively implemented) to cycle forever among a group of non-optimal solutions; i.e., stall permanently at non-optima. However, there are simple safeguards that can prevent that from happening, so stalling forever won't happen in a properly-implemented system, but stalling for quite a while sometimes will, despite all the safeguards. Commercial codes have various strategies to try to "unstall" the method, but of course, they will not work 100% of the time---just often enough to be useful. For gigantic problems, some systems will start with interior-point methods, perhaps to get near a basic feasible solution, then switch to the simplex method near the end to get an accurate, provably-optimal solution.

19. Jan 13, 2019


# Show the matrix commutes with companion matrix is a polynomial

Let $$A$$ be a linear transform on $$n$$-dimensional $$V$$ over a field $$F$$. Under a basis $$\alpha_1, \cdots, \alpha_n$$, the matrix representation of $$A$$ is as follows: $$A = \begin{bmatrix} 0 & 0 & \dots & 0 & -a_0 \\ 1 & 0 & \dots & 0 & -a_1 \\ 0 & 1 & \dots & 0 & -a_2 \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \dots & 1 & -a_{n-1} \end{bmatrix}.$$ Let $$C(A):= \{T: T\text{ is a linear transform on V and } TA = AT \}$$, and let $$F[A]$$ denotes all the polynomials in $$A$$. Show that: $$C(A) = F[A]; \dim(C(A)) = n.$$

First of all, the minimal polynomial $$m(\lambda)$$ of $$A$$ is the same as its characteristic polynomial $$f(\lambda)$$, namely $$m(\lambda) = f(\lambda) = \lambda^n + a_{n-1}\lambda^{n-1} + \cdots a_0$$. Thus, plugging in $$A$$, we see that all $$A^{k}$$ with $$k \geq n$$ could be expressed by $$I, A, A^2, \cdots, A^{n-1}$$. So $$\dim F[A] \leq n$$. If $$\dim F[A] < n$$, say $$k_0 I + k_1 A + \cdots + k_r A^r = 0$$ with $$r < n$$ and some $$k_j \neq 0$$, then we have that $$g(\lambda) = k_0 + k_1 \lambda + \cdots + k_r \lambda^r$$ is another polynomial with $$g(A) = 0$$. By the definition of minimal polynomial, we must have that $$r \geq n$$, a contradiction. So $$\dim(F[A]) = n$$, and it remains to show the first equality $$C(A) = F[A]$$.

Also, one could see that $$F[A] \subseteq C(A)$$. But I am not sure how to show the other direction. Could someone give me a hint?

Define a linear map $$\Psi \colon C(A) \rightarrow V$$ by $$\Psi(T) = T\alpha_1$$. Let's show that this map is an isomorphism. First, note that $$A^i \in C(A)$$ for all $$i \in \mathbb{N}_0$$ and
$$\Psi(I) = \alpha_1, \psi(A) = A\alpha_1 = \alpha_2, \cdots, \psi(A^{n-1}) = A^{n-1}\alpha_1 = \alpha_n.$$
This shows that $$\Psi$$ is surjective. Next, let's assume that $$\psi(T) = T\alpha_1 = 0$$. Then $$T\alpha_2 = T(A\alpha_1) = A(T\alpha_1) = A(0) = 0, \\ T\alpha_3 = T(A\alpha_2) = A(T\alpha_2) =0, \\ \vdots,\\ T\alpha_n = T(A\alpha_{n-1}) = A(T\alpha_{n-1}) = 0 \\$$
which shows that $$T \equiv 0$$. This shows that $$\Psi$$ is injective. Hence, $$\dim C(A) = n$$ and since $$\dim F[A] = n$$ and $$F[A] \subseteq C(A)$$, we deduce that $$F[A] = C(A)$$.
• Yes I think this is excellent! But how do we come up with such $\Psi$? – mathdoge Jun 5 at 12:00
• The matrix $A$ acts on your basis by $\alpha_1 \mapsto \alpha_2 \dots \mapsto \alpha_n$ (where $x \mapsto y$ means that $A$ sends $x$ to $y$). By applying $T$ and using the fact that $A$ and $T$ commute, you can see that we also have $T\alpha_1 \mapsto T\alpha_2 \dots \mapsto T\alpha_n$. From here you can already see that if we know $T\alpha_1$ and $A$, we also know $T\alpha_i$ for all $2 \leq i \leq n$. – levap Jun 5 at 12:06


# Find the sum to n terms

$$S=1^2+3^2+6^2+10^2+15^2+.......$$

My attempt is as follows:

$$T_n=\left(\frac{n\cdot\left(n+1\right))}{2}\right)^2$$

$$T_n=\frac{n^4+n^2+2\cdot n^3}{4}$$

$$S=\frac{1}{4}\cdot\sum_{n=1}^{n}\left(n^4+n^2+2\cdot n^3\right)$$

Now to solve this one has to calculate $$\sum_{n=1}^{n}n^4$$ which will be a very lengthy process, is there any shorter method to solve this question?

By the way I calculated $$\sum_{n=1}^{n}n^4$$ and it came as $$\dfrac{\left(n\right)\cdot\left(n+1\right)\cdot\left(2\cdot n+1\right)\cdot\left(3\cdot n^2+3\cdot n-1\right)}{30}$$, then I substituted this value into the original equation.

Then I got final answer as $$\dfrac{\left(n\right)\cdot\left(n+1\right)\cdot\left(n+2\right)\cdot\left(3\cdot n^2+6\cdot n+1\right)}{60}$$

But it took me a very long time to calculate all of this, is there any shorter way to solve this problem?

• This is A024166 in OEIS. They don't appear to provide a simple closed formula for it. – lulu Sep 29 '19 at 13:42
• actually my requirement is to solve this faster, I did it in the conventional way and it took a lot of time. – user3290550 Sep 29 '19 at 13:49
• Have you seen this picture proof for $\sum r^4$ ? – almagest Sep 29 '19 at 14:08
• Alternatively, the standard way to do $\sum_rr^k$ is to do $\sum r(r+1)\dots(r+k-1)$ – almagest Sep 29 '19 at 14:11
• Don't have multiple identically-named variables in the same expression! It is very confusing. For example, in the summations, either change the variable denoting the number of terms or change the variable that is being summed over. – Solomon Ucko Sep 29 '19 at 22:14

It is easier to do this kind of problem using factorial polynomials than conventional polynomials. Using falling factorials, for example, we would use $$(n)_4=n(n-1)(n-2)(n-3)$$ rather than $$n^4$$. The wiki articles explains how to convert from conventional polynomials to falling or rising factorials under in the section titled, "Connection coefficients and identities." The advantage of using factorial polynomials comes in summation. We have, for example $$(n+1)_5-(n)_5=(n+1)n(n-1)(n-2)(n-3)-n(n-1)(n-2)(n-3)(n-4)=5(n)_4$$ so that $$\sum_{n=1}^k(n)_4=\frac15\sum_{n=1}^k((n+1)_5-(n)_5)={(k+1)_5-1\over5}$$

EDIT

In this case, it's very easy, because we have $$T_n=\frac14(n+1)_2(n+1)_2$$ and we can use one of the formulas under the "Connection coefficients and identities" section to get$$T_n=\frac14(n+1)_2(n+1)_2=\sum_{k=0}^2{2\choose k}{2\choose k}(n+1)_{4-k}$$

• Wow...what a nice and simple approach! – John Hughes Sep 29 '19 at 15:09
• See Concrete Mathematics by Donald Knuth et. al. – Felix Marin Jul 13 at 16:40

Well...there's a way to get a good guess of the answer. You could say to yourself (or plot the data!) that it looks like a 5th degree polynomial, $$p(n) = a_5n^5 + a_4 n^4 + \ldots + a_0.$$ Then you know that $$p(n+1) - p(n)$$ is the thing you've called $$T_n$$, but it's also $$a_5[(n+1)^5 - n^5] + a_4 [(n+1)^4 - n^4] + \ldots + a_1 [(n+1)^1 - n^1]$$ which you can write out as a 4th degree polynomial. The first term will be $$4 a_5 n^4,$$ I think, which I got by simply expanding $$(n+1)^5 - n^5$$ using Pascal's triangle.

Setting this 4th degree poly equation to $$T_n$$, you get a triangular system of equations that can be backsubstituted to get an answer.

OF course, you then must check that the answer is in fact correct. You know it satisfies the recurrence, but you also need to show it gives the correct values for the first few values of $$n$$ (perhaps the first six?)

Is it faster? Probably. But not a lot. And if the answer had turned out not to be polynomial, you'd have wasted a lot of time.

You can use this result: why is $\sum\limits_{k=1}^{n} k^m$ a polynomial with degree $m+1$ in $n$

Since $$T_n$$ is of degree $$4$$ then its sum will be of degree $$5$$.

So let $$S(n)=a_0+a_1n+a_2n^2+a_3n^3+a_4n^4+a_5n^5$$.

Then you can proceed by solving the system obtained calculating the first $$6$$ terms $$S(1)$$ to $$S(6)$$.

• yeah this is the good way, actually we don't need $a_0$, S(n) will always a multiple of n – user3290550 Sep 29 '19 at 14:15
• you can even simplify it further using Saulspatz hint. If you write $S(n)=a_0+a_1(n-1)+a_2(n-1)(n-2)+\cdots+a_5(n-1)(n-2)(n-3)(n-4)(n-5)$ then the system is even easier to solve since it is triangular. – zwim Sep 29 '19 at 14:17

You may use the hockey-stick identity, like in the computation of $$\sum_{n=1}^{N}n^m$$. We have

$$\binom{n}{2}^2 = 6\binom{n}{4}+12\binom{n}{3}+7\binom{n}{2}+\binom{n}{1}$$ hence $$\begin{eqnarray*} \sum_{n=1}^{N}\binom{n}{2}^2 &=& 6\binom{N+1}{5}+12\binom{N+1}{4}+7\binom{N+1}{3}+\binom{N+1}{2}\\&=&\color{red}{\frac{N(N+1)(N+2)(3N^2+6N+1)}{60}}.\end{eqnarray*}$$

I change a little the notations from your original wording.

$$T(n)=\dfrac{n(n+1)}{2}$$

$$S(n)=\sum\limits_{k=1}^nT(k)^2$$

Cheating on the resulting formula for $$f(n)=\dfrac{n(n+1)(n+2)(3n^2+6n+1)}{60}$$

we notice that $$f(0)=f(-1)=f(-2)=0$$.

Is there a way to exploit these negative indices in order to find the $$(3n^2+6n+1)$$ part more easily?

In fact there is, $$T(n)$$ is perfectly defined for negative numbers so this part does not pose any issue.

But how to interpret $$S(-n)$$?

To be consistent with the summation identity $$\sum\limits_a^{b-1}+\sum\limits_b^c=\sum\limits_a^c$$ when $$a one need to set $$\ \sum\limits_M^m=-\sum\limits_{m+1}^{M-1}$$ for the case $$m.

This results in $$\displaystyle S(-n)=\sum\limits_{k=1}^{-n}T(k)^2=-\sum\limits_{k=-(n-1)}^0T(k)^2$$

I let you do the calculation to verify that $$\begin{array}{lcr}S(0)&=&0\\S(-1)&=&0\\ S(-2)&=&0\\ S(-3)&=&-1\\S(-4)&=&-10\\S(-5)&=&-46\end{array}$$

Now by applying the identification method (I describe in my other post) to $$S(n)=a_0+a_1\,n+a_2\,n(n+1)+a_3\,n(n+1)(n+2)+\cdots+a_5\,n(n+1)(n+2)(n+3)(n+4)$$

You immediately get $$a_0=a_1=a_2=0$$

The others coefficients give you $$S(n)=n(n+1)(n+2)\bigg[\frac 16-\frac 14(n+3)+\frac 1{20}(n+3)(n+4)\bigg]=n(n+1)(n+2)\left(\dfrac{3n^2+6n+1}{60}\right)$$

Once you’ve rewritten your sum as $$\frac14\sum_{k=1}^n k^4+2k^3+k^2$$ it’s not terribly difficult to compute this using generating functions if you use some key tools for manipulating them. To wit, if $$g(x)$$ is the ordinary generating function for the sequence $$\{a_n\}_{n=0}^\infty$$, then $$g(x)/(1-x)$$ is the o.g.f. for the sequence of partial sums $$\{\sum_{k=0}^na_k\}_{n=0}^\infty$$, and similarly, $$x\frac d{dx}g(x)$$ is the o.g.f. for $$\{na_n\}_{n=0}^\infty$$. So, starting with the o.g.f. $$(1-x)^{-1}$$ for the sequence of all ones, we have $$\left\{\sum_{k=0}^n k^2\right\}_{n=0}^\infty \stackrel{ogf}{\longleftrightarrow} \frac1{1-x}\left(x\frac d{dx}\right)^2\frac1{1-x} = {x+x^2 \over (1-x)^4},$$ therefore $$\sum_{k=0}^n k^2 = [x^n]{x+x^2\over(1-x)^4} = [x^{n-1}]\frac1{(1-x)^4} + [x^{n-2}]\frac1{(1-x)^4},$$ which you can compute using the generalized binomial theorem. Similarly, $$\sum_{k=0}^n k^3 = [x^n]{x+4x^2+x^3\over(1-x)^5} \\ \sum_{k=0}^n k^4 = [x^n]{x+11x^2+11x^3+x^4\over(1-x)^6}.$$


Completely monotone imitation of 1/x

I wanted an example of a function ${f}$ that behaves mostly like ${1/x}$ (the product ${xf(x)}$ is bounded between two positive constants), but such that ${xf(x)}$ does not have a limit as ${x\rightarrow 0}$.

The first thing that comes to mind is ${(2+\sin(1/x))/x}$, but this function does not look very much like ${1/x}$.

Then I tried ${f(x)=(2+\sin\log x)/x}$, recalling an example from Linear Approximation and Differentiability. It worked well:

In fact, it worked much better than I expected. Not only if ${f'}$ of constant sign, but so are ${f''}$ and ${f'''}$. Indeed,

$\displaystyle f'(x) = \frac{\cos \ln x - \sin \log x - 2}{x^2}$

is always negative,

$\displaystyle f''(x) = \frac{4 -3\cos \log x + \sin \log x}{x^3}$

is always positive,

$\displaystyle f'''(x) = \frac{10\cos \log x -12}{x^4}$

is always negative. The sign becomes less obvious with the fourth derivative,

$\displaystyle f^{(4)}(x) = \frac{48-40\cos\log x - 10\sin \cos \ln x}{x^5}$

because the triangle inequality isn’t conclusive now. But the amplitude of ${A\cos t+B\sin t}$ is ${\sqrt{A^2+B^2}}$, and ${\sqrt{40^2+10^2}<48}$.

So, it seems that ${f}$ is completely monotone, meaning that ${(-1)^n f^{(n)}(x)\ge 0}$ for all ${x>0}$ and for all ${n=0,1,2,\dots}$. But we already saw that this sign pattern can break after many steps. So let’s check carefully.

Direct calculation yields the neat identity

$\displaystyle \left(\frac{1+a\cos \log x+b\sin\log x}{x^n}\right)' = -n\,\frac{1+(a-b/n)\cos\log x+(b+a/n) \sin\log x}{x^{n+1}}$

With its help, the process of differentiating the function ${f(x) = (1+a\cos \log x+b\sin\log x)/x}$ can be encoded as follows: ${a_1=a}$, ${b_1=b}$, then ${a_{n+1}=a_n-b_n/n}$ and ${b_{n+1} = b_n+a_n/n}$. The presence of ${1/n}$ is disconcerting because the harmonic series diverges. But orthogonality helps: the added vector ${(-b_n/n, a_n/n)}$ is orthogonal to ${(a_n,b_n)}$.

The above example, rewritten as ${f(x)=(1+\frac12\sin\log x)/x}$, corresponds to starting with ${(a,b) = (0,1/2)}$. I calculated and plotted ${10000}$ iterations: the points ${(a_n,b_n)}$ are joined by piecewise linear curve.

The total length of this curve is infinite, since the harmonic series diverges. The question is, does it stay within the unit disk? Let’s find out. By the above recursion,

$\displaystyle a_{n+1}^2 + b_{n+1}^2 = \left(1+\frac{1}{n^2}\right) (a_n^2+b_n^2)$

Hence, the squared magnitude of ${(a_n,b_n)}$ will always be less than

$\displaystyle \frac14 \prod_{n=1}^\infty \left(1+\frac{1}{n^2}\right)$

with ${1/4}$ being ${a^2+b^2}$. The infinite product evaluates to ${\frac{\sinh \pi}{\pi}a\approx 3.7}$ (explained here), and thus the polygonal spiral stays within the disk of radius ${\frac12 \sqrt{\frac{\sinh \pi}{\pi}}\approx 0.96}$. In conclusion,

$\displaystyle (-1)^{n} \left(\frac{1+(1/2)\sin\log x}{x}\right)^{(n)} = n!\,\frac{1+a_{n+1}\cos\log x+b_{n+1} \sin\log x}{x^{n+1}}$

where the trigonometric function ${a_{n+1}\cos\log x+b_{n+1} \sin\log x}$ has amplitude strictly less than ${1}$. Since the expression on the right is positive, ${f}$ is completely monotone.

The plot was generated in Sage using the code below.

a,b,c,d = var('a b c d')
a = 0
b = 1/2
l = [(a,b)]
for k in range(1,10000):
c = a-b/k
d = b+a/k
l.append((c,d))
a = c
b = d
show(line(l),aspect_ratio=1)

2 thoughts on “Completely monotone imitation of 1/x”

1. What was the motivation for finding such a function? Interesting stuff!

1. L says:

A Math.SE question


EXAMPLE 34 Finding the Number of Terms Needed for a Given Accuracy Determine

# Example 34 finding the number of terms needed for a

• Notes
• Ailsa
• 13
• 100% (1) 1 out of 1 people found this document helpful

This preview shows page 5 - 8 out of 13 pages.

EXAMPLE 3.4 Finding the Number of Terms Needed for a Given Accuracy Determine the number of terms needed to obtain an approximation to the sum of the series k = 1 1 k 3 correct to within 10 5 . Solution Again, we already used the Integral Test to show that the series in question converges. Then, by Theorem 3.2, we have that the remainder satisfies 0 R n n 1 x 3 dx = lim R →∞ R n 1 x 3 dx = lim R →∞ 1 2 x 2 R n = lim R →∞ 1 2 R 2 + 1 2 n 2 = 1 2 n 2 . So, to ensure that the remainder is less than 10 5 , we require that 0 R n 1 2 n 2 10 5 . Solving this last inequality for n yields n 2 10 5 2 or n 10 5 2 = 100 5 223 . 6 .
8-31 SECTION 8.3 . . The Integral Test and Comparison Tests 641 So, taking n 224 will guarantee the required accuracy and consequently, we have k = 1 1 k 3 224 k = 1 1 k 3 = 1 . 202047, which is correct to within 10 5 , as desired. Comparison Tests We next present two results that allow us to compare a given series with one that is already known to be convergent or divergent, much as we did with improper integrals in section 6.6. THEOREM 3.3 (Comparison Test) Suppose that 0 a k b k , for all k . (i) If k = 1 b k converges, then k = 1 a k converges, too. (ii) If k = 1 a k diverges, then k = 1 b k diverges, too. Intuitively, this theorem should make abundant sense: if the “larger” series converges, then the “smaller” one must also converge. Likewise, if the “smaller” series diverges, then the “larger” one must diverge, too. PROOF Given that 0 a k b k for all k , observe that the n th partial sums of the two series satisfy 0 S n = a 1 + a 2 + ··· + a n b 1 + b 2 + ··· + b n . (i) If k = 1 b k converges (say to B ), this says that 0 S n a 1 + a 2 + ··· + a n b 1 + b 2 + ··· + b n k = 1 b k = B , (3.5) for all n 1. From (3.5), the sequence { S n } n = 1 of partial sums of k = 1 a k is bounded. No- tice that { S n } n = 1 is also increasing. (Why?) Since every bounded, monotonic sequence is convergent (see Theorem 1.4), we get that k = 1 a k is convergent, too. (ii) If k = 1 a k is divergent, we have (since all of the terms of the series are nonnegative) that lim n →∞ ( b 1 + b 2 + ··· + b n ) lim n →∞ ( a 1 + a 2 + ··· + a n ) = ∞ . Thus, k = 1 b k must be divergent, also. You can use the Comparison Test to test the convergence of series that look similar to series that you already know are convergent or divergent (notably, geometric series or p -series).
642 CHAPTER 8 . . Infinite Series 8-32 EXAMPLE 3.5 Using the Comparison Test for a Convergent Series Investigate the convergence or divergence of k = 1 1 k 3 + 5 k . Solution The graph of the first 20 partial sums shown in Figure 8.26 suggests that the series converges to some value near 0.3. To confirm such a conjecture, we must carefully test the series. Note that for large values of k , the general term of the series looks like 1 k 3 , since when k is large, k 3 is much larger than 5 k . This observation is significant, since we already know that k = 1 1 k 3 is a convergent p -series ( p = 3 > 1).


Question

# The average of $$20$$ numbers is zero. Of them, at the most, how many may be greater than zero?

A
0
B
1
C
10
D
19

Solution

## The correct option is D $$19$$Let the $$20$$ numbers be $$a_1,a_2,...,a_{20}$$Given that average of 20 numbers is zero.Therefore, $$\dfrac{a_1+a_2+...+a_{20}}{20}=0$$$$\implies {a_1+a_2+...+a_{20}}=0$$$$\implies a_1+a_2+...+a_{19}=-a_{20}$$Therefore, at the most $$19$$ numbers can be greater than zero.Mathematics

Suggest Corrections

0

Similar questions
View More

People also searched for
View More


# Does there exist a continuous surjection from $\Bbb R^3-S^2$ to $\Bbb R^2-\{(0,0)\}$?

Prove or disprove : There exists a continuous surjection from $\mathbb{R}^3- S^2$ to $\mathbb{R}^2-\{(0,0)\}$ (here $S^2\subset \mathbb{R}^3$ denotes the unit sphere defined by the equation $x^2+y^2+z^2=1$),.

This question had appeared in TIFR GS-2018 exam for PhD admissions. How should I think about such a map?

• Hint: Think about (path-)connectedness – B. Mehta Dec 11 '17 at 20:31
• $\mathbb{R}^3-S^2$ is Euclidean space with the unit sphere removed. So there are no paths between the interior of the sphere and the exterior. – user326210 Dec 11 '17 at 20:46
• @B.Mehta I don't think it's going to be as simple as that – Perturbative Dec 13 '17 at 15:47
• @user326210 But how would that prove your point? There are examples of continuous maps which map not-path-connected spaces to path connected spaces. – Error 404 Dec 13 '17 at 16:28
• @B.Mehta Can you elaborate your approach? Thanks in advance. – Error 404 Dec 14 '17 at 7:25

There is such a map :

• project $\mathbb{R}^3 \setminus \mathbb{S}_2$ onto $\mathbb{R}^2$ (projection on the first two coordinates, for instance);

• apply the exponential map from $\mathbb{R}^2 \simeq \mathbb{C}$ onto $\mathbb{R}^2 \setminus \{(0,0)\} \simeq \mathbb{C}^*$.

Both are continuous surjections, so their composition still is.

Given the bounty, I think this deserves at least some additional material (or: how may someone find this answer). Let $X$ and $Y$ be two topological spaces. If there is no continuous surjective map $f$ from $X$ to $Y$, then $X$ must have some property which is preserved by continuous maps, and which $Y$ doesn't have. It turns out that there are not many such properties. On top of my head, the only general ones I can see are :

• Cardinality : If Card(X) < Card(Y), then there is no such $f$. Example : $X = \{0\}$, $Y = \{0,1\}$.

• Compactness : If $X$ is compact and $Y$ is separable but not compact, then there is no such $f$. Example : $X = [0,1]$, $Y = \mathbb{R}$.

• Connectedness : If $X$ is connected and $Y$ isn't, then there is no such $f$. More generally, if $X$ has less (in the sense of cardinality) connected components than $Y$, then there is no such $f$. Example : $X = (0,1)$ and $Y = \mathbb{Z}$.

Although, I am sure, one may find examples with other, less obvious, obstructions. Outside of these, things may get wild. For instance, in all the following cases, there exists a continuous surjective map from $X$ to $Y$:

• $X = C$, any Cantor set, and $Y$ is any compact metric space.

• $X=[0,1]$ and $Y = [0,1]^2$ : Peano curve.

• More generally, $X = \mathbb{R}$ and $Y = \mathbb{R}^n$, with $n \geq 1$, using variants of the Peano curve.

• $X = \mathbb{R}^k$ and $Y = \mathbb{R}^n$, with $k \geq n$, using projections. Combining with he previous example, we get all $k \geq 1$ and $n \geq 0$.

• $X = \mathbb{R}^k$ and $Y$ is a (separable) connected, $n$-dimensional topological manifold, with $k \geq 1$. This is not easy to formalize and I have no reference at hand, but the basic idea is to take $k=n$, and make $\mathbb{R}^n$ a thin tape and wrap it around the manifold (see e.g. this related discussion). I also think that one may replace $X$ by any non-compact $k$-dimensional manifold.

With that, we have the tools to answer the question. First, since $X$ ha dimension $3$ and $Y$ has dimension $2$, we reduce the dimension by projecting. We get the plane $\mathbb{R}^2$. Then we wrap the plane around the origin in $\mathbb{R}^2$ ; and we are lucky, since this can be done very explicitly (thanks to the exponential map).

• Same as my comment here: math.stackexchange.com/questions/2565030/… – zhw. Dec 14 '17 at 23:40
• @zhw: yes, it's pretty close. I didn't notice that this question had a duplicate. – D. Thomine Dec 15 '17 at 13:49
• Right, not exactly the same, as I was addressing someone else's proof. Looks like you're headed to bounty nirvana in one of the stranger bounty situations I've seen. – zhw. Dec 15 '17 at 22:54


1. ## inequalities: 2 methods

Hi guys,

I am trying to find the values of x for which

$x - 3 < \frac{x - 4}{x}$

Attached is a diagram from which it is easy to see the answer x < 0! i.e these are the values of x for which the straight line x - 3 is below the curve (which I have expressed as:

$1 - \frac{4}{x}$

But, as we all know, inequalities can be solved in three ways: by sketching, by calculation and by completing the square. So I have tried it by calculation - here goes:

$x - 3 < (x - 4) / x$

$x^2 - 3x < x - 4$

$x^2 - 4x + 4 < 0$

$(x - 2) (x - 2) < 0$

$(x - 2)^2 < 0$

Now since (x - 2) is squared no matter what value x takes the result is always positive so it seems to me there is no solution here. Can anyone see what I am doing wrong!

2. Originally Posted by s_ingram
...So I have tried it by calculation - here goes:

$x - 3 < (x - 4) / x$

$x^2 - 3x < x - 4$

$x^2 - 4x + 4 < 0$

$(x - 2) (x - 2) < 0$

$(x - 2)^2 < 0$

... Can anyone see what I am doing wrong!
You assumed that $x \geq 0$. If you do the calculations for x < 0 you'll get the result which you already know.

3. Originally Posted by s_ingram
$x - 3 < (x - 4) / x$

$x^2 - 3x < x - 4$

$x^2 - 4x + 4 < 0$

$(x - 2) (x - 2) < 0$

$(x - 2)^2 < 0$

Now since (x - 2) is squared no matter what value x takes the result is always positive so it seems to me there is no solution here. Can anyone see what I am doing wrong!
I wouldn't multiply both sides by x. Instead, I would do this:
\begin{aligned}
x - 3 &< \frac{x - 4}{x} \\
x - 3 - \frac{x - 4}{x} &< 0 \\
\frac{x^2 - 3x}{x} - \frac{x - 4}{x} &< 0 \\
\frac{x^2 - 4x + 4}{x} &< 0 \\
\frac{(x - 2)^2}{x} &< 0
\end{aligned}

At this point I would make a sign chart. First, I need "critical points." These are values which (1) the fraction equals 0, and (2) the fraction is undefined. I find (1) by setting the numerator equal to zero:
\begin{aligned}
(x - 2)^2 &= 0 \\
x - 2 &= 0 \\
x &= 2
\end{aligned}

I find (2) by setting the denominator equal to zero: x = 0.

Then I draw my sign chart like this:
Code:
         und              0
----------+---------------+-------------
0               2
(und = undefined)

Now take the fraction
$\frac{(x - 2)^2}{x}$ and test a value less than 0. You will see that the fraction is negative, so I make a notation on my sign chart.
Code:
  (-)^2
-----
(-)   und              0
----------+---------------+-------------
neg    0               2
Pick a number between 0 and 2 and test the fraction, and then pick a number greater than 2 and test the fraction. When you're done, you should get this:
Code:
  (-)^2          (-)^2          (+)^2
-----          -----          -----
(-)    und     (+)      0     (+)
----------+---------------+-------------
neg    0      pos      2     pos
We want a range of numbers where the fraction is less than 0, or negative. So the solutions are x < 0.

01

4. Sorry, where do I assume that $x \geq 0$? If x is less than zero say -5, then $(x - 2)^2$ gives $(-7)^2 = 49$ and this is not less than 0.

5. Thanks again yeongil. I can see your method works and I have used something like it when checking the ranges of functions for which they are real or unreal, but I don't see why you would not multiply by x. Is it wrong to do so and if so why?

6. To answer both of your posts, you assumed that $x \geq 0$ when you multiplied both sides by x. Remember that when you multiply both sides of an inequality by a negative number, you flip the sign. When you went from this step:
$x - 3\;{\color{red}<}\;\frac{x - 4}{x}$
to this step:
$x^2 - 3x\;{\color{red}<}\;x - 4$
you multiplied both sides by x, and since you didn't change the sign, you assumed that $x \geq 0$.

The problem was to solve for x, and if we pretend that we do not know what x is beforehand, we shouldn't multiply both sides by x; instead, subtract the fraction from both sides and proceed like I did earlier.

01

7. Excellent answer! Now I see. I suspected Earboth was on to something but I didn't understand what he meant.


# Series converges implies $\lim{n a_n} = 0$

I'm studying for qualifying exams and ran into this problem.

Show that if $\{a_n\}$ is a nonincreasing sequence of positive real numbers such that $\sum_n a_n$ converges, then $\lim_{n \rightarrow \infty} n a_n = 0$.

Using the definition of the limit, this is equivalent to showing

$$\forall \varepsilon > 0 \; \exists n_0 \text{ such that } |n a_n| < \varepsilon \; \forall n > n_0$$

or

$$\forall \varepsilon > 0 \; \exists n_0 \text{ such that } a_n < \frac{\varepsilon}{n} \; \forall n > n_0$$

Basically, the terms must be bounded by the harmonic series. Thanks, I'm really stuck on this seemingly simple problem!

• This is a classic problem. I remember it from teaching undergrad real analysis in 2005 (specifically I remember having a good think about it at the beautiful YMCA in downtown Montreal -- it took me a while to get it). I think it will be helpful to see a variety of answers. – Pete L. Clark Sep 14 '10 at 8:18
• This is indeed a nice problem, and I don't want to give it away. The hint I would give is to remember to use the condition that $a_n$ is nonincreasing. – David E Speyer Sep 14 '10 at 17:21
• Maybe this is interesting: If we omit monotonicity then $na_n$ converges to 0 statistically. (It is relatively easy to find examples showing that it need not converge in the usual sense.) Tibor Šalát; Vladimír Toma: A Classical Olivier’s Theorem and Statistical Convergence. dx.doi.org/10.5802/ambp.179 – Martin Sleziak Nov 23 '11 at 16:13
• Maybe it's too late for your exam, but I've added another answer that is fairly short and is not very notation-intensive and does not rely on standard results but works from basic definitions. (I don't even use the fact that the harmonic series diverges.) I like to keep things simple. $\qquad$ – Michael Hardy Jul 21 '16 at 2:02
• Can you tell me where did you see this problem? I'm studying for an exam and It would really help some extra problems. This seems a very good one – J.Dane Jul 27 '18 at 10:39

Some hints:

If $S_{n} = \sum_{k=1}^{n} a_{k}$

then what is

$\lim_{n \to \infty} S_{2n} - S_{n}$?

Now can you use the fact that $a_{n}$ is non-increasing to upper bound a certain term of the sequence $na_{n}$ with a multiple of $S_{2n} - S_{n}$?

• Let me give this a shot: Assuming the limit you mention tends to zero, for a given $\epsilon$, there is an integer $n_0$ such that $2 ( S_{2n_0} - S_{n_0} ) < \epsilon$. Because the sequence is nonincreasing, we have that $2n a_{2n} \leq 2 ( S_{2n_0} - S_{n_0} ) < \epsilon$ for all $n \geq n_0$. – dls Sep 15 '10 at 4:13
• @dls: Right. It is still incomplete though. You have to consider (2n+1)a_{2n+1} too. – Aryabhata Sep 15 '10 at 5:02

By the Cauchy Condensation test, $\displaystyle \sum 2^n a_{2^n}$ converges since $\displaystyle \sum a_n$ converges, and thus $2^n a_{2^n} \to 0.$ Now for $2^n < k < 2^{n+1}$,

$$2^n a_{2^{n+1}} \leq k a_{k} \leq 2^{n+1} a_{2^n}$$

so $n a_n \to 0.$

Now that enough time has passed so that more information will not spoil anything for the OP:

This fact can be found in $\S 179$ of G.H. Hardy's seminal A Course of Pure Mathematics: he mentions that it was first proved by Abel, then forgotten and later rediscovered by Alfred Pringsheim. I have reproduced Hardy's proof in $\S 2.4.2$ of these notes on infinite series. This is much slicker than what I came up with when I had to solve this exercise myself some years ago. On the other hand it seems to be exactly what Aryabhata's answer hints at.

In my notes I also attribute this result to L. Olivier and even cite the issue of Crelle's Journal in which it appears in 1827. This attribution does not appear in Hardy's book, which temporarily mystified me (I am no historian of mathematics: whatever such information I have comes from math books with good bibliographies), but I surmise I must have gotten it from Konrad Knopp's book on infinite series (the only other book I own which treats the subject seriously).

P.S.: The wikipedia article on Pringsheim is unusually (almost suspiciously?) good. The impression that I have of him as a mathematician is someone who worked on infinite series at a stage when the foundations of the theory were finally solidly in place...and when the best mathematicians of the day had gone on to more fundamental and difficult problems. But I don't know whether this is at all fair. Anyway, it seems that you won't hear of him until you learn a little more about series than is treated in the standard contemporary curriculum, but as soon as you do his name comes up again and again.

• Re: P.S.: The English Wikipedia page is almost a verbatim copy of the German one. The Pringsheim family is very well known in Germany due to its influence in Munich over centuries, and also due to fact that Alfred P.'s daughter was married to Thomas Mann who certainly contributed to making the family's fate in the first half of the twentieth century known to a wide audience. – t.b. Nov 23 '11 at 7:23
• @t.b.: Thanks for this. I vaguely noticed the connection to Thomas Mann in the wikipedia article, but it didn't really sink in. – Pete L. Clark Nov 23 '11 at 16:04
• Interestingly, it seems that Olivier's paper contained a mistake and later Abel wrote a paper to correct it. Details can be found e.g. in Michael Goar: Olivier and Abel on Series Convergence, Mathematics Magazine Vol. 72, No. 5 (Dec., 1999), pp. 347-355 jstor. To add also a freely available paper, it is briefly mentioned here. (The later is the paper where I've read about Olivier's mistake for the first time.) – Martin Sleziak Aug 15 '12 at 11:07

I think I have an answer which doesn't rely on being clever enough to use the even and odd subsequences.

Because the series converges the sequence of partial sums forms a Cauchy sequence so we have for m,n>N

$$\| \sum_m^n(a_i) \| < \epsilon$$

And by a similar argument to those above: $\|(n-m)a_n \| \leq \| \sum_m^n(a_i) \| < \epsilon$ Distributing out the left hand side and spliting the inequality gives us the chain:

$$\| na_n \|-\|ma_n\|\leq \|(n-m)a_n \| \leq \| \sum_m^n(a_i) \| < \epsilon$$

Then in the limit as n goes to infinity and fixing m we have the desired result since $ma_n$ will go to zero.

I think... ?

Try to stay away from quantifier-laden formulas, which make the problem harder to understand, and draw a picture. There is an equivalent problem for decreasing functions (as in the Integral Test for convergence) and the picture makes it obvious what is true in that case. Having seen the continuous proof, run the same argument for the sequence, or specialize the function to a sequence by using step functions or approximation thereof. I won't spoil the "aha!" proof-by-picture experience by posting more details, but it is quite easy once you draw the graph.

Note that the desired conclusion is not true if the $a_n$ are not assumed to be nonincreasing:

We know a couple of facts:

1. If a sequence $(s_n)_{n\geq1}$ converges then we have that
$\displaystyle\qquad\liminf_{n\to\infty} s_n = \lim_{n\to\infty} s_n = \limsup_{n\to\infty} s_n$.

2. There is a summable series $\sum_{n=1}^\infty a_n$ with non-negative $a_n$ such that $\limsup\limits_{n\to\infty} na_n > 0$.

Take these two together you get that the best you can hope to prove in this slightly more general situation is that $\liminf\limits_{n\to\infty} na_n = 0$, and that is indeed true.

For an example showing that 2 above is true, consider this: We start with the harmonic series and observe that
$\displaystyle\qquad \limsup_{n\to\infty} n\cdot \tfrac1n = 1$,
but it isn't summable. But we could replace infinitely many of the sequence elements by zeroes without changing the limit superior from being $1$. Define $S(n)$ to be $1$ when $n$ is a perfect square and $0$ otherwise. Then $a_n = \frac{S(n)}n$ has the desired property as
$\displaystyle\qquad \sum_{n=1}^\infty a_n = \sum_{n=1}^\infty \frac{S(n)}n = \sum_{k=1}^\infty \frac1{k^2} < \infty$.

• Note that $a_n$ is supposed to be nonincreasing. Your sequence isn't. – mrf Sep 12 '13 at 20:01
• Ah. Miss one word and the whole thing goes down the crapper. Typical. Well now it's fixed at least. And CW just for good measure. – kahen Sep 12 '13 at 20:02

Let $\epsilon > 0$.

Let Let $s_n=\sum_{k=1}^n a_k$.

$\{s_n\}$ converges, therefore $\{s_n\}$ is Cauchy which implies $\exists$ some $N$ such that $m, n \geq N$ implies $\left | s_n-s_m \right | < \epsilon$

Consider $m=N$, for $n \geq N$ we have $\left | s_n-s_N \right | < \epsilon$,
$\Rightarrow \left | a_N + a_{N-1} + a_{N-2}+\cdots +a_n \right | < \epsilon$,
$\Rightarrow \left | a_n + a_{n} + a_{n}+\cdots +a_n \right | \leq \left | a_N + a_{N-1} + a_{N-2}+\cdots +a_n \right | < \epsilon$ $\Rightarrow \left (n-N)| a_n\right | \leq \left | a_N + a_{N-1} + a_{N-2}+\cdots +a_n \right | < \epsilon$
$\Rightarrow (n-N)\left| a_n\right | < \epsilon$

So, $\lim_{n \rightarrow \infty } (n-N)a_n = 0$
$\lim_{n \rightarrow \infty } na_n - \lim_{n \rightarrow \infty } Na_n = 0$
From above, since {$a_n$}$\rightarrow 0$, {$na_n$}$\rightarrow 0$ $\blacksquare$

• Shouldn't it be $|a_N + a_{N+1} + \ldots + a_n|$ since $n \ge N$? – philmcole Jan 13 '18 at 10:07
• Very clear and nicely explained. Thanks – StammeringMathematician Jul 28 at 18:31

Here's one more approach : By Cauchy's general principle of convergence :

$\forall \epsilon>0, \exists ~p \in \mathbb N , \exists ~m> N: |a_{m+1}+a_{m+2}+ \cdots + a_{m+p}| < \epsilon$.

Choose:$p = n-m$ .

$|a_{m+1}+a_{m+2}+ \cdots + a_n| < \epsilon$.

Now, since $a_n$ is non increasing and $\epsilon \rightarrow 0$: the above relation can be written as :

$(n-m)a_n = 0 \implies na_n = ma_n$

For a convergent series. $\lim a_n=0 \implies \lim_{n \rightarrow \infty} n a_n = 0$

• You seem to claim that directly from $(n-m)a_n<\varepsilon$ you get $(n-m)a_n=0$. This argument is not correct, since $m$ depends on $\varepsilon$. (But you still get $(n-m)a_n<\varepsilon$. For a fixed $\varepsilon>0$ and for $m$ corresponding to this $\varepsilon$.) – Martin Sleziak Apr 4 '16 at 4:27

You might also do this the other way around. What if $$\lim_{n\to\infty}na_n \not=0,$$ that is if the limit does not exist or if it is positive, what does this tell you about $a_n$? What about sub-sequences of $(a_n)$?

• I can't see how this works. The easy part - if the limit exists and is positive, then $\sum a_n$ diverges like a harmonic series, contradiction. The harder part, if the limit does not exist - There there exists a subsequence and an $\epsilon > 0$ such that $n_k a_{n_k} > \epsilon$ for all $n_k$. But that itself does not imply the result. Did you have something else in mind? – Ragib Zaman Oct 11 '11 at 15:03

If the sequence is strictly decreasing, I guess there is a neat little argument. Look at the series $\sum n a_n$ and define $\rho_n=\frac{(n+1)a_{n+1}}{na_n}$. Then $\rho_n=\frac{a_{n+1}}{a_n} \frac{(n+1)}{n}$. We have that $\lim_{n \to \infty} \frac{(n+1)}{n}$ exists and is equal to $1$. As $(a_n)$ is strictly decreasing and the terms are positive, we have $\frac{a_{n+1}}{a_n} < 1$ Therefore the limit $\lim_{n \to \infty} \frac{a_{n+1}}{a_n}$ exists and is smaller than $1$. So $\lim_{n \to \infty} \rho_n$ exists and is smaller than 1, and thus by the ratio test the series $\sum n a_n$ converges. Hence $n a_n \to 0$.

• Consider $a_n = \frac{1}{n^2}$. Then the limit of ratios is $1$. – Daniel Fischer Apr 27 '14 at 21:59
• Oh my, you are right. Nevermind then. – José Siqueira Apr 27 '14 at 22:06
• Still, looking at a series is a nice trick when you want to prove a limit is 0. – José Siqueira Apr 27 '14 at 22:10

If $\lim\limits_{n\to\infty} n a_n\ne 0$, then for some $\varepsilon>0$, there are infinitely many $n$ for which $a_n \ge \dfrac \varepsilon n.$

If $a_n \ge \dfrac \varepsilon n,$ then let $m = \lfloor \log_2 n \rfloor$, so that $2^m\le n < 2^{m+1}$. Then $$a_{2^{m-1}} + \cdots + a_{2^m} \ge 2^{m-1} a_{2^m} \ge 2^{m-1} a_n \ge \frac{2^{m-1}\varepsilon} n \ge \frac{2^{m-1}\varepsilon} {2^{m+1}} = \frac \varepsilon 4.$$

Then go on to the next $n$ for which $a_n \ge \dfrac \varepsilon n$, and if it's not big enough for the resulting sequence $a_{2^{m-1}} + \cdots + a_{2^m}$ to have a different (larger) value of $m$ than the one we just saw, then go on to the next one after that, etc.

We get infinitely many disjoint sets of terms with sums exceeding $\dfrac \varepsilon 4$.

Let $\epsilon$ be given. By Cauchy, there exists $N(\epsilon)$ in $\mathbb{N}$ such that: $a_N+a_{N+1}+....+a_{N+P}<\epsilon$, for every $P$ in $\mathbb{N}$. Note that for every chosen $P$, there are $P$ $a_n$'s on the left side of the inequality, not all of which can exceed $\dfrac{\epsilon}{P}$. Anyway, since $a_n$ is non increasing, $a_{N+P}$ is always less than $\dfrac{\epsilon}{P}$. We have then:

$$a_{N+P}<\dfrac{\epsilon}{P}, \forall P \in \mathbb{N}$$ Multiplying by $N+P$ at each side of the inequality: $$(N+P)a_{N+P}<\dfrac{(N+P)\epsilon}{P}$$

"Throwing" $p$ to ininity, we can see then that for $n$ large enough, $na_n$ is almost less than $\epsilon$.

Taking $\dfrac{\epsilon}{2}$ instead of $\epsilon$, we can guarantee that $na_n$ is less than $\epsilon$ for $n$ large enough, completing the proof.

Suppose $n_ja_{n_j}\geq \alpha>0$ and up to (infinity) subsequence assume $n_{j}-n_{j-1}\geq n_{j}/2$.

Using that $a_n\geq 0$ we get

$$\displaystyle A=\sum_{n=1}^\infty a_n =\sum_{n=1}^{n_0} a_n+\sum_{j=1}^\infty\sum_{n=n_{j-1}+1}^{n_j}a_n\geq B+\sum_{j=1}^\infty\sum_{n=n_{j-1}+1}^{n_j}a_{n_j}\geq B+\sum_{j=1}^\infty(n_{j}-n_{j-1})a_{n_j} \\\geq B+\sum_{j=1}^\infty\frac{n_{j}}{2}a_{n_j}\geq B+\frac{1}{2}\sum_{j=1}^\infty{n_{j}}{}a_{n_j}=\infty. \ QED.$$

Let $$f: (0, \infty)\to [0, \infty)$$ be a continuous, non-increasing function such that $$f(n)=a_n$$ for all $$n \in \mathbb{N}.$$ Such a function certainly exists (for $$x \in (n, n+1)$$ let $$f(x) = a_n + (a_{n+1}-a_n)(x-n)$$)

Since $$\displaystyle \sum_{n=1}^{\infty}f(n) = \displaystyle \sum_{n=1}^{\infty} a_n$$ converges, by the integral test, $$\displaystyle \int_{0}^{\infty}f(x)dx < \infty.$$

Claim: $$\displaystyle\lim_{x\to \infty}xf(x)=0.$$

We reproduce the argument that JLA gave here, begin by noting that $$\displaystyle \lim_{t \to \infty}\int_{t/2}^{t}f(x)dx=0.$$ Then $$0 \leq \dfrac{t f(t)}{2}\leq \displaystyle \int_{t/2}^{t}f(x)dx \to 0$$ as $$t \to \infty$$ and the claim holds.

In particular, $$\displaystyle \lim_{n\to \infty}nf(a_n) =0$$ and we are done.


# If $f$ is continuously differentiable in $[a,b]$, $f(a)=f(b)$, and $f'(a)=f'(b)$, then there exist $a<x_1<x_2<b$ such that $f'(x_1) = f'(x_2)$.

This problem is from Apostol's Mathematical Analysis:

Let $f$ be continuously differentiable in $[a, b]$. If $f(a) = f(b)$ and if $f^{'}(a) = f^{'}(b)$, then prove that there exists $x_1$ and $x_2$ in $(a, b)$ such that $x_1\neq x_2$ but $f^{'}(x_1) = f^{'}(x_2)$.

My try:

By Rolle's Theorem $\exists x_0\in (a,b)$ such that $f^{'}(x_0)=0$. How to guarantee existence of $x_1,x_2$ from here?

Can it be solved from a geometrical point of view?

• you don't know that $f'(a)=f'(b)=0$ – tattwamasi amrutam Oct 2 '15 at 8:53
• Geometrical point of view. At point a the function is going at a rate of f'. if that's positive the function is going up. At point b, f(a) = f(b) so the function had to have come down again. That means that somewhere f' was neg. But the means somewhere f' had to be zero. But right now at b f' is positive again. But that means it had to go from negative to positive. That means there was another point in between where f' was zero. Recap: function going up at a, peaks, f' = 0, goes down, plateaus, f' = 0 goes up again, reaches b. It's the only possibility. – fleablood Oct 2 '15 at 9:05
• It will be nice to mention why you downvote and let people think and learn from your comments on their wrong answers. – Math-fun Oct 2 '15 at 9:41
• thanks for your useful comments@fleablood – Learnmore Oct 3 '15 at 3:30

As you said, by Rolle's Theorem, we are guaranteed existence of $c \in (a,b)$ such that $f'(c) = 0$. WLOG, let $f'(a) = f'(b) = k > 0$. By the continuity of $f'$ and the intermediate value theorem, we get existence of $c_1 \in (a,c)$ such that $f'(c_1) = k_1$ where $0<k_1<k$. Similarly, we get $c_2 \in (c,b)$ such that $f'(c_2) = k_1$.

Now, if $f'(a) = 0$, then let's look at some cases. If $f(c) \neq f(a)$, then the mean value theorem gives existence of $d \in (a,c)$ such that $\alpha = f'(d) = \frac{f(c) - f(a)}{c - a}\neq 0.$ Now, we can apply the above argument again.

If $f(c) = f(a) = f(b)$, then if $f'$ is nonzero at some point in the interval, the above argument works. Otherwise, $f'$ is $0$ and the result follows.

(i) Let's suppose that $f'(a)>0$ (then we'll see the case $f'(a)=0$). Because of (i), you can find a $\eta > 0$ (as small as it is) that we have $f(a + \eta) > f(a)$ and $f(b - \eta) < f(b)$.

$f$ is continuous on $[a + \eta, b-\eta]$, therefore there exists $c \in [a + \eta; b - \eta]$ so that $f(c) = f(a) = f(b)$. ($f(c)$ in $[f(a+\eta], f(b-\eta)])$.

$f$ is continuous on both intervals $[a, c]$ and $[c, b]$ and reach its maximums in a $x_1$ and $x_2$ ($x_1$ in $(a, c)$ and $x_2$ in $(c, b)$ because $a, c$ and $b$ are not the maximum since $a+\eta$ and $b-\eta$).

We have $f'(x_1) = f'(x_2) = 0$

Opposite reasonning for $f'(a)<0$ leading to the same conclusion

(ii) if $f'(a) = 0$ because of Rolle's theorem you know that you have a $c$ in $(a,b)$ that $f'(c) = 0$. Assume that $f(c) = f(a)$ (then we reapply this reasonning on $a$ and $c$ instead of $a$ and $b$ until finding a $c_n$ that $f(c_n)$ is different from $f(a)$, if we can not find one then $f$ is constant and any $c_1<c_2$ in $(a, b)$ will do)

We have a $f(a) < f(c)$ and $f'$ continuous on $[a, c]$ and $f'(a) = f'(c) = 0$ but $f'$ not equal to $0$ and it exists a $c_1$ in $(a, c)$ so that $f'(c_1)>0$ because $f(a) < f(c)$.

Because of that and $f'$ continuous on this interval, $f'$ reaches its maximum in $d$ in $(a;c)$ and because of its continuity $f'$ reaches $f'(d)/2$ in two points $x_1,x_2$, where $a<x_1<d<x_2<c<b$.

• i dont understand the down votes, because the arguments seems fine to me. – Lost1 Oct 3 '15 at 1:57
• The format was messy. @Lost1 – user99914 Oct 3 '15 at 3:48


# Moving average process - stationarity

If we consider a moving average process of order 1, is that stationary?

Because, although, the mean will remain the same for Yt and Yt+k, the variance and co-variance will change if you calculate for Yt+k, so in that case, why is it stated as stationary?

Can anyone explain: how do you know if a moving average process is weakly stationary, strictly stationary or non stationary?

A stochastic process is weakly stationary if its mean and variance and covariances are finite and do not depend on time.

A moving average process of order q (with q finite), $$MA(q)$$ is defined as:

$$y_t = \epsilon_t + \alpha_1 \epsilon_{t-1} + \alpha_2 \epsilon_{t-2} + \dots + \alpha_q \epsilon_{t-q}, \quad \epsilon_t\sim WN(0,\sigma^2),$$

and is weakly stationary for all the values of $$\alpha_j$$.

So, in your example it is true that the variance and covariances change, but you can check that both are finite and do not depend on $$t$$ (the covariance will depend only the distance $$k$$).

Moreover, even a moving average process of infinite order $$MA(\infty)$$:

$$y_t = \sum_{j=0}^\infty \alpha_j \epsilon_{t-j}$$

can be stationary, but we need an additional condition in order to have a finite variance:

$$\sum_{j=0}^\infty|\alpha_j|<\infty.$$

• Thank you. Is every moving average process weakly stationary? – user218970 Mar 10 at 10:10
• Yes, and I edited the answer with some more details. – pdb Mar 10 at 10:52
• thank you so much for your additional explanation. But the previous answer stated that MA(1) process is strictly stationary. – user218970 Mar 10 at 12:55
• If you assume that the elements of the white noise process $\epsilon_t$ are also indipendent (and not only uncorrelated) and identically distributed, then the moving average process is strictly stationary. – pdb Mar 10 at 14:02

First see what definitions say

• $$\{X_t\}$$ is strictly stationary if for any $$t_1,t_2,...,t_n \in T$$ and any $$k \in T$$
$$P(X_{t_1},...,X_{t_n}) = P(X_{t_1+k},...,X_{t_n+k})$$ that is, we have statistical equilibrium.

• $$\{X_t\}$$ is second order/weakly stationary if

1. $$\mathbb{E}[X_t] = \mu < \infty$$, independent of $$t$$
2. $$Var(X_t) = \sigma^2 <\infty$$ , independent of $$t$$
3. $$cov(X_t,X_{t+\tau})$$, is a function of $$\tau$$ only.

Think of what weakly stationarity means. It means that the expected value of the process is finite and constant. It also means that the autocovariance does not depend on where two random variables are positioned but just on their distance! Autocovariance between today and yesterday same as autocovariance between 100 days and 101 days ago.

Now take the MA(1) process $$\boxed{ X_t = \varepsilon_t + \theta \varepsilon_{t-1} }$$ where $$\varepsilon_t \sim WN(0,\sigma^2)$$.

This process is weakly stationary as

• $$\mathbb{E}[X_t] = \mathbb{E}[\varepsilon_{t}] + \theta \mathbb{E} [\varepsilon_{t-1}] = 0$$
• $$Var(X_t) = \sigma^2(1+\theta^2)$$, i.e. independent of $$t$$
• $$cov(X_t,X_{t-\tau}) = \theta \sigma^2, |\tau|=1$$, $$cov(X_t,X_{t-\tau}) = 0, \forall |\tau|>1$$ hence function of $$\tau$$ only.

(if you have difficulties deriviting that, let me know. It is very straightforward and you shouldn't have any difficulties)

MA(1) is also strictly stationary as both $$P(X_{t_1},...,X_{t_n})$$ and $$P(X_{t_1+k},...,X_{t_n+k})$$ multivariate (1-dependent) Normal distributions with identical parameters as it is a combination of WN random variables.

Edit to provide further explanation: Each $$X_{t_1},..X_{t_n}$$ is a linear combination of independent Gaussian random variables,. In particular all $$X_{t_i} \sim N(0, \sum_{j=1}^{q} \theta_j^2 \sigma^2) \forall j$$. The joint distribution of normal random variables is a multivariate normal. As they are all driven by an MA(q) process their covariance matrix can be easily derived. But as seen above, this does not depend on location, just on distance. Explicitly for MA(1):

$$f_{\mathbf {X} }(X_{t_1} \dots X_{t_n})={\frac {\exp \left(-{\frac {1}{2}}{\mathbf {X} }^{\mathrm {T} }{\boldsymbol {\Sigma }}^{-1}{\mathbf {X} }\right)}{\sqrt {(2\pi )^{k}|{\boldsymbol {\Sigma }}|}}}$$

where

$$\boldsymbol {\Sigma } = \begin{bmatrix} \sigma^2(1+\theta^2) & \theta \sigma^2 & 0 & 0 & \dots & 0 \\ \theta \sigma^2 & \sigma^2(1+\theta^2) & \theta \sigma^2 & 0 & \dots & 0 \\ 0 & \theta \sigma^2 & \sigma^2(1+\theta^2) & \theta \sigma^2 & \ddots & \vdots \\ 0 & 0 & \ddots & \ddots & \ddots & 0 \\ \vdots & \vdots & \ddots & \ddots & \ddots & \theta \sigma^2 \\ 0 & 0 & \dots & 0 & \theta \sigma^2 & \sigma^2(1+\theta^2) \end{bmatrix}$$

Hence MA(q) processes driven by Gaussian noise are always strictly stationary (only condition is that the sum of MA coefficients should be finite)

In general, all weakly stationary Gaussian processes are strictly stationary too.

• Thank you so much, yes I can derive that - no problem. Although, in the end, I did not understand the 'strictly stationary' part. I have read that MA(2) process is weakly stationary. How do their results differ? Could you elaborate, please? – user218970 Mar 10 at 10:08
• MA(q) is also strictly stationary. See addition – Stats Mar 10 at 14:25
• I'm a beginner in time series and therefore most of the matrices and notation is lost on me. I'm sorry for that. Can you explain me in simple terms that how should I go about figuring out the differences between strictly and weakly stationary from my derivation answers? – user218970 Mar 10 at 17:56
• If you want to understand what strict stationarity means, it is highly essential you understand the basic multivariate distributions like the multivariate normal distribution. Strict stationarity has to do with the joint distribution of random variables, you will not be able to understand anything without first understanding what a joint distribution is. Could you please do this first? – Stats Mar 10 at 18:24


# Rolling dice such that they add up to 13 — is there a more elegant way to solve this type of problem?

Here is the problem:

There are $6^3$ possible outcomes to rolling a die $3$ times. Out of these, how many yield a total of (exactly) $13$ dots?

My solution would be absolutely impractical for problems involving $4$ rolls of the die. And at higher numbers it would be downright impossible without brute-forcing it with a computer.

Is there a more elegant way to solve this type of problem?

My solution:

First we find all sets $\{a, b, c\}$ such that $a + b + c = 13; \; a, b, c \le 6$:

$\{1, 6, 6\}$

$\{2, 5, 6\}$

$\{3, 4, 6\}, \{3, 5, 5\}$

$\{4, 4, 5\}$

The total number of sets that fit these criteria is $5$. If $a \not= b \not= c$, then there exist $3!$ unique permutations of $\{a, b, c\}$. If $a = b \not= c$, then there exist $3$ unique permutations of $\{a, b, c\}$. -- There cannot be a set such that $a = b = c$.

There are $2$ sets of the first kind and $3$ of the second. It follow that the total number of triple die rolls that can fit the criteria is

\begin{equation*} 2 \cdot 3! + 3 \cdot 3 = 21 \end{equation*}

I can think of a second way to do it, which might be faster for slightly larger numbers... but essentially still comes down to brute force, not a method that can be generalized.

-
If you're going for elegant, I think the method from Fool's answer below is nice. Basically the computation is reduced to $\binom{12}{2} - 3 \cdot \binom{6}{2}$, with no brute-forcing, and no counting possibilities manually. Just some algebra. –  TMM Sep 28 '11 at 1:22
Could whoever downvoted this explain why? And also explain why they didn't post such an explanation here? –  Michael Hardy Sep 28 '11 at 11:06

## 5 Answers

Here's one approach which is suitable in various circumstances.

Consider the expression $(x+x^2+x^3+x^4+x^5+x^6)^3$. What is the coefficient of $x^{13}$ when you expand this out?

The expression can also be re-written as $\left(\frac{x(x^6-1)}{x-1}\right)^3$ to make it less unwieldy to work with. The coefficient of $x^k$ can be extracted by taking derivatives, for example.

This is a very useful tool which can be applied in much more general situations, as you may observe. For instance you could replace $1+x+\ldots+x^6$ by some other expression to represent dice with more faces, or dice with arbitrary faces, or dice with weights, etc.

-
Interesting! thanks. –  iDontKnowBetter Sep 27 '11 at 22:36
Including $1$ in the expression is equivalent to having seven sided dice with numbers $0$ through $6$. It doesn't hurt with $13$, but would with $11$, because you could afford a $0$. –  Ross Millikan Sep 27 '11 at 22:37
You're welcome. Note that I corrected my expression slightly to account for the fact that a die can't come up 0 - it doesn't change the answer in this case since 13 cannot be attained with 0's. –  Alon Amit Sep 27 '11 at 22:39

In this case it's easier to find the number of triples $(a,b,c)$ that sum up to 8. If $(a,b,c)$ are possible dice rolls that sum up to 8, then $(7-a,7-b,7-c)$ are also possible dice rolls and sum to 13. In general the number of ways to make $x$ and $21-x$ on three dice are the same. (With two dice, of course, the number of ways to make $x$ and $14-x$ are the same.)

Of course this is still brute force, but it's good to take advantage of symmetry -- for example, if you had been asked to find the number of outcomes giving $k$ dots for all of $k = 3, 4, \ldots, 18$, you could save yourself time by doing only half of them.

One way to do this for an arbitrary number of dice is as follows: let $N(d,s)$ be the number of ways to roll a sum of $s$ with $d$ dice. (So you're trying to find $N(3,13)$.) In order to get a sum of $s$ with $d$ dice, you must have a sum of between $s-6$ and $s-1$ on the first $d-1$ dice, and then roll the appropriate number on the final die. So you have $$N(d,s) = N(d-1, s-1) + N(d-1, s-2) + \cdots + N(d-1, s-6)$$ where we start with $N(0,0) = 1$ and $N(0,s) = 0$ for all other integers $s$. You can rearrange this to get $$N(d,s) = N(d, s-1) + N(d-1, s-1) - N(d-1, s-7)$$ and so you can compute each $N(d,s)$ with just one addition and one subtraction.

The generating-function method is actually the same as this, once you think about how polynomial multiplication works.

-
+1 for the method in your third paragraph, which is very easy to implement on a spreadsheet, especially if you have six blank rows at the top of your table. –  Henry Sep 27 '11 at 23:37

If I have understood your problem correctly then I guess we could use the stars and bars concept for a clever solution.

For example in your case,

$$x_1+x_2+x_3 = 13$$

Number of positive integer solution possible such that $x_i \ge 1$ is given by $\binom{12}{2}=66$.

Then set $x_1'=x_1+6$,so the equation reduces to: $$x_1'+x_2+x_3=7$$

which gives $15$ possible solution,using the same thing for $x_2$ and $x_3$ we would see that we have over-counted $3\times15$ solutions in our first calculation,hence subtracting $66-45=21$.

-
(+1) I was going to post a link to your earlier question but I see you already posted an answer using that method :) –  TMM Sep 28 '11 at 0:04

One way is generating functions: form $(x+x^2+x^3+x^4+x^5+x^6)^3$ and find the coefficient of $x^{13}$

-
Ah, the very last chapter in my combinatorics book is titled "generating functions", though I've not gotten there yet. Thanks. (This is from my current probability course, which starts with basic combinatorics). –  iDontKnowBetter Sep 27 '11 at 22:39
If you want to learn more about generating functions, you should take a look at Herb Wilf's book "generatingfunctionology", which can be found free online. (This is legal; Wilf has posted the book on his web page.) This book is probably best read after you know some combinatorics and some probability. –  Michael Lugo Sep 28 '11 at 1:03

If you throw the die a very large number of times, maybe there would be some difficulty in finding the exact number of ways in which a certain total can appear. But the central limit theorem from probability theory can give some reasonable approximations.

Say you throw the die 40 times. On average the sum is 140. There are $6^{40}$ possible outcomes. How many of those give a total in the closed interval $[135,150]$?

When you throw a die once, the variance of the probability distribution of the number of dots you see is $35/12$, so when you throw it 40 times, the variance is $40\cdot35/12= 10\cdot35/3$, and the standard deviation is therefore $\sqrt{350/3} = 10.801234497\ldots\ {}$. For this discrete distribution, "$\ge 135$" is the same as "$>134$" and "$\le 150$" is the same as "$<151$", so we do a continuity correction and look at the interval $(134.5,150.5)$. The number $134.5$ is $(134.5-140)/10.801234497\ldots)$ standard deviations above the mean, i.e. about $0.5092$ standard deviations below the mean, and $150.5$ is about $0.972$ standard deviations above the mean. Plugging these into the cumulative probability distribution function $\Phi$ of the normal distribution, we get a probability of about $\Phi(0.972)-\Phi(-0.5092)=0.529$.

So $0.529 \times 6^{40} \approx 7.074\times 10^{30}$ is approximately how many ways there are to get a sum in that interval.

-
Could whoever downvoted this explain why? And also explain why they didn't post such an explanation here? –  Michael Hardy Sep 28 '11 at 5:40
Don't sweat it. Random downvotes are more than balanced by random upvotes. –  TonyK Sep 28 '11 at 9:52
The concern is of course that it may not have been "random". Indeed, that is what one must presume. –  Michael Hardy Sep 28 '11 at 11:05
Yeah but still. –  TonyK Sep 28 '11 at 11:51
To suggest that "random downvotes are more than balanced by random upvotes" is to suggest that the concern here is about the number of reputation points. That's not what it is. Apply a bit of common sense here. –  Michael Hardy Sep 28 '11 at 15:02


# In the figure, a quarter circle, a semicircle and a circle are mutually tangent inside a square of side length $2$. Find the radius of the circle.

In the figure, a quarter circle, a semicircle and a circle are mutually tangent inside a square of side length $$2$$. Find the radius of the circle.

I first assumed that when a vertical line is drawn from the radius of the semicircle, that line would be tangent to the smallest circle and it would mean that the radius is $$\frac{1}{4}$$, but the correct answer was $$\frac{2}{9}$$. I also tried using coordinate geometry, but I got stuck because I did not know how to get the equation of the smallest circle.

• $2/9$ seems to be very much too large simply from eyeballing the figure. Should it be the diameter of the circle rather than its radius? – hmakholm left over Monica May 6 '19 at 11:41
• @HenningMakholm: I've confirmed that $2/9$ is correct. I submit that it also looks plausible. The diameter of the circle looks to be slightly less than the radius of the semicircle, and the diameter of the semicircle looks to be about half the side of the square (in fact, it's exactly half). So, the radius of the circle should be just shy of $1/4=0.25$; and $2/9=0.222\ldots$ is in that ballpark. – Blue May 6 '19 at 12:00
• @Blue: Ah, sorry, I missed that the outer square has side length $2$ rather than $1$. – hmakholm left over Monica May 6 '19 at 13:05
• Sounds like the start of a joke... – Asaf Karagila May 7 '19 at 12:43

Look at the picture:

From $$\triangle ABE$$ we have $$(2+r)^2= 2^2+(2-r)^2$$ so $$r=1/2$$. From $$\square ECGF$$ we have $$CG^2=(1/2+s)^2-(1/2-s)^2= 2s$$. From $$\square ADGF$$ we have $$GD^2= (2+s)^2-(2-s)^2= 8s$$. So $$2=CG+GD=3\sqrt 2\sqrt s$$, hence $$s=2/9$$.

• It's surprising to me that the length of the square's sides are an integer multiple of the circle's radius. – BlueRaja - Danny Pflughoeft May 6 '19 at 16:10
• Could you explain the calculation of $CG^2$ and $GD^2$? What principle are you invoking here? You appear to have applied some formula (perhaps some standard formula that applies to trapezia), but it is unknown to me. – Hammerite May 6 '19 at 16:26
• @Hammerite If $H$ is the foot of the perpendicular from $F$ to $EC$, then $CG=FH$, and then apply Pythagorean theorem on $\triangle FHE$ to find $FH$. And the same trick for $GD$. – SMM May 6 '19 at 16:37
• @BlueRaja-DannyPflughoeft Yes, in general $r=a/4$ and $s=a/9$, where $a$ is the side of the square. – SMM May 6 '19 at 16:46
• @SMM: Yes, those values are obvious from this answer, but that gives no intuition as to why the multiple should be an integer. I think Blue's answer below gives that, though. – BlueRaja - Danny Pflughoeft May 6 '19 at 21:17

@SMM's proof is nicely self-contained. Here's one that invokes the Descartes "Kissing Circles" theorem, simply because everyone should be aware of that result.

Let the quarter-, semi-, and full-circles have radius $$a$$, $$b$$, $$c$$, respectively.

From the right triangle, we have $$a^2+(a-b)^2=(a+b)^2 \quad\to\quad a=4b \tag{1}$$

Considering the side of the square a circle of curvature $$0$$, that special case of the Kissing Circles theorem implies $$\frac1{c} = \frac{1}{a}+\frac{1}{b}\pm 2\sqrt{\frac{1}{a}\cdot\frac{1}{b}} = \frac{5}{4b}\pm 2\sqrt{\frac{1}{4b^2}} = \frac{5\pm 4}{4b}\quad\to\quad c = \frac49 b \;\text{or}\; 4b\;\text{(extraneous}) \tag{2}$$

Then, with $$a=2$$, we have $$b=1/2$$, so that $$c=2/9$$. $$\square$$

let the side of the square be $$a$$.

Let's find the radius x of the semicircle

We have $$(a+x)^2 = a^2 + (a-x)^2$$ $$x=\frac{a}{4}$$

Now, a lemma.

If circles of radiuses R and r are touching externally, then the length of their common tangent is $$2\sqrt{Rr}$$

Proof of the lemma: draw the common tangent and radiuses as in the figure. There is a right trapezium, so we get $$(R+r)^2 = h^2 + (R-r)^2$$, from where $$h = 2 \sqrt{Rr}$$.

Now, let's use the lemma. Let $$y$$ be the radius of the small circle. We have $$a = 2\sqrt{ay} + 2 \sqrt{\frac{a}{4}y}$$ $$\sqrt{a} = 3 \sqrt{y}$$ $$y = \frac{a}{9}$$

• I like this one because it taught me something useful. – richard1941 May 7 '19 at 19:03


# Conditionally combining vanilla and chocolate ice cream scoops

Suppose I have a plate that fits $n$ number of ice cream scoops. I can choose between vanilla and chocolate flavors. The only condition is that I cannot scoop for chocolate twice in a row, e.g. if $n=5$ then {$v,c,c,v,c$} is not allowed - an impossible combination - but {$c,v,c,v,c$} or {$v,v,v,v,c$} is allowed.

How many possible combinations are there? I know I have to perform the operation $${n \choose 2} - \text{impossible combinations}$$

But just how do I figure out the number of impossible combinations?

There are $2^{5}$ possible combinations. We want a recurrence to help us out. So let $T(1)$ be our recurrence denoting the number of allowed combinations for a string of length $n$. So $T(1) = 2$. Similarly, $T(2) = 2^{2} - 1 = 3$, giving us $vv, vc, cv$. Now for $T(3)$, we cannot have $ccv, vcc, ccc$. So there are $2^{3} = 8$ possible combinations and we exclude three, leaving $T(3) = 5 = T(2) + T(1)$.

So more generally, $T(n) = T(n-1) + T(n-2)$ with initial conditions $T(1) = 2$, $T(2) = 3$. We set up the characteristic polynomial and solve:

$\lambda^{2} - \lambda - 1 = 0$, which gives us eigenvalues $\lambda = \frac{ 1 \pm \sqrt{5}}{2}$.

The general form equation is: $T(n) = A \cdot (\frac{1 + \sqrt{5}}{2})^{n} + B \cdot (\frac{1 - \sqrt{5}}{2})^{n}$.

Now plug in your initial conditions and solve.

The number of impossible combinations is $2^{n} - T(n)$.

Edit: Proving T(n) holds by induction. The base cases are given in my analysis above for $T(1), T(2)$. So assume true up to $n-1$ and consider case $n$.

Now look at $T(n)$ and remove the last flavor added. If it was vanilla, there are $T(n-1)$ ways of constructing such a sequence. By the inductive hypothesis, $T(n-1)$ correctly counts the number of valid $n-1$ configurations. So adding vanilla is valid.

If the last flavor is instead chocolate, we note that the flavor before last is vanilla (otherwise, the configuration would be invalid). So there are $T(n-2)$ such strings so that the $n-1$ flavor is vanilla. And then the $n$th flavor is chocolate. Thus, $T(n) = T(n-1) + T(n-2)$, exhausting all valid possibilities.

So by the principle of mathematical induction, $T(n)$ correctly counts the valid configurations for your problem.

• $2^5$ possible combinations for $n = 5$? – Don Larynx Dec 22 '14 at 22:45
• Yes. This is a "word" problem. There are five slots: $_ _ _ _ _$. Each slot can have vanilla or chocolate, and is independent of the others. So by rule of product, we multiply, giving us $2^{5}$ possible combinations, before we impose the restriction. – ml0105 Dec 22 '14 at 22:46
• How do we know that this is a Fibonacci sequence for all $n$? – Don Larynx Dec 22 '14 at 22:53
• You can prove it by induction. We have our base cases of $n = 1, 2$ taken care of by my explanation in the post. So suppose up to $n$ and look at the $n+1$ case. Use the $n-1, n$ cases to derive that this must be true for $T(n+1)$. – ml0105 Dec 22 '14 at 22:56
• I understand how to prove the Fibonacci sequence holds, but how do we know this doesn't diverge for large enough $n$, e.g. 1,1,2,3,5,8,13,21,44(it diverged),79,333, etc... – Don Larynx Dec 22 '14 at 22:58

You want binary sequences not containing two consecutive ones.

Let $f(n)$ be the number of such sequences of length $n$.

then we have $f(1)=2,f(2)=3$.

After this we use the recursion $f(n)=f(n-1)+f(n-2)$.

Why? seperate the strings of lentgh $n$ into two kinds, those ending in $1$ and those ending in $0$.

How many end in $0$? $f(n-1)$, since after removing the last digit you must have a valid sequence of length $n-1$.

How many end in $1$? $f(n-2)$ since the secon to last digit must be $0$, and then the first $n-2$ must form a valid sequence.

Thus the sequence goes, $1,2,3,5,8,13\dots$ And so on, it is a tail of the Fibonacci sequence.

• But $f(3) = 3$, not $5$. – Don Larynx Dec 22 '14 at 22:43
• vcv,vvc,cvc,cvv,vvv – Jorge Fernández Hidalgo Dec 22 '14 at 22:47
• Oops, I was counting the number of impossible strings. – Don Larynx Dec 22 '14 at 22:47
• How do we know that this is a Fibonacci sequence for all $n$? – Don Larynx Dec 22 '14 at 22:54
• well, we proved $f(n)=f(n-1)+f(n-2)$ for all $n$, that's the recurrence ficonaccis follow by definition. – Jorge Fernández Hidalgo Dec 22 '14 at 23:01

We reason by cases. Suppose that we place down $k$ vanilla scoops first. This leaves $k + 1$ gaps, each of which will either contain exactly $0$ or exactly $1$ of the $n - k$ remaining chocolate scoops (since we can't have more than $1$ chocolate scoop in the same gap). This can be done in $\binom{k+1}{n-k}$ ways. Summing over each possible value of $k$ (that is, from $k = 2$ to $k = 5$), we obtain: $$\binom{3}{3} + \binom{4}{2} + \binom{5}{1} + \binom{6}{0} = 1 + 6 + 5 + 1 = 13$$


# In how many ways can we place 10 identical red balls and 10 identical blue balls into 4 distinct urns if each urn has at least 1 ball?

In how many ways can we place 10 identical red balls (R) and 10 identical blue balls (B) into 4 distinct urns if each urn has at least 1 ball?

My attempt: Put the minimum number of balls into each urn:

case 1: R R R R (4C0, or 4 choose 0) ways to place 4 red balls, remaining 6R balls can be placed in 4 urns in (6+4-1)C(4-1) or (9 choose 3) ways, and 10B can be placed in (10+4-1)C(4-1) or (13 choose 3) ways, then total ways for this case 4C0*9C3*13C3 = 1*84*286 = 24024

case 2: B R R R, R B R R , etc, total of 4C1 ways to have 1 blue ball and 3 red ones, then for remaining 7R and 9B - 4C1*10C3*12C3 = 4*120*220 = 105600

case 3: B B R R , B R B R etc - following same logic 4C2*11C3*11C3 = 163350

case 4: 4C3*12C3*10C3 = 105600

case 5: 4C4*13C3*9C3 = 24024

Total ways = 24024+105600+163350+105600+24024 = 422598 However, the answer doesn't seem to be correct. What am I doing wrong?

• Are the urns numbered? i.e. is B R R R really different from R B R R? If they are not ordered I would start with looking at how many ways there are to put 20 balls into 4 urns such that none is empty. This can be looked up as partitions of size 4 i.e. there are 64 such partitions. e.g. 6+6+4+4 Then for each partition one can see in how many ways one can fill urns with exactly 6,6,4,4 balls, which seems easier. – Rene Recktenwald Jun 4 '19 at 10:38
• maybe you've got to work it out first without the 1-ball constraint, then subtract all the combinations with zero in any pot, possibly remembering the inclusion exclusion principle to avoid double deducting – Cato Jun 4 '19 at 10:56
• Look up "Stars and Bars" for a general approach to the problem of counting the red ball arrangements (or the blue ball arrangements), with or without the restriction that every box has at least one ball. Then figure out how to combine those values for the problem at hand -- you'll also need a little bit of inclusion-exclusion, I think. – Ned Jun 4 '19 at 13:07

By the complement rule, the answer = U-L, where:
U is the total number of ways 10 identical red balls (R) and 10 identical blue balls (B) can be placed into 4 distinct urns without constraints
$$U={10+4-1 \choose 4-1}^2=81796$$
L is number of ways with 1 or more urns having no balls
To find L, let's use inclusion-exclusion principle. Let set A be the set of all distributions of 10 red balls and 10 blue balls in urns 1,2 and 3. Set B is the set of all distributions of 10 red balls and 10 blue balls in urns 2,3 and 4; set C is the set of all distributions of 10 red balls and 10 blue balls in urns 1,2 and 4; set D is the set of all distributions of 10 red balls and 10 blue balls in urns 1,3 and 4. Then $$L = A\cup B \cup C\cup D$$ will be the set of all distributions in which at least one urn is left empty. By inclusion-exclusion
$$L = |A\cup B \cup C\cup D| = |A|+|B|+|C|+|D|-(|A\cap B|+|A\cap C|+|A\cap D|+|B\cap C|+|B\cap D|+|C\cap D|) + (|A \cap B \cap C| + |A \cap B \cap D| + |A \cap C \cap D| + |B \cap C \cap D|) - |A \cap B \cap C \cap D|$$
$$|A| = |B|=|C|=|D|$$ - number of ways 10 identical red balls and 10 identical blue balls can be placed into 3 distinct urns
$$|A\cap B|=|A\cap C|=|A\cap D|=|B\cap C|=|B\cap D|=|C\cap D|$$ - number of ways 10 identical red balls and 10 identical blue balls can be placed into 2 distinct urns
$$|A \cap B \cap C|=|A \cap B \cap D|=|A \cap C \cap D|=|B \cap C \cap D|$$ - number of ways 10 identical red balls and 10 identical blue balls can be placed into 1 urn
$$|A \cap B \cap C \cap D|$$ case when all urns are empty - not possible, therefore zero
$$|A| = {10+3-1 \choose 3-1}^2=4356$$
$$|A\cap B|={10+2-1 \choose 2-1}^2=121$$
$$|A \cap B \cap C|={10+1-1 \choose 1-1}^2=1$$
$$L=4356*4 - 121*6 +4=17424-726+4=16702$$
The ANSWER = $$\boxed{U-L = 81796-16702=65094}$$

When you do a question with the wording "at least" you almost always approaching it using the $$1-$$ not $$P(A)$$ method, because otherwise you are often likely to double count or miscount stuff.

For example in the way you approached the question, you have over counted in your case two. The reason is that if I put two red balls, with the four urns already having $$B R B B$$, they are fundamentally the same if I put them in the first urn and then the third urn compared to if I put them in the third urn and then the first urn. It is however different if I put one in he second urn and the other in the third urn.

This is because the ordering of the urn is taken care of at the step when you made a distinction between $$B R B B$$ as opposed to $$R B B B$$, then after that distinction, the three blue urn are no longer distinct. So placing a red ball in the first blue urn is no different to placing in the third blue urn for example.

Using the other method, you calculate the total number of way of placing the balls, then subtract all the ways with 1 or more urn having no balls. Then you should get the right answer.

• Thank you. Following your suggestion, the answer should be the total number of ways to put 10 identical red balls and 10 identical blue balls into 4 distinct urns minus number of combinations with 1 urn empty minus number of combinations with 2 urns empty minus number of combinations with 3 urns empty, correct? Continued in next comment – Alexander Arefolov Jun 9 '19 at 20:39
• Total number of ways to put 10 identical red balls and 10 identical blue balls into 4 distinct urns without any constrains is ((10+4-1)C(4-1))^2 or (13 choose 3) squared = 81796 (I know this part is correct). Number of ways to have 1 urn empty should be (4C3)*((10+3-1)C(3-1))^2 : (4 choose 3) ways to choose one empty bin or 3 full bins times number of ways to fill 3 distinct bins with 10 identical red and 10 identical blue balls which should be (10+3-1)C(3-1)^2 or (12 choose 2) squared = 4*66^2=17424. Continued in next comment – Alexander Arefolov Jun 9 '19 at 20:40
• For 2 urns with no balls scenario - (4 C 2)*((10+2-1)C(2-1))^2 = 6* (11 choose 1)^2 = 6*121=726. For 3 urns with no balls: (4 C 1)*((10+1-1)C(1-1))^2 = 4. The answer then should be 81796 - (17424+726+4)= 63642. However, this answer still does not seem to be correct! – Alexander Arefolov Jun 9 '19 at 20:41


# Is there a power of $2$ whose last digit is a $0$?

I'm looking for a power of $$2$$ that ends in $$0$$, so $$2^n = k\cdot 10$$, where $$n \in \mathbb{Z}$$ and $$k \in \mathbb{Z}$$. It doesn't seem to exist. As an equation with two variables, I was looking for a second equation, but just can't think of any.

I also trialled a few consecutive powers of $$2$$ and noticed that there seems to be a sequence perpetually ending in $$2, 4, 8, 6, 2, 4, 8, 6, \cdots$$

How can I prove mathematically that there will never be a power of $$2$$ that ends in $$0$$? Is there a simply way to explain that?

• $5$ divides the RHS, but not the LHS. Sep 24 at 15:04
• You already proved that the ending digit cycles and $0$ does not appear. Nothing more has to be done. Of course, you can also apply the above comments. Sep 24 at 15:23
• @Peter I haven't proven it. All I wrote was, that I observed ("noticed") a sequence. Sep 25 at 14:47
• Thanks for all answers (permanently or temporarily submitted). My first post to this site seemed to have sparked some interest. Sep 25 at 15:03
• Oct 15 at 16:03

The only numbers, in the decimal basis, with a digit of $$0$$ for the units, are those that are multiples of $$10$$, a fortiori, multiples of $$2$$ AND $$5$$. Through the fundamental theorem of arithmetic, you can show that there is no power of $$2$$ that is divisible by $$5$$; thus, there is no power of $$2$$ which ends by a $$0$$ digit (in the decimal basis).

• I've just realised that you already cite the fundamental theorem of arithmetic. (+1) I've deleted my answer. Sep 24 at 19:07
• Thanks. That's the simplest of answers. Though not quite a proof I accept this as the best answer. Sep 25 at 15:02

Proof 1: Let $$a=2^n$$ and $$b = 2^{n-1}$$. Since $$a = 2b$$, if the last digit of $$a$$ is $$0$$, then the last digit of $$b$$ must be $$0$$ or $$5$$. Since $$b$$ is odd, the last digit can't be $$5$$. But if the last digit of $$b$$ is $$0$$, we can apply the same logic to find that the last digit of $$2^{n-2}$$ is $$0$$, and so on all the way down to $$2$$, but obviously the last digit of $$2$$ isn't $$0$$.

Proof 2: Suppose we take a power of two and write it as $$10a+b$$, and then multiply it by $$16$$. $$16*(10a+b)=160a+16b=160a+10b+5b+b$$. Now clearly the $$160a$$ and $$10b$$ terms don't affect the last digit, and since $$b$$ is even, neither does $$5b$$. So the last digit is $$b$$. This shows that whenever you take a power of two, and then take four more powers of two (that is, multiply by $$2^4=16$$), you don't change the last digit.

Proof 3: The last digit of a number is the same as the remainder when divided by $$10$$, and taking the remainder when divided by some number is known as "modular arithmetic". In modular arithmetic, the set of all numbers with the same remainder is an equivalence class, and these equivalence classes act like numbers. We can apply addition and multiplication to them and get an equivalence class as an answer. For instance, if we multiply a number with a last digit of $$2$$ with a number with a last digit of $$3$$, the product will have a last digit of $$6$$. If we represent the set of numbers with last digit $$r$$ as $$\bar r$$, we can say $$\bar 2 \times \bar 3 = \bar 6$$, and this is true regardless of which numbers we pick from the $$\bar 2$$ and $$\bar 3$$ equivalence classes. So you're asking for an $$n$$ such that the $$\bar 2^n =\bar 0$$. It's easy to see by inspection that this is not possible, but there's also a theorem that if we define $$\phi(n)$$ as the number of numbers less than $$n$$ that are coprime to $$n$$, then $$\bar a^{\phi(n)+1}$$ in $$n$$-modular arithmetic is $$\bar a$$. Since $$\phi(10)=4$$ ($$1,3,7,9$$ are coprime to $$10$$), $$\bar 2^{n+4}=\bar2^n$$.

• I really liked the Proof 2! $(+1)$ Sep 26 at 22:52

The below tells us more generally what the last digit can be (although the proof is a bit informal).

(The lemma, and a bit more formal reasoning, is really the only thing you were missing.)

Lemma: when multiplying 2 positive integers, only the last digits of each affects what the last digit of the result will be.

Proof: ($$x_i$$ represents the $$i$$-th digit of the integer $$x$$ and $$x_1x_2...x_{n-1} = 0$$ if the number only has 1 digit)

$$a_1a_2...a_n * b_1b_2...b_n$$
$$=(10 * a_1a_2...a_{n-1} + a_n) * b_1b_2...b_n\hspace{3cm}(1)$$
$$=a_n * b_1b_2...b_n + 10 * a_1a_2...a_{n-1} * b_1b_2...b_n$$
$$=a_n * b_n + 10 * a_n * b_1b_2...b_{n-1} + 10 * a_1a_2...a_{n-1} * b_1b_2...b_n\hspace{1cm}\text{(similar to 1)}$$
$$=a_n * b_n + 10 * (a_n * b_1b_2...b_{n-1} + a_1a_2...a_{n-1} * b_1b_2...b_n)$$

The last digit of 10 times any positive integer will always be 0. If you sum such an integer with any other positive integer, the last digit of the result will be equal to the last digit of the other integer. Thus $$a_n * b_n$$ (that is, the last two digits of each integer) is the only thing that affects the last digit of the result. Q.E.D.

Now let's consider the first few powers of 2:

$$2^0 = 1$$ $$2^1 = 2$$ $$2^2 = 2 * 2 = 4$$ $$2^3 = 4 * 2 = 8$$ $$2^4 = 8 * 2 = 16$$ $$2^5 = 16 * 2 = 32$$

Since only the last digit of the current power affects the last digit of the next power, we now have a cycle.

We know any number ending in 2 multiplied by 2 will end in 4. Multiply that by 2 and it will end in 8, then 6, then 2 again. And it will repeat like this indefinitely.

Therefore, the only last digits possible, from $$2^1$$ onward, are 2, 4, 6 and 8.

Negative powers of 2 trivially cannot have a last digit of 0.

Therefore, there is no integral power of 2 having a last digit of 0.

As a bonus result, this approach also shows that the last digit of $$2^{1+i}$$ equals $$2^{1+(i\bmod 4)}\bmod 10$$ for any $$i \ge 0$$.

I'm a Computer Science teacher and was also intrigued by this, so wrote the following program to prove that there are no numbers that are multiples of 5 and powers of 2. I'm definitely no mathematician, so forgive the brute force approach. As stated above by posters, the repeating end digit sequence of 2,4,8,6 is the proof / 'give away'.

# part 1 - set up powers of 2 for reference

maxNumber = int(input('Enter highest number ')) result = 0 power = 0 base2 = [] while True: result = 2**power if result <= maxNumber: base2.append(result) power += 1 else: break print (base2)

# part 2 - go search

found = False for i in range(1,maxNumber+1): if i % 5 == 0 and i in base2: print (i,'is a multiple of 5 and power of 2') found = True if not found: print ('There are no numbers between 1 and',maxNumber,'that are a multiple of 5 and power of 2')

• As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
– Community Bot
Oct 26 at 6:21