matrix determinant

6 views
Skip to first unread message

Piers Barber

unread,
Dec 1, 2011, 8:31:33 PM12/1/11
to iPhone42s
i'm using Thomas's 42s on iPhone and Free42s as packaged for Fedora
16.

i get a non-zero result for:

| 1 2 3 |
| 4 5 6 |
| 7 8 9 |

i.e. det [[1,2,3],[4,5,6],[7,8,9]]

the determinant should be zero as this matrix is singular. it follows
that there should also be no inverse - yet one is calculated.

the determinant is very small (and the matrix inverse is very large as
a result of 1/det)

but i don't understand why it's non-zero - HP48GX is correct, and
complains with INV Error: Infinite result

what's the explanation?

thanks

Byron Foster

unread,
Dec 7, 2011, 6:04:13 AM12/7/11
to ipho...@googlegroups.com
Here's a little discussion about it:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv014.cgi?read=65551

I also tried this with a real 42S and the determinant is also a very small non-zero number. So the behavior is consistent. Thomas added a singular matrix error option, but I'm not sure why it's not triggered in this case when the option is on.

If you are still curious I would ask Thomas Okken.

http://thomasokken.com/free42/

Message has been deleted

Piers Barber

unread,
Dec 7, 2011, 5:30:16 PM12/7/11
to iPhone42s
Thanks Byron, that's great - answers my question especially after a
quick look at the source and a glance at my 30 year old college math
book

My 3x3 A is being LU decomposed into:

A = LU

| 1 2 3 | | 1 0 0 | | p q r |
| 4 5 6 | = | a 1 0 | | 0 s t |
| 7 8 9 | | b c 1 | | 0 0 u |

det(A) = det(L)det(U)
= det(U)
= p * s * u

That's going to be very fast on big matrices, but the LU decomp
scaling factors will result in errors and these show up in my final
result.

Piers Barber

unread,
Dec 7, 2011, 8:08:51 PM12/7/11
to iPhone42s
Nah - still confused because I've now done an LU decomposition
manually and i get:

LU=A

| 1 0 0 || 1 2 3 | | 1 2 3 |
| 4 1 0 || 0 -3 -6 | = | 4 5 6 |
| 7 2 1 || 0 0 0 | | 7 8 9 |

det(U) = 1 * -3 * 0 = 0

Looks as though I'm really going to have to go through what actually
happens in the code - time to learn ddd debugger...

Byron Foster

unread,
Dec 9, 2011, 8:02:15 AM12/9/11
to ipho...@googlegroups.com
Hmm, curious... I'll take a closer look this weekend.

> --
> You received this message because you are subscribed to the Google Groups "iPhone42s" group.
> To post to this group, send email to ipho...@googlegroups.com.
> To unsubscribe from this group, send email to iphone42s+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/iphone42s?hl=en.
>

Reply all
Reply to author
Forward
0 new messages