12

If you look at $2^{3^4}$, what is the expected result? Should it be read as $2^{(3^4)}$ or $(2^3)^4$? Normally I would use parentheses to make the meaning clear, but if none are shown, what would you expect?

(In this case, the formatting gives a hint, because I can either enter $2^{3^4}$ or ${2^3}^4$. If I omit braces in the MathML expression, the output is shown as $2^3^4$. Just suppose all three numbers were displayed in the same size, and the same vertical offset between 2, 3 and 3, 4.)

MJD
  • 65,394
  • 39
  • 298
  • 580
Axel
  • 233
  • Without any convention it is ambiguous, same as it is for any operation that is nonassociative, i.e. $\rm: x \circ ( y \circ x) \ne (x \circ y) \circ z.\ $ – Math Gems Apr 12 '13 at 16:25
  • 5
    @MathGems, this operation is deemed right-associative (in programming-language-speak), i.e. $a * b * c$ means $a * (b * c)$. That makes sense, because otherwise $a^{b^c}$ would be just the same as $a^{b c}$, and the extra power would be just a waste of ^ ;-) In the end, that is just a convention, like $a b + c$ means $(a b) + c$, not $a (b + c)$. – vonbrand Apr 12 '13 at 16:29
  • @vonbrand That is one possible convention. But it is not universal. – Math Gems Apr 12 '13 at 16:30
  • 1
    @MathGems, it is universal enough for me. Haven't ever (outside of APL, that is) seen any other interpretation: In mathematics, and in computer languages like FORTRAN and others. – vonbrand Apr 12 '13 at 16:32
  • 2
    In normal mathematical usage, the exponential operation is "right" associative, i.e. if you see $a^{b^c}$, it means $a^{(b^c)}$. If you see "a^b^c", it usually means "a^(b^c)". However, this is not universal. e.g. Excel will interpret "a^b^c" as "(a^b)^c". – achille hui Apr 12 '13 at 16:41
  • @vonbrand "Universal enough?" You cannot even typeset it unparenthesized here, as mathjax/LaTeX will reject it. – Math Gems Apr 12 '13 at 16:46
  • See http://math.stackexchange.com/questions/534578/xyz-is-it-xyz-or-xyz – Martin Sleziak Apr 13 '14 at 05:00

2 Answers2

16

Barring parentheses, $2^{3^4}$ should definitely be read as, and is equivalent to $\;2^{\left(3^4\right)}$:$$2^{3^4} = 2^{(3^4)} = 2^{81}$$ whereas $${(2^3)}^4 = 2^{3\cdot 4} = 2^{12}$$


Added:

As pointed out in the comments, it is fairly standard practice that exponents are "right associative" - which is somewhat of a misnomer which should only be taken to mean, evaluate rightmost first: read a^b^c as a^(b^c) and read a^b^c^d as a^[b^(c^d)], and so on. As the example above shows,the exponential operator is not associative. So as you have indicated you typically do, use parentheses, when possible, in your own usage, to avoid any possible confusion.

amWhy
  • 209,954
  • @Dolma, I lost my brain and was thinking of $3^6$ in the exponent for some reason! ;-) – amWhy Apr 12 '13 at 16:33
  • 1
    Ok, with your edit I think this is just fine. Wikipedia hinted me at the same in the entry about operator associativity in programming languages ("In order to reflect normal mathematical usage, addition, subtraction, multiplication, and division operators are usually left-associative while an exponentiation operator (if present) is right-associative."). – Axel Apr 12 '13 at 16:36
0

In the same way that any expressions in brackets inside other brackets are done before the rest of the things in the brackets, I'd say that one works from the top down in such a case.

i.e. because we do $(a*d)$ first in$((a*b)*c)*d$, I'd imagine it'd be the expected thing to do $x^{(y^z)}$

Tim
  • 3,349