How to Use Matrices to Represent Data

How to Use Matrices to Represent Data

A matrix organizes data into rows and columns, so its dimensions are written rows by columns and that order never changes. Below: how to set up a matrix from a data table, what each entry position means, and worked examples of reading and building one.

Build a matrix from a data table

Choose what each row and column represents, keep that order fixed, and put each number in its matching position. A matrix is the rectangular array of numbers; the row labels, column labels and units tell you what those numbers mean.

Suppose three school clubs record the number of notebooks and pencils they collect. These are invented values for a worked example.

Items collected by each club
ClubNotebooksPencils
Art1218
Science915
Drama610

Use rows in the order Art, Science, Drama and columns in the order Notebooks, Pencils. The data matrix is

\(A=\begin{bmatrix}12 & 18\\9 & 15\\6 & 10\end{bmatrix}.\)

There are three rows and two columns, so A is a 3 × 2 matrix. The club names and item names remain in your key; they are not extra numerical entries.

Read an entry in context

In \(a_{ij}\), the first subscript gives the row and the second gives the column. Thus \(a_{21}=9\) means Science collected 9 notebooks. By contrast, \(a_{12}=18\) means Art collected 18 pencils. Swapping the subscripts changes which value you read.

The second row, [9, 15], describes Science’s collection. The second column, [18, 15, 10], describes pencils across all three clubs. The pencil total is 18 + 15 + 10 = 43. Read the labels before deciding whether a row total or a column total answers your question.

You may instead put clubs in columns and item types in rows. That gives \(A^T=\begin{bmatrix}12 & 9 & 6\\18 & 15 & 10\end{bmatrix}\), a 2 × 3 matrix containing the same information with a different orientation. Update the labels whenever you transpose the matrix.

Check the labels before calculating

  • Keep one ordering. If another day’s matrix lists Science first, reorder its rows before combining matching club totals.
  • Keep units clear. A column measured in centimeters is different from one measured in kilograms. A rectangular matrix can store both, but adding those two measurements would not produce a meaningful total.
  • Distinguish zero from missing data. Zero notebooks means none were collected; an unrecorded count is unknown. Do not silently replace an unknown value with zero.
  • Check the shape. Every row must contain one entry for every column category.

When two matrices use the same clubs, item categories and units, you can add their corresponding entries to combine the counts. For more connected lessons, use the matrix topics in the Algebra 2 Online Center.

Curriculum connection: Common Core HSN-VM.C.6 includes representing and manipulating data with matrices. The example and explanations above are original to this lesson.

Tutor-style math help

Matrix operations: a follow-up review

Matrices skill
Matrix work starts with dimensions. The rows and columns tell you whether an operation is allowed before you calculate anything.

What to notice first

Write the matrix size first. Addition, multiplication, determinants, and inverses all have dimension rules.

Common student mistake

Do not multiply matrices entry by entry. Matrix multiplication uses each row of the first matrix with each column of the second.

Key formulas and cues

\((m\times n)+(m\times n)\text{ is allowed}\)
\((m\times n)(n\times p)=m\times p\)
\(\det\begin{pmatrix}a&b\\c&d\end{pmatrix}=ad-bc\)
\(A^{-1}A=I\)
[ 2 1 ][ 3 4 ] x [ 5 ][ 6 ] = rowdot

A reliable path

  1. Check dimensionsRows by columns determines what operation is legal.
  2. Use the correct ruleAddition is entry-by-entry; multiplication is row-by-column.
  3. Interpret the resultFor systems, translate the matrix answer back into variables.

Worked examples

Add matrices

Example: \([1\ 4]+[2\ 3]\)
  1. The matrices have the same size.
  2. Add matching entries.
  3. Compute each position.
Answer: \([3\ 7]\)

Multiplication size

Example: 2 by 3 matrix times 3 by 2 matrix
  1. Inner dimensions match: 3 and 3.
  2. The product is allowed.
  3. Outer dimensions give the result size.
Answer: 2 by 2 matrix
Try one before moving on
Try: What is the size of a 4×2 matrix times a 2×5 matrix?
Answer: 4×5.
This follow-up practice reviews matrix operations. For the data example above, first check that you can explain what each row, column and entry represents.

Related Topics

Other ways to represent information with matrices

Matrices can also describe equation systems, transformations and networks. These are different uses from arranging observations in a data table.

1. Representing a system of equations: A system of linear equations can be represented as a matrix equation of the form \(AX = B\), where \(A\) is the coefficient matrix, \(X\) is the variable matrix, and \(B\) is the constant matrix. For example, the system of equations \(2x + 3y = 6\) and \(4x + 6y = 12\) can be represented as the matrix equation:

\(\begin{bmatrix}2 & 3 \\4 & 6 \end{bmatrix}\)\(\begin{bmatrix}x \\y \end{bmatrix}\)\(=\begin{bmatrix}6\\12 \end{bmatrix}\)

2. Representing a set of data: A set of data can be represented as a matrix, where each row represents an observation and each column represents a variable. For example, a set of data on the height and weight of three individuals can be represented as the matrix:

Height (cm) Weight (kg)
\(170\) \(70\)
\(175\) \(75\)
\(180\) \(80\)

3. Representing a linear transformation: A linear transformation can be represented as a matrix transformation of the form \(Y = AX\), where \(A\) is the transformation matrix and \(X\) and \(Y\) are the input and output vectors. For example, a transformation that doubles the \(x\)-coordinate and triples the \(y\)-coordinate can be represented as the matrix:

Original price was: $27.99.Current price is: $17.99.

\(\begin{bmatrix}2 & 0 \\0 & 3 \end{bmatrix}\)\(\begin{bmatrix}x \\y \end{bmatrix}\)

4. Representing a graph: A graph can be represented as an adjacency matrix, where each element in the matrix represents the presence or absence of an edge between two nodes.

Matrices are widely used in various fields such as statistics, physics, computer science, engineering, and many more, to represent and organize data in a compact and efficient way.

Related to This Article

What people say about "How to Use Matrices to Represent Data"?

No one replied yet.

Leave a Reply