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
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Discrete Mathematics.
Lesson complete
Earn the 4 college credits for Discrete Mathematics
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Matrix Operations and Inverses →← Prim's Algorithm for Minimum Spanning TreesNext lesson: Matrix Operations and Inverses →
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.
Enroll now → Course details Download the syllabus Every course with PRO →
Why take it here
Why students take Discrete Mathematics with UPI Study
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.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →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}?
What is the difference between a square matrix, a zero matrix, and an identity matrix?
How do you add, subtract, and scale matrices?
Why do two matrices need the same dimensions to be added?
About the Discrete Mathematics course
How many college credits is Discrete Mathematics?
How much does Discrete Mathematics cost and what is included?
Which universities accept UPI Study credits?
How long does Discrete Mathematics take?
How are the exams done?
How do my credits reach my college?
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.
4 credits · NCCRSEnroll →