Larger stack size
12-29-2020, 06:18 PM
Post: #21
 Mike (Austria) Junior Member Posts: 11 Joined: Sep 2018
RE: Larger stack size
In conventional math notation, serial exponentiation is right-associative: https://en.wikipedia.org/wiki/Order_of_o...nentiation
Best! Mike
12-29-2020, 06:20 PM
Post: #22
 Albert Chan Senior Member Posts: 2,100 Joined: Jul 2018
RE: Larger stack size
(12-29-2020 05:56 PM)Allen Wrote:  Symbolically it does.

This is exactly the reason exponentiation is evaluated from right to left.
(had it been from left to right, we could have rewritten as products of exponents)

lua> pow(2, pow(1.8, pow(1.6, pow(1.4, 1.2))))
9.72086810644022

lua> 2 ^ 1.8 ^ 1.6 ^ 1.4 ^ 1.2
9.72086810644022
12-29-2020, 06:23 PM (This post was last modified: 12-29-2020 06:25 PM by Massimo Gnerucci.)
Post: #23
 Massimo Gnerucci Senior Member Posts: 2,519 Joined: Dec 2013
RE: Larger stack size

Greetings,
Massimo

-+×÷ ↔ left is right and right is wrong
12-29-2020, 06:26 PM
Post: #24
 Dave Britten Senior Member Posts: 2,168 Joined: Dec 2013
RE: Larger stack size
(12-29-2020 05:56 PM)Allen Wrote:
(12-29-2020 04:59 PM)Valentin Albillo Wrote:  Wrong. Yout code above does not compute correctly that tower of exponentials.
V.

Symbolically it does.

In python it's off by the trailing digit, but the same could be true of either implementation on different calculators with different accuracy.

Code:
 pow(pow(pow(pow(2,1.8),1.6),1.4),1.2) Out[124]: 28.609056210554545 pow(2,1.8*1.6*1.4*1.2) Out[125]: 28.60905621055455

I would suggest that on a pocket calculator
$$2^{1.8*1.6*1.4*1.2}$$
is the better approach since there is only 1 opportunity to cascade floating point errors, rather than the nested exponential which propagates any round-off error from the first EXP several times before arriving at the final result.

I think there's some disagreement over the associativity of exponentiation. The 65 Notes article suggests it's right associative - i.e. 2^1.8^1.6^1.4^1.2 = 2^(1.8^(1.6^(1.4^1.2))) - which the 35's x^y is particularly well suited to handle. That is, of course, most definitely not equal to 2^(1.8*1.6*1.4*1.2). If we assume the exponents are left-associative, then you are correct.

It seems like TI treats it as left-associative (28.6) according to my 58C, 85, and 84 Plus, and Casio changed from left-associative to right-associative (9.72) at some point: my fx-7000G is left-associative, and the fx-5800P and fx-991EX both display the operator as ^( in line I/O mode, clearly showing the right associativity.
12-29-2020, 06:29 PM
Post: #25
 Massimo Gnerucci Senior Member Posts: 2,519 Joined: Dec 2013
RE: Larger stack size
(12-29-2020 06:26 PM)Dave Britten Wrote:  I think there's some disagreement over the associativity of exponentiation.

Mathematically none that I know of.

Greetings,
Massimo

-+×÷ ↔ left is right and right is wrong
12-29-2020, 06:31 PM
Post: #26
 Dave Britten Senior Member Posts: 2,168 Joined: Dec 2013
RE: Larger stack size
(12-29-2020 06:29 PM)Massimo Gnerucci Wrote:
(12-29-2020 06:26 PM)Dave Britten Wrote:  I think there's some disagreement over the associativity of exponentiation.

Mathematically none that I know of.

Between calculator models, there certainly seems to be.

The TI 84 Plus is worse than I thought: it's left-associative in classic mode, and right-associative in Math Print mode. The exact same key sequence will give you a different result depending on which of the two display modes you're in! I think Casio has the right idea of making it clearly right-associative, with a forced ( in line-I/O mode.
12-29-2020, 09:07 PM
Post: #27
 Valentin Albillo Senior Member Posts: 909 Joined: Feb 2015
RE: Larger stack size
(12-29-2020 05:56 PM)Allen Wrote:
(12-29-2020 04:59 PM)Valentin Albillo Wrote:  $$2^{1.8^{1.6^{1.4^{1.2}}}}$$

Wrong. Yout code above does not compute correctly that tower of exponentials.
V.

Symbolically it does.

Nope. Written as you posted, it's evaluated from right to left, i.e.: you first evaluate 1.4^1.2, then 1.6 raised to the last result, then 1.8 raised to the last result, then 2 raised to the last result.

That final result is 9.720868106440216192155483936635...

V.

All My Articles & other Materials here:  Valentin Albillo's HP Collection

12-29-2020, 10:10 PM (This post was last modified: 12-29-2020 10:11 PM by robve.)
Post: #28
 robve Senior Member Posts: 360 Joined: Sep 2020
RE: Larger stack size
(12-29-2020 09:07 PM)Valentin Albillo Wrote:
(12-29-2020 05:56 PM)Allen Wrote:  Symbolically it does.

Nope. Written as you posted, it's evaluated from right to left, i.e.: you first evaluate 1.4^1.2, then 1.6 raised to the last result, then 1.8 raised to the last result, then 2 raised to the last result.

That final result is 9.720868106440216192155483936635...

V.

Since the dawn of computing it's been "top down" or right associative. Otherwise it is a bug.

However, mathematicians like Neil Sloane take a much more creative look at this problem with "Dungeon Numbers - Numberphile" giving "top down" an entirely different meaning

One of my favorite videos.

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
12-30-2020, 01:49 PM
Post: #29
 ijabbott Senior Member Posts: 1,211 Joined: Jul 2015
RE: Larger stack size
(12-29-2020 06:31 PM)Dave Britten Wrote:
(12-29-2020 06:29 PM)Massimo Gnerucci Wrote:  Mathematically none that I know of.

Between calculator models, there certainly seems to be.

The TI 84 Plus is worse than I thought: it's left-associative in classic mode, and right-associative in Math Print mode. The exact same key sequence will give you a different result depending on which of the two display modes you're in! I think Casio has the right idea of making it clearly right-associative, with a forced ( in line-I/O mode.

The Casio solution is a good technique. For the TI, you can understand why they would have made it left-associative in classic mode for consistency with other binary operators, and perhaps for consistency with earlier AOS models.

Back to HP Land, the HP-27S also has a left-associative exponentiation operator, but it displays partially evaluated results as it goes, so that [3] [x^y] [3] [x^y] [3] is finally displayed as 27^3.

— Ian Abbott
12-30-2020, 02:11 PM
Post: #30
 Dave Britten Senior Member Posts: 2,168 Joined: Dec 2013
RE: Larger stack size
(12-30-2020 01:49 PM)ijabbott Wrote:
(12-29-2020 06:31 PM)Dave Britten Wrote:  Between calculator models, there certainly seems to be.

The TI 84 Plus is worse than I thought: it's left-associative in classic mode, and right-associative in Math Print mode. The exact same key sequence will give you a different result depending on which of the two display modes you're in! I think Casio has the right idea of making it clearly right-associative, with a forced ( in line-I/O mode.

The Casio solution is a good technique. For the TI, you can understand why they would have made it left-associative in classic mode for consistency with other binary operators, and perhaps for consistency with earlier AOS models.

Back to HP Land, the HP-27S also has a left-associative exponentiation operator, but it displays partially evaluated results as it goes, so that [3] [x^y] [3] [x^y] [3] is finally displayed as 27^3.

Interestingly, the fx-CG500 (the calculator formerly known as ClassPad) will display the entry as 3^3^3 without any parentheses, but still evaluates it as right-associative (i.e. 7.63E12 rather than 19683). The fx-991MS 2nd Edition also does not include parentheses, but evaluates this as left-associative. The TI Voyage 200 - and presumably 92 and 89 - are right-associative, and will even automatically change your input to 3^(3^3) after entry if pretty print mode is turned off (if it's on you get a tower of superscripts).

Very strange to see so much inconsistency on this, even between calculators from a single manufacturer.
12-30-2020, 02:19 PM (This post was last modified: 12-30-2020 10:35 PM by robve.)
Post: #31
 robve Senior Member Posts: 360 Joined: Sep 2020
RE: Larger stack size
(12-29-2020 06:31 PM)Dave Britten Wrote:
(12-29-2020 06:29 PM)Massimo Gnerucci Wrote:  Mathematically none that I know of.

Between calculator models, there certainly seems to be.

The TI 84 Plus is worse than I thought: it's left-associative in classic mode, and right-associative in Math Print mode. The exact same key sequence will give you a different result depending on which of the two display modes you're in! I think Casio has the right idea of making it clearly right-associative, with a forced ( in line-I/O mode.

No, no, no! The Ti 84 Plus is not that bad. Let's take a look at Ti BA II Plus Professional. Quoting from the manual:

Choosing Calculation Methods
When you choose chain (Chn) calculation method, the calculator solves problems in the order that you enter them. (Most financial calculators use Chn.)
For example, when you enter 3[+]2[x]4[=], the Chn answer is 20 (3+2=5, 5*4=20).

The worst part is that Chn is the default method on all of these calculator models. Their AOS^tm (algebraic operation system) is only optional, and "solves problems according to the standard rules of algebraic hierarchy."

Apparently financial calculators only offer one register to calculate with, i.e. a stack of one register (an accumulator). Why bother calculating with a stack of four registers?

PS. Funny that they introduce fancy names for standard stuff, like AOS^tm and also APD^tm (automatic power down). I'm sure their marketing department had some say in this crap.

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
01-04-2021, 12:21 PM
Post: #32
 JSBach Junior Member Posts: 25 Joined: Feb 2018
RE: Larger stack size
Hi,

on the HP-28S if I type '3^3^3 [EVAL]
I get 19683

Fail :-(

JSB
01-04-2021, 03:58 PM
Post: #33
 John Keith Senior Member Posts: 859 Joined: Dec 2013
RE: Larger stack size
This appears to have changed at some point, the 50g returns 7625597484987, which is 3^(3^3) as opposed to (3^3)^3.
 « Next Oldest | Next Newest »