Introduction to Matrices | Free Discrete Mathematics Lesson (4 College Credits) | UPI Study

UPI Study › Courses › Discrete Mathematics › Free lessons › Lesson 12.1 Free with a free account

Introduction to Matrices

Discrete Mathematics · Chapter 12: Matrices and TransformationsSection 12.1 · lesson 77 of 879 min · free with a free account

← Prim's Algorithm for Minimum Spanning TreesNext lesson: Matrix Operations and Inverses →

Earn 4 college credits for Discrete MathematicsRecommended for credit by NCCRS · Math 230 · self-paced · one payment, lifetime access

In this lesson

Notation, special matrices, and entrywise arithmetic.

  • Read a matrix's dimensions and name its entries
  • Recognize square, zero and identity matrices
  • Add, subtract and scale matrices entrywise
  • Explain why dimensions must match

Transcript

Everything said in the video, section by section (1,373 words). Read along, or search it.

Matrices and Transformations

Introduction to Matrices

This section opens chapter twelve, on matrices and the transformations they describe. A matrix is a rectangular grid of numbers. But it's more than a grid, because it comes with its own notation, its own special cases, and its own arithmetic. Here, we cover the notation and the simplest arithmetic: addition, subtraction, and multiplying by a single number.

The Opening Problem

How Motion Detection Sees Video

Think about a security camera's motion detector. It doesn't look at video the way a person does. It receives a rapid sequence of frames, and each frame is a rectangular grid of brightness values. Frame by frame, it has to decide whether anything moved. One simple and still widely used technique is frame differencing. Subtract the previous frame from the current one, position by position. Then look for regions where the result is far from zero. That's where something changed. Brightening a frame, combining correction layers, comparing frames. None of this is exotic. It's exactly matrix addition, subtraction, and scalar multiplication.

12.1.1

What a Matrix Is

Chapter ten already used a matrix informally, to record which vertices of a graph are adjacent. Now we treat it as a mathematical object in its own right. An m by n matrix is a rectangular array of numbers, with m rows and n columns. By convention, the row count always comes first. A matrix is named with a capital letter, like A. Its entry in row i and column j is written lowercase a, with subscripts i and j. Two matrices are equal only if they have identical dimensions, and every pair of corresponding entries is equal. Take this matrix A, with two rows and three columns. It's two by three, and holds six entries. Its entry a one two, row one, column two, is seven. Entry a two one is nine. And entry a two three is six.

Figure 12.1.1

The Anatomy of a 3 × 4 Matrix

Here's the anatomy of a general three by four matrix. There are three rows, numbered top to bottom, and four columns, numbered left to right. Row two is shaded orange. Column three is shaded teal. Where they meet is a single entry, a two three. The row index comes first in the subscript, just as rows come first in the dimensions. Get that order backwards, and a two three and a three two would be confused. They are different positions entirely.

Shape, Not Count

Dimensions Describe a Shape

Here's a subtle point. A two by three matrix and a three by two matrix both hold six entries. But they are not the same kind of object. Dimensions describe a shape, not merely a count. Two special shapes have names. A matrix with only one row is called a row vector. A matrix with only one column is called a column vector. Both are still just matrices, with one of their dimensions equal to one.

12.1.2

Square, Zero and Identity Matrices

Some matrices are special enough to earn names. A matrix is square when its number of rows equals its number of columns. An n by n matrix is called a matrix of order n. The zero matrix has every entry equal to zero. It can have any dimensions at all. The identity matrix of order n is n by n. It has a one in every position on the main diagonal, where the row index equals the column index, and zero everywhere else. On the left is the identity matrix of order four. Its ones run down the diagonal, from row one column one, to row four column four. On the right is a three by three zero matrix. The identity must be square, since its diagonal pattern needs matching row and column counts. Section twelve point two explains the property that gives it its name.

Table 12.1.1

The Three Special Matrices Compared

Here's how the three compare. A square matrix needs only the right shape, with no pattern of entries required. A zero matrix can be any size, but every entry is zero. An identity matrix must be square, with ones on the main diagonal and zeros elsewhere. The zero matrix earns its name from a concrete fact. Add it to any matrix A of the same dimensions, and you get A back. The proof is one line. Each entry of the sum is a i j plus zero, which is just a i j. Every entry matches, so the matrices are equal.

12.1.3

Adding, Subtracting and Scaling

Now, the arithmetic. To add two matrices, add corresponding entries. The entry in row i, column j of A plus B is a i j plus b i j. Subtraction works the same way, entry by entry. Both operations are defined only when A and B have identical dimensions. A matrix with different dimensions can't be added to A, no matter how many entries it happens to contain. Scalar multiplication is different. Here a scalar is just a single real number, c. The matrix c times A multiplies every entry of A by c. It works for any matrix, of any size.

Proposition 12.1.2

Properties Inherited From Real Numbers

These operations obey three familiar laws. Addition is commutative: A plus B equals B plus A. It's associative: A plus B, then plus C, equals A plus the sum of B and C. And scalar multiplication distributes over addition: c times A plus B, equals c A plus c B. Why must these hold for every matrix? Because each one is checked entry by entry. Take the distributive law. Each entry on the left is c times the sum of a i j and b i j. On the right, the same entry is c a i j plus c b i j. Those are equal because real-number multiplication distributes over addition. Each matrix law is inherited directly from a law of real numbers.

Worked Example

Combining Frame Data

Back to the camera. Here's a two by three patch from two consecutive frames, plus a brightness-correction layer. Frame one, A, has rows four, seven, two, and nine, one, six. Frame two, B, has rows three, five, eight, and zero, four, two. And the correction layer, C, has rows one, zero, minus one, and two, minus three, one. All three are two by three, so every operation we try is legal.

Worked Example

4 Operations, Entry by Entry

First, apply the correction, A plus C. Four plus one is five, seven plus zero is seven, and so on, giving rows five, seven, one, and eleven, minus two, seven. Next, frame differencing, B minus A. Three minus four is minus one. The result has rows minus one, minus two, six, and minus nine, three, minus four. Now read it like a motion detector. The entries of largest magnitude, minus nine in position two one, and minus four in position two three, mark where brightness changed most. Small entries near zero, like minus one in position one one, mark regions of little change. A brightness gain of two doubles every entry, giving rows eight, fourteen, four, and eighteen, two, twelve. And the combined expression, two A minus B, gives rows five, nine, minus four, and eighteen, minus two, ten.

Table 12.1.2

The Three Operations Compared

Here's a summary of all three operations. Addition and subtraction both require identical dimensions, work entry by entry, and give a result of the same dimensions. Scalar multiplication works for any real number c, and the result has the same dimensions as A. One practical caution. In real image processing, brightness values are usually restricted to a fixed range, such as zero to two hundred fifty-five. The matrix arithmetic places no such limit on entries. So software has to clip or rescale any result that falls outside the valid range. Multiplying two matrices together is a different story, and it's the subject of section twelve point two.

Takeaways

A Grid With Rules

To summarize. An m by n matrix has m rows and n columns. Its dimensions are a shape, not just a count of entries. Square matrices, the zero matrix, and the identity matrix are named special cases that recur throughout linear algebra. Addition and subtraction work entry by entry, and only between matrices of identical dimensions. Scalar multiplication multiplies every entry by the same number. And the laws these operations obey come straight from real-number arithmetic. Here's something to think about. A two by six matrix and a three by four matrix both contain exactly twelve entries. Why can't we add them by simply lining up all the numbers in order? And can you find two reasonable ways of lining them up that give two different answers?

About Discrete Mathematics at UPI Study

Discrete Mathematics (Math 230) is a self-paced online course of 87 video lessons in 13 chapters, from logic and proof to counting, probability, graph theory and trees. It carries a NCCRS credit recommendation for 4 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Why take it here

Why students take Discrete Mathematics with UPI Study

The math behind computer scienceDiscrete Mathematics is the mathematics of computer science: logic, proofs, sets, counting, probability and graphs underpin algorithms, data structures, cryptography and databases. Completing it now lets you qualify for those courses at your university.
Credit at a fraction of the priceThe same 4 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Discrete Mathematics carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Introduction to Matrices

How do you read a matrix's dimensions and find the entry a_{ij}?
An m \times n matrix has m rows and n columns, with the row count always listed first. The entry a_{ij} sits in row i, column j. In a 2 \times 3 matrix, a_{23} is in row 2, column 3, and it is a different position from a_{32}, which does not exist in that matrix.
What is the difference between a square matrix, a zero matrix, and an identity matrix?
A square matrix has as many rows as columns, and no pattern of entries is required. A zero matrix has every entry equal to 0 and can have any dimensions. An identity matrix of order n is n \times n, with 1s on the main diagonal and 0s everywhere else, so it must be square.
How do you add, subtract, and scale matrices?
Add or subtract matrices entry by entry, and multiply every entry by c for scalar multiplication. For A=\begin{bmatrix}4&7\\9&1\end{bmatrix} and B=\begin{bmatrix}3&5\\0&4\end{bmatrix}, B-A=\begin{bmatrix}-1&-2\\-9&3\end{bmatrix} and 2A=\begin{bmatrix}8&14\\18&2\end{bmatrix}. Each result has the same dimensions as the originals.
Why do two matrices need the same dimensions to be added?
Matrix addition pairs each entry a_{ij} with the entry b_{ij} in the same position, so both matrices need identical dimensions. A 2\times 6 and a 3\times 4 matrix both have 12 entries, but their shapes differ, so some positions would have no partner. Matching the total count of entries is not enough. Scalar multiplication has no such restriction.

About the Discrete Mathematics course

How many college credits is Discrete Mathematics?
Discrete Mathematics (Math 230) carries a NCCRS credit recommendation for 4 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Discrete Mathematics cost and what is included?
$250, paid once, with lifetime access: all 87 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Discrete Mathematics take?
It is self-paced with no deadlines. The 87 lessons total about 13 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 4 credits in Discrete Mathematics.

87 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Discrete Mathematics
4 credits · NCCRS
Enroll →