50g System RPL list processing
11-01-2014, 09:26 PM (This post was last modified: 11-01-2014 09:35 PM by Gilles.)
Post: #21
 Gilles Member Posts: 162 Joined: Oct 2014
RE: 50g System RPL list processing
(11-01-2014 02:48 PM)Claudio L. Wrote:
(10-31-2014 10:06 PM)Gilles Wrote:  Note that the 50G use sometimes a '?' value (something like unknown or undetermined algebraic... For examplle lim (x->+oo,SIN(X)) -> ?
Could be interesting in some cases. A kind of NIL for algebraic
(...) I think this is more generic, but still doesn't cover all cases, since it won't work for objects that are not accepted inside symbolics, like strings.
'?'+"HELLO" will give an error.

Hi Claudio :

? "Hello" + gives "'?'Hello"
'?' works both in numeric and exact mode. (Oh I see ! :It works only with FLAG 3 OFF )

And you can do

«
'?'
IF '?' SAME THEN "Undeterminded" END
»

(but == does'nt work)

['?' 1 2 3 ]
{'?' 1 2 4 }

are OK

{'?' 1 2 3 } ΣLIST gives '?'
which seems correct

[[1 2][3'?']] INV gives [[? ?][? ?]]
in exact and approx mode (with flag 3)
11-01-2014, 10:40 PM
Post: #22
 Marcus von Cube Senior Member Posts: 760 Joined: Dec 2013
RE: 50g System RPL list processing
(11-01-2014 08:34 PM)Han Wrote:  I don't understand the point of "one" -- "nil" actually makes sense with respect to empty sets. At what point will you ever use a regular operation and expect an ambiguous "one" ? The notion of "one" is a solution to a problem that does not seem to exist.
One is the neutral element for multiplication as nil is for addition.

Π list1 * Π list2 should return the same as Π (list1 concat list2). As long as none of the lists is empty this works fine but when one list is empty, the result will be nil. The object one would solve the problem.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
11-02-2014, 01:04 AM
Post: #23
 Han Senior Member Posts: 1,810 Joined: Dec 2013
RE: 50g System RPL list processing
(11-01-2014 10:40 PM)Marcus von Cube Wrote:
(11-01-2014 08:34 PM)Han Wrote:  I don't understand the point of "one" -- "nil" actually makes sense with respect to empty sets. At what point will you ever use a regular operation and expect an ambiguous "one" ? The notion of "one" is a solution to a problem that does not seem to exist.
One is the neutral element for multiplication as nil is for addition.

Π list1 * Π list2 should return the same as Π (list1 concat list2). As long as none of the lists is empty this works fine but when one list is empty, the result will be nil. The object one would solve the problem.

Addition has more meaning than simple addition of real numbers. This is why nil makes sense for addition (sum of an empty list, for example) due to the ambiguity of
the argument types. Yet despite all these different abstract objects which may be "added" they all have a natural element that can play the role of 'nil' (e.g. empty string, 0, 0+0i, null character, #0h, empty list, etc.) Thus the implementation of 'nil' is possible because not too many people will argue with how 'nil' should behave. However, that is not the case with multiplication.

Multiplication is merely an extension of addition. For example, $$3\cdot a$$ merely means add $$a$$ to itself 3 times. Unless the multiplication is some well defined special binary operation, the product $$a\cdot b$$ usually requires that either $$a$$ or $$b$$ is a scalar (i.e. in $$\mathbb{R}$$ ). Scalar multiplication is easily implemented since it is really just addition. But when we start talking about $$a \cdot b$$ where both $$a$$ and $$b$$ are abstract objects, then there is no sense in having a multiplicative equivalent of 'nil' (i.e. 'one') because beyond regular multiplication, any other type of multiplication is more or less arbitrary from the point of view of the user. Sometimes 'one' does not even exist depending on the type of multiplication. The notion of 'one' really only makes sense for a very small collection of multiplications (e.g. real, complex, matrix). Even differentiating between scalar multiplication and abstract multiplication makes the notion of 'one' hard to define.

Graph 3D | QPI | SolveSys
11-02-2014, 12:02 PM
Post: #24
 Claudio L. Senior Member Posts: 1,671 Joined: Dec 2013
RE: 50g System RPL list processing
'?' seems to be much more versatile than I thought. I learnt something new today.
However, if we use it for ΣLIST, then we are changing its definition from undefined to something closer to "nil".
Not that '?' is that useful anyway, but before changing its meaning I need to learn the full extent of the consequences, and make sure nothing breaks in he CAS down the road because of us trying to fix lists. Since I'm not too familiar with it, I'm having second thoughts on using it.

The concept of 'one' does have the trouble of having to define the additions of 'one', and yes, it would only be useful in the context of ΠLIST, as no other command would need it.
But if we don't do it, then ΠLIST returns an error for empty lists, but ΣLIST does not?
Doesn't feel consistent, either both return an error, or both return some abstract value.
11-02-2014, 04:34 PM
Post: #25
 Marcus von Cube Senior Member Posts: 760 Joined: Dec 2013
RE: 50g System RPL list processing
(11-02-2014 12:02 PM)Claudio L. Wrote:  The concept of 'one' does have the trouble of having to define the additions of 'one',
You can simply define nil and one as the two elements of a mod2 group. This would lead to one+one=nil.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
11-02-2014, 06:26 PM (This post was last modified: 11-02-2014 06:26 PM by Han.)
Post: #26
 Han Senior Member Posts: 1,810 Joined: Dec 2013
RE: 50g System RPL list processing
(11-02-2014 04:34 PM)Marcus von Cube Wrote:
(11-02-2014 12:02 PM)Claudio L. Wrote:  The concept of 'one' does have the trouble of having to define the additions of 'one',
You can simply define nil and one as the two elements of a mod2 group. This would lead to one+one=nil.

That seems quite arbitrary. And what if were looking at the product of a list of square matrices (only the list itself is empty)? The 'one' would presumably behave like the identity matrix, but clearly $$I_n + I_n \not= 0_n$$

Graph 3D | QPI | SolveSys
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)