• ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended

The following relates to the HP Prime Emulator version 2013 8 5 Rev: 4980

 

In the PDF manual that came with the emulator:

Prime_manual_matrix_inverse.jpg

 

 

 I could not find "INVERSE" in the Matrix category of the Math menu and neither in the Catalog.

 

So, as a first off, I used the X^-1   format.

 

 

Introduction:

 

Now, a note on the inverse of a matrix. Although for matrix M we write M^-1, it does not mean 1/M. The inverse of a matrix is defined as "a matrix multiplied by it's inverse = the identity matrix". Just like sin^-1(x) is sometimes used for arcsin(x), we know it does not = 1/sin(x). I.e. M^-1 or 1/M are ways of representing the inverse matrix fuction while not literally meaning "devide 1 by M". (I realise most of us know this, but it is of interest for non-square matrices on the Prime, see below).

 

See: http://www.mathwords.com/i/inverse_of_a_matrix.htm

 

Division with a matrix also does not exist. Again, sometimes it is used as a representation. E.g.. to solve A where 

AxB=C. A, B and C are matrices of compatible sizes.

 

It may be written as: A=C/B, but actually means: A=(B^-1)xC, where B^-1 is the inverse of B as defined above.

(edit: red part fixed after Joe's comment).

 

For matrices to be multiplied, the number of columns of the 1st matrix must equal the number of rows of the 2nd matrix. Thus from above it also follows that one of the requirements to find the inverse of a matrix is that it has to be square.

 

The issues I have with the Prime:

 

Let's see what the Prime CAS does:

 

Screen 1:

Prime_m1_inverse.jpg

 

All good.

 

Screen 2:

Prime_m2_inverse.jpg

 

 

What's this?  When we have a non-square matrix we can just invert the elements?

 

I have read that the matrix is now interpreted as "a vector of vectors".

 

Note, the same operation is used ! So the behaviour of the operation is different depending on whether a square or non-square matrix is entered.

 

If you put an invalid argument in a function, it usually gives an error, but not here. From what I've read, the writers of this function are actually proud that they dynamically re-interpret the input.

 

So the student just changes the question to get an answer he likes, when the answer should be "a non-square matrix cannot be inverted".

 

I work in a safety critical world. Imagine a young engineer or programmer coming to work on safety critical systems after having been taught maths by the HP Prime. When a set of sensors fail, just re-interpret the state matrix to a "a vector of vectors" and send believable but nonsense results to the control software. That would go down well with the cert. authorities - NOT! (Fortunately with such systems there are development processes in place that would catch such erroneous methods during tests).

 

So what if you wanted the inverse of the elements of a matrix?

 

There is a perfectly good command for that: (note the dot before the power operator)

Screen 3:

Prime_m1_element_inverse.jpg

 

 

Which works for a non-square matrix too:

Screen 4:

Prime_m2_element_inverse.jpg

 

 

So why not just give an error for the inverse of a non-square matrix, and let this be used to get inverses of elements?

 

 

At the beginning of the post I noted I could not find the INVERSE command. But I did find an "inv" command in the catalog.

From the manual:

Prime_manual_inv.jpg

 

 

and this is what it does:

Screen 5:

Prime_m1_m2_inverse_using_inv.jpg

 

What's this? For the square matrix M1 it still gives the inverse, but for M2 it now gives 1/32 ???

 

 

 

.

-Bart
_________________________________________________________
calculator enthusiast
12 REPLIES 12
HP Recommended

Bart dB wrote:

Now, a note on the inverse of a matrix. Although for matrix M, we write M^-1 it does not mean 1/M. The inverse of a matrix is defined as "a matrix multiplied by it's inverse = the identity matrix". Just like sin^-1(x) is sometimes used for arcsin(x), we know it does not = 1/sin(x).

 

1/M as a shortcut for M^-1 is not new.  HP has been using 1/M as a shortcut for matrix inversion for at least 30 years.  Unless I'm mistaken, they started it with the HP-15C in 1982, and HP calculators have been doing it that way ever since.  Nobody complained, since 1/M as a shortcut for "multiplicative inverse" makes perfect sense.  The notation sin^-1 has nothing to do with multiplicative inverses, so it cannot be compared to that.

 

Division with a matrix also does not exist. Again, sometimes it is used as a representation. E.g.. to solve A where 

AxB=C. A, B and C are matrices of compatible sizes.

It may be written as: A=C/B, but actually means: A=CxB^-1, where B^-1 is the inverse of B as defined above.

 

(Actually, it means A=(B^-1)*C, but that's not important right now).  Notice that you answered your own previous objection here.  Although matrix division is not defined mathematically, it IS defined in HP calculators, which after all are nothing more than tools.  They are not math textbooks.  Like all sophisticated tools, HP calculators must be learned.  Expecting to be able to use them without learning anything new, or expecting them to work the same way as other calculators, is unrealistic.

In any case, I hope HP will not overturn 30 years of perfectly reasonable, well-received, and often-used matrix functionality.

-Joe-

 

-Joe-
HP Recommended

Hi Joe,

Thank you for re-iterating what i said. By the way my comment on sin^-1 was more about "ways functions are represented whilst not exactly meaning...", which is the purpose of that introductory part of my post. I have no objection to the representation of M^-1 or 1/M for matrix inversion.

quote: HP has been using 1/M as a shortcut for matrix inversion for at least 30 years.

Now this is the crux of my post, why now are HP using it to really do 1/x for the elements of a matrix when it is non-square? In actual fact, why for the first time ever (that i am aware of) is an HP calculator giving an answer for an invalid input to the inverse matrix function?

 

Edit: I have updated my first post to highlight what is introductory and what are my issues with the Prime.

-Bart
_________________________________________________________
calculator enthusiast
HP Recommended

Quote: Why now are HP using it [1/matrix] to really do 1/x for the elements of a matrix when it is non-square? In actual fact, why for the first time ever (that i am aware of) is an HP calculator giving an answer for an invalid input to the inverse matrix function?

 

The philosophy of the author of the CAS is: "It's better to do something useful and predictable rather than just error."

 

For what it's worth, many of us agree with you that 1/(non-square matrix) should error.  An error message in that case is very useful.  The good news is that Prime's firmware is easily upgraded; a future version might indeed behave the way you suggest.  Meanwhile, it gives us high school math teachers a golden opportunity to illustrate some very important points about matrix math: "If you attempt to do this, you get this. Why?"

-Joe-
HP Recommended

quote: The philosophy of the author of the CAS is: "It's better to do something useful and predictable rather than just error."

 

Predictable? You missed the other part of my post:  for two instructions that are seemingly the same, i.e. M^-1 and INV(M) - which produces the same result for square matrices, produces different results for non-square mtrices? Where's the predictability in that? Also see my post on matrices and powers, non-square matrices raised to different powers, produces different types of answers (a scalar or a matrix, depending on the power). You call that predictable?

 

-Bart
_________________________________________________________
calculator enthusiast
HP Recommended

> You missed the other part of my post ... You call that predictable?

 

I didn't miss it; I simply disagree with it.  Not to quibble, but no function produces unpredictable outputs with a given input (not even the random functions), so yes, it's completely predictable.  Unexpected maybe, but not unpredictable.

-Joe-
HP Recommended

OK, let's see:

 

Prime_m3_-1_and_inv.jpg

 

 

So, a pattern is emerging: for a non-square matrix, M^-1 gives a matrix with the inverse of the elements and 1/M gives some scalar value.

 

 

Prime_m4_-1_and_inv.jpg

 

 

OK, just when I thought I could predict the output, 1/M returns a different result!!

 

Oh, sorry, of course the output is predictable. We can at least predict that the results will be unexpected. Not to mention random, but it will likely be pseudo-random. It just looks random to me because I have too few samples.

 

Let's talk about consistency then, M^-1 seems consistent, but for 1/M the answers are inconsistent. Should we not at least expect consistency from a calculator?

 

 

 

-Bart
_________________________________________________________
calculator enthusiast
HP Recommended

I'm afraid that this discussion has devolved into semantic quibbling.  So please allow me to define my terms.

 

REGARDING "PREDICTABLE":

 

Apparently we're defining "predictable" differently.  To me, it means "able to be predicted".  Is the output of Prime for any given matrix expression able to be predicted?  My hypothesis is: yes.  That hypothesis would be refuted by a single counterexample, namely, a matrix expression which Prime evaluates differently at different times, UNPREDICTABLY.

 

Do you know of any such inputs that Prime treats capriciously?

 

On the other hand, if every matrix expression always gets one unique output (all else being equal, e.g. mode settings), then the outputs ARE able to be predicted, which is the definition of predictable.

 

If you define "predictable" differently, please explicitate it so that I can at least know what you mean.

 

Everything you say about "consistent" can be tested the same way as "predictable".  Prime's CAS consistently follows the rules given to it by its programmer... rules that can be learned by its users.

 

Example: Input A always yields output B. Input A never yields something other than B.  So it's consistent.

 

REGARDING "UNEXPECTED":

 

Whether something is unexpected is 100% subjective.  If something that Prime does is unexpected by you, that says something about you, not about Prime, because your expectations are entirely inside your head.  I have used Prime enough that I find none of its outputs unexpected any more; I'm pretty sure that I've wrapped my brain around how it works, and I know how to use it now. If you don't want Prime to return unexpected outputs, you can solve that problem by learning how it works too, after which none of its outputs will be unexpected.

 

If I misunderstood what you mean by "unexpected", please correct me.

-Joe-
HP Recommended

>If something that Prime does is unexpected by you, that says something about you, not about Prime

 

Or poor documentation that doesn't indicate it works differently than expected.  😉

 

>you can solve that problem by learning how it works too

 

Or reading the documentation.

HP Recommended

Hi Joe,

This thread has devolved into semantic quibbling because YOU have made it so.

If you wish to define terms, please use a credible source, not your own interpretations.

 

However, I doubt whether adding any dictionary definitions will be of any value. I feel you are deliberately side-tracking the issues and splitting hairs over semantics in an ettempt to defend HP. Any attempt to use dictionary definitions will only bloat this thread with useless semantic arguments as you will probably attempt to re-define words within the definitions.

 

> Example: Input A always yields output B. Input A never yields something other than B.


This is a nugatory example. If a calculator didn't give the same answer for the same input, it would be a random number generator. This example says nothing about predictability, consistency or expectancy. Once we have a specific answer for a specific input, it becomes yesterday's information. A weather channel would not be much use "predicting" yesterday's weather, would it?

 

I leave it to other readers to decide what to make of the results I have presented.

-Bart
_________________________________________________________
calculator enthusiast
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.