Who cares for a divide key
#1

Today, while flirting with my first HP machine (15C), I had an epiphany: I realized that I almost never use the "division" key. Instead, for some reason which Freud might explain, I will always (at least for any non trivial fraction) first compute the denominator, invert it, and then multiply the numerator.

I don't know why I do it. It just comes natural to me. It may be something wich happens with all RPN nuts, or it may have had an origin when, at the beggining of times, in Calculus classes, I was trying the avoid the need to memorize yet another rule (derivative of a fraction) by forcing the world to be constituted only by multiplying factors.

Question: wich hypothesis is closer to the truth?

Hyp 1: Most RPN/RPL nuts are like this, because this is a disease which develops as a natural consequence of their (our) beloved yoda-speak;

Hyp 2: My kids are right: I am just weird.

BTW: Hypothesis 1, if true, would imply that the arithmetic key placement in HP41, with a seldom used key in such a privileged position, was not a best choice.

Best

Paulo


Edited: 8 July 2012, 6:03 a.m.

#2

Freud would say that you feel that "dividing" is a very negative action, while "multiplying" (God said to Adam and Eve to go forth and multiply) is is very intuitive for life (and even for evolution). The reciprocal makes results ready for multiplication. Also "reciprocating" is related to returning the "favor" or repaying "bad deeds".

Freud also asks about your relationship with your parents. Your next appointment is Monday July 16 at Berggasse 19, Vienna. You'd better be there, cause you never want Freud to come looking for you, cause Lisbon isn't that far from Vienna!

:-)

Frankenstein


Edited: 8 July 2012, 6:39 a.m.

#3

Hey, maybe we can eliminate another key as well. The minus key is such a negative thing :-) Why not just use the CHS (+/-) and a plus?

#4

Hello Paulo,

I fear, second hypothesis is right, but the good news is: the kids are alright and reasonable in this subject.


Greetings

peacecalc

#5

:-)

On top of your capabilities and dedication to linear algebra, you turn out to also be a very competent and polite freudian shrink (polite, because you said "parents", and not specifically "mother" :-) ), and, judging by your signature, you're made out of random body parts (same as a 41Cl I bought on TAS).

Man. You never cease to amaze me... ;-)

If they ever find out how much fun I occasionally get out of this forum, they will create a special tax for me: "if you're having fun, you should pay more"....

Cheers

Paulo

#6

Right. And why should we stop there? A 5 is just 3+2, or 1+1+1+1+1. A sin is simply SQRT(1-cos^2). And so on...

Come on. Be nice, and don't shoot me on this. Maybe Hyp 2 is true; but "weird" is not "crazy" (or so I keep repeating to myself)

;-)

Paulo

#7

Olá, Paulo! Greetings from the other side of the ocean! (Saudações do outro lado do oceano!)

Hey, why not to try an Einsteinian, or Matrix related...

Hyp. 3: using the [÷] key is not just a matter of choice, it's a matter of purpose (try reading this with Keanu Reeves' voice reverberating in your head and you'll have an astonishing surround effect...)

I am an RPN addicted, and I try to balance the use of available resources, mostly in programming. BTW, the reciprocal prior to multiplying implies division: 1/x.

Cheers.

Luiz (Terra do Pau Brasil)

Edited: 8 July 2012, 12:16 p.m.

#8

Olá, Luís

Let me try to clear things up. I'm not stating that calculators should not have the divide key. I was just asking if it is common for RPN users to seldom use it, as is my case, since that would imply an imperfect key assignment on the 41C.

By the look of things, I guess not. Hyp 2 on the OP is therefore true.

Quote:
and I try to balance the use of available resources, mostly in programming

Let me point out that, on average, the thing does not waste additional resources...

7
Enter
2
/

uses as many steps as

2
1/x
7
X

I guess we can come up with custom made examples which would be solvable more efficiently with the divide key, using the reciprocal and multiply, or using the X<>Y in any combination. But I don't think that, on the average, one can argue with efficiency in operation and/or programming.

It's just the way we mentally look at the expression, I guess.

Cheers

Paulo ( from Terra do Pau Lo) :-)

Edited: 8 July 2012, 1:57 p.m.

#9

Quote:
Let me point out that, on average, the thing does not waste additional resources...

It does - it wastes precious accuracy. ;-)

If the two operands are given exactly (in terms of machine precision) the result of a single division will be exact as well. An additional [1/x] however may add some rounding error:

Simply try [3] [ENTER] [6] [/] and compare the result with [6] [1/x] [3] [x].

Dieter

#10

Olá, Paulo;

First of all, forgive me.

I actually agree with all of what you wrote, I was just trying to make some fun of the circumstance with no intention to make it look small, just by adding a few more perspective. When I first red your post I found it had a bit of funny context, but it seems that my way of trying to be fun in English did not work too well...

Just a brief about the use of reciprocal prior to multiply: based on what ENTER does - mainly register manipulation - followed by a division, consider that the reciprocal and multiplication demand some more computing power than ENTER and division. That's what I had in mind in terms of balance.

Cheers.

Luiz (Brazil)

#11

Quote:
while "multiplying" ... is is very intuitive for life

so is "dividing" if you are an unicellular organisms.

#12

Adam & Eve did not go forth.

However, they did multiply - which created mankind and the various problems associated with it.

The Hp-71B went Forth - in 1984 - and multiplied also (and was codenamed Titan).

But sales were poor and it did not multiply to the extent it could solve the issues created by the aforementioned Dummköpfe.

E.

#13

Reminds me of a giant Levi's ad I saw one of these days :-)

GO FORTH

#14

Olá, Luiz

That's a valid point. Sorry for not having understood it immediately.
Will you forgive (and believe) me, if I blame Alzheimer for that? :-)

Um grande abraço cá da terrinha

Paulo

#15

It is worth pointing out that numerically a / b is not exactly the same as a * (1/b). The latter has an extra rounding step.

Take 5/6 as an example. On a 42S 5/6 correctly ends with a 3 whereas 5 * (1/6) ends with a 5. The latter is also correct based on the operations performed but is unlikely to be the desired answer.


- Pauli

#16

Didn't Whitehead and Russel pretty much prove, in Principia Mathematica, that addition is the only real operation? remember the successor of the successor of the successor....etc. We can delete ALL the operation keys and just have a + and CHS key, plus 10 numbers. Think of how small the calculator could be! Wait, think of how LONG the programs would be... Never mind.

Edited: 8 July 2012, 10:31 p.m.

#17

:-)

Edited: 8 July 2012, 10:44 p.m.

#18

ha

#19

Olá, Paulo.

No hard feelings at all, good to know that 'Lusophones' can understand each other in other languages as well.

And make fun of it... seriously! 8^D

And yep, let's blame that poor old German guy who's always forgetting things... what's his name? Can't remember...

Grande abraço daqui também! (A big hug from here, too!)

Luiz (Brazil)

#20

you two...

#21

A Turing calculator?

Or Peano's calculator?

#22

Ok. I surrender. I promise I will, henceforth, do my best to use the divide key as often as I can.
Try, I said.

:-)

Paulo

Edited: 9 July 2012, 3:01 a.m.

#23

Interestingly, using IEEE 854:

5/6     ==> 0.8333333333333334
5*(1/6) ==> 0.8333333333333333
#24

Olá Paulo,

My first thought was Paul's and Dieter's: it's not the same, numerically speaking.

However, you're making an interesting point about the suggested operation not taking any more entry steps.

Also, having had an epiphany when, only in college, I learned about inverse elements, I understand where you're coming from and wish to lend the following two bits of moral support to you:

- you can, with some justification, lay claim to be following a purer approach. In abstract algebra, there is no such thing as a divide and a minus. There's inverse elements instead. (And I swear it would be a good thing to tell 8-graders about it. Not doing so, is a detriment of math education in schools, IMO.)

- you can get fired if you use divides! That is, if you work as software developer in a game company. It belongs to the 101 of writing efficient computer graphics code to avoid divides and use multiplies instead. That's because, still today, a multiply executes typically one order of magnitude faster. If you need millions of them in an inner loop, you better compute the reciprocal beforehand, and stick to multiplying. (And I swear lots of code written in scientific computing would run an awful lot faster if physicists etc. knew that little bit of information. So, your proposed calculator modification would have led the way...)

Cheers.

#25

What rounding mode is in use here?

The 34S uses IEEE 854 and it matches the 42S giving 0.8333333333333333 and 0.8333333333333335 using the default rounding mode of round half to even. The only way I can see IEEE 854 getting ...34 for 5/6 is using the ceiling rounding mode.


- Pauli

#26

As Paulo dares to question the prominence of the divide key, let me "come out" in similar fashion and ask this:

Where's the undo key?

It's my most used function and key (when one exists).

Am I alone in thinking it's surprisingly difficult to get undo on HP calcs, and that it deserves to be a dedicated key? (Gladly aliased on the backspace key, if there's one.)

#27

Not sure. Please ask my Intel Core Duo 2 running under OS X.

Under gdb it actually does look like round half to even:

(gdb) p 5.0/6.0
$2 = 0.83333333333333337

(gdb) p 5.0*(1.0/6.0)
$4 = 0.83333333333333326

#28

This will be computed using IEEE 754 binary arithmetic not 854 decimal.

- Pauli

#29

Pauli,

Indeed. I misspelled 854 in my initial post. I meant to say IEEE-754.

This IEEE 854-1987 teaches me that both IEEE 854 and 754 have specs for both radix 2 and radix 10.

So, yes, I commented on the radix 2 IEEE-754 (or 854, I guess; not sure if the old spec would make any difference here; probably not).

Looking at the spec, just saying IEEE 754 is way too imprecise apparently. It appears I should have said "IEEE 754 double-precision binary floating-point format" or, less of a mouthful, "IEEE 754 binary64".

I assume that standard OSes define "round to nearest, ties to even" rounding mode.

So, finally, the reported values are good for "IEEE 754 double-precision binary floating-point format in round to nearest, ties to even rounding mode". Short and concise.

:-^-1* ( for those uninitiated: this is the old :-/ )

#30

Yeah the 754 and 854 specifications have kind of merged over the years. 854 used to be the decimal standard and 754 the binary.

I suspect your results ares for round to even binary floats. At least I'm fairly confident that the round to nearest decimal floats are behaving as I've suggested :-)


- Pauli

#31

Dear Oliver

Bless you! If I had any type of leverage up there, you would surely go to heaven, just because of this.

After reading your post, I'm even thinking that maybe (just maybe) I don't really need the shrink apointment Namir set me up with. :-)

(I also totally agree with your comments about the way algebra is, sometimes - or too often -, taught in school)

Best

Paulo (a much relieved version of him) :-)

#32

Hear, hear.

Last_X doesn't really do this job well. "Undo" (be it in a 48GX like fashion, or in some other flavour) is/would_be a fine thing to have, IMHO.

Dieter: you are not alone. :-)

Paulo

#33

I'm not sure it's really RPN but a function of having a stack.

With a stack, you have the option of doing x * 1/y instead of x/y - should you realize after entering or calculating the denominator that entering the numerator will require a swap. Same can be said for subtraction.

I would have no idea how to do this with a common infix calculator.

#34

The ubiquitous (on HP RPN machines) x <> y (x y exchange) key is how I always flipped the operands for subtract and divide when I had them reversed on the stack.

The TI SR-50 also had an x <> y key, so if you wanted, for example, to take 50 and divide it by the displayed result of 10 from a previous calculation, you would key in / 5 0 x<>y = to get 5.

But not all algebraic / infix machines have such a key. I looked at the picture of a TI-59 on the Datamath site and couldn't find it. There's an x <> t key to allow you to put a value in the "test" register for comparisons. I don't know if that did the x y exchange function or not.

The HP-25 manual explicitly shows (and VERY clearly) how to use x <> y to flip saved stack entries for division. I sure miss those old color HP calculator manuals....

#35

How about a 'Last Stack' operation in addition to 'Last X'?

#36

After the SR-50 and 51, the x<>y functionality was featured on fewer and fewer models. The next models, the SR-56 and 52 didn't have the key. So, I think the TI-51 III (Brazilian model) the last to feature the x<>y operation.

Edited: 9 July 2012, 5:36 p.m.

#37

I failed to mention that I'm referring to the Undo function as it already exists in the RPL line of calcs.

It exists in all calcs HP-28S thru 50g. But it's a hard-to-reach shifted function.

Pressing it after an undo should do a redo. (It doesn't on HPs.) How else to quickly check the inputs of your last operation and then, when satisfied with what you see, return to having it on the stack, and proceeding? Tap, (visual check), tap.

#38

We'd never need an [UNDO] key if we could go back in time and simply not do things...

Edited: 9 July 2012, 11:50 p.m.

#39

Good idea. I vote for a GBIT key instead of UNDO.

#40

Quote:
Pressing it after an undo should do a redo.

That's not logical IMHO. Redo should be a shifted undo instead.
#41

Well... if you consider undoing the last operation, being it an UNDO, you'd undo what was undone, so you'd have a redo as final eff... Where is the GBIT key, please?

Yeah, I know, too goofy, not funny... Sorry!

BtCP! (Back to calculators, please!)

Edited: 10 July 2012, 12:54 a.m.

#42

Or GoBack for short.

#43

Shifted UNDO for REDO makes sense with multiple levels of UNDO. With but a single UNDO, I'd behave as was started (UNDO, UNDO does nothing).


- Pauli

#44

Excuse my ignorance, but if this is a serious comment, how is GBIT different from Undo? (Apart from not stopping you to get older as you use it...)

I'm serious and on-topic, I believe, when I say that I think it's a major oversight that there's no unshifted Undo key that behaves in the prescribed fashion. My own calculator has it, and I can report from "test driving" it over 2 years, that it truly is my most used key. (It occupies the prime spot in the key layout, too.)

How else do people double-check?

Double-checking, in my mind, entails going back to seeing the inputs and repeating the action. Now, LAST ARGS adds the last inputs to the stack, but that's not what I want, as it also leaves the result on the stack. And then it forces me, after inspection, to cumbersomely drop them. Which is certainly not what I want. Not only that this entails more key-presses, but it also messes up my LAST ARGS.

In my calc, the Undo key is aliased on the backspace key: If you have something on the edit line, it backspaces. If there's nothing, it undoes. If you undid before, it undoes the undo, which is a redo. At the shifted position, it becomes "last args". If I see a result that surprises me, or otherwise needs double-checking, I tap one key, look, then tap it again.

I'll be surprised if I'm truly an outlier in wanting to constantly double-check while calculating. Besides an unshifted key function, the only other legit interface I see for this is a running tape of sorts.

#45

Quote:
if this is a serious comment, how is GBIT different from Undo? (Apart from not stopping you to get older as you use it...)

Hey, the chance of going back in time looked just a little more intriguing to me ;-)

Seriously, your UNDO as you describe it is perfectly ok for me but it looks like allowing to undo only the very last step - since UNDO UNDO = NOP. I doubt that's sufficient; thus I was voting for a shifted UNDO for REDOing. BRAUN had a model ET90 with a history stack of 99 editable lines of operations; a very nice idea IMHO though some ten lines would do for most real world cases - alas, no RPN :-(

#46

Hi, Pauli.

Quote:
Shifted UNDO for REDO makes sense with multiple levels of UNDO.
This makes perfect sense for me, too.

In my point of view, both approaches make sense, I mean, the UNDO - UNDO returning to the original point, or doing nothing as you say, and also the UNDO and a REDO , being the REDO a shifted UNDO.

If you think that UNDO and REDO return to the point of origin, then it looks like doing nothing with a review. Like step-back and step-forward: you DO two movements but you end up where you were, as if nothing happens.

But if you consider that you are walking and a back step is a way to UNDO your last step, then if you UNDO your back step you will step-forward. In both cases, you end up doing nothing with a review.

But if you back-step more than once, your considerations for REDO apply.

Maybe it's a matter of taste.

Cheers.

Luiz (Brazil)

Edited: 10 July 2012, 8:44 a.m.

#47

Ok. Gotcha. I agree that single-step undo is deficient, though I really do like double-checking without shifting.

(Speaking of shifting. Something I did only recently was have the shifted function be called when the user presses the key more than half a second. This removed the need for a shift key for me overnight. I wonder if this could easily be done with a HW calc, too. Not as good as time-travel, but close. (Though not so applicable if you have more than one shift level, of course.))

With a device capable of touch UI, multi-step Undo becomes something that can be done in elegant ways: swipe over the stack right or left, for example.

What I'm planning to do is keep the single-step undo/redo for now but have the last 8 or so commands (with args) available by touch on the edit line.

#48

Quote:
Pressing it after an undo should do a redo.

That's the way ctrl-z works in Photoshop (undo last change). To continuously go back in history, you have to use ctrl-alt-z. I like it.
#49

Quote:
Hey, the chance of going back in time looked just a little more intriguing to me ;-)
You wouldn't even note if you do. At the end of your life, you've wandered through every possible time in this span. No matter if you step back for a second and rerun your time, it will still feel the same as undoubtly the state of your mind is tied to the current time. Same time - same thoughts.

;-)

#50

Quote:

You wouldn't even note if you do. At the end of your life, you've wandered through every possible time in this span. No matter if you step back for a second and rerun your time, it will still feel the same as undoubtly the state of your mind is tied to the current time. Same time - same thoughts.


IF your last statement is true THEN reverting time would mean thinking previous thoughts backwards, which a sensible person should notice in contradiction to what you stated before ;-) You seem to be talking about an eigentime where you wrote of "current time". Anyway, not going to happen in our time.
#51

Quote:
IF your last statement is true THEN reverting time would mean thinking previous thoughts backwards, which a sensible person should notice [...]
How? All memories from the future are gone, as they were not part of the past mind, so, how to tell where you're coming from when all you have are memories from the past and impressions from the present? I can't see how a timeflow can be determined.
#52

Quote:

How? All memories from the future are gone, as they were not part of the past mind, so, how to tell where you're coming from when all you have are memories from the past and impressions from the present?


Going back in time, you think from the results of your thoughts back to their inputs. Should be noticeable.
Quote:
I can't see how a timeflow can be determined.

Easily: entropy will decrease. Broken dishes will repair and the like ;-)
#53

Quote:

Easily: entropy will decrease. Broken dishes will repair and the like ;-)


You don't know it was broken, and also you 'forgot' entropy was higher before. It escapes your knowledge. Of course, the definition is clear, but that wasn't what I was asking for.

In the end, when talking about time travelling, people usually think about being exempt from the travel, i.e. not being part of the universe anymore. That's what I made fun about. To me, the concept of time is labelling a certain state of the universe. Very helpful indeed.

#54

Quote:

You don't know it was broken, and also you 'forgot' entropy was higher before. It escapes your knowledge.


I don't have to know: I *watch* it repairing :-) And since I've lived 99.999% of my life with time flowing downstream, I realize there's something strange happening. At the bottom line, it boils down to the question whether the observer is part of the experiment or not.
#55

Quote:
I don't have to know: I *watch* it repairing :-)

You think you would. Without the knowledge of a future state you can't tell if is was 'more damaged' before.

Playback a video of a dish that just broke, then stop where the dish was still intact. The actor won't know it will break and change the whole story ;-).

#56

Quote:
[...] God said to Adam and Eve to go forth and multiply [...]
There was a Sinclair clone called Jupiter Ace running Forth, and actually that was an integer implementation. We learned: Fractions are evil, RPN is heavenly recommended, and scientologists are right: God is from Jupiter.
#57

Drives me nuts.

Mainly though that is because they can't make up their minds with the rest of the CS programs and they all behave differently in some things like this... :-(

Pick one and stay with it!

TW

#58

Sorry, you are missing the point. Traveling backward in time (rewinding the video), you watch a dish repairing in your (observer) time. Watching this and comparing it with your experience as stated above, you know that's abnormal. If back traveling stops anytime AND if it's a fully deterministic system, the dish will break again exactly as before. The interesting philosophic questions are

  1. what happens with your conscience in traveling forth, back, and forth again?
  2. do fully deterministic systems exist at all (cf. quantum mechanics)?
I doubt the second. Since even Franco-Swiss neutrinos didn't succeed in time traveling, however, these questions remain pure academic ones. So I sign off and will return to calculators unless forced to do other stuff ;-)
#59

Quote:
Sorry, you are missing the point. Traveling backward in time (rewinding the video), you watch a dish repairing in your (observer) time.
As the actor you don't. As observer you're not part of the video tape universe (that's science fiction) ;-).

Have a nice time calculating!

#60

Turing, FTW!

#61

If you have something on the edit line, it backspaces. If there's nothing, it undoes. If you undid before, it undoes the undo

I read that real fast w/o parsing first and I swear I heard myself say un-do's instead of undoes. Guess it's the same after all.

Edited: 11 July 2012, 6:24 p.m.

#62

This thread suggests a puzzle: can you replace the four operations +, -, x, and / with just one operation?

In other words, find a function of two variables f(x,y) such that x+y, x-y, x*y and x/y can all be expressed with a static expression using characters among the following:

f(),xy01

For instance, if f(x,y) = x-y, then you could express x+y as

x+y = f(x,f(0,y))

but you cannot get x*y from this, so f(x,y)=x-y is not the answer.
Just to be clear, the word "static" above means that the structure of the expression must not depend on x or y; the same expression must work for all x and all y. So one could not say

x*y = x + x + ... + x (y times)
= f(x,f(x,,...,f(0,x))...) (y times)

because the structure of the expression depends on y.

Disregard accuracy and stack depth, this is a purely mathematical problem.

#63

We're supposed to figure that from the minutiae of the discussion between Walter and Thomas, right?

#64

Definitively not - that discussion turned to time traveling problems and thus drifted far off ... ;-)



Possibly Related Threads…
Thread Author Replies Views Last Post
  WP-34S: Stack after divide by 0 Marcel Samek 4 1,354 08-24-2013, 11:57 PM
Last Post: Paul Dale
  Debug4X and "divide by zero" when attempting build Joe Veazey 3 1,364 11-25-2012, 08:45 PM
Last Post: Han
  Who cares? bluesun08 9 2,579 08-09-2012, 08:42 PM
Last Post: Namir
  [edited] from the HHC email list, what is the proper answer to 8 ENTER 3 divide 2 divide on 10 digit calc Gene Wright 10 2,708 10-02-2011, 01:07 PM
Last Post: Dieter

Forum Jump: