Exponent of an exponent?

2.1k Views Asked by At

If I have an expression that gives 2^3^4, would I compute this as $(2^3)^4$ or as $2^{(3^4)}$? The two answers are wildly different.

My TI gives the former but Wolfram gives the latter and I don't know which to trust more on math. I also tried reading up in textbooks on the Laws of Exponents, but I could not find the case A^B^C in any of the textbooks I can access...

EDIT: This was found as an example in a CompSci textbook, thus the notation as it was.

3

There are 3 best solutions below

3
On BEST ANSWER

Conventionally $a^{b^c}$ means $a^{(b^c)}$.

The other way of parsing it, $(a^b)^c$, yields a result equal to $a^{bc}$. In particular $(2^3)^4 = 2^{3\times 4} = 2^{12} = 4096$.

0
On

There are a number of type-setting situations with algebraic expressions that cause problems when you try to enter them into a one-line input calculator.

For example $$\frac{2+3}{4+5}$$must be entered into a calculator as $$(2+3)/(4+5)$$The horizontal line in the fraction implies brackets around the expression in the numerator and denominator.

Similarly, the expression$$\sqrt{2+5}$$must be entered on my Casio as$$\sqrt{}(2+5)$$Here the horizontal line above the expression shows what expression is to be included in the root; the brackets in the second version do the same thing for the calculator.

Finally, if an exponent is itself an expression, that typesetting defines exactly what is in the exponent; if you can't enter the typesetting directly, you need to supply the missing information.$$2^{3^4}$$should be entered into a calculator as $$\text{2 ^ ( 3 ^ 4 )}$$

Note that when you enter 2 ^ 3 ^ 4 into Wolfram Alpha, it back translates the expression into the typeset version and then evaluates that expression correctly

7
On

In standard mathematics the notation $A \mathrel{^\wedge} B$ is not used; one does $A^B$ instead.

In some computer science (programming) applications the infix circumflex operator notation $A \mathrel{^\wedge} B$ is used (or rather the ASCII version A^B). What you point out is that this operator $\mathrel{^\wedge}$ is not associative.

So does $A \mathrel{^\wedge} B \mathrel{^\wedge} C$ mean $A \mathrel{^\wedge} (B \mathrel{^\wedge} C)$ (that is $A^{B^C}$) or $(A \mathrel{^\wedge} B) \mathrel{^\wedge} C$ (which is $(A^B)^C$)? Well, that depends on the language! For example in PARI/GP and Wolfram Alpha it would be the former, while in Visual Basic .NET and some calculators it would be the latter.

So if you are writing a computer program, find out what convention the programming language in question uses. If you are writing for a human reader, avoid $A \mathrel{^\wedge} B \mathrel{^\wedge} C$ without parenthesis because it can be ambiguous.

For similar reasons, avoid $A/B/C$ and use either $A/(B/C)$ or $(A/B)/C$. Of course, whenever it is technically possible, use "real" mathematical notation like $\frac{A}{\frac{B}{C}}$ or $\frac{\frac{A}{B}}{C}$.

PS! Out of curiosity, was the textbook using a particular programming language?


Addition: In the Java programming language, A^B is not exponentiation but instead bitwise exclusive OR (bitwise XOR). See What does the ^ operator do in Java? Since this operation is associative, A^(B^C) == (A^B)^C for XOR, there will usually not be an issue here.