Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Flag 91....

1 view
Skip to first unread message

Joakim Margell

unread,
Feb 23, 2003, 2:52:41 AM2/23/03
to
Hey

Can anyone explain why there are two types of "matrix", and why doesn´t DOT
works when I have list of lists vektor, TRANS doesn´t work when I have
ordinary vektor.

Regards
Joakim


John H Meyers

unread,
Feb 23, 2003, 6:05:19 AM2/23/03
to
Joakim asked:

> Can anyone explain why there are two types of "matrix"

There are two types (or dimensionalities) of *array*:

o One-dimensional: a single list of N values, known as a "vector"

o Two-dimensional: a list of vectors (rows), MxN, or "matrix"
(even if M=1, this is considered different)

This is somewhat like a "line" vs. a "rectangle," we might say,
or like a "real" number vs. a "complex" number,
in which "-1" and "(-1,0)" are not exactly the same thing.


> and why doesn't DOT work when I have list of lists vector

If you have set flag -91, then the output of the Matrix Writer
is really only lists (and lists of lists), rather than the
"array" object type, whereas DOT accepts only true arrays.

However, a command AXL is available, which "flips" an object
between "list (of lists)" form and "array" (vector or matrix) form,
so you can always apply AXL to the MW output to change its format.


> TRAN [or TRN] doesn´t work when I have ordinary vector.

1-dimensional vectors don't possess a "transpose"
(because there are no "rows" vs. "columns" to interchange),
whereas 2-dimensional matrices do.


If you have an object on the stack which isn't the dimensionality
(vector vs. matrix) that you wanted, you can just press the
cursor-down key (or TOOL EDIT) to activate the Matrix Writer,
then press the VEC menu key [B] to "flip" its dimensionality,
then press ENTER to return it back to the stack.

This allows you to change vector <-> matrix,
provided there is only one row in the matrix.


[r->] [OFF]


.


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

John H Meyers

unread,
Feb 23, 2003, 6:49:45 AM2/23/03
to
Continuing:

If by "two types" you meant "vector" vs. "matrix,"
then the previous reply is appropriate,
regarding 1-dimensional vs. 2-dimensional collections.

If you meant "array format" -- [array] and [[matrix]]
vs. "list format" -- {list} and {{list} {list} ...}
then it's just that there is a choice available
between using true arrays vs. keeping all the same
elements in a collection of lists instead,
which offers different ways of being handled
by different programming commands -- there is no
DOLIST command for arrays, for example, and no
multiplication/transpose/inverse/DOT/etc. for lists (of lists).

Also, in the older HP48 calculator, arrays could consist
only of real and complex number elements; therefore,
to represent symbolic/algebraic arrays, the use of similar
list structures was the only way it could be done,
whereas in the HP49, "arrays" are now permitted
to contain algebraic elements, so now there
really is more opportunity to keep all arrays
in one consistent "square bracket" form.

Actually, the HP49 internally stores a "symbolic array" in a
"list of lists" style anyway, but it conceals this quite well
from the user, by having a new object type code for it (29),
by displaying this object type with square brackets,
and by permitting a similar set of operations upon it
as for numeric arrays, so you usually are not aware
of any of these internal tricks, and don't care how it works.

Given the set of operations in which you seem interested,
it would seem to be a good idea to clear flag -91,
and to use only the conventional "square bracket" array format,
which is the only format understood by TRN, TRAN, DOT, etc.

John H Meyers

unread,
Feb 23, 2003, 7:43:52 AM2/23/03
to
Wow, another slight correction:

TRN (an old HP48 command) does not accept
a "list of lists" format for a matrix,
but TRAN does!

Note:

The object must be a 2-D "matrix," not a 1-D "vector," but
you can use 1. \->LIST to convert a "list of lists vector"
to a 1-row "list of lists matrix" (use HEAD for the reverse :)

Likewise, a "square bracket vector" becomes
a 1-row "square bracket matrix" after 1. ROW\->,
and back to a vector again after \->ROW DROP

Is this beginning to sound confusing?

"Once there was an elephant,
Who tried to use the telephant --
No! no! I mean an elephone
Who tried to use the telephone --
(Dear me! I am not certain quite
That even now I've got it right.)

Howe'er it was, he got his trunk
Entangled in the telephunk;
The more he tried to get it free,
The louder buzzed the telephee --
(I fear I'd better drop this song
Of elephop and telephong!)"

http://www.northcoastcoffee.com/Poems.htm
http://www.oursworld.net/babies-kids/baby-kid-poems/poems.htm#1

Here is Michael Hoppe's ingenious program
for TRAN (list of lists) on an HP48 (or 49):

\<< LIST\-> DUP \-> n \<< \<< n \->LIST \>> DOLIST \>> \>>

http://groups.google.com/groups?selm=199708232232.a26620%40k2.maus.de
http://groups.google.com/groups?selm=199708271106.a29845%40k2.maus.de

"We've heard that a million monkeys at a keyboard
could produce the Complete Works of Shakespeare;
now, thanks to the Internet, we know this is not true."

0 new messages