12
$\begingroup$

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.)

$\endgroup$
7
  • $\begingroup$ 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.\ $ $\endgroup$
    – Math Gems
    Apr 12, 2013 at 16:25
  • 5
    $\begingroup$ @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)$. $\endgroup$
    – vonbrand
    Apr 12, 2013 at 16:29
  • $\begingroup$ @vonbrand That is one possible convention. But it is not universal. $\endgroup$
    – Math Gems
    Apr 12, 2013 at 16:30
  • 1
    $\begingroup$ @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. $\endgroup$
    – vonbrand
    Apr 12, 2013 at 16:32
  • 2
    $\begingroup$ 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". $\endgroup$ Apr 12, 2013 at 16:41

2 Answers 2

16
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ @Dolma, I lost my brain and was thinking of $3^6$ in the exponent for some reason! ;-) $\endgroup$
    – amWhy
    Apr 12, 2013 at 16:33
  • 1
    $\begingroup$ 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."). $\endgroup$
    – Axel
    Apr 12, 2013 at 16:36
0
$\begingroup$

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)}$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .