HP Forums
What is the correct result? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: What is the correct result? (/thread-21474.html)

Pages: 1 2 3 4


RE: What is the correct result? - mfleming - 03-20-2024 09:21 PM

(03-20-2024 10:31 AM)vaklaff Wrote:  ... and here we go :-)

Are there any more examples? Did BASIC or PROLOG raise similar hopes back in their time?

OK, back in the early days of COBOL didn't they assume a businessman could simply dictate a progam to a secretary, even illustrating the process with a photo?


RE: What is the correct result? - DGM - 03-21-2024 04:44 AM

As someone conversant with Fortran (high school and college), Basic (Commodore Pet and others), COBOL (work), and other computer languages, I really wanted to learn APL because it looked cool. I went to a computer swap meet while in San Francisco visiting a friend, and picked up a floppy disc with IBM’s TryAPL2 on it - an interpreter for APL code with examples. It was a great way to learn it without sinking a lot of money into a development environment (that came later). One year I entered a contest in Byte Magazine to write some APL code to solve a problem, and never heard back from them. Nor did they publish the follow-up article on it. I think it was Bill Machrone who posed the problem. I also got into J (jsoftware.com), which Kenneth Iverson and Roger Hui came up with as “APL without the funny characters”, using regular symbols like “,” and “;” and “<“ and “?” to do pretty much the same thing: have a simple way to write terse code. It confuses me because it is made up of verbs and adverbs and nouns and gerunds, and I never learned to diagram a sentence.


RE: What is the correct result? - SlideRule - 03-21-2024 03:29 PM

(03-21-2024 04:44 AM)DGM Wrote:  As someone conversant with Fortran (high school and college), Basic (Commodore Pet and others), COBOL (work), and other computer languages, I really wanted to learn APL … It confuses me because it is made up of verbs and adverbs and nouns and gerunds, and I never learned to diagram a sentence.

I found this article, BASIC, FORTRAN and COBOL in Chemical Engineering magazine {vol 90 #5, 1983 ⁄07 ⁄25, pages 81-84) by Namir C. Shammas a most edifying read on the above referenced topic. Give it a go!

BEST!
SlideRule

ps: there is a positive follow on comment to this article in vol. 90, #21 {1983 ⁄10 ⁄17}, page 5


RE: What is the correct result? - Jlouis - 03-21-2024 07:04 PM

(03-21-2024 03:29 PM)SlideRule Wrote:  
(03-21-2024 04:44 AM)DGM Wrote:  As someone conversant with Fortran (high school and college), Basic (Commodore Pet and others), COBOL (work), and other computer languages, I really wanted to learn APL … It confuses me because it is made up of verbs and adverbs and nouns and gerunds, and I never learned to diagram a sentence.

I found this article, BASIC, FORTRAN and COBOL in Chemical Engineering magazine {vol 90 #5, 1983 ⁄07 ⁄25, pages 81-84) by Namir C. Shammas a most edifying read on the above referenced topic. Give it a go!

BEST!
SlideRule

ps: there is a positive follow on comment to this article in vol. 90, #21 {1983 ⁄10 ⁄17}, page 5

Broken link


RE: What is the correct result? - John Keith - 03-21-2024 07:08 PM

(03-21-2024 04:44 AM)DGM Wrote:  ... I also got into J (jsoftware.com), which Kenneth Iverson and Roger Hui came up with as “APL without the funny characters”, using regular symbols like “,” and “;” and “<“ and “?” to do pretty much the same thing: have a simple way to write terse code.

J seems even less readable than APL to me due to the seemingly random use of ASCII characters for mathematical operations. And people think RPL is unreadable. Harrumph! Big Grin


RE: What is the correct result? - SlideRule - 03-21-2024 07:22 PM

(03-21-2024 07:04 PM)Jlouis Wrote:  Broken link

FIXED: sorry!

SlideRule


RE: What is the correct result? - carey - 03-21-2024 08:24 PM

(03-21-2024 07:08 PM)John Keith Wrote:  
(03-21-2024 04:44 AM)DGM Wrote:  ... I also got into J (jsoftware.com), which Kenneth Iverson and Roger Hui came up with as “APL without the funny characters”, using regular symbols like “,” and “;” and “<“ and “?” to do pretty much the same thing: have a simple way to write terse code.
J seems even less readable than APL to me due to the seemingly random use of ASCII characters for mathematical operations. And people think RPL is unreadable. Harrumph! Big Grin
Yes, while APL’s eventual character set (not fully formed in Iverson’s 1962 book “A Programming Language”) was constrained to use characters (glyphs) that could be included in an IBM selectric typewriter font ball, at least APL glyphs evoke some visual connection to their name or function (e.g., grade up ⍋, grade down ⍒), little visual connection between ASCII symbols and name is found in J, whose appearance has justifiably been described as “line noise.” While a pain to use, APL glyphs are an endearing feature of APL, and are iconic (pun intended).

It may be of interest that ELI is a largely ISO APL compatible APL variant (with additional features e.g., complex #’s, tables, etc.) that also uses an ASCII character set, but unlike J, ELI’s ASCII character set bears at least some visual connection with APL glyphs, names or functions (e.g., compare iota ⍳ (iota in APL) to ! (iota in ELI). Having such visual cues to APL glyphs while using an ASCII font is a nice feature of ELI.


RE: What is the correct result? - mfleming - 03-21-2024 08:58 PM

(03-21-2024 08:24 PM)carey Wrote:  It may be of interest that ELI is a largely ISO APL compatible APL variant (with additional features e.g., complex #’s, tables, etc.) that also uses an ASCII character set, but unlike J, ELI’s ASCII character set bears at least some visual connection with APL glyphs, names or functions (e.g., compare iota ⍳ (iota in APL) to ! (iota in ELI). Having such visual cues to APL glyphs while using an ASCII font is a nice feature of ELI.

Eli to C compiler for speeding up an APL application, and possible multicore parallelization? Oh my, yet another task to add to my backlogged to-do list Sad
Thanks for the reference Smile


RE: What is the correct result? - carey - 03-21-2024 09:19 PM

(03-21-2024 03:29 PM)SlideRule Wrote:  I found this article, BASIC, FORTRAN and COBOL in Chemical Engineering magazine {vol 90 #5, 1983 ⁄07 ⁄25, pages 81-84) by Namir C. Shammas a most edifying read on the above referenced topic. Give it a go!
BEST!
SlideRule

This is a very nice 1983 article. Thank you 'SlideRule' for posting it and well done, Namir, for writing it! The 3 listings it contains of a chem engineering program, in BASIC, Fortran and Pascal, are like a Rosetta Stone for comparing the languages. Just one comment about the last paragraph sentence "C is similar to Pascal" is that Brian Kernighan (The C Programming Language, Kernighan and Richie, 1983) might disagree :)


RE: What is the correct result? - johnb - 03-22-2024 04:18 PM

(03-21-2024 08:24 PM)carey Wrote:  
(03-21-2024 07:08 PM)John Keith Wrote:  J seems even less readable than APL to me due to the seemingly random use of ASCII characters for mathematical operations. And people think RPL is unreadable. Harrumph! Big Grin
Yes, while APL’s eventual character set (not fully formed in Iverson’s 1962 book “A Programming Language”) was constrained to use characters (glyphs) that could be included in an IBM selectric typewriter font ball, at last APL glyphs evoke some visual connection to their name or function (e.g., grade up ⍋, grade down ⍒), little visual connection between ASCII symbols and name is found in J, whose appearance has justifiably been described as “line noise.” While a pain to use, APL glyphs are an endearing feature of APL, and are iconic (pun intended).

It may be of interest that ELI is a largely ISO APL compatible APL variant (with additional features e.g., complex #’s, tables, etc.) that also uses an ASCII character set, but unlike J, ELI’s ASCII character set bears at least some visual connection with APL glyphs, names or functions (e.g., compare iota ⍳ (iota in APL) to ! (iota in ELI). Having such visual cues to APL glyphs while using an ASCII font is a nice feature of ELI.

And then, there are software people in the world who make programming languages that are deliberately warped or obtuse: Intercal (created as a joke at Princeton in 1972), which stands for "Computer Language With No Pronounceable Acronym", was one of the earliest. (http://www.catb.org/~esr/intercal/)

There are others, some with even more delicious names: Maleboge (named after Dante's 8th Circle of Hell), LOLCode*, and BrainF**k. The "Whitespace" language treats only the whitespace characters (space, tab, and return) as syntactically significant, rendering it devilishly difficult to read, but also allowing the developer to steganographically embed their real program in a trivial C, Pascal, or other program, enabling plausible deniability. (Put that in your good programming practices pipe and try to smoke it!)

Reading RPL is, by comparison to these, like reading "Fun With Dick and Jane."

And then there was my own humble contribution, PATHETIC. So named because most programmers had written at least one program in it anyway, as evidenced by someone looking over your shoulder at a printout and commenting, "Gee, that's PATHETIC."

Wink
______________
* LOLCode version of "Hello World":
Code:
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE



RE: What is the correct result? - Matt Agajanian - 04-12-2024 10:50 PM

Hi all.

Here’s a new one.

While following another of those 'What’s the answer' posts, from my post a FB poster stated that "Implied multiplication has no priority." Then, in another statement I made about PEJMDAS, the individual commented Casio and Sharp are, get this, incorrectly programmed and TI is the most reliable.

What do you make of this?


RE: What is the correct result? - carey - 04-13-2024 01:26 AM

(04-12-2024 10:50 PM)Matt Agajanian Wrote:  Hi all.

Here’s a new one.

While following another of those 'What’s the answer' posts, from my post a FB poster stated that "Implied multiplication has no priority." Then, in another statement I made about PEJMDAS, the individual commented Casio and Sharp are, get this, incorrectly programmed and TI is the most reliable.

What do you make of this?

There is no mystery.

But before replying directly to the question, it seems important to recognize that operator precedence is a mathematical convention invented by people (as in Kronecker’s saying: ”God made the integers; all else is the work of man”). People did arithmetic before calculators and there was no universally agreed upon operator precedence before around 1920. As nicely detailed in this YouTube video by an Australian math video creator (starting around 6:45 in the clip) calculators created the recent chaos for math teachers, students and calculator users (but not for professional mathematicians).

As explained in the video (which includes material from Casio and TI managers) North American teachers prefer the (current) TI convention (PEMDAS) while elsewhere in the world PEJMDAS is preferred. (Mercifully, the video defines these terms! :)

Because of TI’s long-standing relationship with the National Council of Teachers of Mathematics (NCTM), the preference of N.A. teachers for the TI convention is not surprising and might be an example of the tail wagging the dog. Thus, the cited FB comment claiming that TI is more reliable and that Casio and Sharp are wrong appears to simply reflect a geography-based preference and not a universal truth.

An interesting sidenote is that at 11:35 in the video the operator precedence for the HP35s appears to throw the video creator for a loop!


RE: What is the correct result? - Matt Agajanian - 04-13-2024 01:52 AM

Carey (and the other MoHPC members):

Thanks for setting the record straight. Carey, your perspective has been mine since I saw the video I'll post later.

In the multitude of YT (not FB) videos I've seen, there's one which is quite technical and very telling. It highlights the trains of thought as well as how distinguished mathematicians have handled the PEJMDAS/PEDMAS dichotomy,

Once I find the video, I'll post the link


RE: What is the correct result? - Matt Agajanian - 04-13-2024 01:56 AM

Here’s the video I’m referring to;

The Problem with PEDMAS: Why calculators differ.


RE: What is the correct result? - Matt Agajanian - 04-14-2024 01:44 AM

Sorry for the double post. But here is a response I got from my exchange on FB:

Casio has been sued in multiple countries for changing the programming in their calculators depending on the market they're selling to, so they really aren't a remotely reputable brand.

Has anyone heard about this?


RE: What is the correct result? - Maximilian Hohmann - 04-15-2024 11:06 AM

Hello!

(04-14-2024 01:44 AM)Matt Agajanian Wrote:  Sorry for the double post. But here is a response I got from my exchange on FB:

"FB" means Facebook? I don't use it and am not really familiar with the abbreviation.

(04-14-2024 01:44 AM)Matt Agajanian Wrote:  Has anyone heard about this?

First this answer: No. And I have even bothered to search in different languages.

(04-14-2024 01:44 AM)Matt Agajanian Wrote:  Casio has been sued in multiple countries for changing the programming in their calculators depending on the market they're selling to, so they really aren't a remotely reputable brand.

I completely disagree with everything contained in this statement. Really everything. Fully and totally.

1. Being sued does not make a brand non-reputable. Only being convicted. Google does not find any reference to lawsuits and no refrence to verdicts against Casio either. At least I could not find them using Google.

2. Localising products for different parts of the world is totally normal and happens everywhere. Ever seen a Mercedes delivered to the United Kingdom? It has the steering wheel on the "wrong side". To my knowlede, nobody ever sued Mercedes for adapting their products to local conditions. To my knowledge, no one ever sued HP either for delivering calculators to Europe which show a comma instead of a decimal point. And even if someone did, that would not make HP a "not remotely reputable brand", wouldn't it?

3. Casio calculators are and remain the intellectual property of Casio. They can do with them and their microcoding what they want. If they decide to change the order of operations they are free to do so as they please. Casio does not even hide these things from their customers because they clearly include the intended marketing region in the product designation, e.g. "fx-810DE CW" where "DE" stands for Deutschland and means, that the calculator is compliant with german school and exam regulations. Additionally, every instruction manual of every calculator from Casio can be downloaded for free by anybody, even without purchasing one. So if unsure, look inside the maual before buying.

4. Sueing people and companies over trivialities is a very American thing (sorry to say that) and certainly not common "in multiple countries". In my part of the world, no court would even accept a lawsuit of someone complaing that a product behaves exactly as advertised. Even if the predecessor behaved differently. And even if someone would be accepted before court with such a claim, the case would not end with a verdict but with a judicial settlement instead. By which Casio will take back the calculator in question and reimburse the 25 Euros to the plaintiff, even if the unit is already out of warranty. The court costs and legal fees will be split in half, leaving the plaintiff with a four-figure bill over a 25 Euro calculator...

Regards
Max

NB: Of course I am still interested in those court cases in multiple countries if someone can find them!


RE: What is the correct result? - Eddie W. Shore - 04-15-2024 01:12 PM

My first thought is go with what Tony Barlow said in Gene Wrights' presentation when Barlow reviewed the ill-fated never-released TI-88:

"1. Kill Implied Multiplication.
2. Kill Implied Multiplication.
3. Kill Implied Multiplication."

https://www.youtube.com/watch?v=wl16wzmn3wA
Scroll to 13:24.

I'm for consistency. I would do what CAS calculators that allow more than one-character variable names: require multiplication symbols (dots, crosses, asterisks) in between operators to be multiplied. Every time. In programs I write, I put multiplication symbols every time. Yes it costs me some bytes but clarity is well worth the cost.

Notation like f(expression) should always be a function call, and 2(expression) would return an error message, requiring a multiplication symbol and/or perhaps an extra set of parenthesis if we really meant to prioritize (2 * (expression)).

Second, PEMDAS vs PEJMDAS seems to align with the way the world views the standard units in science:

PEMDAS: ft, sec, lbs (well, at least in the United States' teachers)
PEJMDAS: m, sec, kg

Third, I'm not a fan of "pick a lane" but in this case, the world needs to pick a method and stick to it, make it universal so there is no confusion. Americans, especially American teachers may have to swallow their pride on this one.


RE: What is the correct result? - Steve Simpkin - 04-15-2024 02:05 PM

Additional discussions of this implicit multiplication topic:
https://www.hpmuseum.org/forum/thread-11916.html
https://www.hpmuseum.org/forum/thread-8982.html
https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv021.cgi?read=246984
https://archived.hpcalc.org/museumforum/showthread.php?mode=linear&tid=246984&pid=247646

Wikipedia also has a description on Order of Operations and the ambiguity it can have.
https://en.wikipedia.org/wiki/Order_of_operations#Mixed_division_and_multiplication

TI's interpretation depends on the model:
https://education.ti.com/en/customer-support/knowledge-base/ti-83-84-plus-family/product-usage/11773

6/2(2+1) Facebook post with 8.3K comments!
https://www.facebook.com/story.php/?story_fbid=5332580956839639&id=649884238442691


RE: What is the correct result? - SlideRule - 04-15-2024 02:27 PM

Normally, I don't chime in on these discussions, however, I have a simple observation - the expression axn seems to affirm arguments both favoring and disfavoring implied multiplication {neh?}? It seems we have lost sight of the original argument over ambiguity in math notation and the posturing of parenthesis free notation (RPN, etc.) as a working solution {praxis}.

my pennies worth

BEST!
SlideRule


RE: What is the correct result? - Matt Agajanian - 04-15-2024 03:49 PM

(04-15-2024 11:06 AM)Maximilian Hohmann Wrote:  Hello!


1. Being sued does not make a brand non-reputable. Only being convicted. Google does not find any reference to lawsuits and no refrence to verdicts against Casio either. At least I could not find them using Google.

/quote]
...
[quote='Maximilian Hohmann' pid='186122' dateline='1713179173']

4. Sueing people and companies over trivialities is a very American thing (sorry to say that) and certainly not common "in multiple countries". In my part of the world, no court would even accept a lawsuit of someone complaing that a product behaves exactly as advertised. Even if the predecessor behaved differently. And even if someone would be accepted before court with such a claim, the case would not end with a verdict but with a judicial settlement instead. By which Casio will take back the calculator in question and reimburse the 25 Euros to the plaintiff, even if the unit is already out of warranty. The court costs and legal fees will be split in half, leaving the plaintiff with a four-figure bill over a 25 Euro calculator...

Regards
Max

NB: Of course I am still interested in those court cases in multiple countries if someone can find them!

Thanks for the extensive explanation.

Those quotes were from another Facebook member. That response was not mine. I don't know where that Facebook member got the info from.