1. ## Oblique Asymptotes

hi , I learned in class that if an Oblique asymptote is present, then the degree of the numerator should be exactly 1 more than the denominator's. However this does not apply to $f(x) = (x^3-16x)/(-4x^2+4x+24)$ how come?

I mean I looked at its appropriate graph, and I could not see an OA, According to my calculations it is: $y= 1/4 x + 1/4$.

2. ## Re: Oblique Asymptotes

Originally Posted by sakonpure6
hi , I learned in class that if an Oblique asymptote is present, then the degree of the numerator should be exactly 1 more than the denominator's. However this does not apply to $f(x) = (x^3-16x)/(-4x^2+4x+24)$ how come?

I mean I looked at its appropriate graph, and I could not see an OA, According to my calculations it is: $y= 1/4 x + 1/4$.
You are off by a - sign. See below.

-Dan

3. ## Re: Oblique Asymptotes

Oh okay! By the way on the right hand side of the graph, does the function approach the OA or get farther from it? Because to me it looks like it is getting farther.

4. ## Re: Oblique Asymptotes

Hello, sakonpure6!

$\text{Find the oblique asymptote: }\:f(x) \:=\: \frac{x^3-16x}{-4x^2+4x+24}$

$\text{We have: }\:f(x) \;=\;\frac{x^3-6x}{\text{-}4x^2 + 4x + 24}$

$\text{Divide numerator and denominator by }x^2\!:$

. . $f(x) \;=\;\dfrac{\frac{x^3}{x^2} - \frac{6x}{x^2}}{\frac{\text{-}4x^2}{x^2} + \frac{4x}{x^2} + \frac{24}{x^2}} \;=\;\frac{x - \frac{16}{x}}{\text{-}4 + \frac{4}{x} + \frac{24}{x^2}}$

$\text{Hence: }\:\lim_{x\to\inty}f(x) \;=\;\lim_{x\to\infty} \frac{x - \frac{16}{x}}{\text{-}4 + \frac{4}{x} + \frac{24}{x^2}} \;=\;\frac{x-0}{\text{-}4+0+0} \;=\;\frac{x}{\text{-}4}$

$\text{The oblique asymptote is: }\:y \:=\:\text{-}\tfrac{1}{4}x$

5. ## Re: Oblique Asymptotes

Originally Posted by sakonpure6
Oh okay! By the way on the right hand side of the graph, does the function approach the OA or get farther from it? Because to me it looks like it is getting farther.
It lines up. Graph it on a calculator and zoom out. (Or you could do it for real and find the limit. )

-Dan

6. ## Re: Oblique Asymptotes

The oblique asymptote is y=-x/4 -1/4

7. ## Re: Oblique Asymptotes

Originally Posted by Soroban
Hello, sakonpure6!

$\text{We have: }\:f(x) \;=\;\frac{x^3-6x}{\text{-}4x^2 + 4x + 24}$

$\text{Divide numerator and denominator by }x^2\!:$

. . $f(x) \;=\;\dfrac{\frac{x^3}{x^2} - \frac{6x}{x^2}}{\frac{\text{-}4x^2}{x^2} + \frac{4x}{x^2} + \frac{24}{x^2}} \;=\;\frac{x - \frac{16}{x}}{\text{-}4 + \frac{4}{x} + \frac{24}{x^2}}$

$\text{Hence: }\:\lim_{x\to\inty}f(x) \;=\;\lim_{x\to\infty} \frac{x - \frac{16}{x}}{\text{-}4 + \frac{4}{x} + \frac{24}{x^2}} \;=\;\frac{x-0}{\text{-}4+0+0} \;=\;\frac{x}{\text{-}4}$

$\text{The oblique asymptote is: }\:y \:=\:\text{-}\tfrac{1}{4}x$
You are looking at the behavior of the function in the asymtotic region. You suppressed what is happening near the origin. Just divide the polynomials and you will get -x/4 - 1/4. The complete graph is attached.

8. ## Re: Oblique Asymptotes

Originally Posted by topsquark
You are off by a - sign. See below.

-Dan
What graphing utility you are using

9. ## Re: Oblique Asymptotes

Originally Posted by votan
What graphing utility you are using
Graph. It's freeware and it's pretty awesome, really. No pesky ads or anything.

-Dan

10. ## Re: Oblique Asymptotes

Originally Posted by topsquark
Graph. It's freeware and it's pretty awesome, really. No pesky ads or anything.

-Dan
I am using dplot95, freeware from uncle sam. It is superior. The reason I asked is because your graph seems to cross the asymptote near about x=6, suggesting there is a point of inflection somewhere. Is there one?

11. ## Re: Oblique Asymptotes

Originally Posted by votan
I am using dplot95, freeware from uncle sam. It is superior. The reason I asked is because your graph seems to cross the asymptote near about x=6, suggesting there is a point of inflection somewhere. Is there one?
I don't think there is anything to be read into the asymptote cutting across the function. It's about the limiting properties of the function at large |x|, not in the region "near" the origin.

I'll look into dplot, thanks.

-Dan

12. ## Re: Oblique Asymptotes

Originally Posted by Soroban
Hello, sakonpure6!

$\text{We have: }\:f(x) \;=\;\frac{x^3-6x}{\text{-}4x^2 + 4x + 24}$

$\text{Divide numerator and denominator by }x^2\!:$

. . $f(x) \;=\;\dfrac{\frac{x^3}{x^2} - \frac{6x}{x^2}}{\frac{\text{-}4x^2}{x^2} + \frac{4x}{x^2} + \frac{24}{x^2}} \;=\;\frac{x - \frac{16}{x}}{\text{-}4 + \frac{4}{x} + \frac{24}{x^2}}$

$\text{Hence: }\:\lim_{x\to\inty}f(x) \;=\;\lim_{x\to\infty} \frac{x - \frac{16}{x}}{\text{-}4 + \frac{4}{x} + \frac{24}{x^2}} \;=\;\frac{x-0}{\text{-}4+0+0} \;=\;\frac{x}{\text{-}4}$

$\text{The oblique asymptote is: }\:y \:=\:\text{-}\tfrac{1}{4}x$
Another way to see this is to use "long division": $\frac{x^3- 16x}{-4x^2+ 4x+ 24}= -\frac{1}{4}x- \frac{1}{4} - \frac{9x- 6}{-4x^2+ 4x+ 24}$.
Obviously as x goes to infinity (or negative infinity) the remaining fraction goes to 0 so the graph approaches $-\frac{1}{4}x- \frac{1}{4}$.

13. ## Re: Oblique Asymptotes

Originally Posted by topsquark
I don't think there is anything to be read into the asymptote cutting across the function. It's about the limiting properties of the function at large |x|, not in the region "near" the origin.

I'll look into dplot, thanks.

-Dan
Can we insert a power point presentation here?


Determine p, q, r and s

anemone

MHB POTW Director
Staff member
Hi MHB,

I have encountered a problem and I am not being able to figure out the answer.

Problem:

Given that $p, q, r, s$ are all positive real numbers and they satisfy the system

$p+q+r+s=12$

$pqrs=27+pq+pr+ps+qr+qs+rs$

Determine $p, q, r$ and $s$.

Attempt:

The AM-GM inequality for both $p, q, r, s$ and $pq,pr,ps,qr,qs,rs$ are:

 1 $\dfrac{p+q+r+s}{4} \ge \sqrt[4]{pqrs}$ which then gives $(\dfrac{12}{4})^4 \ge pqrs$ or $pqrs \le 81$ 2 $\dfrac{pq+pr+ps+qr+qs+rs}{6} \ge \sqrt[6]{(pqrs)^3}$ which then gives $(\dfrac{pqrs-27}{6})^2 \ge pqrs$ $(pqrs-81)(pqrs-81) \ge 0$ $pqrs \le 9$ or $pqrs \ge 81$

After that, I don't see how to proceed...should I conclude that since we need to find $pqrs$ that satisfy both of the inequalities below

$pqrs \le 81$ and $pqrs \ge 81$

$\therefore pqrs=81$ and and obviously the answer would be $p=q=r=s=3$?

Ackbach

Indicium Physicus
Staff member
On your second AM-GM inequality, you get $(pqrs-81)(pqrs-9) \ge 0$, with the individual inequalities that you found.

In the beginning of the problem, you specified that $p,q,r,s$ are real. Is that correct? If so, I see no way of nailing down all four values, given only two equations. Certainly, $p=q=r=s=3$ works, but what guarantee do we have that there isn't another solution? E.g., try setting $p=q=2$, and solving the resulting system for $r,s$, and see if there is a solution.

[EDIT] See Opalg's post below for a correction.

Opalg

MHB Oldtimer
Staff member
Hi MHB,

I have encountered a problem and I am not being able to figure out the answer.

Problem:

Given that $p, q, r, s$ are all positive real numbers and they satisfy the system

$p+q+r+s=12$

$pqrs=27+pq+pr+ps+qr+qs+rs$

Determine $p, q, r$ and $s$.

Attempt:

The AM-GM inequality for both $p, q, r, s$ and $pq,pr,ps,qr,qs,rs$ are:

 1 $\dfrac{p+q+r+s}{4} \ge \sqrt[4]{pqrs}$ which then gives $(\dfrac{12}{4})^4 \ge pqrs$ or $pqrs \le 81$ 2 $\dfrac{pq+pr+ps+qr+qs+rs}{6} \ge \sqrt[6]{(pqrs)^3}$ which then gives $(\dfrac{pqrs-27}{6})^2 \ge pqrs$ $(pqrs-81)(pqrs-81) \ge 0$ $pqrs \le 9$ or $pqrs \ge 81$

After that, I don't see how to proceed...should I conclude that since we need to find $pqrs$ that satisfy both of the inequalities below

$pqrs \le 81$ and $pqrs \ge 81$

$\therefore pqrs=81$ and and obviously the answer would be $p=q=r=s=3$?
It looks as though you have solved this problem. You have shown that either $pqrs\leqslant9$ or $pqrs\geqslant 81$. But the equation $pqrs=27+pq+pr+ps+qr+qs+rs$ shows that $pqrs\geqslant27$, so that rules out the first of those possibilities. We are left with the second one, $pqrs\geqslant 81$. But you have also shown that $pqrs\leqslant 81$. Therefore $pqrs = 81$. That implies that equality occurs in the AM-GM inequality, and that only happens when all four quantities are equal. So $p=q=r=s=3$.

anemone

MHB POTW Director
Staff member
On your second AM-GM inequality, you get $(pqrs-81)(pqrs-9) \ge 0$, with the individual inequalities that you found.

In the beginning of the problem, you specified that $p,q,r,s$ are real. Is that correct? If so, I see no way of nailing down all four values, given only two equations. Certainly, $p=q=r=s=3$ works, but what guarantee do we have that there isn't another solution? E.g., try setting $p=q=2$, and solving the resulting system for $r,s$, and see if there is a solution.

[EDIT] See Opalg's post below for a correction.
...We are left with the second one, $pqrs\geqslant 81$. But you have also shown that $pqrs\leqslant 81$. Therefore $pqrs = 81$. That implies that equality occurs in the AM-GM inequality, and that only happens when all four quantities are equal. So $p=q=r=s=3$.


# Closed form for $\prod_{n=1}^\infty\sqrt[2^n]{\tanh(2^n)},$

Please help me to find a closed form for the infinite product $$\prod_{n=1}^\infty\sqrt[2^n]{\tanh(2^n)},$$ where $\tanh(z)=\frac{e^z-e^{-z}}{e^z+e^{-z}}$ is the hyperbolic tangent.

• Do you have any reason to believe that such a closed form exists? – George V. Williams May 13 '13 at 1:42
• wolframalpha.com/input/… vs. wolframalpha.com/input/?i=1-exp%28-4%29 It could be a coincidence though... – Vladimir Reshetnikov May 13 '13 at 1:51
• Out of curiosity, where are you finding all of these questions? – Jemmy May 13 '13 at 2:32
• @Jeremy A friend of mine shared these problems with me. They were submitted to a math competition for students, but were rejected by the committee for various reasons: too hard, too easy, have been published before, not interesting etc. – Laila Podlesny May 13 '13 at 17:21
• @LailaPodlesny May I trouble you by requesting to know which math competition you are referring to? – Kugelblitz Sep 24 '15 at 12:03

For $x < 1$, we have the Taylor series expansion: $$f(x):= \frac{-1}{4} \log \left(- \frac{x - x^{-1}}{x + x^{-1}} \right) = \frac{x^2}{2} + \frac{x^6}{6} + \frac{x^{10}}{10} + \frac{x^{14}}{14} + \ldots$$

Then

$$f(x) + \frac{f(x^2)}{2} + \frac{f(x^4)}{4} + \frac{f(x^8)}{8} + \ldots = \frac{x^2}{2} + \frac{x^4}{4} + \frac{x^6}{6} + \frac{x^8}{8} + \frac{x^{10}}{10} + \ldots$$ $$= - \frac{1}{2} \log(1 - x^2).$$

Now let $x = e^{-2}$. Then

$$\log \left( \sqrt[2^n]{\mathrm{tanh}(2^n)} \right) = \frac{1}{2^n} \log \left( \frac{e^{2^n} - e^{-2^n}}{e^{2^n} + e^{-2^n}}\right)$$ $$= \frac{-4}{2^n} f(e^{-2^n}) = \frac{-4}{2^{n}} f(x^{2^{n-1}}),$$

Hence summing over all $n \ge 1$, we see that, if the product is $P$, then

$$\log P = -4 \sum_{n=0}^{\infty} \frac{1}{2^{n}} f(x^{2^{n-1}}) = -2 \sum_{n=1}^{\infty} \frac{1}{2^{n}} f(x^{2^{n}}) = \log(1 - x^2),$$

and thus

$$P = \exp \log(1 - x^2) = 1 - x^2 = 1 - e^{-4}.$$

• Nicely done! :) – Caran-d'Ache May 13 '13 at 4:47
• This is a very careful and crafty derivation. Excellent. I especially like where you pulled the ol' $\sum \log \leftrightarrow \log \prod$. – Coffee_Table May 13 '13 at 20:03

Let $$f(x)=\prod_{n=0}^\infty\left(1-x^{2^n}\right)^{1/2^n}\tag{1}$$ and $$g(x)=\prod_{n=0}^\infty\left(1+x^{2^n}\right)^{1/2^n}\tag{2}$$ Then \begin{align} f(x)\,g(x) &=\prod_{n=0}^\infty\left(1-x^{2^{n+1}}\right)^{1/2^n}\\ &=\prod_{n=1}^\infty\left(1-x^{2^n}\right)^{2/2^n}\\ &=\left(\frac{f(x)}{1-x}\right)^2\tag{3} \end{align} from which we get $$\frac{f(x)}{g(x)}=(1-x)^2\tag{4}$$ Note that $$\prod_{n=1}^\infty\left(1-x^{2^n}\right)^{1/2^n}=\frac{f(x)}{1-x}\tag{5}$$ and $$\prod_{n=1}^\infty\left(1+x^{2^n}\right)^{1/2^n}=\frac{g(x)}{1+x}\tag{6}$$ Therefore, combining $(4)$, $(5)$, and $(6)$, we get $$\frac{\displaystyle\prod_{n=1}^\infty\left(1-x^{2^n}\right)^{1/2^n}}{\displaystyle\prod_{n=1}^\infty\left(1+x^{2^n}\right)^{1/2^n}}=1-x^2\tag{7}$$ Plug $x=e^{-2}$ into $(7)$ to get $$\prod_{n=1}^\infty\tanh(2^n)^{1/2^n}=1-e^{-4}\tag{8}$$

• This looks much simpler than the accepted answer (which is also excellent) (+1). – Paramanand Singh Nov 19 '13 at 16:20
• @ParamanandSingh: thanks. This question was just pointed out to me. However, new answers to old questions generally don't get as much attention as the older answers got. – robjohn Nov 19 '13 at 16:32


# How can I correct this Hamming code?

I'm trying to decode the following Hamming sequence (using EVEN parity and knowing there is a 1-bit error), which contains an ASCII value: 01100110101

I've tried to check for the correctness of each parity bit:

    p1 p2 d3 p4 d5 d6 d7 p8 d9 d10 d11
0  1  1  0  0  1  1  0  1   0   1
p1 - 0     1     0     1     1       1
p2 -    1  1        1  1         0   1
p4 -          0  0  1  1
p8 -                      0  1   0   1

p1, p4 and p8 checks are all even and correct.

p2 check is odd, hence the parity bit is incorrect and needs to be flipped. The actual message then becomes 00100110101 and the ASCII value can be read as 1011101.

Supposedly this value is incorrect - can anyone point out the mistake I made?

• Wouldn't Hamming Code be more appropriate in the Signal Processing StackExchange? – KingDuken Aug 9 '18 at 21:53
• @KingDuken It is perfectly appropriate in either. – koverman47 Aug 9 '18 at 22:25
• @polyethene Why do you think that this is wrong? It looks correct. Since p2 has the only odd sum, the bit p2 itself has to be wrong (all the other bits are used by at least 2 controll sums, which would mean that at least two bits are wrong). – Jakube Aug 10 '18 at 13:57
• I suggest you edit the question to describe where you got the idea that this is incorrect. If someone told you that, maybe they are wrong. If you read it somewhere, maybe whatever you read was in error. – D.W. Aug 10 '18 at 16:11
• Someone (this OP?) will pay 10 dollars if you answer the question here at reddit.com – Apass.Jack Aug 12 '18 at 22:24

The original problem is, I believe, the following.

When using Hamming code with EVEN parity for 7-bit ASCII characters, the following symbol is retrieved: 01100110101.

Assuming a 1-bit error, what was the original stored symbol? Write down your answer as a 7-bit binary, with no spaces.

OP's statement, "..., which contains an ASCII value: 01100110101", rephrases the original problem statement in a slightly confusing way, as pointed out by Yuval Filmus.

OP's procedure and result is correct, as said in Jakube's comment and indicated in D.W.'s comment. I have verified it as well according to Hamming code at wikipedia.

OP's procedure and result will not be repeated here.

Someone mentioned that "The usual Hamming code has length of the form $2^\ell−1$". For $\ell=4$, the usual Hamming code of length 15 is defined by the following table from wikipedia. If we truncate the last 4 columns, we will get the truncated Hamming code of length 11, which should be, presumably, the Hamming code used in OP's question.

"Supposedly this value is incorrect - can anyone point out the mistake I made?"

This is the turning point to the climax (or anti-climax). There are four possibilities.

1. A different kind of (truncated) Hamming code is used.
For example, all four parity bits could have been specified to be put together in the first four bits. That is, the first four bits, 0110 are the usual p1, p2, p4 and p8 parity bits while the remaining 0110101 are the data bits. In that case, we rearrange the bits to form the usual Hamming code as (p1)(p2)0(p4)110(p8)101, which is 01011100101. Then p1, p2, p4 check are odd while p8 is OK. So we flip the $1+2+4 =7$-th bit to obtain 01011110101. So the corrected data bit will be 0111101. Well, OP can check if this or something similar is the case.

2. "This is from a quiz on my university's LMS, the site is saying my answer is incorrect."
As D.W. suggested, maybe they are wrong. Maybe whatever you read was in error. There might be a typo in the statement of the quiz. There might be an error in the original answer by the quiz owner. There might be an error in the answer-checking process by the site. There might be a critical typo in OP's post. And so on.

3. Jakube, D.W., I, and, apparently, many others have not been able to find the mistake. That is very unlikely, though.

4. The last possibility stands for, as always, all other probably even lesser possibilities.


# What is the vector $x ∈ \mathbb{R^3}$ that achieves $max||x||_1$ subject to $||x||_2 = 1$?

I'm trying to answer the questions "What is the vector $$x ∈ \mathbb{R^3}$$ that achieves $$max||x||_1$$ subject to $$||x||_2 = 1$$?" and "What is the vector x ∈ $$R^3$$ that achieves $$max||x||_∞$$ subject to $$||x||_2 = 1$$?

I think the first question is asking me to find a vector with three components that will have the maximum $$||x||_1$$ norm value where $$\sqrt{x_1^2 + x_3^2 + x_2^2} = 1$$, so $$x_1^2 + x_3^2 + x_2^2 = 1$$. I know the The L1 norm is just the sum of the absolute values of the vector's components. After trial and error I came up with $$x = [\sqrt{\frac{1}{3}}, \sqrt{\frac{1}{3}}, \sqrt{\frac{1}{3}}]$$ , but also $$[-\sqrt{\frac{1}{3}}, -\sqrt{\frac{1}{3}}, -\sqrt{\frac{1}{3}}]$$, and $$[-\sqrt{\frac{1}{3}}, \sqrt{\frac{1}{3}}, \sqrt{\frac{1}{3}}]$$, etc.

For my the second question, I think I need to find the vector in $$\mathbb{R^3}$$ that will give me the maximum value of the absolute value of the vector's components given $$x_1^2 + x_3^2 + x_2^2 = 1$$. I came up with $$[1, 0, 0]$$, $$[0, 1, 0]$$ , $$[0, 0, 1]$$, $$[-1, 0, 0]$$, $$[0, -1, 0]$$ , and $$[0, 0, -1]$$.

Am I correct? Is there a more formal way to figure this out and write my solution?

• First question is tackled with Cauchy-Schwarz, see math.stackexchange.com/questions/218046/… for instance; Second one is even easier – Olivier Jul 8 '19 at 13:57
• To solve optimization problems subject to equality constraints Lagrange multipliers are a very popular method. Example 1a in the Wiki article is quite close to your $L_1$ problem. – pH 74 Jul 8 '19 at 13:59

To solve the first question:

By symmetry, we can assume $$x_1,x_2,x_3$$ are all positive (and add the other solutions later).

By the method of Lagrange multipliers

$$L=x_1+x_2+x_3 - \lambda(x_1^2 + x_2^2 +x_3^2-1)$$

$$0=\frac{\partial L}{\partial x_1} = 1-2\lambda x_1$$ $$0=\frac{\partial L}{\partial x_2} = 1-2\lambda x_2$$ $$0=\frac{\partial L}{\partial x_3} = 1-2\lambda x_3$$

These three equations imply $$x_1=x_2=x_3$$ so that by the constraint $$||x||_2=1$$, the solutions is $$x_1=x_2=x_3=\frac{1}{\sqrt{3}}$$

All of the solutions are

$$x_1=\pm \frac{1}{\sqrt{3}},\quad x_2=\pm \frac{1}{\sqrt{3}},\quad x_3=\pm \frac{1}{\sqrt{3}}.$$

To solve the second question:

We want to maximize one of the elements of the vector.

Trivially, the solutions are

$$\begin{pmatrix} \pm 1 \\ 0 \\ 0 \end{pmatrix}, \quad \begin{pmatrix} 0 \\ \pm 1 \\ 0 \end{pmatrix}, \quad \begin{pmatrix} 0 \\ 0 \\ \pm 1 \end{pmatrix}.$$

We can obtain this also with Lagrange multipliers. Since, by symmetry, we can seek to maximize $$|x_1|$$, first constrain $$x_1$$ to be positive as above, and then find the other solution ($$x_1<0$$).

Consider

$$L= x_1 - \lambda (x_1^2 + x_2^2 + x_3^2-1)$$

$$0=\frac{\partial L}{\partial x_1} = 1 + 2 \lambda x_1$$ $$0=\frac{\partial L}{\partial x_2} = 2\lambda x_2$$ $$0=\frac{\partial L}{\partial x_3} = 2\lambda x_3$$ implies that $$x_1=1$$ and $$x_2=x_3=0$$. Similarly for the other cases.

If $$\|x\|_2 = 1$$, the Cauchy-Schwarz inequality implies $$\|x\|_1 = |x_1|+|x_2|+|x_3| \le \sqrt{x_1^2+x_2^2+x_3^2}\cdot\sqrt{1+1+1} = \sqrt{3}$$

For $$(x_1,x_2,x_3) = \left(\frac1{\sqrt3}, \frac1{\sqrt3}, \frac1{\sqrt3}\right)$$ we have $$\|x\|_1 = \sqrt{3}$$ so this is the maximum.

Now let $$x$$ be a minimizer. We then have equality in the Cauchy-Schwarz inequality above so there exists $$t \in \mathbb{R}$$ such that $$(|x_1|,|x_2|,|x_3|) = t(1,1,1) = (t,t,t)$$ Taking $$\|\cdot\|_2$$ norm gives $$t = \frac1{\sqrt{3}}$$ so $$x=\left(\pm\frac1{\sqrt3}, \pm\frac1{\sqrt3}, \pm\frac1{\sqrt3}\right)$$

• so would the answer to the first question be the set of vectors x where $\|x\|_1 = \sqrt{3}$ ? – John Jul 8 '19 at 15:39
• @John Precisely, it is the sphere around the origin of radius $\sqrt{3}$ w.r.t. the norm $\|\cdot\|_1$. – mechanodroid Jul 8 '19 at 16:04
• @John Of course, intersect the set above with the unit sphere. There are only $4$ solutions, see above. – mechanodroid Jul 8 '19 at 17:15
• There are eight solutions! They lie on the vertices of a cube. – mjw Jul 8 '19 at 21:54
• @mjw Whoops, $2^3= 8$ and not $4$, thanks. – mechanodroid Jul 8 '19 at 21:57

In general, $$\|x\|_1 \le \sqrt{n}\|x\|_2$$, where $$n$$ is the dimension of the space.

If $$\|x\|_2 = 1$$ then we have $$\|x\|_1 \le \sqrt{n}$$, to achieve equality, note that $$\|{1 \over \sqrt{n}}(1,...,1) \|_1 = \sqrt{n}$$.

For the solution of your first question, you should also add the follwoing points: $$\left(\sqrt{\frac{1}{3}}, -\sqrt{\frac{1}{3}}, -\sqrt{\frac{1}{3}}\right), \left(\sqrt{\frac{1}{3}}, -\sqrt{\frac{1}{3}}, \sqrt{\frac{1}{3}}\right), \left(\sqrt{\frac{1}{3}}, \sqrt{\frac{1}{3}}, -\sqrt{\frac{1}{3}}\right), \left(-\sqrt{\frac{1}{3}}, -\sqrt{\frac{1}{3}}, \sqrt{\frac{1}{3}}\right)$$ and $$\left(-\sqrt{\frac{1}{3}}, \sqrt{\frac{1}{3}}, -\sqrt{\frac{1}{3}}\right)$$.

To intuitively guess them, you need to think that both L1 and L2 are symmetric metrics. So you should consider points $$(x_1, x_2, x_3)$$ where $$|x_1| = |x_2| = |x_3|$$. The constraint of $$x_1^2 + x_2^2 + x_3^2 = 1$$ would give you $$|x_1| = |x_2| = |x_3| = \sqrt{\frac{1}{3}}$$.

For a geomteric solution, let us first consider the case in 1st octant i.e. where $$x_1 \geq 0, x_2 \geq 0,$$ and $$x_3 \geq 0$$. Thus $$L_1 = |x_1| + |x_2| + |x_3|$$ is equivalent to $$L_1 = x_1 + x_2 + x_3$$. Now geometrically, one needs to find the point where the plane $$x_1 + x_2 + x_3 = constant$$ touches the sphere $$x_1^2 + x_2^2 + x_3^2 = 1$$ in the first octant.

If you want to formally and algebraically compute the values in the 1st oactant, then you need to write the Lagrangian function $$L(x_1, x_2, x_3, \lambda) = x_1 + x_2 + x_3 + \lambda(x_1^2 + x_2^2 + x_3^2 - 1)$$. Now equate all the partial derivatives to 0. This will get you $$\lambda = -\frac{1}{2x_1} = -\frac{1}{2x_2} = -\frac{1}{2x_3}$$. This leads to $$x_1 = x_2 = x_3 = \frac{1}{\sqrt{3}}$$. In the other octant (where $$x_1 \le 0, x_2 \geq 0,$$ and $$x_3 \geq 0$$) the Lagrangian function will change sign: $$L(x_1, x_2, x_3, \lambda) = -x_1 + x_2 + x_3 + \lambda(x_1^2 + x_2^2 + x_3^2 - 1)$$. This would yield an answer of $$-x_1 = x_2 = x_3 = \frac{1}{\sqrt{3}}$$.

For the second problem, let us take the first case where the $$L_\infty$$ norm $$= Max(x_1, x_2, x_3) = x_1$$. Then the Lagrangian function $$L(x_1, x_2, x_3, \lambda) = x_1 + \lambda(x_1^2 + x_2^2 + x_3^2 - 1)$$.


# quick question about the limit of a two-variable function as $x,y\to\infty$

$$\lim_{x,y\to\infty} \frac{x-y}{x^2+y^2}\tag{\star}$$

I'm used to do the following substitution when I see $x^2+y^2"$ and that $x,y\to 0$

$$x^2+y^2 = r^2,\;x=r\cos\theta,\;y=r\sin\theta$$

plug these values in the function and compute the limit as $r\to0$ I know I can do that because the only way for $x$ & $y$ to approach $0$ is $r$ approaching $0.$

I cannot do this substitution everytime because if for example: $(x,y)\to(-1,7)$ there's no value $u$ that guarantee me if $r\to u$ then $(x,y)\to(-1,7).$

but here since $x,y\to\infty$ I think that logically this phenomenon can only happen if $r\to\infty$ as well.

So computing $(\star)$ is the same as computing this :

$$\lim_{r\to\infty} \frac{r\cos\theta-r\sin\theta}{r^2} =\lim_{r\to\infty} \frac{\cos\theta-\sin\theta}{r}=0.$$

I'm 90% sure that what I've done is correct but I still want a confirmation and if possible show me other ways to compute this limit.

Sorry if this question sounds kinda dumb but I'm still new to multivariable calculus and today is my first time dealing with MVC limits.

Thank you !

Others can add and/or correct, but I'm not sure if you can do the polar trick. If $x$ and $y$ tend to infinity, then clearly $r \to \infty$. But if you have $r \to \infty$, then you don't necessarily have $x$ and $y$ to infinity since, for example: $x \to \infty$ and $y \to c$ (constant) will also lead to $r \to \infty$.

and if possible show me other ways to compute this limit.

Rewrite: $$\left| \frac{x-y}{x^2+y^2} \right| =\left| \frac{x}{x^2+y^2}- \frac{y}{x^2+y^2} \right| \le \left| \frac{x}{x^2+y^2}\right|+ \left|\frac{y}{x^2+y^2} \right|$$ Now: $$\left| \frac{x}{x^2+y^2} \right| \le \left| \frac{x}{x^2} \right| = \left| \frac{1}{x} \right| \to 0 \quad\mbox{ and }\quad \left| \frac{y}{x^2+y^2} \right| \le \left| \frac{y}{y^2} \right| = \left| \frac{1}{y} \right| \to 0$$ Alternatively, if you feel more comfortable with limits to $(0,0)$, substitute $\left( x,y \right) \to \left( \tfrac{1}{u},\tfrac{1}{v} \right)$ and take the limit $(u,v) \to (0^+,0^+)$ and you could follow up with your classical polar substitution.

With no other answers so far, I'll add this example: consider $f(x,y)=x+y$, then clearly: $$\lim_{(x,y)\to (+\infty,+\infty)} \bigl( x+y \bigr) = +\infty$$ However, switching to polar coordinates, we get: $$f(r,\theta) = r \left( \cos\theta + \sin\theta \right)$$ Now simply taking $r \to +\infty$, the limit: $$\lim_{r \to +\infty} \bigl( r \left( \cos\theta + \sin\theta \right) \bigr)$$ depends on $\theta$ since $\cos\theta + \sin\theta$ can be positive, negative or zero. This makes sense since fixing $\theta$ to a value outside the interval $(0,\tfrac{\pi}{2})$ would not correspond to $(x,y)\to (+\infty,+\infty)$.

• @rapidracim Thanks for accepting but you may want to wait for some more input of others, specifically regarding your question on the polar substitution for the limit to $(+\infty,+\infty)$. – StackTD Apr 11 '17 at 12:52
• I think I've found a counterexample $$\lim_{x,y \to \infty} \frac{x}{y^2}+x^2$$ here If I use the polar substitution I'll get $+\infty$. but wolfram-alpha says it doesn't exist because it is path dependent do you think I can trust wolframalpha ? if it gave me a "value" maybe but since it told me it doesn't exist I presume other than computing the limit along two different paths and finding two different results (which actually proves that the limit D.N.E) a computer can't make such a conclusion (that the limit is path-dependant) using a different algorithm . – the_firehawk Apr 11 '17 at 16:15

"but here since $x,y\to \infty$ I think that logically this phenomenon can only happen if $r\to \infty.$" The definition of $x,y\to \infty,$ which you haven't given us, is probably exactly the same as $r\to \infty.$ Let's assume this. You have correctly arrived at

$$f(r\cos t, r \sin t) = \frac{\cos t - \sin t}{r}.$$

$$0\le |f(r\cos t, r \sin t)| = \frac{|\cos t - \sin t |}{r} \le \frac{|\cos t| + |\sin t|}{r} \le \frac{1 +1}{r} = \frac{2}{r}\to 0.$$
Thus $|f(r\cos t, r \sin t)|\to 0,$ which is the same as saying $f(r\cos t, r \sin t)\to 0.$


# How does the Peano axiom of induction prevent S-loops?

First, let me state what I understand to be the first-order rendition of Peano's 5th axiom: the axiom of induction. For all natural numbers, for any relation/property/predicate $$R$$...

$$(R(0) \land \forall x[R(x) \rightarrow R(S(x))]) \rightarrow \forall x(R(x))$$

(first question: is this a correct formalization of this axiom or not?)

How does this axiom prevent elements of natural numbers that have '$$S$$-loops' that is:

\begin{align} S(a) = b && \text{and} && S(b) = a \end{align} (edited for clarity)

• This axiom does not, but the third Peano Axiom.says that if $S(n)=S(m)$, then $n=m$. If $S(x_9)=x_8$, then $S(x_9)=S(x_7)$, so $x_7=x_9$, which eventually leads to $0=S(x_2)$, which is forbidden by the Fourth Axiom (or peharps by a different number axiom depending on how you formalize them). – Arturo Magidin Mar 7 at 21:37
• ' then 𝑆(𝑥9)=𝑆(𝑥7)...' is not true. As defined above, $S(x_9) = x_8$. I've change the nomenclature to 'a' and 'b' to be more clear. In this sense S(a) = b and S(b) = a are completely possible given axioms 1-4. – C Shreve Mar 8 at 2:41
• It’s not that “it’s not true”. It’s that you’ve changed your statement. When you wrote $x_8$, I of course assumed that you meant the result of applying $S$ to $0$ eight times. And, no it is still not possible, and yes, you still need the other axioms; induction alone doesn’t do it, though induction does come into play in the general statement. If $a=0$, then you are violating the axiom that says that $0$ is not a successor. If $a\neq 0$, then from induction you get that $a$ is a descendant of $0$, so you still get that $a=x_n$ and go from there. – Arturo Magidin Mar 8 at 10:36
• I would prefer brackets enclosing everything to the left of the 2nd "$\implies$" in your statement of Axiom 5. In contrast, putting brackets around everything to the right of "$\land$" gives a different (wrong) meaning. – DanielWainfleet Mar 9 at 18:28

Using Peano's axioms

\begin{align} \forall m \, S(m) \neq 0 &&&\text{(}0\text{ is not the successor of anyone)} \\ \forall m \forall n \, (S(m) = S(n) \to m = n) &&&\text{(injectivity of }S\text{)} \end{align}

and Peano's principle of induction, it is easy to prove that the "double-successor" does not have any fixed point, i.e. \begin{align} \forall m \, S(S(m)) \neq m \end{align}

A rigorous proof of this property is below. It is analogous to the one you can find here to prove that the successor has no fixed point.

Now, this property excludes the possibility of $$S$$-loops. Indeed, if there were $$m$$ and $$n$$ such that \begin{align} S(m) &= n & S(n) &= m \end{align} then we would have $$S(S(m)) = m$$ (replace $$n$$ with $$S(m)$$ in the second identity), which is impossible.

We want to prove that, in Peano arithmetic, \begin{align} \forall x \, S(S(x)) \neq x &&&\text{(i.e. } \forall x \, R(x) \text{ where } R(x) \text{ is the formula } S(S(x)) \neq x\text{).} \end{align}

To prove this we apply Peano's induction principle, thus we have to prove two facts:

1. Base case, i.e. $$S(S(0)) \neq 0$$. This holds because it is just an instance (take $$x = S(0)$$) of Peano's axiom \begin{align} \forall x \, S(x) \neq 0 &&&\text{(0 is not the successor of anyone).} \end{align}

2. Inductive case, i.e. $$\forall x \, \big(S(S(x)) \neq x \to S(S(S(x))) \neq S(x) \big)$$. So, given $$x$$, we suppose $$S(S(x)) \neq x$$ and we have to show that $$S(S(S(x))) \neq S(x)$$. Aiming for a contradiction, suppose $$S(S(S(x))) = S(x)$$. According to Peano's axiom \begin{align} \forall m \forall n \, (S(m) = S(n) \to m = n) &&&\text{(injectivity of }S\text{)} \end{align} instantiated with $$m = S(S(x))$$ and $$n = x$$, we have that $$S(S(x)) = x$$, which is impossible. Therefore, $$S(S(S(x))) \neq S(x)$$.

This ends the proof that $$\forall x \, S(S(x)) \neq x$$.

I think your formalization is correct.

The axiom of induction doesn't prevent by itself S loops. Consider, a two elements set $$\{0,1\}$$ with $$S(0) = 1$$ and $$S(1) = 0$$

To prevent S loops you need axioms

$$\forall a,b \; . \; S(a) = S(b) \Rightarrow a = b$$

3."$$0$$ is not a succesors"

$$\forall a\;.\;S(a)\neq0$$

Informally, if you have a loop from combination of (5) and (4) it follows that loop need to involve all predecessors of a looped element. And with this (3) provides a contradiction, as by (5) every element has $$0$$ as a predecessor.

The more formal proof can look like this.

Consider the predicate $$NL(x) = \text{x is not an element of any loop.}$$ By definition of the loop, if $$a$$ is in the loop, there must be $$b$$ in the loop, such that $$a = S(b)$$. So, $$NL(0)$$ holds by axiom (3). Now consider an element $$a$$ such that $$NL(a)$$ holds. If $$S(a)$$ is an element of the loop, then by the axiom (4) the element $$a$$ is also in the loop. This is a Contradiction! Thus, $$NL(a) \Rightarrow NL(S(a))$$ holds for any $$a$$. Now can apply axiom of induction to see that there is no element $$a$$, which can be looped.

So there are no loops in Natural numbers defined by Peano axioms. Note, however, that you need every axiom to prove it.

• I think your $a$ and $b$ in paragraph 2 are supposed to be $0$ and $1$.... – Arturo Magidin Mar 7 at 21:52
• Thanks. You are correct. This was a typo. – Nik Pronko Mar 7 at 21:57
• Indeed, with only the axiom of induction, the one-element set $\{0\}$ would also be a possibility. – Greg Martin Mar 7 at 22:21
• But this is not necessarily true. The case you bring up is true because you have expressly chosen a specific set ({0,1}) where one member (ie 0) is identified by axiom 3. However, the set {0, 1, 2, ... a, b} with S(a)= b and S(b) = a could still exist given axioms 1-4. What is it about axiom 4 that eliminates 'a' and 'b'? – C Shreve Mar 8 at 2:48
• @CShreve Say, $a = S(c)$, then by axiom 4 $b = c$. Repeating this procedure in so for we can, we will end up with a set $\{0,1\}$ as in example above. Of course, this works only with finite sets, and words "repeating procedure in so for" really is just a reference for the axiom of induction. I will add a more formal proof to the answer. – Nik Pronko Mar 8 at 10:34

In the general statement as you’ve now written, not a specific example as you had before, induction does come into play in the sense that one must prove, by induction, that if $$x\in \mathbf{N}$$, then either $$x=0$$, or there exists $$k$$ such that $$x=S^k(0)$$.

Indeed you let the property by “$$x=0$$ or $$x$$ is a descendant of $$0$$”; $$0$$ has the property, and if $$n$$ has the property, then so does $$S(n)$$.

Once you have that, from $$S(a)=b$$ and $$S(b)=a$$, you get that either $$a=0$$ and you violate the Axiom that says that $$0$$ is not a successor; or else that $$a=S^k(0)$$ for some $$k$$. Then $$b=S^{k+1}(0)$$, and you are now in essentially the same situation as before, when you had the specific example of $$S(x_8)=x_9$$ and $$S(x_9)=x_8$$. Now you have $$S^{k+2}(0)=S^k(0)$$. From that you get $$S^{k+1}(0)=S^{k-1}(0)$$, and so on until you get that $$0$$ is a successor, contradicting that axiom.

@Taroccoesbrocco, so in the spirit of a 'double successor' implies contradiction, would a formalization of this look like:

1. Let R(x) -> S(S(x)) = x (double successor relation)
2. By Axiom 5 then R must also apply to $$0$$
3. So $$S(S(0)) = 0$$
4. Let $$a = S(0)$$
5. By 4 and 3, $$S(a) = 0$$...which contradicts Peano Axiom 4
6. Therefore relation R (ie...double successor) is not in the natural numbers.

Is there anything incorrect about the above line of reasoning?

• What you wrote is essentially meaningless. If you want to prove $\forall x \, S(S(x)) \neq x$ by contradiction, you have to suppose its negation, that is $\exists x \, S(S(x)) = x$. Now, you do not know who is the $x$ such that $S(S(x)) = x$, therefore you are not allowed to conclude that $S(S(0)) = 0$. – Taroccoesbrocco Mar 9 at 11:41
• I edited my answer to include a proof of $\forall x \, S(S(x)) \neq x$. – Taroccoesbrocco Mar 9 at 11:43
• The additional detail above are helpful. The intent in my reasoning above is to 1)assume a relation $R$ of the natural numbers then 2)show that the relation $R$ produces some contradiction against the Peano axioms. The reason $R$ can be applied to 0 is axiom 5 as any relation in the natural numbers must be applicable to 0 as well. – C Shreve Mar 9 at 19:50
• What you proved is that $\exists x \, S(S(x)) \neq x$, more precisely that $S(S(0)) \neq 0$. But it is not enough, indeed you have to prove that $\forall x \, S(S(x)) \neq x$. – Taroccoesbrocco Mar 9 at 20:38
• The fact that a property fails for some natural numbers does not imply that it fails for all natural numbers. You define the predicate $R(x)$ as $S(S(x)) = x$. With your argument you're are showing that $\forall x \, R(x)$ is not true, i.e. that $\exists x \, S(S(x)) \neq x$. But this is not what you need to prove the absence of $S$-loops. What you need to prove is that $\forall x \, S(S(x)) \neq x$. – Taroccoesbrocco Mar 10 at 6:25


# How to prove $\gcd(a,\gcd(b, c)) = \gcd(\gcd(a, b), c)$?

I am trying to prove that $\gcd(a, \gcd(b, c)) = \gcd(\gcd(a, b), c)$.

The definition of GCD available to me is as follows:

Given integers a and b, there is one and only one number d with the following properties.

1. $d \geqslant 0$
2. $d|a$ and $d|b$
3. $e|a$ and $e|b$ implies $e|d$.

In the book that I am studying, prime factorization of numbers hasn't been taught yet. Only, the definition of GCD, I've given above has been taught and proven. So, I want to use only this to prove that $\gcd(a, \gcd(b, c)) = \gcd(\gcd(a, b), c)$. Could you please help me?

-
Show that both sides equal gcd(a,b,c). –  franz lemmermeyer Feb 4 '12 at 19:21
I haven't encountered the definition of gcd of three numbers in the text yet and I am trying to avoid it. –  Lone Learner Feb 4 '12 at 19:26
Proof that GCD is associative –  pedja Feb 4 '12 at 20:01
@LoneLearner : The gcd of any number of numbers is the greatest of all of their common divisors, so you just need to know what a common divisor of three numbers is. The divisors of $12$ are $1,2,3,4,6,12$; the divisors of $15$ are $1,3,5,12$; the common divisors are just the members of the intersection of those sets of divisors (in this case $1,3$). So the question is: what's the definition of the intersection of three sets? The answer is that a thing is a member of the intersection precisely if it's a member of all three sets. –  Michael Hardy Feb 4 '12 at 21:08
By considering prime factorizations, it's a consequence of $\min(x,\min(y,z)) = \min(\min(x,y),z)$. –  lhf Feb 5 '12 at 1:34

Same answer as I just gave in sci.math...

Note that $$d|x,y\Longleftrightarrow d|\gcd(x,y).$$ So: \begin{align*} d|a,\gcd(b,c) &\Longleftrightarrow d|a,b,c\\ &\Longleftrightarrow d|\gcd(a,b),c \end{align*}

-
nice hint! (+1) –  robjohn Feb 4 '12 at 20:20
+1 for giving the cleanest proof possible (as far as I can see). My only gripe is with the notation: I would write $\;d|x \land d|y\;$ instead of $\;d|x,y\;$. Then the associativity of $\;\gcd\;$ translates directly to the associativity of $\;\land\;$. –  Marnix Klooster Jul 26 '13 at 9:41

Please note that this solution uses an idea that is very similar to the idea in the solution posted much earlier by ncmathsadist. The main difference is that it may contain fewer typos.

We show that for any integer $u$, if $u$ divides the left-hand side, then $u$ divides the right-hand side, and vice-versa. Thus the left-hand side and the right-hand side have the same set of common divisors, so must be equal, since they are both non-negative.

Now suppose that $u$ divides $\gcd(a, \gcd(b, c))$. Then $u$ divides $a$ and $u$ divides $\gcd(b,c)$. So $u$ divides $b$ and $c$, and therefore $a$, $b$, and $c$.

Now look at the right-hand side. We know that $u$ divides all of $a$, $b$, and $c$. So $u$ divides $\gcd(a,b)$, and therefore $u$ divides $\gcd(\gcd(a,b),c)$.

Showing that if $u$ divides the right-hand side, then $u$ divides the left-hand side is essentially the same calculation, and can be omitted.

-
I am trying a proof that strictly leads to the fact that if $d = gcd(a, gcd(b, c))$ then $d$ must satisfy the conditions $d|a$, $d|gcd(b, c)$, $e|a$ and $e|gcd(b, c)$ implies $e|gcd(a, gcd(b, c))$. Could you please tell me how to prove the last implication part? –  Lone Learner Feb 4 '12 at 21:03
@Lone Learner: It is inconvenient to work with $d$ directly, it is clearer to work with any common divisor. –  André Nicolas Feb 4 '12 at 21:07

First note that $(a,b) \mapsto \gcd(a,b)$ is symmetric in $a$ an $b$. Suppose $d$ is a commond divisor of $a$, $b$ and $c$. Then $c|a$ and $d|\gcd(b,c)$ so $d|\gcd(a, \gcd(b,c))$.

Conversely suppose that $d$ is a common divisor or $a$ and $\gcd(b,c)$. Then $d|a$ and $d|\gcd(a,b)$. Hence, $d$ is a common divisor of $a$, $b$ and $c$.

Our result follows now by symmetry.

-
Why should we assume that $c$ is a common divisor of $a$ and $b$? The problem doesn't require $c$ to be a common divisor of $a$ and $b$. –  Lone Learner Feb 4 '12 at 19:27
What we see here is that both $\gcd(a,\gcd(b,c))$ and $\gcd(\gcd(a,b), c)$ are both simply the largest common divisor of $a$, $b$, and $c$. –  ncmathsadist Feb 4 '12 at 19:43
But that doesn't imply that $c$ must be a common divisor of $a$, $b$ and $c$. –  Lone Learner Feb 4 '12 at 20:14
@LoneLearner: There’s a major typo in the answer: the common divisor should be $d$ (or some other symbol distinct from $a,b$, and $c$). –  Brian M. Scott Feb 4 '12 at 20:18
But that still doesn't show how $d$ is a $gcd(a, gcd(b, c))$. According to the definition I have given, we now need to show that if $e$ divides $a$ and $e$ divides $gcd(b, c)$, then $e$ must divide $d$. How do you show this? –  Lone Learner Feb 4 '12 at 20:45

Here is a proof I am attempting from all the hints I have got so far. Please let me know if this is correct.

Let $d = gcd(a, gcd(b, c))$. Therefore,

1. $d \geqslant 0$ from the definition of GCD.
2. $d|a$ from the definition of GCD.
3. $d|gcd(b, c)$ from the definition of GCD.
4. $e|a$ and $e|gcd(b,c)$ implies $e|d$, also from the definition of GCD.
5. From 3, $d|b$.
6. From 3, $d|c$.
7. From 2 and 5, $d|gcd(a, b)$.
8. Let $e|gcd(a, b)$ and $e|c$. From the definition we know that $gcd(a, b) | a$ and $gcd(a, b) | b$. Therefore, $e|a$ and $e|b$ from the transitive property of divisibility. So, $e|gcd(b, c)$ from the definition of GCD. So, from 4 we have, $e|$d.

From 1, 7, 6 and 8, we get, $d = gcd(gcd(a, b), c)$.

-
#4 seems false. How does it follow from the definition of GCD? If d is a prime factor X common to both a and gcd(b,c), and e is a different prime factor Y common to both a and gcd(b,c), then e will not divide d or vice versa, because they're prime. –  Joseph Garvin Jan 26 '13 at 19:05
Actually #4 is OK, it does follow from the definition if you're using the Bezout's identity version. –  Joseph Garvin Jan 27 '13 at 17:17


# Weighted Averages: Averaging Averages or Rates

In our series on averages, last week we introduced the idea of the weighted average (or weighted mean), where each item has a weight attached. The classic examples all involve grade averages in various ways. This time, we’ll look at how weighted averages arise when you need to average several averages together, something we touched on last time, but which arises often in very different settings. One thing we’ll see repeatedly is that the appropriate average depends on your needs.

## Can you average averages, or  not?

We’ll start with a 1997 question from a professional who had learned that, generally, you can’t average averages, but didn’t know when you can:

Algebra: Average of an Average

Hi!  This one is a real-life need.  I work for a consulting firm, and am having a hard time remembering my basic Algebra!

If the "Wireless" line of business hires 50 people in one month, and the "Multimedia" line of business hires 80 people in one month, what is the average number of people per month we are hiring?

At first, one thinks (50 + 80)/2 = 65 is the correct answer, but it's not because we're taking the average of an average, right?

Don't you have to let x = something and then do 1/50 + 1/80 and solve... or something?

Hi Ron,

65 is the correct answer if the question is: "What is the average number of people hired per line of work per month?"

Here, we are just averaging the two averages “per line”, so as long as we state clearly what it means, it is valid. The question is, is this average what you want to know, or is it something else entirely?

Assuming that the entire company is made up of only those two lines of business, and you're asking "What is the average number of people hired by the whole company per month?", the answer is obviously 50+80 = 130.

This seems to be what Ron wants, and it isn’t really an average at all, just a total!

So what about the idea that you can’t average averages? That’s really a different story:

The operations above are perfectly reasonable. Let me show you the kind of situation that I think you were worried about, and you'll see why it's different from the situations above:

I take 4 exams and have an average score of 80. Then I take 2 more exams and on those 2, my average is 100. What's my overall average for the course?

The wrong way to do it is (80+100)/2 = 90. This is wrong because the averages were of different-sized groups. To get the correct answer, I know that on the first 4 exams I got 320 total points because when I divide 320 by 4, I get 80.

Similarly, for the last two exams, I must have gotten 200 points total. So for the six exams, I got 200+320 = 520 points and 520/6 = 86.66666 = my real grade average.

We saw this scenario last week: If we just average the two averages, the result can only be described as the average of the averages, not the average for the course. The latter has to be weighted, because for the course, each exam counts the same, not each of these two sets of exams.

As we saw last week, a weighted average can often be understood by breaking it down:

For your problem, the averages you are averaging are for the same period, so it works out. To convince you that it's true, let's just look at a situation where the averages came from 10 months of data.

Then in the first line of business, 500 people must have been hired, since 500/10 = 50. Similarly, 800 were hired in the other, since 800/10 = 80. Altogether, 1300 people were hired in the ten months, or 1300/10 = 130 per month, company-wide.  Or if you're trying to get the average per line of work, 65 is right, since if each group had hired 65 people each month for 10 months, there would be 65*20 = 1300 total hires, so it works out.

Bottom line: always think about what you want, and what an average means, rather than use an average (or not!) unthinkingly.

## Using a weighted average

Averaging Averages

I was reading your response on averaging averages. This has come up in a meeting I go to regarding a report that I am responsible for every month. After reading your response, I want to make sure that I am doing this right.

I have 5 different departments that send me an average rating to 3 different questions from a feedback form (rated 1-5). For example, this is what they send me:

Question 1 - average 4 (this is the average of question 1 from all feedback forms this department received during a certain time period)

Question 2 - average 3 (same comment as above)
Question 3 - average 5 (same comment as above)

Total average- 4

After getting this information from all 5 different departments, I combine them in a total company report by taking everyone's average to question 1 and then average that to get an average for the whole program. (For this program the company average to question 1 is...) and so on for questions 2 and 3 and the total average.

If I am reading your response correctly to the question on averaging averages, this is okay to do if all information is contained within the same time period (which it is).

Please advise.

Doctor Douglas answered, starting with a basic assumption:

Hi Stacy,

It sounds as though you are trying to average a set of averages. As long as the data reflect the same measurement (or question) for each of the individual groups, then it is okay to proceed. That is, if question 1 is the same among all departments ("Please rate the chef at the last company BBQ on a scale of one to ten.") then it is a meaningful question to ask: what did the employees think of our last BBQ chef?

Of course, it would be meaningless to average question 1 if each department had a different question, or if the responses were on different scales. But how shall we calculate the average?

Now, when you take averages of averages, there is often a preferred way to do this operation. It is called "weighted averages" and reflects the fact that the number of observations may vary among the different groups. For example, let's say that the Marketing Department has 50 employees, and the Research Department has only 6. If the Marketing Department average was 8.5 ("BBQ was great!") and Research Department average was 3.1 ("heartburn!"), what is the correct average for these 2 departments? We might simply take the average of 8.5 and 3.1, i.e. 5.8.  But it seems unfair to let the Research Dept sway the whole vote, having only 6 employees. The weighted average accounts for the differing number of employees:

weighted avg. = (no. of M)(AVG-of-M) + (no. of R)(AVG-of-R)
-------------------------------------------
(total no. of M and R together)

= (50)*(8.5) + (6)*(3.1)
----------------------
(50 + 6)

=  7.92

This is the classic example of a weighted average, and, as we saw last week, it amounts to finding the total score for the whole company by multiplying each average by the number of people it represents, and dividing by the total number of people. Thus this average is what we would get if we just averaged all the individual scores.

Do you see how the final average is much closer now to the Marketing Department's evaluation? Another way I sometimes explain it is that simple direct averaging is like the way states are represented in the U.S. Senate (every state gets two votes), while weighted averaging is like the way states are represented in the U.S. House of Representatives (every state is represented in proportion to its population).

As we’ll be saying several more times, each of these is a valid average, but has a different meaning. The U.S. Congress intentionally has one part in which every state, even the smallest, is treated equally, and another in which the largest state has more power, and each person is treated equally.

Now, it's impossible for me to say which type of averaging is correct for your situation, but I think it's probably better to use weighted averaging when you have information about the number of observations in each of the groups.

I would agree.

## Averaging percentages

A slightly different situation was involved in this 1998 question:

Averaging Percentages

Hi,

I am having difficulties in explaining to several friends that you cannot take percentages by totaling them up and then averaging the total of the percentages. It does not equal the percentage of the total of the numbers.

Is there a rule or theory that can explain this better?

Hi, Dominic. I'm not entirely sure what kind of problem you are referring to. Certainly there are at least some situations where you can average percentages. For example, if there are 50 questions on an exam, and three students got 20%, 30%, and 40% of them right, then the average number of questions they got right is 30%, or 15 questions.

This is like our situations above where we had equal groups, so a straight average made sense.

I suspect what you are thinking of is cases where the percentages are taken from different totals, in which case weighted averaging is needed. For example, if I survey 20% of 50 people, and 80% of 500 other people, then I have not surveyed (20+80)/2 = 50% of the total population, but:

.20 * 50 + .80 * 500   10 + 400   410
-------------------- = -------- = --- = 74.5%
50 + 500           550      550

The problem is simply that the percentages in such a problem do not represent fractions of the same total, so they can't be added.

As with an average of averages, here we are reconstructing the individual numbers (10 and 400 out of 50 and 500), then finding the actual percentages of the whole. That’s what a weighted average is.

I closed by referring to some of the answers we saw last week.

## Average price per square foot

For a specific real-life example, consider this 2003 question:

Average of Ratios vs. Ratio of Averages

I write and maintain software for real estate agents, and we include a calculation called, "Average dollars per square foot."  We currently calculate this as the ratio of the average price divided by the average square footage of all the homes in the list.  It seems to me that it should be calculated as the average of the price-per-square-foot ratio of each house. Can you think of any reason why the ratio of the averages would be more useful than the average of the ratios?  Is there a technical name for this ratio of averages?

I answered again, pointing out as before that different calculations can both be meaningful, though they mean different things:

Hi, Laure.

Interesting question!

What you are currently calculating actually does make sense; you are just averaging over all the square feet of houses, rather than over all houses, and that may be just the right thing to do -- or it might not.  Here's what I mean:

Suppose that N houses are sold; the sum of all their prices is P, and the sum of all their areas is A.  (That is, if the individual prices are P1, P2, ..., Pn, and the individual areas are A1, A2, ..., An, then P is the sum of P1 through Pn, and A is the sum of A1 through An.)

Then the average price of a house is P/N, and the average area of a house is A/N; and you are calculating

P/N
--- = P/A
A/N

as the average price per square foot.  And that is exactly what it is: the total price of all those square feet, divided by the number of square feet.

In terms of the individual numbers, this is $$\frac{P_1+P_2+\dots+P_n}{A_1+A_2+\dots+A_N}$$ Imagine laying out tiles representing each square foot of each house, and dollar bills representing the price of each house. This average spreads all the money equally over all the tiles, to find an overall price per square root. That sounds perfectly reasonable.

What you envision is

P1/A1 + P2/A2 + ... + Pn/An
---------------------------
N

which would average the price per square foot of all the houses.  This puts the focus on the individual houses, rather than the individual square feet.  How would this be different?

Again, this is $$\frac{\frac{P_1}{A_1}+\frac{P_2}{A_2}+\dots+\frac{P_N}{A_N}}{N}$$ Imagine laying out tiles representing each square foot of each house, keeping each house separate, and dollar bills representing the price of each house, spread equally among the tiles of that house. Now we take one tile and its cost from each house, and average those, spreading the money equally among the selected tiles. What have we found this time?

The way to see the difference is to take an extreme example. (Don’t check whether the sizes or prices are realistic; they aren’t meant to be!)

Well, let's take a simple case with N = 2.  Suppose we have a big, well-built house of 10,000 square feet, and that it costs $2,000,000 ($200 per square foot), and a little house of 1,000 square feet that costs $20,000 ($20 per square foot). Then the total cost of the houses P is \$2,020,000, and the total area A is 11,000 square feet. The average price per square foot is

P/A = 2,020,000/11,000 = 183.6

(closer to the more expensive price) while the average of the two price-per-square-foot numbers is

average(Pn/An) = (200 + 20)/2 = 110

(which is considerably lower).  What pulled the first number up is the fact that the bigger house had the bigger price per square foot; since we counted each square foot equally, the numerous high-cost ones won.  The second calculation treats all 10,000 of the expensive square feet equally with the mere 1,000 square feet of the little house, so the little house pulled the average down.

Which do you think is the better calculation?

Both numbers are meaningful.  The first fully deserves the name you are giving it (though there is definitely some ambiguity in the English!); but the second may better reflect what the average homeowner (as opposed to the "average square foot of floor space") can expect.  Call it, perhaps, the "cost per square foot of the average house", where the number you are currently calculating is the "average cost of a square foot" or "cost of an average square foot".

Perhaps the builder would consider the first calculation more appropriate, since they put more effort into the bigger house, and every square foot they built matters to them; but the homeowner might care only about his own house — which neither calculation really reflects!

So, again, both numbers can reasonably be called "average cost per square foot"; which is more useful to you depends on how you want to use it.  Do you want a number that is pulled up by big fancy houses, or one that shows what the average house is worth?  Or would separate numbers for different categories of houses make more sense?  Perhaps you can gather data that shows how costs per square foot are distributed, and how each average reflects that.

Any kind of average is an attempt to reduce a lot of data to a single number, and will never give a full picture of a diverse population. Other numbers, or a graph of the distribution, are often more useful.

Laure chose to leave the calculation as it was.

## Average speed

Let’s look at one more 2003 question, which is about a ratio in disguise:

Weighted Average of the Velocities

A truck on a straight road starts from rest and accelerates at 2.0 m/s2 until it reaches a speed of 20 m/s. Then the truck travels for 20 s at constant speed until the brakes are applied, stopping the truck in a uniform manner in an additional 5.0 s.

(a) How long is the truck in motion?
(b) What is the average velocity of the truck for the motion described?

Hi, Garin.

The trick here is to get the average velocity for each of the three phases of the trip, then do a weighted average of the three velocities.

Average velocity for phase 2 is easy, 20 m/s. During phases 1 and 3, the velocity changes linearly. That means that we can just average the starting and ending velocities to get the velocity for the entire phase.

This sort of average becomes most meaningful when you apply calculus, but for uniform acceleration, it requires only algebra. Doctor Edwin chose to leave that part for Garin to handle (or to ask for more help, which he never did), and focused just on the idea of the average. It turns out that the acceleration phase takes 10 seconds, at an average speed of 10 m/s; the cruise phase takes 20 seconds at 20 m/s; and the deceleration phase takes 5 seconds at an average speed of 10 m/s.

Once you've got those, you'll do a weighted average with respect to the time spent in each phase:

(v_1 * t_1) + (v_2 * t_2) + (v_3 * t_3)
v_avg =  ---------------------------------------
t_total

The calculation looks like this: $$\frac{v_1\cdot t_1 + v_2\cdot t_2 + v_3\cdot t_3}{t_1+t_2+t_3} = \frac{10\cdot 10 + 20\cdot 20 + 10\cdot 5}{10+20+5} = \frac{100 + 400 + 50}{10+20+5} = \frac{550}{35} = 15.7\text{ m/s}$$

Just for fun, I'll point out that the same set of equations has another interpretation that works just as well. Average velocity is just distance over time, right? So if we figure out how far the truck went in each phase, add them all up, and divide by the total time, you'll also get the same answer:

d_1     +    d_2     +      d3
v_avg =  ---------------------------------------
t_total

But the middle terms in those two equations are the same:

d_2 = v_2 * t_2

and so are the first terms:

a(t_1)^2
d_1 = --------
2

v
a  =  -
t

v_1_end * (t_1)^2
d_1 = -----------------
2(t_1)

v_1_end * t_1
d_1 =   -------------
2

But since the starting velocity is zero, we can add it in wherever we want:

(v_1_start + v_1_end)
d_1 =  ---------------------- * t_1
2

which means that our first terms are the same as well, and so are our third terms.

Anyway, there you have it. Total distance traveled divided by time, or a weighted average of velocities with respect to time, it works out to the same thing.

In other words, each “average velocity · time” is a distance, so our average velocity calculation was really just total distance over total time. We’ve seen previously that when distances are the same, we can use a harmonic mean to find the average speed; this confirms that when times are known but different, we can use a weighted arithmetic mean, using times as weights.

This site uses Akismet to reduce spam. Learn how your comment data is processed.


# Function with arbitrary small period

Is there a function f: $$\mathbb{R} \to \mathbb{R}$$ with arbitrary small period different from $$f(x) = k$$? ($$\forall \epsilon >0 \exists a < \epsilon$$ such that f(x) has a periodicity $$a$$) I think the function is the Dirichlet function but I don't know how to prove it properly.

• F(x)=1 for numbers with a halting decimal expansion, for example $3.452$ and not $1/3$ Oct 4, 2018 at 12:00
• @Empy2 Nice: your example also works for domain $\mathbb{Q}$. Oct 4, 2018 at 12:38
• I would avoid saying “such that the period of $f(x)$ is $a$” here. The term period would usually denote the smallest $a>0$ that fulfills $f(x+a) = f(x)$. Here you should rather just say “such that $f$ has a periodicity $a$”, or “such that $f$ is $a$-periodic”, which does assert $f(x+a) = f(x)$ but does not make any statement as to whether there exists also $b \in ]0,a[$ with $f(x+b)=f(x)$. Oct 4, 2018 at 13:55
• Of course you want $0<a<\epsilon$
– MPW
Oct 4, 2018 at 18:07
• You can construct a lot of such functions. The recipe: 1) Take any sequence $a_k$ which has infinite number of values in any neighbourhood of zero; 2) Make a set consisting of all finite sums of $a_k$ with arbitrary integer coefficients; 3) The characteristic function of this set will satisfy your requirements for $f$. If $a_k=1/k$ then you're getting rationals. If $a_k=10^{-k}$ then you're getting Empy2's set. If $a_k=k^{-\pi}$ then you're getting new set which is hard to imagine :-) If $a_k=\sin{k}$ then you're getting new interesting set. Oct 5, 2018 at 7:40

You're right. The characteristic function of the rationals is periodic of period $$1/n$$ for all $$n \in \mathbb N$$ because $$x$$ is rational iff $$x+1/n$$ is rational.

You're correct.

Let $$\epsilon$$ be arbitrarily small. You need to prove that there exists some $$0 such that $$D(x)=D(x+p)$$ for all $$x\in \mathbb{R}$$.

We know that $$\epsilon$$ is some positive real number, so there exists some $$p\in \mathbb{Q}$$ such that $$0. Let's look at an arbitrary $$x\in \mathbb{R}$$ and see if our property is satisfied or not:

If $$x$$ is rational, then $$D(x)=1$$. Since the sum of two rationals is rational, then $$D(x+p)=1$$ too.

If $$x$$ is irrational, then $$D(x)=0$$. Since the sum of a rational and an irrational is irrational, then $$D(x+p)=0$$ too.

So if we choose our period to be $$p$$, our property is satisfied.

The main question has been answered in other answers well enough, but I would like to address a few natural follow-up questions. What about continuous functions $$f$$ with this property?

It turns out that in this case there are no nontrivial solutions - every such function is constant. Here's a topological proof: Let $$K=\{x\in\Bbb R\mid \forall y, f(y)=f(x+y)\}$$ be the set of periods of $$f$$. If $$f$$ is continuous, then this is an intersection of the sets $$\{x\in\Bbb R\mid f(y)=f(x+y)\}$$, which is closed (it is the preimage of $$\{0\}$$ under the function $$g(x)=f(y)-f(x+y)$$), so $$K$$ itself is closed. $$K$$ is also dense in $$\Bbb R$$, because it is an additive group with arbitrarily small elements, so $$K=\Bbb R$$ and hence $$f(x)=f(y)$$ for all $$x,y\in \Bbb R$$.

If we consider discontinuous functions again, then we know $$K$$ is a dense additive subgroup of $$\Bbb R$$. Does every dense additive subgroup generate such a function? Yes, we can just take the characteristic function of $$K$$. For a fixed $$K$$, the space of such functions is just all functions $$\Bbb R/K\to \Bbb R$$. This is another way to get at the constancy result, since as a topological group, $$\Bbb R/K$$ has the indiscrete topology, because any open set will cover $$\Bbb R$$ if copied around with translations by $$K$$.

Of course $$\Bbb R/K$$ can be uncountable, for example if $$K=\Bbb Q$$ or any other countable subgroup. Can it be countable or finite? It can be countable assuming some choice, as observed in TomGrubb's answer. If we consider a Hamel basis $$B$$ of $$\Bbb R$$ over $$\Bbb Q$$, then the set of all real numbers with zero first projection is a subgroup $$K$$ of $$\Bbb R$$ for which $$\Bbb R/K\simeq \Bbb Q$$.

But it can't be finite (unless it is trivial). In other words, there is no coherent way to talk about real numbers being partitioned into the "even" and "odd" ones. If $$\Bbb R/K$$ has $$n>1$$ elements, then that means that every number which is a multiple of $$n$$ is in $$K$$; but every real number is a multiple of $$n$$, to wit, $$x=n(x/n)$$.

Another way to look at it is to think about the set of periods, i.e.

$$P = \{ p \in \mathbb{R} | f(x + p) = f(x) \text{ for all } x \in \mathbb{R} \}$$

Zero is clearly a member of this set no matter what f is. P is closed under addition and negation. So clearly P is a group over addition. So, if you want to find a function that has arbitrarily small periods, you want to find a subgroup of $$\mathbb{R}$$ that has arbitrarily small values. $$\mathbb{Q}$$ is the obvious choice, so the characteristic function for $$\mathbb{Q}$$ works, as stated in another answer.

Here's a different function with the same property (which relies on a fair bit of choice). Choose a Hamel basis for $$\mathbb{R}$$ over $$\mathbb{Q}$$ and pick a basis vector $$v$$. Let $$f$$ be the function which projects onto the $$v$$ coordinate. Then for any other basis vector $$u$$ and any integer $$n$$, $$f(x+u/n)=f(x).$$ More can be found on these functions in the article "Discontinuous additive functions" by Bernardi.

• Hope you don't mind my edit, since it's not that much choice needed for what you want. =) Oct 4, 2018 at 17:10


# Expected number of groups of 3 consecutive wins in 200 rounds

If I know the probability of winning an individual round (while playing, say, a slot machine), call it $p_0$, what is the expected number of groups of 3 consecutive wins in 200 rounds? Or, to make it more general, what is the expected number of $k$-consecutive-win groups in $n$ rounds?

The groups cannot overlap, so 4 consecutive wins do not count as 2 different groups of 3 wins, while 6 consecutive wins do count as 2 different groups.

I was thinking of looking for the total number of possible $k$-group configurations in $n$ rounds, but I'm not too sure.

Explaining how you got this result would be most welcome, though the final formula would do as well. Thank you very much.

My solution will not only answer your question exactly (within linear algebra roundoff error) for the general case, but actually gives you the entire probability distribution of number of successful (i.e., completed) streaks.

This can readily be solved by using a discrete time discrete state (time-homogeneous) Markov Chain, in an approach similar in spirit to, but with larger state space, than the methods I used in https://math.stackexchange.com/questions/383704/probability-of-streaks/1739987#1739987 . After you read my answer in that thread plus this thread, you should be a wizard in using Markov Chains to solve all manner of streaks problems.

I will let

p = probability of winning per round
k = number of wins for successful streak
n = number of rounds

Then g is determined to be the upper bound on largest number of streaks, calculated as

g = floor(n/k)

Define the states as bivariate pairs(i,j), in which i denotes the current number of successful (i.e., completed) streaks and j is the length of the current streak. i will range from 0 to g, and j will range from 0 to k-1, except for when i = g, in which case j only goes from 0 to 0, and we make that state, (g,0), an absorbing state because we can't get any additional successful streaks. Order the states with j increasing fastest, then i increasing. I.e., with k = 3, the states would be (0,0),(0,1),(0,2),(1,0),(1,1),(1,2), etc.

Once the Markov Chain one step transition matrix, M, has been populated (see below), we compute the n step Markov Chain transition matrix, Mn as $M^n$. Given that we start in state (0,0) before the first of n rounds, the first row of Mn contains the probabilities of being in the various states after n rounds. For each possible value of number of successful streaks i, the sum of the probabilities over j for all states (i,j) provides the probability of exactly i successful streaks having occurred. It is then trivial to compute the expected number of successful streaks.

The one step transition matrix is populated as follows (note that w.p. is short for "with probability"):

For each i from 0 to g-1 (I'll show here for the case k = 3)
State (i,0) transitions to (i,0) w.p. 1-p and to (i,1) w.p. p
State (i,1) transitions to (i,0) w.p. 1-p and to (i,2) w.p. p
State (i,2) transitions to (i,0) w.p. 1-p and to (i+1,0) w.p. p

The absorbing state (g,0) transitions w.p. 1 to (g,0)

The population of the one step Markov Chain for a general value of k (and n) is shown in my MATLAB code below. Everything on a line after % is a comment.

k = 3; n = 200; p = .6; % set k, n, and p to particular values
g = floor(n/k);
B = [(1-p)*ones(k,1),p*eye(k)]; % recurring block in transition matrix M.
% B is a k by (k+1) matrix, consisting of a column vector of (1-p) 's,
% right-horizontally concatenated with p times the k by k identity matrix
% Start building up one step transition matrix, M
M = zeros(g*k+1); % (g*k+1) by (g*k+1) matrix of zeros
for i=0:g-1, M(k*i+1:k*(i+1),k*i+1:k*(i+1)+1) = B; end;
M(g*k+1,g*k+1) = 1; % Construction of M is now complete
Mn = M^n; % n step transition matrix
% Calculate array of probabilities of number of successful streaks
% and place in prob_array
prob_array = zeros(g+1,1);
for i=0:g-1, prob_array(i+1) = sum(Mn(1,k*i+1:k*i+k)); end;
prob_array(g+1) = Mn(1,g*k+1); % prob_array is now complete
expected_number_streaks = (0:g)*prob_array

Here are example results for n = 200 rounds, and streaks of length k = 3, with bonus results for streaks of length k = 5.

Here is an example one step transition matrix, for p = 0.6, n = 11, k = 3, which results in g = 3.

• Great. Yes, this agrees with observations... By the by, do you recommend any books to learn (relatively) advanced probability? I hadn't met the use of Markov Chains like this before. Apr 18 '16 at 7:02
• @Kristian D'Amato , many so-called advanced probability books deal with rigorous theory - it sounds like that may not be what you want. It sounds like a book on stochastic processes might be good for you, or perhaps applied probability with significant stochastic processes content, but I don't have a specific book of such type to recommend. Apr 18 '16 at 17:12

Since you're talking about a slot-machine, I assume that the probabilities are independent. The probability of $k$ consecutive wins is $p_0^k$. That probability is the expected portion of the groups with size $k$ that contain all wins. The number of groups with size $k$ (that does not overlap) is $200/k$, and we can call the number of all rounds $n$ (already alluded to in your question). So, the expected number of groups with size $k$ that contains consecutive wins would be

$p_0^k \cdot (n/k)$

$p_0^3 \cdot (200/3)$

Edit:

Apparently this problem is deceptively hard, like really hard. Just answering what the probability is that one group of length $k$ will appear is hard. The probability $S(n,k)$ of a group of consecutive wins of length $k$ in a chain of $n$ events, with the probability of a win $p$ and probability of a fail $1-p=q$ is

$S(n,k) = p^k \sum_{i=0}^{\infty} {n - (i+1)k \choose i}(-qp^k)^i - \sum_{i=1}^{\infty} {n - ik \choose i}(-qp^k)^i$

Here, the groups can even overlap, which is not what you asked for. I hope this can point you in the right direction.

(I apologize for the wrong answer earlier, I hope I did not lead you astray too much)

• Are you sure this is right? Observed information is not matching with this prediction (observations are about 50% higher) Apr 15 '16 at 10:47
• Are you sure that the groups may not overlap? Because, if they are allowed to overlap I can understand why the estimate is missing by 50% and in that case you should use the formula n + 1 - k to estimate the number of possible blocks. Apr 15 '16 at 11:41
• Yep. Keep in mind that if they are allowed to overlap the chance of getting a second win-group overlapping with the first is not independent of the first (since you only need one more round to have another win-group)... Anyway they don't overlap. Apr 15 '16 at 12:35
• I'm doubting myself, but I don't see how this could be wrong. p^k is the expected proportion of groups with all wins, n/k is the maximum amount of consecutive, non overlapping groups that can fit within the chain. Are you running simulations and could you supply some code in that case? Apr 15 '16 at 13:40
• I will when I'm able to later on. There are other k-chains in the entire sequence, since a group can start at position 2, for instance, covering 2-4, etc... Apr 15 '16 at 13:51


# Taylor Theorem inequality

Prove that for all $f\in C^2([0,1])$ with $f(0)=f(1)=0$ and $|f''(x)| \le 1$ $$|f(x)| \le \frac{1}{2}x(1-x)$$ $\forall x \in [0,1]$.

-
If your function is only continuous, how do you know for sure that it has a second derivative? –  Mercy Mar 30 '14 at 1:01
Mistake in the post, sorry! Just corrected… –  Brontolo Mar 30 '14 at 1:05

We have, $\displaystyle (1-x)\int_0^x tf''(t)\,dt -x \int_x^1 (t-1)f''(t)\,dt = -f(x)$, for $x \in [0,1]$ (just apply integration by parts on LHS to ease the simplification).

Since, $t\ge 0$ for $t\in [0,1]$ and $(t-1) \le 0$ for $t \in [0,1]$, taking modulus on both sides,

$|f(x)| = \displaystyle \left|(1-x)\int_0^x tf''(t)\,dt -x \int_x^1 (t-1)f''(t)\,dt\right|$

$\le \displaystyle \left|(1-x)\int_0^x tf''(t)\,dt\right| + \left|-x \int_x^1 (t-1)f''(t)\,dt\right|$

$\le \displaystyle \sup\limits_{t\in[0,1]}|f''(t)|. \bigg( (1-x)\int_0^x t\,dt -x \int_x^1 (t-1)\,dt \bigg)$

$= \dfrac{x(1-x)}{2}.\sup\limits_{t\in[0,1]}|f''(t)| \le \dfrac{x(1-x)}{2}$.

Aliter: Define $g(t)=f(t)-\dfrac{t(t-1)}{x(x-1)}f(x)$, on $[0,1]$.

Then, $g(0)=g(x)=g(1)=0$.

Applying Rolle's Theorem twice on $(0,1)$, $\exists \alpha \in (0,1)$ such that $g''(\alpha)=0$.

That is $g''(\alpha) = f''(\alpha) - \dfrac{2}{x(x-1)}f(x)=0$

or, $|f(x)|=\dfrac{x(1-x)}{2}|f''(\alpha)| \le \dfrac{x(1-x)}{2}$.

-
How do you pull $\sup|f''(t)|$ out of the integrals while maintaining the subtraction between the integrals? Suppose $f''(t)=1$ on $[0,x]$ and $f''(t)=-1$ on $[x,1]$ (or a continuous function very close to that). –  robjohn Mar 30 '14 at 2:00
I think if you add the absolute values of the integrals you get what you want. That is, $$\frac12x^2(1-x)+\frac12x(1-x)^2=\frac12x(1-x)$$ –  robjohn Mar 30 '14 at 2:03
@robjohn fixed typo and added a line .. thanks for pointing it out :) –  r9m Mar 30 '14 at 2:08
Nice way the second one! I thought that it would be good to do with Taylor Theorem (therefore the title) but I found no way. –  Brontolo Mar 30 '14 at 10:17

For some $\xi_k\in[0,1]$, $$f(1)=f(0)+f'(0)+\frac12f''(\xi_1) \quad\text{and}\quad f(0)=f(1)-f'(1)+\frac12f''(\xi_2)$$ implies $$|f'(0)|\le\frac12 \quad\text{and}\quad |f'(1)|\le\frac12$$ Let $g(x)=f(x)-\frac12x(1-x)$ and $h(x)=f(x)+\frac12x(1-x)$.

$g(0)=0$, $g'(0)\le0$, and $g''(x)\le0$; therefore, $g(x)\le0$.

$h(0)=0$, $h'(0)\ge0$, and $h''(x)\ge0$; therefore, $h(x)\ge0$.

Thus, $$\overbrace{-\frac12x(1-x)\le}^{h(x)\ge0}f(x)\overbrace{\le\frac12x(1-x)}^{g(x)\le0}$$

-
Can you explain why $g(0)=0, g′(0)≤0$, and $g″(x)≤0$; therefore, $g(x)≤0$? –  Brontolo Mar 30 '14 at 10:09
@TheMaker94: Mean Value Theorem on $[0,1]$. Since $g'(0)\le0$ and $g''(x)\le0$, we have $g'(x)\le0$. Since $g(0)=0$ and $g'(x)\le0$, $g(x)\le0$. –  robjohn Mar 30 '14 at 12:14
Perfect, clear thanks! –  Brontolo Mar 30 '14 at 12:28

We want to prove that for each $x$:$$\exists c\ \ f(x) =\frac 12 f''(c) x(1-x)$$

We want to find such a $c$ via the Rolle theorem (or via the mean value theorem, but we can always go back to the Rolle version).

We can already apply the Rolle theorem, which gives an annulation for $f'$.

Let us modify $f$ to go to $0$ once more: assuming $0<x<1$,

$$g(u) := f(u) + A_xu(1-u)\\ g(x) = 0\Leftarrow A_x = - \frac{f(x)}{x(1-x)}$$

Now $g(1)=g(x) = g(0)$ hence, applying several times the Rolle theorem:

$$\exists c \ \ 0=g''(c) = f''(c) - \frac{f(x)}{x(1-x)}(-2)\\ f(x) = -\frac 12 x(1-x)f''(c)$$

NB: the error in the sign does not change the final inequality.

-
clever idea (+1) –  robjohn Mar 30 '14 at 8:09


# Finding Area using Integrals

As part of my Calculus 2 class, I have created a practice exam to help my students study.  In doing so, I felt that providing the questions and the solutions in a blog series would be helpful not just to my students, but also to anyone that may be taking, or teaching, calculus 2.  I hope you find the following solutions helpful in your studies.

You can also view me presenting the solution on YouTube at

## Find the area bounded by the function $$f(x)=8x$$, $$g(x)=\frac{8}{x}$$, and $$h(x)=x^{2}$$.

Drawing a sketch of these graphs, we get the following picture.

In order to find the area, we cut this into smaller cross sections, then add up the areas of the cross sections. Here we will cut out rectangles as shown below.

Note that the height of the rectangles has a different function value in the first portion than it does in the second portion, so we will split this into two parts. In the first section, we get that
\begin{align*} A_{cs}&=h*w \\ &=(y_{b}-y_{s})\Delta x, \end{align*} where $$y_{b}$$ is the bigger $$y$$ value and $$y_{s}$$ is the smaller $$y$$ value. In this case, we note from the graph that $$y_{b}=8x$$ and $$y_{s}=x^{2}$$. Therefore,
\begin{align*} A_{cs}=(8x-x^{2})\Delta x. \end{align*}

In order to find the total area over this interval, we then find that
\begin{align*} A_{T1}=\int_{a}^{b}(8x-x^{2})dx. \end{align*} Where is $$a$$ is the smallest $$x$$ value and $$b$$ is the largest $$x$$ value where these cross sections work.

We find $$a$$ as the intersection of $$8x$$ and $$x^{2}$$. That is, we solve
\begin{align*} 8x&=x^{2} \\ 0&=x^{2}-8x \\ 0&=x(x-8) \\ x&=0,8. \end{align*} From the picture, we note that the point we are interested for this example is actually $$a=0$$.

We then find $$b$$ as the intersection of $$8x$$ and $$\frac{8}{x}$$, so we get
\begin{align*}
8x&=\frac{8}{x} \\
8x^{2}&=8 \\
x^{2}&=1 \\
x&=\pm 1.
\end{align*}
Again, by looking at the picture, we note that the correct choice is $$b=1$$.

Therefore,
\begin{align*} A_{T1}&=\int_{0}^{1}(8x-x^{2})dx \\ &=4x^{2}-\frac{x^{3}}{3}|_{0}^{1} \\ &=4-\frac{1}{3}-0=\frac{11}{3}. \end{align*}

If we follow the same process for the second area, we note that we will have $$y_{b}=\frac{8}{x}$$ and $$y_{s}=x^{2}$$. Therefore, we will get that
\begin{align*} A_{cs}&=h*w \\ &=(y_{b}-y_{s})\Delta x \\ &=(\frac{8}{x}-x^{2})\Delta x. \end{align*}

Therefore, the total area of the second section will be
\begin{align*} A_{T2}=\int_{b}^{c}(\frac{8}{x}-x^{2})dx. \end{align*}

We have already found that $$b=1$$, so now we need to find $$c$$. Here, this is the intersection of $$\frac{8}{x}$$ and $$x^{2}$$. Therefore, we get that
\begin{align*} \frac{8}{x}&=x^{2} \\ 8&=x^{3} \\ x&=2. \end{align*} Hence, $$c=2$$.

We then get that
\begin{align*} A_{T2}&=\int_{1}^{2}(\frac{8}{x}-x^{2})dx \\ &=8\ln|x|-\frac{x^{3}}{3}|_{1}^{2} \\ &=8\ln(2)-\frac{8}{3}-(8\ln(1)-\frac{1}{3}) \\ &=8\ln(2)-\frac{7}{3}. \end{align*}

Now that we have found both areas, the total area of the region will be given as the sum of the two areas. Therefore, the total area is
\begin{align*} A_{T}&=A_{T1}+A_{T2} \\ &=\frac{11}{3}+8\ln(2)-\frac{7}{3} \\ &=\frac{4}{3}+8\ln(2). \end{align*}

## Other Resources

I have it linked above, but you can find the practice exam here.  You can find the other solutions to the practice exam in the other posts available here.

If you found the post, or the YouTube video helpful, please like the post or the video.  Also remember to follow the blog and subscribe to the YouTube channel.  By doing so you will not only be able to find future content, you will also make it easier for other students to find the content when they are studying for Calculus.  Thank you.

## 1 thought on “Finding Area using Integrals”

This site uses Akismet to reduce spam. Learn how your comment data is processed.


# Kronecker Product (G Dataflow)

Calculates the Kronecker product of two input matrices.

## matrix A

The first input matrix.

This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

Default: Empty array

## matrix B

The second input matrix.

This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

Default: Empty array

## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

## kronecker product

Matrix containing the Kronecker product of the first and second input matrices.

The number of rows in kronecker product is the product of the number of rows in the first and second input matrices. The number of columns in kronecker product is the product of the number of columns in the first and second input matrices.

## error out

Error information. The node produces this output according to standard error behavior.

## Algorithm for Calculating the Kronecker Product

If A is an n-by-m matrix and B is a k-by-l matrix, the Kronecker product of A and B, C = AB, results in a matrix C with dimensions nk-by-ml. This node calculates the Kronecker product using the following equation.

$C={\left[\begin{array}{cccc}{a}_{11}B& {a}_{12}B& \dots & {a}_{1m}B\\ {a}_{21}B& {a}_{22}B& \dots & {a}_{2m}B\\ ⋮& ⋮& \ddots & ⋮\\ {a}_{n1}B& {a}_{n2}B& \dots & {a}_{nm}B\end{array}\right]}_{nk×ml}$

For example, if

$\begin{array}{cc}A=\left[\begin{array}{cc}1& 2\\ 3& 4\end{array}\right]& B=\left[\begin{array}{cc}5& 6\\ 7& 8\end{array}\right]\end{array}$

then

$\begin{array}{ccc}{a}_{11}B=\left[\begin{array}{cc}5& 6\\ 7& 8\end{array}\right]& {a}_{12}B=\left[\begin{array}{cc}10& 12\\ 14& 16\end{array}\right]& C=\left[\begin{array}{cc}{a}_{11}B& {a}_{12}B\\ {a}_{21}B& {a}_{22}B\end{array}\right]=\left[\begin{array}{cccc}5& 6& 10& 12\\ 7& 8& 14& 16\\ 15& 18& 20& 24\\ 21& 24& 28& 32\end{array}\right]\end{array}$

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported