INAIO Guide Stage 1 11Matrices and Linear Transformations
11.1 Matrix dimensions and indexing
Read a matrix as a rectangular grid with a defined shape, row-column indexing, and a clear meaning for each entry.
Matrices keep related numbers in a rectangular layout. A matrix can store image pixels, tabular measurements, graph connections, or coefficients of equations. The shape and indexing tell you what each number means before you calculate with it. In Module 2.2, we wrote several equations separately; a matrix can gather all their coefficients into one object. In Module 10.3, a vector gathered several coordinates in the same way.
This is foundational linear algebra. Start with the first part of OpenStax's matrix lesson. You only need to be comfortable reading tables.
A basic idea: rows, columns, entries
A matrix with rows and columns has shape . The entry is in row , column in the mathematical convention used here, starting at . For example,
has shape , with and .
A quick tour of properties
A single row is a row matrix; a single column is an column matrix. A square matrix has the same number of rows and columns. The main diagonal of a square matrix runs from the top left to the bottom right. A matrix's shape is more than a label: later, it tells us whether an operation can pair the entries we need. A computer language may start indexing at , so check its convention before translating a problem into code. In Python with NumPy, above is A[1, 2].
Application 1: image pixels
A greyscale image patch has pixel intensities
It has two pixel rows and three columns. Pixel is at the second row, first column. A pixel value is not a coordinate: it is the measurement stored at that position.
Application 2: scores by learner and test
Rows of represent three learners; columns represent two tests. Thus has shape , and is learner three's score on test two. Column two is , which lets you compare all learners on the same test.
Resources
| Source | Title | Why read it |
|---|---|---|
| OpenStax | Matrices and matrix operations | Begin with matrix dimensions and entry notation. |
Finished this module? Mark it done.
Comments
Stuck on something, spotted a mistake, or found a resource that helped you? Tell us below.
Loading comments