WeBWorK Main Forum

Linear Algebra (Matrix)

Linear Algebra (Matrix)

by William Boshuck -
Number of replies: 0
I have some questions about linear
algebra problems, particularly in
connection with matrices.

I've written some problems that ask for
matrices, or bases for certain linear
spaces of matrices, hoping to not give
away the number and shape of the
matrices required.

The Matrix type (Value::Matrix, I think)
works for not giving away the shape.

However, if a student is completely lost
and enters, e.g., (1, 2, 3) where a matrix
should go, the problem throws a mean
error. (It seems that cmp tries to apply
"$student->dimensions" before checking
that the student's answer is a matrix,
and chokes on the point.)

As well, I was unable after a few minutes
to compare a student's answer to a List
of matrices (not giving away the number
of matrices in a basis). I could manage
using a MultiAnswer, but of course that
gives away the (maximum, at least)
number of matrices in the list.

Finally, I was unable after a few minutes
to apply basis_cmp to a single answer blank
(into which would go a list of matrices)
or a MultiAnswer, so I resorted to ad hoc
checks.

These issues might be easy to resolve
in ways that I couldn't see quickly. I
am writing these problems on the run
and so I tend to give up quickly and go
to something that is close to what I
want and works. (I can warn my
students that a problem will get
embarrassed and "blush" if they
enter a point where they should
enter a matrix, for example).

Does anyone know of simple and fairly
general ways around such issues? Is
anyone working on these kinds of things
right now? If so, I'd be happy to pitch
in when I get up to speed on how the
current stuff works. (It would be nice,
e.g., to be able to enter and parse
matrices column-by-column, to support
parameters in matrices/polynomials,
to have a matrix-matrix product a la
Artin, where the left factor is a list of
abstract vectors, etc. etc.)

Thanks for any information/comments.

William Boshuck