Showing posts with label linear algebra. Show all posts
Showing posts with label linear algebra. Show all posts

Tuesday, January 27, 2015

Linear Algebra - matrix dimensions

A nxm matrix is a rectangular array of numbers in n rows and m columns.
For example:
A 2x3 matrix has two rows and three columns.
A 1x3 matrix is a 3-coordinate vector in horizontal format, just one row with three numbers in it.
A 3x1 matrix is a 3-coordinate vector in vertical format, commonly known as a “column vector.” It is a matrix with a single column and three numbers in it.

For us to be able to add or subtract two matrices, they have to have the exact same dimensions. For example, you can add or subtract a 4x3 matrix with another 4x3 matrix but not with a 4x4, 3x3, 3x4, 4x2, 5x3 or any other type of matrix.

Matrix multiplication has its own, particular requirements on the dimensions of the matrices being multiplied. You can multiply any nxm matrix with any mxk matrix, and the result will be a nxk matrix.
For example:
A 3x2 matrix times a 2x4 matrix will result in a 3x4 matrix.
A 3x2 matrix cannot be multiplied with another 3x2 matrix.
A 3x2 matrix times a 2x3 matrix will result in a 3x3 matrix.
A 3x3 matrix times a 3x3 matrix is again a 3x3 matrix.
A 3x3 matrix times a 3x1 matrix will result in another 3x1 matrix.
A 2x7 matrix times a 7x4 matrix will result in a 2x4 matrix.

Matrix multiplication involves a lot more arithmetic operations than matrix addition, because just to get the number for the entry in the i-th row and j-th column of the product, we have to calculate the dot-product of the i-th row of the first matrix times the j-th column of the second matrix.

All this can be pretty confusing for students when they first read it in a book but after being shown how it’s done in a couple of examples, it becomes clear and then with more practice it becomes easy but it always is a lot of work, and you have to pay close attention to all the little calculations involved because the large number of them makes it easy to make silly mistakes.

Friday, August 21, 2009

Is it possible to visualize a 4th spatial dimension?

A classic question about higher dimensions

Last week I had a tutoring session with a college student I help with his Advanced Calculus class. We did mostly exercises on line integrals, integrating functions of two variables along paths in the XY plane. After that, near the end of the hour, my student asked me some questions on Linear Algebra. He wanted to clarify some details about the dimension of vector sub-spaces spanned by finite sets of vectors, related to whether the spanning set was linearly dependent or independent. We looked at a couple of examples in the XYZ three-dimensional space. That was enough to answer his questions on that particular topic but then he asked me something to the effect of: “How can we visualize a four-dimensional space?” This is a classic question many students ask themselves when taking classes like Linear Algebra, Advanced Calculus, and other, more advanced math classes. There are some videos about projections of four-dimensional objects onto the three-dimensional space. Some mathematicians do specialized work on the geometry of four-dimensional spaces but I remember relatively early on in my math studies I gave up on trying to visualize a four-dimensional space. I have no problem working out abstract math proofs and formulas about objects in many dimensions, even an infinite number of dimensions. When doing such exercises I construct visual images to help me solve these problems but said images are always two-dimensional, or at most three-dimensional, not multi-dimensional. They are just schematic representations of the concepts at hand. I never (not any more, not in a long time) try to actually imagine how a four-dimensional space would “really” look like if we could move around in it. So, when my student asked me this question I was kind of hesitant in my answer. I said: “Well, that thing of trying to visualize or imagine a four-dimensional space is complicated. We have no real experience of such a thing. Spaces of dimension higher than three are all in the dark. The space we live in is only three-dimensional. The space we believe we see, is just an illusion created by our brains but it is the best representation our brain can come up with, based on the visual information collected as light by our flat retina. It is one reconstruction, or a representation of our three-dimensional world, and our brain spends a lot of time, energy, and resources reproducing these three dimensions because that is the world in which we have to survive.” Then my student said: “So, do not think about four dimensions?” And I said: “Think about four dimensions, just do not try to ‘see’ them.” That was the end of it but somehow I was left with the feeling there was something not quite right with my answer. Why did my student interpret my answer as an admonition “not to think about four dimensions?” Did I make it sound too hard, too complicated? I ended up thinking: “Why not?” Maybe there is a way to build the specific kind of imagination that would allow us to represent, in a visually realistic way (whatever that means), the experience of how it would be like to see in four dimensions with our two-dimensional retinas. Just maybe. What do you think? If you are a computer programmer reading this, please contact me so we can see about the possibility of doing a project on these ideas.