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) |
What is the correct result? - hp41cx - 03-17-2024 03:03 PM Facebook link RE: What is the correct result? - SammysHP - 03-17-2024 04:33 PM Hard to say because it's in a private group. Could you please post your question here? RE: What is the correct result? - hp41cx - 03-17-2024 05:37 PM (03-17-2024 03:03 PM)hp41cx Wrote: Facebook link Sharp & Casio Facebook RE: What is the correct result? - Steve Simpkin - 03-17-2024 06:16 PM (03-17-2024 05:37 PM)hp41cx Wrote:(03-17-2024 03:03 PM)hp41cx Wrote: Facebook link That didn’t help. It’s still a private group. You can’t see any posts without joining first. RE: What is the correct result? - KeithB - 03-18-2024 02:04 PM I am going to guess "-2" since that is the answer to the usual question. RE: What is the correct result? - vaklaff - 03-18-2024 06:57 PM (03-18-2024 02:04 PM)KeithB Wrote: I am going to guess "-2" since that is the answer to the usual question. Quite right. And in the slim chance it’s not that question but the other question, the answer is 42. RE: What is the correct result? - Matt Agajanian - 03-18-2024 08:31 PM From what I’ve noticed about this inquiry and my personal experiences with my Casio fx-115/991, TI-30/36 X Pro MathPrint, and my Sharp EL-W516X,T, PEDMAS and PEJMDAS rules both depend on the manufacturer and the region. For example, schools in the US teach & follow PEDMAS while non-US countries subscribe to PEJMDAS. Plus, PEJMDAS is commonly used in the sciences. RE: What is the correct result? - Steve Simpkin - 03-18-2024 11:26 PM Yes it was just yet another 6÷2(2+1)=? post. To quote the movie Wargames, "Joshua: A strange game. The only winning move is not to play. How about a nice game of chess?" RE: What is the correct result? - johnb - 03-18-2024 11:40 PM (03-18-2024 11:26 PM)Steve Simpkin Wrote: Yes it was just yet another 6÷2(2+1)=? post. Would have been more warped if you had responded to the O.P. "How about a nice game of Global Thermonuclear War?" RE: What is the correct result? - johnb - 03-18-2024 11:49 PM (03-18-2024 08:31 PM)Matt Agajanian Wrote: Plus, PEJMDAS is commonly used in the sciences. If you really want to make your head hurt for a while, try learning APL and reading a few programs written in it. The language was developed by Dr. Kenneth E. Iverson as his doctoral dissertation in mathematics. His goals were (a) provide a formalized means of describing algorithms, and, as part of that, (b) provide a completely consistent mathematical language for doing so. He made everything into either monadic (1-argument) or dyadic (2-argument) functions. Negation is monadic, and subtraction is dyadic. And then he "solved" the rules of precedence by doing away with them entirely. Expressions are evaluated right-to-left, and parentheses DO gain precedence within that structure, but again, from right to left. Reading an APL program of any substance whatsoever is not for the faint of heart. RE: What is the correct result? - carey - 03-19-2024 12:29 AM (03-18-2024 11:49 PM)johnb Wrote: Reading an APL program of any substance whatsoever is not for the faint of heart.Fortunately, many APL programs are one-liners, so the pain is brief. :) RE: What is the correct result? - KeithB - 03-19-2024 01:58 PM The obvious answer is to use RPN. I think I have quoted it before, but here is APL's entry in "The Devil's DP Dictionary": APL n, [A Personal Language, A Packed Language, or rarely A Programming Language] A language devised by K Iverson, so compacted that the source code can be freely disseminated without revealing the programmer's intentions or jeopardizing proprietary rights. There are three things a man must do Before his life is done Write two lines in APL and make the buggers run. RE: What is the correct result? - carey - 03-19-2024 05:45 PM I love the well-deserved hilarity about APL's opaqueness, but in its defense, APL is an executable math notation. Iverson developed his math notation while teaching algorithms at Harvard in the late 1950's and, after being denied tenure (writing a book wasn't considered as tenure worthy as writing a paper), was offered a position at IBM where Iverson's math notation became a live programming language. APL does away with the step of needing to convert mathematical algorithms into code - an algorithm written in APL math notation IS the code, i.e., the middle man is eliminated and the math is executable. At least, that's how it was supposed to work! :) RE: What is the correct result? - mfleming - 03-19-2024 08:43 PM (03-19-2024 01:58 PM)KeithB Wrote: There are three things a man must doLet's not forget Aaron Hsu who did his dissertation on an APL compiler that targeted the GPU's array parallelism. The compiler, written in APL, fits on a T Shirt! [attachment=13383] https://www.bonfire.com/co-dfns-thesis-edition/?productType=bacf6cd6-b53d-469c-ab96-02afe5b15f71 RE: What is the correct result? - johnb - 03-19-2024 09:19 PM (03-19-2024 05:45 PM)carey Wrote: I love the well-deserved hilarity about APL's opaqueness, but in its defense, APL is an executable math notation. Iverson developed his math notation while teaching algorithms at Harvard in the late 1950's and, after being denied tenure (writing a book wasn't considered as tenure worthy as writing a paper), was offered a position at IBM where Iverson's math notation became a live programming language. APL does away with the step of needing to convert mathematical algorithms into code - an algorithm written in APL math notation IS the code, i.e., the middle man is eliminated and the math is executable. At least, that's how it was supposed to work I'm encouraged that others here are familiar with APL as well. And I did not know about Iverson being denied tenure! Yeah, at one time, IBM thought that APL was the language to save businessmen from reliance upon programmers! Hard to imagine how they arrived at that, if you've seen any nontrivial APL!! But they actually had short film clips showing how a businessperson could sit down to a live terminal session (because timesharing was futuristic and sexy!) and get answers with just a few keystrokes. A few years later, they thought the same thing about SQL... Today, a few idiots are suggesting just training a Generative AI on your business data and asking it questions. I guess it's cheaper than hiring consultants from a big-5 firm, and the answer quality might be similar... RE: What is the correct result? - johnb - 03-19-2024 09:32 PM (03-19-2024 01:58 PM)KeithB Wrote: APL n, [A Personal Language, A Packed Language, or rarely A Programming Language] Obligatory disclosure here: I learned to program in FORTRAN IV in 8th grade (on a 60-bit 1's complement CDC mainframe), and APL was my second computer language, picked up the following summer (at a non-boarding math camp). This may explain quite a bit about my particular mental abberations. Be that as it may, about 6-8 months after the end of that APL camp, I spent a half day shadowing some APL programmers at a local IBM facility. Their lunchtime sport was to print out an APL "one-liner" (which wrapped to about 6-8 lines when printed), shove it under the nose of a fellow programmer, and dare him to explain what the program does before the lunchbreak was over... RE: What is the correct result? - KeithB - 03-19-2024 09:41 PM (03-19-2024 09:19 PM)johnb Wrote: Yeah, at one time, IBM thought that APL was the language to save businessmen from reliance upon programmers! Hard to imagine how they arrived at that, if you've seen any nontrivial APL!! But they actually had short film clips showing how a businessperson could sit down to a live terminal session (because timesharing was futuristic and sexy!) and get answers with just a few keystrokes. The BigNerdRanch guy says that this is why NextStep was so popular with Business Analysts/programmers: The GUI was so easy, it let you focus on the problem at hand, rather than getting a button to run a certain piece of code. RE: What is the correct result? - vaklaff - 03-20-2024 10:31 AM (03-19-2024 09:19 PM)johnb Wrote: Yeah, at one time, IBM thought that APL was the language to save businessmen from reliance upon programmers! Hard to imagine how they arrived at that, if you've seen any nontrivial APL!! But they actually had short film clips showing how a businessperson could sit down to a live terminal session (because timesharing was futuristic and sexy!) and get answers with just a few keystrokes.When reading this, SQL popped up in my mind... (03-19-2024 09:19 PM)johnb Wrote: A few years later, they thought the same thing about SQL...... and here we go :-) Are there any more examples? Did BASIC or PROLOG raise similar hopes back in their time? RE: What is the correct result? - carey - 03-20-2024 12:28 PM (03-20-2024 10:31 AM)vaklaff Wrote:(03-19-2024 09:19 PM)johnb Wrote: Yeah, at one time, IBM thought that APL was the language to save businessmen from reliance upon programmers! Hard to imagine how they arrived at that, if you've seen any nontrivial APL!! But they actually had short film clips showing how a businessperson could sit down to a live terminal session (because timesharing was futuristic and sexy!) and get answers with just a few keystrokes.When reading this, SQL popped up in my mind... While APL and SQL, as johnb mentioned, were naively expected to allow business people to do constructive work without the intermediary of programmers, Dartmouth BASIC began as a tool in education, so its expectation (not completely naive) was that it could be used by professors and students both in learning and research and was widely used in the 1970's at Dartmouth and elsewhere even in the social sciences and humanities, as it was simple enough to use. PROLOG was expected to allow experts (e.g., doctors, lawyers, etc.) to develop expert systems on their own by inputting their knowledge as Prolog clauses, but in retrospect, would probably have been as successful if input as Santa Clauses :) RE: What is the correct result? - johnb - 03-20-2024 03:50 PM (03-20-2024 12:28 PM)carey Wrote: PROLOG was expected to allow experts (e.g., doctors, lawyers, etc.) to develop expert systems on their own by inputting their knowledge as Prolog clauses, but in retrospect, would probably have been as successful if input as Santa Clauses Anything is simple if you look at it shallowly enough! This reminds me of a canonical example... Many years ago when I was still just a journeyman programmer in my 20's, my manager actually complained "I don't know why it takes you guys so long to do anything! It's only writing!" I was very proud of my comeback: "Sir, how long would it take you to write a business plan for a large division of Corporation X?" Him: "From scratch?" Me: "Yes. Shouldn't take you more than half an afternoon. It's only writing." Enlightenment dawned. |