# Comparing numbers in form $x^y$

Let's consider two numbers in form $x_1^{y_1}$ and $x_2^{y_2}$

How can we compare those two numbers without evaluating them ? Can we use logarithms to check it ? If yes - how ?

P.S It's not my homework :)

-
You may want to also take a look at: math.stackexchange.com/questions/97049/… – NoChance Jan 7 '12 at 0:16

Yes, we can. The key is that $$\log_b a = \frac{\log_{b'} a}{\log_{b'} b}$$ and that taking logarithms of positive numbers (I assume you're working with positive $x_1,x_2$) with respect to the same base preserves inequalities. Thus we can take $\log_{x_1} x_1^{y_1} = y_1$ and $$\log_{x_1} x_2^{y_2} = \frac{\log_{x_2} x_2^{y_2}}{\log_{x_2} x_1} = \frac{y_2}{\log_{x_2}{x_1}}$$ and compare these two numbers instead, which is easier.

-
Thanks a lot for reply ! – Spinach Jan 6 '12 at 20:39
@Chris No problem. – Alex Becker Jan 6 '12 at 20:39

Let's assume $x_i > 1$ and $y_i > 0$, because other cases can be handled analogously (just be careful when negatives crop up). Certain cases are easy. If both $x_1 \geq x_2$ and $y_1 \geq y_2$, then $x_1^{y_1} \geq x_2^{y_2}$. The more interesting cases occur when there is a mixed relationship, such as $x_1 \leq x_2$ and $y_1 \geq y_2$. In fact, let's assume the latter two inequalities and consider the following:

\begin{align*} x_1^{y_1} &\geq x_2^{y_2} \\ &\Leftrightarrow \\ \log_{x_1} x_1^{y_1} &\geq \log_{x_1} x_2^{y_2} \\ &\Leftrightarrow \\ y_1 &\geq y_2 \log_{x_1} x_2 \end{align*}

Without doing much calculation, we may be able to bound $\log_{x_1} x_2$ by two consecutive integers (recall, that $\log_{x_1} x_2$ is the exponent that when applied to $x_1$ results in the value $x_2$). So, if we know that $n \leq \log_{x_1}x_2 \leq n+1$, it's easy to multiply $y_2$ by $n$ or $n+1$ and compare to $y_1$. Unfortunately, if $y_1$ is very close to $ny_2$, we may not have a fine enough estimate to make the decision about the inequality. In that event, you may have to use a calculator anyway.

-
Thanks a lot for reply ! – Spinach Jan 6 '12 at 20:39

Take logarithms.

If $\log(x_1^{y_1})>\log(x_1^{y_1})$ i.e. $y_1\log(x_1)>y_2\log(x_2)$, then $x_1^{y_1}>x_2^{y_2}$ and vice versa.

-