An interview question: $2.1^{3.1}$ vs $3.1^{2.1}$,$ 2.1^{4.1}$ vs $4.1^{2.1}$, which is larger?

195 Views Asked by At

While Mathematica told me that $2.1^{3.1} - 3.1^{2.1} = -0.786932$ and $2.1^{4.1} - 4.1^{2.1} = 1.58855$, I wonder how to compare them quickly, by hand.

I see $2^3 < 3^2$, so perhaps we have $2.1^{3.1} < 3.1^{2.1}$, but I'm not sure.

As for $2^4 = 4^2$, I guess $2.1^{4.1}$ is larger because the exponent is bigger, but I'm not too sure.

3

There are 3 best solutions below

0
On BEST ANSWER

The problem boils down to comparing different values of the function $f(x)=x^{\frac{1}{x}}$, or, equivalently, different values of: $$ g(x)=\frac{\log x}{x}\qquad \text{or}\qquad h(t)=t\, e^{1-t}. \tag{1}$$ $g(x)$ a maximum at $x=e$ and $h(t)$ has a maximum at $t=1$.

By computing the Taylor expansion of $h(t)$ at $t=1$, we have: $$ h(t)\approx 1-\frac{(t-1)^2}{2}+\frac{(t-1)^3}{3} \tag{2}$$ and by approximating the remainder, that gives $h(\log 4.1)<h(\log 3.1)<h(\log 2.1)$, from which: $$ 2.1^{3.1} < 3.1^{2.1},\qquad 2.1^{4.1}>4.1^{2.1}.\tag{3} $$

0
On

Let's consider

$$(a+\epsilon)^{b+\epsilon} = e^{(b+\epsilon) \log{(a+\epsilon)}}$$

$$\begin{align}(b+\epsilon) \log{(a+\epsilon)} &= (b+\epsilon) \left [\log{a} + \log{\left (1+\frac{\epsilon}{a} \right )} \right ] \\ &= (b+\epsilon) \left [\log{a} +\frac{\epsilon}{a} - \frac12 \frac{\epsilon^2}{a^2} +O\left (\epsilon^3 \right ) \right ]\\ &= b \log{a} + \left (\frac{b}{a}+\log{a} \right )\epsilon + \left (\frac1{a}-\frac{b}{2 a^2} \right )\epsilon^2 + O\left (\epsilon^3 \right )\end{align}$$

Exponentiating, we get that

$$(a+\epsilon)^{b+\epsilon} = a^b \left [1+ \left (\frac{b}{a}+\log{a} \right )\epsilon + \left (\frac1{a}-\frac{b}{2 a^2}+ \frac12 \left ( \frac{b}{a}+\log{a} \right )^2 \right ) \epsilon^2 \right ]+ O\left (\epsilon^3 \right )$$

For the purposes of the interview, we only need look at the $O(\epsilon)$ term. Thus, when $a=2, b=3$ and $\epsilon=0.1$, we get that $2.1^{3.1} \approx 8 + 8 (1.5+\log{2}) (0.1) \approx 9.8$. In contrast, when $a=3, b=2$ and $\epsilon=0.1$, we get that $3.1^{2.1} \approx 9 + 9 (0.7+\log{3}) (0.1) \approx 10.6$. The difference is sufficiently greater than $a^b \epsilon^2$ that we don't need to consider the $O(\epsilon^2)$ term. Thus, we can say that $3.2^{2.1} \gt 2.1^{3.1}$.

The OP should be able to continue the analysis for the other case, which seems more interesting.

0
On

The relevance of the following answer for an interview is questionable, because it takes some fiddling around. However, it is elementary and complete.

For the first inequality, brute force works:

$$\left({3.1\over 2.1}\right)^{2.1}>\left({3.1\over 2.1}\right)^2=\left({31\over 21}\right)^2=({30\over 20}-{1\over 42})^2=2.25+(1/42)^2-3/42>2.25-3/42 > 2.1$$ So multiplying both sides by $(2.1)^{2.1}$ gives the first inequality.

For the second inequality, note that the function $f(x)={x+2\over x}$ is decreasing for $x>0$ (it's derivative is $-{2\over x^2}$). Therefore: $$\left({4.1\over 2.1}\right)^{2.1}=f(2.1)^{2.1}<f(2)^{2.1}=2^{2.1}<^{?}(2.1)^2$$ so if we can show that $2^{2.1}<(2.1)^2$, we are done, because then multiplying both sides of the displayed inequality by $(2.1)^{2.1}$ gives the desired result.

Now why is $2^{2.1}<(2.1)^2$? Becasue if we assume $2^{0.1}=1+x$, then $(1+x)^{10}=2$, so $1+10x<(1+x)^{10}=2$, whence $x<0.1$. It follows that $2^{0.1}<1.1$, hence $2^{2.1}<4\times 1.1=4.4$. But $4.4<4+2\cdot 2\cdot 0.1 + 0.01=(2+0.1)^2=(2.1)^2$. We are done.