Results 1 to 6 of 6
Thread: Excel calculation order

20110515, 20:08 #1
 Join Date
 Jan 2001
 Location
 La Jolla, CA
 Posts
 1,546
 Thanks
 39
 Thanked 69 Times in 65 Posts
Excel calculation order
The math problem: (1/16)^(2/3) produces an error in Excel.
However, ((1/16)^2)^(1/3) does not.
Neither does: ((1/16)^(1/3))^2
Why is that?
Guess it's that 1/16 with the attempt to raise it to the 2/3 power or the positive 0.6666 power.
Those negatives just have a problem when intermixed in power problems.
Almost gives the impression the problem doesn't have a real solution, but it does actually.Last edited by kweaver; 20110515 at 20:12.

20110516, 06:06 #2
 Join Date
 Jul 2002
 Location
 Pittsburgh, Pennsylvania, USA
 Posts
 11,225
 Thanks
 14
 Thanked 342 Times in 335 Posts
I presume that the method for calculating whole number roots are different than fractional. I will make a leap and presume the fractional problem:
A=(1/16)^(2/3)
A=0.0625^0.66666666666666
lnA = ln(0.0625^0.66666666666666)
lnA = 0.66666666666666 * ln(0.0625)
ln(0.625) is undefined so is an error.....
I presume the 1/3 uses a different procedure (perhaps a builtin one) involving some type of series...
These are only speculations, I am not privy to the actual coding done in excel...
Steve
PS something to think about:
(1/16)^(1/2)
Is a complex (nonreal) number.
But using distribution manipulation like you do, excel can calculate it:
((1/16)^(2))^(1/4) = 0.25
But 0.25^2 does not equal 1/16...
Which indicates to me that your distributive recalculation is not always the same thing as the original. Your reordering may be changing the values....
The solution you get in those 2 calcs:
0.15749 ^ (3/2) = 1/16 not 1/16....Last edited by sdckapr; 20110516 at 10:33.

20110516, 07:48 #3
 Join Date
 Mar 2004
 Location
 Manning, South Carolina
 Posts
 9,838
 Thanks
 412
 Thanked 1,573 Times in 1,424 Posts
Excel Order of Operations
Excel has a very definite order of operations as shown in the attached table. The best policy is to never depend on the default order but to control the order of operations using parenthesis with the inner most set of parenthesis being evaluated first and working outward.
The default order of operations is as shown in the table with operations at the same level being evaluated left to right.
Examples:
Where A1=1; A2=2; A3=3; A4=4
=A1(A2*(A3^A4)) This is the parenthesized version of the default order.
=1(2*(3^4))
=1(2*81)
=1162
=161
=(A3*A4)(A1*(A4^A2))
=(3*4)(1*(4^2))
=12(1*(16)
=1216
=4
=(A3*A4)((A1)*(A4^A2))
=(3*4)((1)*(4^2)
=12(1*16)
=12(16)
=28Last edited by RetiredGeek; 20110517 at 08:52. Reason: Fixed Type pointed out by Fred...Thanks
May the Forces of good computing be with you!
RG
PowerShell & VBA Rule!
My Systems: Desktop Specs
Laptop Specs

20110517, 07:59 #4
 Join Date
 Jan 2001
 Location
 West Long Branch, New Jersey, USA
 Posts
 1,935
 Thanks
 6
 Thanked 9 Times in 7 Posts
typo?
RetiredGeek
I think you have a typo in your first example where you do 3^4 and in the next line have 2*91. The following line does correctly show 162, which would be the result of 2*81 and 81=3^4.
But for any nonmath people reading your post (eg, my students), you might want to consider correcting that. Otherwise, I know I'll be getting answers like that.
Fred

20110517, 08:26 #5
 Join Date
 Jan 2001
 Location
 West Long Branch, New Jersey, USA
 Posts
 1,935
 Thanks
 6
 Thanked 9 Times in 7 Posts
there are a few other quirks that one can show and they have nothing to do with Excel. These have to do when neg numbers are introduced where they shouldn't be.
For example: log bases are defined to be nonneg  the log bases correspond to the base of an exponential. That is log(base) of arg = exp where base is a nonneg number by definition; when considering the corresponding exponential representation, this becomes base^exp = arg where base is >0 and NE 1. This is because if base were allowed to be neg, then you'd have an oscillating function as the sign of the result alternates between plus and minus as exp changes between even and odd. Without this restriction, one could ask the question log(2)16 = ?. My students always say 4 since (2)^4 = 16 (a teacher's favorite trick log question).
Similarly log args are also nonneg as you observed in Steve's example, since a pos base raised to any exp is always pos.
Makes for nice continuous functions.
Another item using the property of exponents in fraction form that applies to the original example: sqrt(4^2) = (sqrt(4))^2. But if use 4, one gets sqrt(4^2) =4 which is NE to (sqrt(4))^2 = 4. Hence, the rules of exponents do not apply to neg numbers.

20110517, 08:53 #6
 Join Date
 Mar 2004
 Location
 Manning, South Carolina
 Posts
 9,838
 Thanks
 412
 Thanked 1,573 Times in 1,424 Posts
May the Forces of good computing be with you!
RG
PowerShell & VBA Rule!
My Systems: Desktop Specs
Laptop Specs