0% found this document useful (0 votes)
2 views86 pages

Module2ImageProcessing

This document outlines an educational module on image processing that teaches students how to manipulate images using matrices and vectors, culminating in a project to create a classroom 'Instagram feed.' The module includes lessons on matrix operations, image processing, and an extension involving Python programming, designed for high school math courses. It provides implementation notes, lesson plans, and assessments to facilitate learning and application of mathematical concepts in a practical context.

Uploaded by

SivaCharan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views86 pages

Module2ImageProcessing

This document outlines an educational module on image processing that teaches students how to manipulate images using matrices and vectors, culminating in a project to create a classroom 'Instagram feed.' The module includes lessons on matrix operations, image processing, and an extension involving Python programming, designed for high school math courses. It provides implementation notes, lesson plans, and assessments to facilitate learning and application of mathematical concepts in a practical context.

Uploaded by

SivaCharan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 86

Image Processing

Authors:
Tamar Avineri, North Carolina School of Science and Mathematics, Durham NC
Emily Berkeley, Panther Creek High School, Cary, NC
Ashley Miller, North Rowan High School, Spencer, NC

Advisors: Eric Hallman, Rachel Minster, and Arvind K. Saibaba ([email protected])


North Carolina State University

Abstract: In this all-inclusive module students will learn how to use matrices and vectors to manipulate and
edit images. The students will be provided with their own image editing activity where they will create their
own classroom “Instagram feed.” There is also an extension activity that incorporates some basic Python
programming into this module.

The authors would like to acknowledge the support of the National Science Foundation through the grant
DMS-1845406
2

Implementation Notes 3
Lesson 1: Introduction to Matrices and Matrix Operations 5
Lesson Plan 5
Guided Notes – Teacher Version 9
Lesson 2: Matrix Multiplication 14
Lesson Plan 14
Guided Notes – Teacher Version 16
Lesson 3: Introduction to Image Processing 22
Lesson Plan 22
Guided Notes – Teacher Version 25
Lesson 4: (Extension) Image Processing using Computer Science 40
Lesson Plan 40
Lesson 5: Instagram Project 42
Lesson Plan 42
Warm-Up – Teacher Version 44
Instagram Project 47
References and Additional Readings 48
Appendices 49
Appendix A: Lesson Materials – Student Versions 49
Lesson 1: Guided Notes – Student Version 49
Lesson 2: Guided Notes – Student Version 54
Lesson 3: Guided Notes – Student Version 61
Lesson 5: Warm-Up – Student Version 9
Appendix B: Lesson Materials – Templates/Examples 15
Lesson 4: Math Symbols Image 15
Lesson 5: Instagram Project Stock Images 16
Lesson 5: Instagram Project Example 18
3

Implementation Notes
v Length of module:
Ø In total, this unit is designed to take approximately 3.5 days of 90-minute lessons, or
7 days of 45-minute lessons, including the final project. There is also an extension
project that is designed to take approximately 85 minutes.
Ø Each of the lessons is accompanied by an estimate of the length of time it is
designed to take in class. If the estimate is longer than you can devote in class, feel
free to select portions for students to complete outside of class.
Ø There is an extension project that includes coding in Python. This is a lesson that is
intended for Discrete Math for Computer Science but would be a great tool if you
have the extra time to implement the lesson in the Math 4 or Pre-Calculus class.

v Relevant courses: This module is designed to be self-contained, as the first 2 lessons


provide foundational knowledge in the linear algebra skills that students will need for the
subsequent lessons. The materials are appropriate for any NC Math 4, Pre-Calculus, or
Discrete Mathematics for Computer Science courses. This could also serve as an interesting
study following the AP exam for students in AP Calculus AB or BC.

v Mathematical practices/student learning outcomes: In addition to the standards for


mathematical practices, this module addresses several standards covered in NC Math 4, Pre-
Calculus, and Discrete Mathematics for Computer Science.
Ø Mathematical practices:
§ Make sense of problems and persevere in solving them.
§ Reason abstractly and quantitatively.
§ Construct viable arguments and critique the reasoning of others.
§ Model with mathematics.
§ Use appropriate tools strategically.
§ Attend to precision.
§ Look for and make use of structure.
§ Look for and express regularity in repeated reasoning.
§ Use strategies and procedures flexibly.
§ Reflect on mistakes and misconceptions.
Ø NC Math 4: NC.M4.N.2.1 Execute procedures of addition, subtraction,
multiplication, and scalar multiplication on matrices; NC.M4.N.2.2 Execute
procedures of addition, subtraction, and scalar multiplication on vectors.
Ø Precalculus: PC.N.2.1 Execute the sum and difference algorithms to combine
matrices of appropriate dimensions; PC.N.2.2 Execute associative and distributive
properties to matrices; PC.N.2.3 Execute commutative property to add matrices;
PC.N.2.4 Execute properties of matrices to multiply a matrix by a scalar; PC.N.2.5
Execute the multiplication algorithm with matrices.
Ø Discrete Mathematics for Computer Science: DCS.N.1.1 Implement procedures
of addition, subtraction, multiplication, and scalar multiplication on matrices;
DCS.N.1.2 Implement procedures of addition, subtraction, and scalar multiplication
4

on vectors; DCS.N.1.3 Implement procedures to find the inverse of a matrix;


DCS.N.2.1 Organize data into matrices to solve problems; DCS.N.2.2 Interpret
solutions found using matrix operations in context; DCS.N.2.3 Represent a system
of equations as a matrix equation; DCS.N.2.4 Use inverse matrices to solve a system
of equations with technology.

v Assessments:
Ø Feel free to select portions of the guided notes to serve as out-of-class activities.
Ø Any problem set contained within guided notes could be given as homework
assignments.
Ø As an alternative to the final project in this module, you could choose to give
students a standard test or quiz on the skills that have been learned.

v Online delivery suggestions:


Ø For asynchronous online delivery, create instructional videos to take students
through the guided notes.
Ø For synchronous online delivery, display the guided notes on your screen and take
students through the activities while you annotate on your screen (or writing on
paper and using a document camera).
Ø Share all prepared documents through a learning management system so that
students would have access to them at home
Ø For the project, you can have the students create the matrices using Microsoft word
(or if they have access to a tablet and a note taking app, they can create the matrices
on there), they can use this website to create the pictures, and then they can screen
snip the pictures out and paste them into the final document. They can then submit
the project fully through an online submission.

v List of accompanying documents:


Ø Lesson 4: Python or Jupyter Coding Template
§ To download Jupyter click HERE

v Student Versions: Please note that the student versions are located at the end of this
document in Appendix A.
5

Lesson 1: Introduction to Matrices and Matrix Operations

Lesson Plan

Standards Topic/Day: Introduction to Matrices, Matrix


NC.M4.N.2.1 Execute procedures of addition, Addition/Subtraction, and Scalar Multiplication
subtraction, multiplication, and scalar Content Objective: Elementary Matrix Operations
multiplication on matrices Vocabulary: matrix; row; column; dimension; square; transpose

PC.N.2.1 Execute the sum and difference


algorithms to combine matrices of appropriate
dimensions; PC.N.2.2 Execute associative and
distributive properties to matrices; PC.N.2.3
Execute commutative property to add matrices;
PC.N.2.4 Execute properties of matrices to
multiply a matrix by a scalar;

DCS.N.1.1 Implement procedures of addition,


subtraction, multiplication and scalar
multiplication on matrices.

(~60 minutes)

Time Student Does Teacher Does


6

Warm Up ~15 Students read the opening problem (e.g., Teacher hands out a sheet of
Elicit/Engage min Textbook Problem or other context of paper with the opening
Build relevance through a interest) from a handout and/or projected problem written on it and/or
problem on a screen. projects it on the screen.
Try to find out what your In groups of 2-3, students talk briefly about Teacher opens with the
students already know how they would answer the question from question, “How might we
Get them interested the teacher. (~5 minutes) The teacher brings organize this information in a
back students to share out with the class. (~3 way that allows us to answer
minutes) questions about the
Students are provided guided notes to university’s inventory?”
document new terms (e.g., matrix,
dimension, row, column, etc.) They will After students discuss, the
complete the notes through the discussion teacher solicits students’
conducted by the teacher. (~5 minutes) responses.

If students do not suggest a


matrix, the teacher will
introduce the name and ask
students if they are familiar
with the term. If not, the
teacher will define it through
one of the matrices used to
organize the information in
the problem.

Explore I Students complete the second matrix from Teacher circulates the room to
Connectivity to build ~15 the problem in their groups. (~5 min) observe/monitor students’
understanding of concepts min work.
Allow for collaboration consider Students work in groups of 2-3 to answer
heterogeneous groups teacher’s question. (~5 minutes) Teacher then poses question:
Move deliberately from concrete “How could we use these
to abstract matrices to determine the
Apply scaffolding & total inventory of books at the
personalization university?”

Once students have some


time to answer question,
teacher returns to full class
discussion to ask how we
could define matrix addition.
7

Explain I ~5 min Students offer their ideas on how to define Teacher conducts discussion
Personalize/Differentiate as matrix addition (and subtraction). on matrix addition and
needed subtraction.
Adjust along Students engage in class discussion on
teacher/student centered teachers’ questions. Teacher poses questions: “Is
continuum matrix addition commutative?
Provide vocabulary Is it associative? Is matrix
Clarify understandings subtraction commutative? Is
it associative? Why/why not?”

Explore II Students work in groups of 2-3 to answer Teacher then poses question:
Connectivity to build ~5 min teacher’s question. (~5 minutes) “How could we use these
understanding of concepts matrices to determine the
Allow for collaboration consider inventory of books at the
heterogeneous groups university if the librarian
Move deliberately from concrete would like to double the
to abstract inventory?”
Apply scaffolding &
personalization Once students have some
time to answer question,
teacher returns to full class
discussion to ask how we
could define scalar
multiplication..

Explain II ~5 min Students offer their ideas on how to define Teacher conducts discussion
Personalize/Differentiate as scalar multiplication. on scalar multiplication.
needed
Adjust along
teacher/student centered
continuum
Provide vocabulary
Clarify understandings

Extend ~15 Students complete class problem set in Teacher circulates the room
Apply knowledge to new min groups of 2-3 to apply their new knowledge. and observes/monitors
scenarios students’ work.
Continue to personalize as
needed
Consider grouping
homogeneously
8

Evaluate N/A Students will complete guided notes and a Teacher will review students’
Formative Assessment problem set for practice. Students turn in work as they circulate room
How will you know if students their solutions to the last problem in the and monitor progress,
understand throughout the problem set as an exit ticket (e.g., Stereo engaging students who may be
lesson? Problem) having difficulty in discussion
to probe their thinking.

Evaluate N/A N/A N/A


Summative-like Assessment
Questions similar to final
assessment
9

Guided Notes – Teacher Version


Matrix Addition, Subtraction and Scalar Multiplication

A university is taking inventory of the books they carry at their two biggest bookstores.
The East Campus bookstore carries the following books:
Hardcover: Textbooks-5280; Fiction-1680; NonFiction-2320; Reference-1890
Paperback: Textbooks-1930; Fiction-2705; NonFiction-1560; Reference-2130

The West Campus bookstore carries the following books:


Hardcover: Textbooks-7230; Fiction-2450; NonFiction-3100; Reference-1380
Paperback: Textbooks-1740; Fiction-2420; NonFiction-1750; Reference-1170

In order to work with this information, we can represent the inventory of each bookstore using an
organized array of numbers known as a matrix.

Definitions: A matrix is a rectangular table of entries and is used to organize data in a way that can
be used to solve problems. The following is a list of terms used to describe matrices:

• A matrix’s size (or dimension) is written by listing the number of rows “by” the number

of columns.

• The values in a matrix, A, are referred to as entries or elements. The entry in the “mth”

row and “nth” column is written as 𝑎!" .

• A matrix is square if it has the same number of rows as it has columns.

• If a matrix has only one row, then it is a row vector. If it has only one column, then the

matrix is a column vector.

• The transpose of a matrix, A, written AT, switches the rows with the columns of A and the

columns with the rows.

• Two matrices are equal if they have the same size and the same corresponding entries.
10

The inventory of the books at the East Campus bookstore can be represented with the following 2 x
4 matrix:
𝑇 𝐹 𝑁 𝑅
𝐻𝑎𝑟𝑑𝑏𝑎𝑐𝑘 5280 1680 2320 1890
𝐸= 2 <
𝑃𝑎𝑝𝑒𝑟𝑏𝑎𝑐𝑘 1930 2705 1560 2130

Similarly, the West Campus bookstore’s inventory can be represented with the following matrix:

𝑇 𝐹 𝑁 𝑅
𝐻𝑎𝑟𝑑𝑏𝑎𝑐𝑘 7230 2450 3100 1380
𝑊= 2 <
𝑃𝑎𝑝𝑒𝑟𝑏𝑎𝑐𝑘 1740 2420 1750 1170

Adding and Subtracting Matrices

In order to add or subtract matrices, they must first be of the same size. The result of the addition
or subtraction is a matrix of the same size as the matrices themselves, and the entries are obtained by
adding or subtracting the elements in corresponding positions.

In our campus bookstores example, we can find the total inventory between the two bookstores as
follows:

5280 1680 2320 1890 7230 2450 3100 1380


𝐸+𝑊 =2 <+2 <
1930 2705 1560 2130 1740 2420 1750 1170

𝑇 𝐹 𝑁 𝑅
𝐻𝑎𝑟𝑑𝑏𝑎𝑐𝑘 12510 4130 5420 3270
= 2 <
𝑃𝑎𝑝𝑒𝑟𝑏𝑎𝑐𝑘 3670 5125 3310 3300
11

Question: Is matrix addition commutative (𝑒. 𝑔. , 𝐴 + 𝐵 = 𝐵 + 𝐴)? Why or why not?


Matrix addition is commutative. This is because the operation is based in the addition of real
numbers, as the entries of each matrix are added to their corresponding entries in the other
matrix/matrices. Since addition of real numbers is commutative, so is matrix addition.

Question: Is matrix subtraction commutative (𝑒. 𝑔. , 𝐴 − 𝐵 = 𝐵 − 𝐴)? Why or why not?


Matrix subtraction is not commutative. This is because the operation is based in the subtraction of
real numbers, as the entries of each matrix are subtracted from their corresponding entries in the
other matrix/matrices. Since subtraction of real numbers is not commutative, neither is matrix
subtraction.

Question: Is matrix addition associative (𝑒. 𝑔. , (𝐴 + 𝐵) + 𝐶 = 𝐴 + (𝐵 + 𝐶))? Why or why not?


Matrix addition is associative. This is because the operation is based in the addition of real numbers,
as the entries of each matrix are added to their corresponding entries in the other matrix/matrices.
Since addition of real numbers is associative, so is matrix addition.

Question: Is matrix subtraction associative (𝑒. 𝑔. , (𝐴 − 𝐵) − 𝐶 = 𝐴 − (𝐵 − 𝐶))? Why or why not?


Matrix subtraction is not associative. This is because the operation is based in the subtraction of real
numbers, as the entries of each matrix are subtracted from their corresponding entries in the other
matrix/matrices. Since subtraction of real numbers is not associative, neither is matrix subtraction.

Scalar Multiplication

Multiplying a matrix by a constant (or scalar) is as simple as multiplying each entry by that number!
Suppose the bookstore manager in East Campus wants to double his inventory. He can find the
number of books of each type that he would need by simply multiplying the matrix E by the scalar
(or constant) 2. The result is as follows:
𝑇 𝐹 𝑁 𝑅 𝑇 𝐹 𝑁 𝑅
5280 1680 2320 1890 2(5280) 2(1680) 2(2320) 2(1890)
2𝐸 = 2 ∗ 2 <=J K
1930 2705 1560 2130 2(1930) 2(2705) 2(1560) 2(2130)

𝑇 𝐹 𝑁 𝑅
𝐻𝑎𝑟𝑑𝑏𝑎𝑐𝑘 10560 3360 4640 3780
= 2 <
𝑃𝑎𝑝𝑒𝑟𝑏𝑎𝑐𝑘 3860 5410 3120 4260
12

Exercises: Consider the following matrices:

1 0 1 0 6 −21 5
𝐴 = L 2 −4 3M 𝐵 = [2 8 −6] 𝐶 = L2 4 −9 M 𝐷 = L−2M
−6 1 8 5 −7 1 3

Find each of the following, or explain why the operation cannot be performed:

a. 𝐴 + 𝐵: This operation cannot be performed, since matrices 𝐴 and 𝐵 are of different dimensions.

b. 𝐵 – 𝐴: This operation also cannot be performed, as 𝐴 and 𝐵 have different dimensions.

1 0 1 0 6 −21 𝟏 −𝟔 𝟐𝟐
c. 𝐴 − 𝐶 = L 2 −4 3M − L2 4 −9 M = L 𝟎 −𝟖 𝟏𝟐M
−6 1 8 5 −7 1 −𝟏𝟏 𝟖 𝟕

0 6 −21 1 0 1 −𝟏 𝟔 −𝟐𝟐
d. 𝐶 − 𝐴 = L2 4 −9 M − L 2 −4 3M = L 𝟎 𝟖 −𝟏𝟐M
5 −7 1 −6 1 8 𝟏𝟏 −𝟖 −𝟕

e. 5𝐵 = 5 ∗ [2 8 −6] = [𝟏𝟎 𝟒𝟎 −𝟑𝟎]

1 0 1 0 6 −21
f. – 𝐴 + 4𝐶 = − L 2 −4 3M + 4 ∗ L2 4 −9 M =
−6 1 8 5 −7 1

−1 0 −1 0 24 −84 −𝟏 𝟐𝟒 −𝟖𝟓
L−2 4 −3M + L 8 16 −36M = L 𝟔 𝟐𝟎 −𝟑𝟗M
6 −1 −8 20 −28 4 𝟐𝟔 −𝟐𝟗 −𝟒

g. 𝐵 – 𝐷: This operation cannot be performed, since B and D are not of the same size.

0 6 −21 1 0 1
h. 2𝐶 − 6𝐴 = 2 ∗ L2 4 −9 M − 6 ∗ L 2 −4 3M =
5 −7 1 −6 1 8
13

0 12 −42 6 0 6 −𝟔 𝟏𝟐 −𝟒𝟖
L4 8 −18M − L 12 −24 18M = L−𝟖 𝟑𝟐 −𝟑𝟔M
10 −14 2 −36 6 48 𝟒𝟔 −𝟐𝟎 −𝟒𝟔

2 5 𝟕
#
i. 𝐵 + 𝐷 = L 8 M + L−2M = L 𝟔 M
−6 3 −𝟑
14

Lesson 2: Matrix Multiplication

Lesson Plan

Topic/Day: Matrix Multiplication


Standards Content Objective: Elementary Matrix Operations
NC.M4.N.2.1 Execute procedures of addition,
subtraction, multiplication, and scalar
multiplication on matrices

PC.N.2.1 Execute the sum and difference


algorithms to combine matrices of appropriate
dimensions; PC.N.2.2 Execute associative and
distributive properties to matrices; PC.N.2.3
Execute commutative property to add matrices;
PC.N.2.4 Execute properties of matrices to
multiply a matrix by a scalar;

DCS.N.1.1 Implement procedures of addition,


subtraction, multiplication and scalar
multiplication on matrices; DCS.N.2.1 Organize
data into matrices to solve problems; DCS.N.2.2 (~70 minutes)
Interpret solutions found using matrix operations
in context

Time Student Does Teacher Does

Warm Up ~5 min Students read the opening problem (e.g., Teacher hands out a sheet of
Elicit/Engage
Build relevance through a Opera Problem or other context of interest) paper with the opening
problem from a handout and/or projected on a problem written on it and/or
screen. projects it on the screen.
Try to find out what your
students already know Teacher opens with the
Get them interested question, “How might we
organize this information in a
way that allows us to answer
the question?”
15

Explore In groups of 2-3, students work together to Teacher asks students to


Connectivity to build
understanding of concepts ~15 min calculate each value of interest by hand (not calculate each value of interest
Allow for collaboration using any specific method). (~10 minutes) by hand, showing their work
consider heterogeneous groups but not using any specific
Move deliberately from
concrete to abstract method.
Apply scaffolding & Students work in groups of 2-3 to answer
personalization teacher’s question. (~10 minutes) Students
The teacher brings students
can break the work up among their group
back to share their results and
members.
confirm their results with
other groups.

Explain ~15 Students follow along the teachers’ Teacher conducts lesson on
Personalize/Differentiate as
needed min explanation on their opening problem. matrix multiplication using the
Adjust along opening problem to
teacher/student centered Students share their thoughts on teacher’s demonstrate the operation.
continuum
Provide vocabulary posed questions.
Clarify understandings Teacher poses questions: “Is
matrix multiplication
commutative? Is it
associative? Why/why not?”
Teacher provides examples of
why they are/aren’t, and
students practice the
operation with those
examples.
Extend ~25 Students complete class problem set in Teacher will review students’
Apply knowledge to new
scenarios min groups of 2-3 to apply their new knowledge. work as they circulate room
Continue to personalize as and monitor progress,
needed engaging students who may be
Consider grouping
homogeneously having difficulty in discussion
to probe their thinking.

Teacher brings class back


together to engage in debrief
on the problem set.
Evaluate ~10 Students work on exit ticket problem and Teacher poses exit ticket
Assessment
How will you know if students min turn it in. problem for students to turn
understand throughout the in.
lesson?
16

Guided Notes – Teacher Version


Matrix Multiplication

The Metropolitan Opera is planning its last cross-country tour. It plans to perform Carmen and La
Traviata in Atlanta in May. The person in charge of logistics wants to make plane reservations for the two
troupes. Carmen has 2 stars, 25 other adults, 5 children, and 5 staff members. La Traviata has 3 stars, 15
other adults, and 4 staff members. There are 3 airlines to choose from. Redwing charges round-trip fares
to Atlanta of $630 for first class, $420 for coach, and $250 for youth. Southeastern charges $650 for first
class, $350 for coach, and $275 for youth. Air Atlanta charges $700 for first class, $370 for coach, and
$150 for youth. Assume stars travel first class, other adults and staff travel coach, and children travel for
the youth fare.

Use multiplication and addition to find the total cost for each troupe to travel each of the airlines.

Carmen/Redwing: 2(630) + 30(420) + 5(250) = $15110

Carmen/Southeastern: 2(650) + 30(350) + 5(275) = $13175

Carmen/Air Atlanta: 2(700) + 30(370) + 5(150) = $13250

La Traviata/Redwing: 3(630) + 19(420) + 0(250) = $9870

La Traviata/Southeastern: 3(650) + 19(350) + 0(275) = $8600

La Traviata/Air Atlanta: 3(700) + 19(370) + 0(150) = $9130


17

It turns out that we can solve problems like these using a matrix operation, specifically matrix
multiplication!

We first note that matrix multiplication is only defined for matrices of certain sizes. For the product 𝐴𝐵
of matrices 𝐴 and 𝐵, where 𝐴 is an 𝑚 𝑥 𝑛 matrix, 𝐵 must have the same number of rows as 𝐴 has
columns. So, 𝐵 must have size 𝒏 𝑥 𝑝. The product 𝐴𝐵 will have size 𝒎 𝒙 𝒑.

Exercises

The following is a set of abstract matrices (without row and column labels):

2 4 1
1 −1 6
𝑀=2 < 𝑁 = L0 −1 3M 𝑂=2 <
2 0 −1
1 0 2

0 ! 4
" 3 1
𝑃=f !g 𝑄 = L1 M 𝑅=2 <
−1 −1 0
" 3
3 1 1 4 2 6 −1
𝑆=j1 0k 𝑇=j2 k 𝑈 = L5 3 1 0M
0 2 −3
−1 1 4 0 2 −1 1

List at least 5 orders of pairs of matrices from this set for which the product is defined. State the
dimension of each product.

MO: 2x1 MP: 2x2 PM: 2x2 MR: 2x2 RM: 2x2 NQ: 3x1

NU: 3x4 PO: 2x1 US: 3x2 UT: 3x1


18

Back to the opera…

Define two matrices that organize the information given:

𝐬𝐭𝐚𝐫𝐬 𝐚𝐝𝐮𝐥𝐭𝐬 𝐜𝐡𝐢𝐥𝐝𝐫𝐞𝐧


𝑪𝒂𝒓𝒎𝒆𝒏 𝟐 𝟑𝟎 𝟓
9 @
𝑳𝒂 𝑻𝒓𝒂𝒗𝒊𝒂𝒕𝒂 𝟑 𝟏𝟗 𝟎

𝐑𝐞𝐝 𝐒𝐨𝐮𝐭𝐡 𝐀𝐢𝐫


𝐬𝐭𝐚𝐫𝐬 𝟔𝟑𝟎 𝟔𝟓𝟎 𝟕𝟎𝟎
𝐚𝐝𝐮𝐥𝐭𝐬 E𝟒𝟐𝟎 𝟑𝟓𝟎 𝟑𝟕𝟎I
𝐜𝐡𝐢𝐥𝐝𝐫𝐞𝐧 𝟐𝟓𝟎 𝟐𝟕𝟓 𝟏𝟓𝟎

We can multiply these two matrices to obtain the same answers we obtained above, all in one matrix!

𝐑𝐞𝐝 𝐒𝐨𝐮𝐭𝐡 𝐀𝐢𝐫


𝐬𝐭𝐚𝐫𝐬 𝐚𝐝𝐮𝐥𝐭𝐬 𝐜𝐡𝐢𝐥𝐝𝐫𝐞𝐧 𝐬𝐭𝐚𝐫𝐬 𝟔𝟑𝟎 𝟔𝟓𝟎 𝟕𝟎𝟎
𝑪𝒂𝒓𝒎𝒆𝒏 𝟐 𝟑𝟎 𝟓
9 @ ∙ 𝐚𝐝𝐮𝐥𝐭𝐬 E 𝟒𝟐𝟎 𝟑𝟓𝟎 𝟑𝟕𝟎I
𝑳𝒂 𝑻𝒓𝒂𝒗𝒊𝒂𝒕𝒂 𝟑 𝟏𝟗 𝟎
𝐜𝐡𝐢𝐥𝐝𝐫𝐞𝐧 𝟐𝟓𝟎 𝟐𝟕𝟓 𝟏𝟓𝟎

𝐑𝐞𝐝 𝐒𝐨𝐮𝐭𝐡 𝐀𝐢𝐫


= 𝑪𝒂𝒓𝒎𝒆𝒏 𝟏𝟓𝟏𝟏𝟎 𝟏𝟑𝟏𝟕𝟓 𝟏𝟑𝟐𝟓𝟎
2 <
𝑳𝒂 𝑻𝒓𝒂𝒗𝒊𝒂𝒕𝒂 𝟗𝟖𝟕𝟎 𝟖𝟔𝟎𝟎 𝟗𝟏𝟑𝟎

Carmen/Redwing: $15110

Carmen/Southeastern: $13175

Carmen/Air Atlanta: $13250

La Traviata/Redwing: $9870

La Traviata/Southeastern: $8600

La Traviata/Air Atlanta: $9130


19

Exercises

1. The K.L. Mutton Company has investments in three states - North Carolina, North Dakota, and
New Mexico. Its deposits in each state are divided among bonds, mortgages, and consumer
loans. The amount of money (in millions of dollars) invested in each category on June 1 is
displayed in the table below.

NC ND NM
Bonds 13 25 22
Mort. 6 9 4
Loans 29 17 13
The current yields on these investments are 7.5% for bonds, 11.25% for mortgages, and 6% for
consumer loans. Use matrix multiplication to find the total earnings for each state.

Total earnings for each state (in millions of dollars):

𝑵𝑪 𝑵𝑫 𝑵𝑴
𝑩𝒐𝒏𝒅𝒔 𝑴𝒐𝒓𝒕. 𝑳𝒐𝒂𝒏𝒔 𝑩𝒐𝒏𝒅𝒔 𝟏𝟑 𝟐𝟓 𝟐𝟐 𝑵𝑪 𝑵𝑫 𝑵𝑴
[𝟏. 𝟎𝟕𝟓 𝟏. 𝟏𝟏𝟐𝟓 𝟏. 𝟎𝟔] =[
𝑴𝒐𝒓𝒕. L𝟔 𝟗 𝟒 M 𝟑. 𝟑𝟗 𝟑. 𝟗𝟎𝟕𝟓 𝟐. 𝟖𝟖]
𝑳𝒐𝒂𝒏𝒔 𝟐𝟗 𝟏𝟕 𝟏𝟑

2. Several years ago, Ms. Allen invested in growth stocks, which she hoped would increase in value
over time. She bought 100 shares of stock A, 200 shares of stock B, and 150 shares of stock C.
At the end of each year she records the value of each stock. The table below shows the price per
share (in dollars) of stocks A, B, and C at the end of the years 1984, 1985, and 1986.

1984 1985 1986


Stock A 68.00 72.00 75.00
Stock B 55.00 60.00 67.50
Stock C 82.50 84.00 87.00
Calculate the total value of Ms. Allen’s stocks at the end of each year.

Total value of the stocks (in dollars) at the end of each year:

𝟏𝟗𝟖𝟒 𝟏𝟗𝟖𝟓 𝟏𝟗𝟖𝟔


𝑨 𝑩 𝑪 𝑨 𝟔𝟖 𝟕𝟐 𝟕𝟓 𝟏𝟗𝟖𝟒 𝟏𝟗𝟖𝟓 𝟏𝟗𝟖𝟔
[𝟏𝟎𝟎 = [𝟑𝟎,
𝟐𝟎𝟎 𝟏𝟓𝟎] 𝑩 L 𝟓𝟓 𝟔𝟎 𝟔𝟕. 𝟓M 𝟏𝟕𝟓 𝟑𝟏, 𝟖𝟎𝟎 𝟑𝟒, 𝟎𝟓𝟎]
𝑪 𝟖𝟐. 𝟓 𝟖𝟒 𝟖𝟕
20

3. The Sound Company produces stereos. Their inventory includes four models - the Budget, the
Economy, the Executive, and the President models. The Budget needs 50 transistors, 30
capacitors, 7 connectors, and 3 dials. The Economy model needs 65 transistors, 50 capacitors, 9
connectors, and 4 dials. The Executive model needs 85 transistors, 42 capacitors, 10 connectors,
and 6 dials. The President model needs 85 transistors, 42 capacitors, 10 connectors, and 12 dials.
The daily manufacturing goal in a normal quarter is 10 Budget, 12 Economy, 11 Executive, and 7
President stereos.

a. How many transistors are needed each day? Capacitors? Connectors? Dials?

b. During August and September, production is increased by 40%. How many Budget, Economy,
Executive, and President models are produced daily during these months?

c. It takes 5 person-hours to produce the Budget model, 7 person-hours to produce the


Economy model, 6 person-hours for the Executive model, and 7 person-hours for the
President model. Determine the number of employees needed to maintain the normal
production schedule, assuming everyone works an average of 7 hours each day. How many
employees are needed in August and September?

Define the matrices for the inventory parts (𝑰) and the daily manufacturing goal (𝑵) as

𝒕 𝒄𝒂 𝒄𝒐 𝒅
𝑩 𝟓𝟎 𝟑𝟎 𝟕 𝟑 𝑩 𝑬𝒄 𝑬𝒙 𝑷
𝑰 = 𝑬𝒄 𝟔𝟓 𝟓𝟎 𝟗 𝟒 k 𝒂𝒏𝒅 𝑵=[
j 𝟏𝟎 𝟏𝟐 𝟏𝟏 𝟕]
𝑬𝒙 𝟖𝟓 𝟒𝟐 𝟏𝟎 𝟔
𝑷 𝟖𝟓 𝟒𝟐 𝟏𝟎 𝟏𝟐

a. The answers are the results of the matrix multiplication


𝒕 𝒄𝒂 𝒄𝒐 𝒅
𝑵𝑰 = [
𝟐𝟖𝟏𝟎 𝟏𝟔𝟓𝟔 𝟑𝟓𝟖 𝟐𝟐𝟖]

b. The new daily manufacturing goals are given by


𝑩 𝑬𝒄 𝑬𝒙 𝑷
𝟏. 𝟒𝑵 = [
𝟏𝟒 𝟏𝟔. 𝟖 𝟏𝟓. 𝟒 𝟗. 𝟖]

Which should be rounded to integer quantities

c. Define a matrix 𝑯 for hours of labor as


𝑯𝒓𝒔.
𝑩 𝟓
𝑯 = 𝑬𝒄 j𝟕 k
𝑬𝒙 𝟔
𝑷 𝟕

The number of labor hours needed per week is given by

𝑵𝑯 = 𝟐𝟒𝟗
21

𝟐𝟒𝟗
With 7-hour workdays, the number of employees needed is 𝟕 = 𝟑𝟓. 𝟔, which implies
that 36 employees are needed to maintain full production. For August and September,
𝟏.𝟒𝑵𝑯 𝟑𝟒𝟖.𝟔
we want 𝟕 = 𝟕 , which rounds to 50.

4. The president of the Lucrative Bank is hoping for a 21% increase in checking accounts, a 35%
increase in savings accounts, and a 52% increase in market accounts. The current statistics on the
number of accounts at each branch are as follows:

Checking Savings Market


Northgate 40039 10135 512
Downtown L15231 8751 105 M
South Square 25612 12187 97

What is the goal for each branch in each type of account? (HINT: multiply by a 3 × 2 matrix
with certain nonzero entries on the diagonal and zero entries elsewhere.) What will be the total
number of accounts at each branch?

The goal for each branch in each type of account is given by:

𝒄 𝒔 𝒎 𝒄 𝒔 𝒎
𝑵 𝟒𝟎𝟎𝟑𝟗 𝟏𝟎𝟏𝟑𝟓 𝟓𝟏𝟐 𝒄 𝟏. 𝟐𝟏 𝟎 𝟎
⋅ 𝒔
𝑺 L𝟏𝟓𝟐𝟑𝟏 𝟖𝟕𝟓𝟏 𝟏𝟎𝟓 M L 𝟎 𝟏. 𝟑𝟓 𝟎 M
𝑫 𝟐𝟓𝟔𝟏𝟐 𝟏𝟐𝟏𝟖𝟕 𝟗𝟕 𝒎 𝟎 𝟎 𝟏. 𝟓𝟐

𝒄 𝒔 𝒎
𝑵 𝟒𝟖𝟒𝟒𝟕 𝟏𝟑𝟔𝟖𝟐 𝟕𝟕𝟖. 𝟐𝟒
= 𝑺 L𝟏𝟖𝟒𝟑𝟎 𝟏𝟏𝟖𝟏𝟒 𝟏𝟓𝟗. 𝟔 M
𝑫 𝟑𝟎𝟗𝟗𝟏 𝟏𝟔𝟒𝟓𝟐 𝟏𝟒𝟕. 𝟒𝟒

𝟏
Right-multiplying this result by the matrix f𝟏g yields the following total number of
𝟏
𝑻𝒐𝒕𝒂𝒍
𝑵 𝟔𝟐𝟗𝟎𝟕. 𝟔𝟖
accounts at each branch: .
𝑫 L𝟑𝟎𝟒𝟎𝟐. 𝟗𝟔M
𝑺 𝟒𝟕𝟓𝟗𝟎. 𝟒𝟏

Note: this answer can also be obtained by just adding up the entries in each row of the
previous matrix.
22

Lesson 3: Introduction to Image Processing

Lesson Plan

Standard Topic/Day: Introduction to Image Processing


DCS.N.1.1 Implement procedures of addition, Content Objective:
subtraction, multiplication and scalar Language Objective:
multiplication on matrices. Vocabulary:
Materials Needed:

(~90 minutes)

Time Student Does Teacher Does

Warm Up ~10 Students work on nonogram activity in Teacher opens with a color-
Elicit/Engage
min groups of 2-3. by-number nanogram-style
Build relevance through a
problem image displayed to the class
(Activity site)
and prompts students to
Try to find out what your
students already know complete the diagram.
Get them interested (Teacher provides the
rules/process of completing a
nanogram.)

Teacher opens discussion with


students about what pixels are
and asks students if they know
how to interpret the numbers.
Ultimately, teacher concludes
that 0 represents black and
255 represents white.
Explore I Students work in groups of 2-3 through Teacher demonstrates how to
Connectivity to build
understanding of concepts ~10 min guided notes provided by the teacher. The draw an image based on a
Allow for collaboration teacher will work through the first example matrix with the students
consider heterogeneous groups with the students and then give them time to (displaying the first matrix on
Move deliberately from
concrete to abstract work the rest. the students’ guided notes on
Apply scaffolding & the screen for students to
personalization
The guided notes would include both follow.)
problems on drawing images based on
matrices and vice versa.
23

Teacher circulates the room


monitoring students’ progress
and addressing questions
along the way.
The teacher brings students
back to share and confirm
their results.

Explain Ia ~10 Students follow along the teachers’ Teacher conducts lesson on
Personalize/Differentiate as
needed min explanation. interpreting what the sum,
Adjust along difference, scalar
teacher/student centered Students then work together in groups of 2-3 multiplication and
continuum
Provide vocabulary on practice problems based on the teacher’s combinations of operations of
Clarify understandings lesson. matrices would represent in
the context of images.

Teacher brings back class to


discuss and confirm results.
Explain Ib ~10 Students follow along the teachers’ Teacher conducts lesson on
Personalize/Differentiate as
needed minut explanation. “bits”
Adjust along es
teacher/student centered
continuum
Provide vocabulary
Clarify understandings

Explore II Students work in groups of 2-3 through Teacher demonstrates how to


Connectivity to build
understanding of concepts ~10 min guided notes provided by the teacher. The convert matrices into vectors
Allow for collaboration teacher will work through the first example (displaying the first matrix on
consider heterogeneous groups with the students and then give them time to the students’ guided notes on
Move deliberately from
concrete to abstract work the rest. the screen for students to
Apply scaffolding & follow.)
personalization

Teacher circulates the room


monitoring students’ progress
and addressing questions
along the way.

The teacher brings students


back to share and confirm
their results.
24

Explain II ~15 Students engage in discussion as a class, Teacher debriefs the results
Personalize/Differentiate as
needed min facilitated by the teacher. They share their from the Explore session and
Adjust along results up at the board and present them to conducts class discussion on
teacher/student centered the class. results.
continuum
Provide vocabulary
Clarify understandings
Extend ~20 Students apply their new understanding to a Teacher will review students’
Apply knowledge to new
scenarios min problem set involving specific images. work as they circulate room
Continue to personalize as and monitor progress,
needed engaging students who may be
Consider grouping
homogeneously having difficulty in discussion
to probe their thinking.

Teacher brings class back


together to engage in debrief
on the problem set.
Evaluate ~10 Students work on exit ticket problem and Teacher poses exit ticket
Formative Assessment
How will you know if students min turn it in. problem for students to turn
understand throughout the in.
lesson?

Evaluate N/A Instagram Project (separate lesson) N/A


Summative-like Assessment
Questions similar to final
assessment
25

Guided Notes – Teacher Version


Introduction to Image Processing Name: ___________________________
Part I: Image representation and processing Date: _______________ Period: ______

In this lesson, we will discuss representations of images and methods to manipulate those images.

Figure: Image of a raccoon in grayscale, binary and copper coloring

Matrix representations:
• A grayscale image is a 2-dimensional array of numbers. An 8-bit image has entries between 0

and 255.

• The value 255 represents a white color, and the value 0 represents a black color.

• Lower numbers translate to darker pixels, while higher numbers translate to lighter pixels.

• For an image that has 𝑚 𝑥 𝑛 pixels (i.e., “picture elements”), we represent that image using a

matrix of size 𝒎 𝒙 𝒏. The entries of the matrix indicate the pixel value of the corresponding

part of the image.

Example: This table represents an image that has 4 𝑥 5 pixels.

Example: This 4 𝑥 4 image of the raccoon is represented by the matrix on the right below:
26

Example: Write the matrix that represents the following image:

255 255 255


255 0 255
„ …
255 255 255
0 255 0

Exercises:
1. Write a matrix that represents each of the following images.
a.
0 255 255
⎡255 0 255⎤
⎢ ⎥
⎢255 0 255⎥
⎢255 255 0 ⎥
⎣255 0 255⎦

b.
255 255 255 255
L 0 255 0 255M
255 255 255 0

2. Draw a visual representation of the following matrices.

0 255 255
0 255 255
a. „ …
255 0 0
255 255 0

0 255 255
b. L0 0 255M
0 255 255
27

255 0 0
c. 2 <
0 255 0

Color Images:
Color images can be stored in a similar fashion to a grayscale image. Instead of one number (0-255)
per pixel, one stores three numbers per pixel – these three numbers denote the “amount” of red,
“amount” of green, and “amount” of blue in each pixel. These three numbers can be used to depict
a wide range of colors.
28

Image transformations:
Once images are represented as matrices, we can describe many transformations of those images
using basic matrix operations!

Example: Suppose we have two separate images that can be represented by the matrices 𝐴 = 9255 0
@
0 255
and 𝐵 = 9 0 0
@.
255 0

1. Draw the images that correspond to 𝐴 and 𝐵.


𝐴 𝐵

2. Find and draw 𝐴 + 𝐵.


255 0 0 0 255 0
𝐴+𝐵 =9 @+9 @=9 @
0 255 255 0 255 255

/
3. Compute 𝐶 = 0 𝐴. How would you describe the image represented by 𝐶 in relation to the image

represented by 𝐴?
1 1 255 0 51 0
𝐶= 𝐴= 2 <=2 <
5 5 0 255 0 51

The image represented by the matrix 𝐶 would have pixels that are darker than those in the image represented
by matrix 𝐴.

Note: When mathematical operations on images result in entries that range outside of the integer values 0
through 255, image visualization tools treat them as 255 if the value exceeds 255, and as 0 if the value is
below 0.
29

Exercises:
1. a. Describe an image whose matrix representation contains entries of all zeros.
The image would be entirely black.

b. Describe an image whose matrix representation contains entries of all 255.


The image would be entirely white.

2. Let 𝐴 and 𝐵 be matrices that represent two images of the same size. Describe in words what each of the
following means.
a. 𝐴 − 𝐵
This matrix represents the image that is the result of darkening the image represented by 𝐴, if 𝐵 has at least
one nonzero entry.

b. 5𝐴 + 𝐵
This matrix represents the lightening of the image represented by 𝐴, since all of the values in 𝐴 are multiplied
by a positive number, and the entries in 𝐵 are added to those entries.

c. 255 ∗ 1 − 𝐴, where “1” is the matrix of all 1’s


This matrix is the result of darkening an all-white image, since the entries in 𝐴 are all positive numbers (if 𝐴
has at least one nonzero entry.
30

Part II: Manipulating images


Reflecting/rotating images
Let us consider how we might reflect an image over the x or y-axis. Here’s an example!

How would we represent these reflections using matrices?

From our earlier work, we know that the image represented by the matrix 𝑋 = 9255 0
@ would
0 255
be:

If we were to reflect this image about the x-axis, we would obtain:

The matrix 𝑋′ that represents this image is 𝑋 = 9 0 255


@. We can generalize this result!
255 0
Exercises:
0 𝑎 𝑏 0
𝑐 𝑑 0 0
1. Which matrix represents the image that is the reflection of the matrix 𝐴 = U ^ about
𝑒 0 𝑓 𝑔
0 0 0 ℎ
the 𝑥-axis?
𝟎 𝟎 𝟎 𝒉
𝒆 𝟎 𝒇 𝒈
U ^
𝒄 𝒅 𝟎 𝟎
𝟎 𝒂 𝒃 𝟎
31

2. Write the matrix that corresponds to the reflection of each of the following about the
a. 𝑥 −axis
b. 𝑦 −axis

0 255 255 255 255 0


0 255 255 255 0 0
a. „ … 𝑥 −axis: „ …
255 0 0 0 255 255
255 255 0 0 255 255

255 255 0
255 255 0
𝑦 −axis: „ …
0 0 255
0 255 255

0 255 255 0 255 255


b. L0 0 255M 𝑥 −axis: L0 0 255M
0 255 255 0 255 255

255 255 0
𝑦 −axis: L255 0 0M
255 255 0

255 0 0 0 255 0
c. 2 < 𝑥 −axis: 2 <
0 255 0 255 0 0

0 0 255
𝑦 −axis: 2 <
0 255 0
32

Reflecting images using matrix-matrix multiplication


1 3
Consider the matrix 𝑋 = 2 < that represents an image1.
2 4

Question: From our work above, we know that the matrix representing the image reflected about
2 4
the 𝑥-axis is 2 <. What matrix would we need to multiply 𝑋 by on the left in order to obtain the
1 3
matrix of the image reflected about the 𝒙-axis? Show that your answer gives you the correct result.
0 1
2 <
1 0

0 1 1 3 2 4
2 <2 <=2 <
1 0 2 4 1 3

Question: From our work above, we know that the matrix representing the image reflected about
3 1
the 𝑦-axis is 2 <. What matrix would we need to multiply 𝑋 by on the right in order to obtain
4 2
the matrix of the image reflected about the 𝒚-axis? Show that your answer gives you the correct
result.
0 1
2 <
1 0

1 3 0 1 3 1
2 <2 <= 2 <
2 4 1 0 4 2

The matrix you used above is a form of a permutation matrix (here referred to as a reverse identity
matrix). This matrix is always square, and its size is determined by the size of the matrix it is
multiplied to (i.e. in order for the matrix multiplication to be performed).

Exercises:

1. What size does the reverse identity matrix need to be to be used to reflect an image represented
by a 5 𝑥 3 matrix about the 𝑥-axis? Why?
The matrix must be a 𝟓 𝒙 𝟓 matrix, so that it can left-multiply the 𝟓 𝒙 𝟓 matrix. The reverse
identity matrix is square, and it must have the same number of columns as the 𝟓 𝒙 𝟑 matrix
has rows.

1
Note that these values each represent a shade of color between white and black, where 0 represents black, and 1 represents white.
While we have used only values of 0 and 255 thus far, we will use these values in this example to make the reflections clear.
33

2. What size does the reverse identity matrix need to be to be used to reflect an image represented
by a 5 𝑥 3 matrix about the 𝑦-axis? Why?
The matrix must be a 𝟑 𝒙 𝟑 matrix, so that it can right-multiply the 𝟓 𝒙 𝟑 matrix. The
reverse identity matrix is square, and it must have the same number of rows as the 𝟓 𝒙 𝟑
matrix has columns.

3. Use the reverse identity matrix of the appropriate size to reflect the images represented by the
following matrices about the 𝑥-axis.
0 255 255 𝟎 𝟎 𝟏 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓
a. L0 0 255M L𝟎 𝟏 𝟎M L𝟎 𝟎 𝟐𝟓𝟓M = L𝟎 𝟎 𝟐𝟓𝟓M
0 255 255 𝟏 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓

0 255 255 𝟎 𝟎 𝟎 𝟏 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎


0 255 255 𝟎 𝟎 𝟏 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎
b. „ … „ …„ …= „ …
255 0 0 𝟎 𝟏 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓
255 255 0 𝟏 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓

255 0 0 𝟎 𝟏 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎


c. 2 < 2 <2 <= 2 <
0 255 0 𝟏 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓 𝟎 𝟎

4. Use the reverse identity matrix of the appropriate size to reflect the images represented by the
following matrices about the 𝑦-axis.
0 255 255 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟏 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎
a. L0 0 255M L𝟎 𝟎 𝟐𝟓𝟓M L𝟎 𝟏 𝟎M = L𝟐𝟓𝟓 𝟎 𝟎M
0 255 255 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟏 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎

0 255 255 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎


𝟎 𝟎 𝟏
0 255 255 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎
b. „ … „ … L𝟎 𝟏 𝟎M = „ …
255 0 0 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓
𝟏 𝟎 𝟎
255 255 0 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓

𝟎 𝟎 𝟏
255 0 0 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓
c. 2 < 2 < L𝟎 𝟏 𝟎M = 2 <
0 255 0 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎
𝟏 𝟎 𝟎
34

Reflecting images using matrix-vector multiplication


We can also manipulate images using matrix-vector multiplication. This method is a bit more
powerful than matrix-matrix multiplication, because it allows us with more flexibility in ways you can
manipulate those images.

Using this method, we first convert our matrices into vectors (i.e., single column or single row
matrices).

• We define 𝑣𝑒𝑐(𝑋) as the vector conversion of the matrix 𝑋. In general, for 𝑋 =



⎡𝑥 ⎤
⋮ ⋮ ⎢ ⋮/ ⎥
⎢ ⎥
L𝑥/ … 𝑥" M, we have 𝑣𝑒𝑐(𝑋) = ⎢ … ⎥.
⋮ ⋮ ⎢⋮⎥
⎢𝑥" ⎥
⎣⋮⎦

⎡𝑥 ⎤
⎢ ⋮/ ⎥
⎢ ⎥
• We define 𝑚𝑎𝑡(𝑋) as the matrix conversion of the vector 𝑌. In general, for 𝑌 = ⎢ … ⎥, we have
⎢⋮⎥
⎢𝑥" ⎥
⎣⋮⎦
⋮ ⋮
𝑚𝑎𝑡(𝑋) = L𝑥/ … 𝑥" M.
⋮ ⋮

Examples:

1
1 3 2
1. For 𝑋 = 2 <, 𝑣𝑒𝑐(𝑋) = „ ….
2 4 3
4
1
⎡2⎤
⎢3⎥
⎢ ⎥
1 4 7 ⎢4⎥
2. For 𝑋 = L2 5 8M, 𝑣𝑒𝑐(𝑋) = ⎢ 5 ⎥.
3 6 9 ⎢6⎥
⎢7⎥
⎢8⎥
⎣9⎦
35

3
5 3 6
3. For 𝑋 = „ …, 𝑚𝑎𝑡(𝑋) = 2 <.
6 5 1
1

1
⎡ 0 ⎤
⎢ 0 ⎥
⎢ ⎥
⎢ 0 ⎥ 1 0 0
4. For 𝑋 = ⎢ 1 ⎥, 𝑚𝑎𝑡(𝑋) = L0 1 0M.
⎢ 0 ⎥ 0 0 1
⎢ 0 ⎥
⎢ 0 ⎥
⎣ 1 ⎦

Exercises:

1. Convert each of the following matrices into vectors.


5
5 0 3
a. 𝐴 = 2 < 𝑣𝑒𝑐(𝐴) = „ ….
3 4 0
4

2
2 3 1
b. 𝐵 = 2 < 𝑣𝑒𝑐(𝐵) = „ ….
1 6 3
6

8
⎡7⎤
⎢8⎥
⎢ ⎥
8 8 8 ⎢8⎥
c. 𝐶 = L7 7 7M 𝑣𝑒𝑐(𝐶) = ⎢ 7 ⎥.
8 8 8 ⎢8⎥
⎢8⎥
⎢7⎥
⎣8⎦
36

2. Convert each of the following vectors into matrices.


3
5 3 6
a. 𝑋 = „ … 𝑚𝑎𝑡(𝑋) = 2 <
6 5 1
1

8
⎡ 7⎤
⎢ 6⎥
⎢ ⎥
⎢ 5⎥ 8 5 2
b. 𝑌 = ⎢4⎥ 𝑚𝑎𝑡(𝑌) = L7 4 1M
⎢ 3⎥ 6 3 0
⎢ 2⎥
⎢ 1⎥
⎣ 0⎦
37

Reflection about the axes using matrix-vector multiplication

1
1 3 2
Consider the matrix 𝑋 = 2 <. We know that 𝑣𝑒𝑐(𝑋) = „ ….
2 4 3
4
Question: From our earlier work, we know that the reflection of the image with matrix 𝑋 about the
2
2 4 1
𝑥-axis would be 𝑌 = 2 <. So, 𝑣𝑒𝑐(𝑌) = „ …. What matrix would we need to multiply 𝑣𝑒𝑐(𝑋)
1 3 4
3
by on the left in order to obtain 𝑣𝑒𝑐(𝑌)? Show that your answer gives you the correct result.

𝒚 = 𝑨𝒙, where y is 𝒗𝒆𝒄(𝒀) and x is 𝒗𝒆𝒄(𝑿)


2 0 1 0 0 1
1 1 0 0 0 2
Using only 1s and 0s to fill in matrix A: „ … = „ …„ …
4 0 0 0 1 3
3 0 0 1 0 4
Matrix A is a permutation matrix which permutes the entries for x.

Question: From our earlier work, we know that the reflection of the image with matrix 𝑋 about the
3
3 1 4
𝑦-axis would be 𝑌 = 2 <. So, 𝑣𝑒𝑐(𝑌) = „ …. What matrix would we need to multiply 𝑣𝑒𝑐(𝑋)
4 2 1
2
by on the right in order to obtain 𝑣𝑒𝑐(𝑌)? Show that your answer gives you the correct result.

𝒚 = 𝑨𝒙, where y is 𝒗𝒆𝒄(𝒀) and x is 𝒗𝒆𝒄(𝑿)


3 0 0 1 0 1
4 0 0 0 1 2
Using only 1s and 0s to fill in matrix A: „ … = „ …„ …
1 1 0 0 0 3
2 0 1 0 0 4
Matrix A is a permutation matrix which permutes the entries for x.
38

Blurring images
We can also blur images to get an effect we’re interested in, and we use linear algebra to do it! The
image on the left below is the picture, and the image on the right is the blurred version.

One way to do this is to average each entry’s “neighbors” (including the entry itself). The definition
of these neighbors can be determined by the user themselves. For example, a neighbor could be any
entry in the matrix representation that is directly left, right, above and below the original entry, along
with the entry itself.

1 1 2
Example: Consider an image whose matrix representation is 𝑋 = L2 1 1M. Suppose we define a
3 1 2
“neighbor” as an entry that is directly above, below, next to or diagonal from that entry. For
example, the entries that are neighbors of 𝑥1/ = 3 in the matrix are 𝑥2/ = 2, 𝑥22 = 1, 𝑥12 = 1, and
23/3/31 5
𝑥1/ = 3. So the entry 𝑦1/ in the new matrix would be 4
= 4.

5/4 8/6 5/4


This gives us 𝑌 = L9/6 14/9 8/6M.
7/4 10/6 5/4
39

Challenge Question: Find the 9 𝑥 9 matrix 𝐴 such that 𝑌 = 𝐴 ∗ 𝑣𝑒𝑐(𝑋). Show that your choice
indeed results in 𝑌.

1/4 1/4 0 1/4 1/4 0 0 0 0 1


⎡ ⎤ ⎡2⎤
1/6 1/6 1/6 1/6 1/6 1/6 0 0 0
⎢ ⎥ ⎢3⎥
⎢ 0 1/4 1/4 0 1/4 1/4 0 0 0 ⎥
⎢ ⎥
⎢1/6 1/6 0 1/6 1/6 0 1/6 1/6 0 ⎥
⎢1⎥
𝐴 = ⎢1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 ⎥
1/9 , 𝑣𝑒𝑐(𝑋) = ⎢1⎥
⎢ 0 1/6 1/6 0 1/6 1/6 0 1/6 1/6⎥
⎢ ⎥ ⎢1⎥
⎢ 0 0 0 1/4 1/4 0 1/4 1/4 0 ⎥ ⎢2⎥
⎢ 0 0 0 1/6 1/6 1/6 1/6 1/6 1/6⎥ ⎢1⎥
⎣ 0 0 0 0 1/4 1/4 0 1/4 1/4⎦ ⎣2⎦

*Note: the denominator of the fractions in matrix A are determined by the number of neighbors the
element has (example: element 𝑥1/ has 4 neighbors, so in matrix A row 3 all has denominators of 4).
The numerator will always be 1. Place the appropriate fraction in the location that correlates to
where the neighbors of that element are placed in 𝑣𝑒𝑐(𝑋).
40

Lesson 4: (Extension) Image Processing using Computer


Science

Lesson Plan
Teacher: Subject:
This will be a teacher led activity especially if Topic/Day: Using Python to Manipulate Photos
students are not familiar with Python. If Content Objective: Use Matrices to solve real world problems.
students have previous Python programming
experience they could try the coding on their Materials Needed: Python notebook-nothing has to be
own. downloaded but you will need to allow “colab” to run as an
extension in Google Chrome to run the program.

Time Student Does Teacher Does

Warm Up ~10 Write a matrix on paper of the image of the Provide the image either on
Elicit/Engage
min math symbols. the board or a copy on paper.
Build relevance through a
problem
Try to find out what your
students already know
Get them interested
Explore Explore putting the code in Python to see Provides code and
Connectivity to build
understanding of concepts ~45 how the images are created and manipulated. scaffolding.
Allow for collaboration min (Code will be provided.)
consider heterogeneous groups
Move deliberately from
concrete to abstract
Apply scaffolding &
personalization
Explain ~30 Student should ask for help on any of the Review the algorithms for
Personalize/Differentiate as
needed min previously taught matrix operations as reflecting, rotating, blurring
Adjust along needed. and combining as needed.
teacher/student centered
continuum
Provide vocabulary
Clarify understandings
41

Evaluate N/A Final Code will be the assessment N/A


Summative-like Assessment
Questions similar to final
assessment
42

Lesson 5: Instagram Project

Lesson Plan
Standard Topic/Day: Instagram Project
NC.M4.N.2.1 Execute procedures of addition, Content Objective: Use matrices to manipulate and edit a photo to post on Instagram
Language Objective:
subtraction, multiplication, and scalar Vocabulary:
multiplication on matrices; NC.M4.N.2.2 Execute Materials Needed: Instagram Project printout, stock images printed, poster board (or other
procedures of addition, subtraction, and scalar arts and craft supplies for the students)
multiplication on vectors.

PC.N.2.1 Execute the sum and difference


algorithms to combine matrices of appropriate
dimensions; PC.N.2.2 Execute associative and
distributive properties to matrices; PC.N.2.3 ~85 minutes
Execute commutative property to add matrices;
PC.N.2.4 Execute properties of matrices to
multiply a matrix by a scalar; PC.N.2.5 Execute
the multiplication algorithm with matrices.

DCS.N.1.1 Implement procedures of addition,


subtraction, multiplication, and scalar
multiplication on matrices; DCS.N.1.2 Implement
procedures of addition, subtraction, and scalar
multiplication on vectors; DCS.N.1.3 Implement
procedures to find the inverse of a matrix;
DCS.N.2.1 Organize data into matrices to solve
problems; DCS.N.2.2 Interpret solutions found
using matrix operations in context; DCS.N.2.3
Represent a system of equations as a matrix
equation; DCS.N.2.4 Use inverse matrices to
solve a system of equations with technology.

Time Student Does Teacher Does

Warm Up Provide the students with the


Elicit/Engage
Build relevance through a problem Students will manipulate the image provided worksheet for the warm up and
Try to find out what your students already ~25 (Lesson 5 – Warm Up) to reflect, blur, and have them write the matrix of the
know mins image. Then they would need to
Get them interested brighten the image
manipulate the image and draw the
outcome for each manipulation.
43

Explore
Connectivity to build understanding of Go over the outline and
concepts
Allow for collaboration consider expectations with the students
heterogeneous groups
Move deliberately from concrete to abstract ~5
Apply scaffolding & Review the Instagram project as a class
personalization mins Provide the students with the
necessary arts and craft supplies for
the project to be completed

Explain
Personalize/Differentiate as needed Walk around the class listening to
Adjust along
teacher/student centered continuum ~45 the conversations of students and
Provide vocabulary Complete the Instagram project
Clarify understandings mins facilitate conversations and answer
questions as needed

Extend
Apply knowledge to new scenarios
Continue to personalize as needed N/A
Consider grouping homogeneously N/A N/A

Evaluate Facilitate the students sharing their


Formative Assessment
How will you know if students understand outcomes with their peers
throughout the lesson?

You can choose to do whole group


presentations or partner groups and
have them share with only one
group at a time and do a rotation (if
you do this, be sure to move around
and listen to each groups
~10
Share their outcomes with their peers presentation)
mins
Recommended: Hang the outcomes
on the wall and create a classroom
“Instagram feed” on the wall. You
can also have the students give the
photos likes/comments and choose
a classroom influencer based on the
likes/comments that each photo
receives.

Evaluate
Summative-like Assessment
Questions similar to final assessment
N/A N/A N/A
44

Warm-Up – Teacher Version


Image Processing Name: ___________________________

Warm-Up Date: _________________Period: ____

Given the image below, write the corresponding matrix:


𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡ 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎤
⎢𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
𝑨=⎢
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢ 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦

Reflect the image over the x-axis, write the new matrix, and draw the new image:
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡ 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎤
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢ ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 ⎥
𝑨=⎢
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦

Reflect the previous image over the y-axis, write the new matrix, and draw the new image:
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 ⎤
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢ ⎥
⎢ 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
𝑨=⎢
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 ⎥
⎣𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦
45

Reflect the previous image over the 45⁰ line, write the new matrix, and draw the new image:
𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓
⎡𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎤
⎢𝟐𝟓𝟓
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ ⎥
⎢ 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 ⎥
𝑨=⎢
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦
Change the brightness of the previous image by a scalar of 1/2, write the new matrix, and draw the
new image: *Note: you will use the color gray to draw the darkened or lightened image.
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡ 𝟎 𝟎 ⎤
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎
𝟐𝟓𝟓 𝟐𝟓𝟓
𝟎 𝟎 𝟎
𝟐𝟓𝟓⎥
⎢ 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟎 𝟎 𝟎 𝟎 𝟎
𝟐 𝟐 𝟐 𝟐 ⎥
⎢ 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟎 𝟎 𝟎 𝟎
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢ 𝟐𝟓𝟓 𝟐𝟓𝟓 ⎥
⎢ 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
𝑨=⎢ 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
⎢ 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎
𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟎 𝟎 𝟎 𝟎 ⎥
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟎 𝟎 𝟎 𝟎
𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣ 𝟐 𝟎 𝟎
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎦

• Did you darken or lighten the image? Why?


o Darkened the image because 255 = white, and when the number gets closer to 0, then
the shade gets closer to black, so all of the white spaces turned gray.
Blur the original image and write the new matrix (you do not need to draw the new image):
46

𝟐𝟓𝟓 𝟐𝟓𝟓 𝟒𝟐𝟓


⎡ 𝟏𝟕𝟎 𝟏𝟕𝟎 𝟖𝟓 𝟖𝟓 𝟏𝟕𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎤
⎢ 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟏𝟕𝟎 𝟏𝟕𝟎 𝟏𝟕𝟎
𝟑𝟒𝟎
𝟖𝟓
𝟒𝟐𝟓 𝟓𝟗𝟓
𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟑 𝟑 𝟑 ⎥
⎢ 𝟑𝟒𝟎 𝟒𝟐𝟓 𝟑𝟒𝟎 𝟖𝟓 𝟏𝟕𝟎 𝟒𝟐𝟓 𝟔𝟖𝟎 ⎥
⎢ 𝟖𝟓 𝟑 𝟑
𝟏𝟕𝟎
𝟑 𝟑 𝟑 𝟑 𝟑
𝟐𝟓𝟓⎥
⎢ 𝟒𝟐𝟓 𝟑𝟒𝟎 𝟑𝟒𝟎 𝟖𝟓 𝟖𝟓 𝟒𝟐𝟓⎥
⎢𝟏𝟕𝟎 𝟑 𝟑 𝟑
𝟖𝟓
𝟑 𝟑
𝟖𝟓 𝟏𝟕𝟎
𝟐 ⎥
⎢𝟒𝟐𝟓 𝟒𝟐𝟓 𝟖𝟓 𝟖𝟓 𝟖𝟓 𝟏𝟕𝟎 𝟑𝟒𝟎 𝟐𝟓𝟓⎥
⎢ 𝟖𝟓 𝟎 ⎥
𝑨=⎢ 𝟐 𝟑 𝟑 𝟑 𝟑 𝟑 𝟑 𝟐 ⎥
⎢𝟒𝟐𝟓 𝟒𝟐𝟓 𝟏𝟕𝟎
𝟎 𝟎 𝟎
𝟖𝟓 𝟖𝟓 𝟏𝟕𝟎 𝟖𝟓 ⎥
⎢ 𝟐 𝟑 𝟑 𝟑 𝟑 𝟑 𝟐 ⎥
⎢ 𝟑𝟒𝟎 𝟏𝟕𝟎 𝟖𝟓 𝟖𝟓 𝟖𝟓 𝟖𝟓 𝟏𝟕𝟎 𝟖𝟓 ⎥
⎢𝟏𝟕𝟎 𝟑 𝟑 𝟑 𝟑
𝟎
𝟑 𝟑 𝟑 𝟐 ⎥
⎢ 𝟑𝟒𝟎 𝟖𝟓 𝟖𝟓 𝟏𝟕𝟎 𝟑𝟒𝟎 𝟐𝟓𝟓⎥
⎢ 𝟖𝟓 𝟖𝟓 𝟖𝟓 𝟖𝟓 ⎥
⎢ 𝟑 𝟑 𝟑 𝟑 𝟑 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟒𝟐𝟓
𝟏𝟕𝟎 𝟏𝟕𝟎
𝟑𝟒𝟎 𝟏𝟕𝟎
𝟖𝟓
𝟒𝟐𝟓 𝟓𝟗𝟓 𝟒𝟐𝟓⎥
⎢ 𝟐 𝟑 𝟑 𝟑 𝟑 𝟑 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟒𝟐𝟓 𝟒𝟐𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟒𝟐𝟓 ⎥
⎣ 𝟐 𝟏𝟕𝟎 𝟖𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦
𝟐 𝟐 𝟐 𝟐 𝟐

*Image Source: https://www.woojr.com/printable-picross-grid-puzzles/


47

Instagram Project
v The project outline is in Appendix A
v There is an example of the Instagram Project in Appendix B
48

References and Additional Readings


v Allali, Mohamed. "Linear algebra and image processing." International Journal of Mathematical
Education in Science and Technology 41.6 (2010): 725-741.

v Linear algebra and discrete image


processing https://www.nibcode.com/en/blog/1135/linear-algebra-and-digital-image-
processing-part-I

v Lecture notes for image processing and computer


vision https://staff.fnwi.uva.nl/r.vandenboomgaard/IPCV20172018/LectureNotes/index.h
tml

v Bartkovich, K. G., Goebel, J. A., Graves, J. L., Teague, D. J., Barrett, G. B., Compton, H. L.,
... & Whitehead, K. (2000). Contemporary Precalculus through Applications. New York:
Glencoe/McGraw-Hill
v 9:59
v Tan, S. (2002). Finite Mathematics for the Managerial, Life, and Social Sciences (7th ed.). Boston:
Brooks Cole.
49

Appendices

Appendix A: Lesson Materials – Student Versions

Lesson 1: Guided Notes – Student Version


v Student version begins on next page
50

Matrix Addition, Subtraction and Scalar Multiplication

A university is taking inventory of the books they carry at their two biggest bookstores.
The East Campus bookstore carries the following books:
Hardcover: Textbooks-5280; Fiction-1680; NonFiction-2320; Reference-1890
Paperback: Textbooks-1930; Fiction-2705; NonFiction-1560; Reference-2130

The West Campus bookstore carries the following books:


Hardcover: Textbooks-7230; Fiction-2450; NonFiction-3100; Reference-1380
Paperback: Textbooks-1740; Fiction-2420; NonFiction-1750; Reference-1170

In order to work with this information, we can represent the inventory of each bookstore using an
organized array of numbers known as a matrix.

Definitions: A __________ is a rectangular table of entries and is used to organize data in a way that
can be used to solve problems. The following is a list of terms used to describe matrices:

• A matrix’s ___________________________ is written by listing the number of rows “by”

the number of columns.

• The values in a matrix, A, are referred to as ______________ or ______________. The

entry in the “mth” row and “nth” column is written as 𝑎!" .

• A matrix is ______________ if it has the same number of rows as it has columns.

• If a matrix has only one row, then it is a row ____________. If it has only one column, then

the matrix is a column ______________.

• The __________________ of a matrix, A, written AT, switches the rows with the columns of

A and the columns with the rows.

• Two matrices are _____________ if they have the same size and the same corresponding

entries.
51

The inventory of the books at the East Campus bookstore can be represented with the following 2 x
4 matrix:
𝑇 𝐹 𝑁 𝑅

𝐻𝑎𝑟𝑑𝑏𝑎𝑐𝑘
𝐸= „ …
𝑃𝑎𝑝𝑒𝑟𝑏𝑎𝑐𝑘

Similarly, the West Campus bookstore’s inventory can be represented with the following matrix:

𝑇 𝐹 𝑁 𝑅

𝐻𝑎𝑟𝑑𝑏𝑎𝑐𝑘
𝑊= „ …
𝑃𝑎𝑝𝑒𝑟𝑏𝑎𝑐𝑘

Adding and Subtracting Matrices

In order to add or subtract matrices, they must first be of the same ______________________.
The result of the addition or subtraction is a matrix of the same size as the matrices themselves, and
the entries are obtained by adding or subtracting the elements in corresponding positions.

In our campus bookstores example, we can find the total inventory between the two bookstores as
follows:

𝐸+𝑊 =„ …+„ …

𝑇 𝐹 𝑁 𝑅

𝐻𝑎𝑟𝑑𝑏𝑎𝑐𝑘
= „ …
𝑃𝑎𝑝𝑒𝑟𝑏𝑎𝑐𝑘
52

Question: Is matrix addition commutative (𝑒. 𝑔. , 𝐴 + 𝐵 = 𝐵 + 𝐴)? Why or why not?

Question: Is matrix subtraction commutative (𝑒. 𝑔. , 𝐴 − 𝐵 = 𝐵 − 𝐴)? Why or why not?

Question: Is matrix addition associative (𝑒. 𝑔. , (𝐴 + 𝐵) + 𝐶 = 𝐴 + (𝐵 + 𝐶))? Why or why not?

Question: Is matrix subtraction associative (𝑒. 𝑔. , (𝐴 − 𝐵) − 𝐶 = 𝐴 − (𝐵 − 𝐶))? Why or why not?

Scalar Multiplication

Multiplying a matrix by a constant (or scalar) is as simple as multiplying each entry by that number!
Suppose the bookstore manager in East Campus wants to double his inventory. He can find the
number of books of each type that he would need by simply multiplying the matrix E by the scalar
(or constant) 2. The result is as follows:
𝑇 𝐹 𝑁 𝑅

𝐻𝑎𝑟𝑑𝑏𝑎𝑐𝑘
2𝐸 = 2 ∗ „ …= „ …
𝑃𝑎𝑝𝑒𝑟𝑏𝑎𝑐𝑘
53

Exercises: Consider the following matrices:

1 0 1 0 6 −21 5
𝐴 = L 2 −4 3M 𝐵 = [2 8 −6] 𝐶 = L2 4 −9 M 𝐷 = L−2M
−6 1 8 5 −7 1 3

Find each of the following, or explain why the operation cannot be performed:

b. 𝐴 + 𝐵 b. 𝐵 – 𝐴

𝑐. 𝐴 – 𝐶 d. 𝐶 – 𝐴

e. 5𝐵 f. −𝐴 + 4𝐶

g. 𝐵 – 𝐷 h. 2𝐶 − 6𝐴

i. 𝐵# + 𝐷
54

Lesson 2: Guided Notes – Student Version


v Student version begins on next page
55

Matrix Multiplication

The Metropolitan Opera is planning its last cross-country tour. It plans to perform Carmen and La
Traviata in Atlanta in May. The person in charge of logistics wants to make plane reservations for the two
troupes. Carmen has 2 stars, 25 other adults, 5 children, and 5 staff members. La Traviata has 3 stars, 15
other adults, and 4 staff members. There are 3 airlines to choose from. Redwing charges round-trip fares
to Atlanta of $630 for first class, $420 for coach, and $250 for youth. Southeastern charges $650 for first
class, $350 for coach, and $275 for youth. Air Atlanta charges $700 for first class, $370 for coach, and
$150 for youth. Assume stars travel first class, other adults and staff travel coach, and children travel for
the youth fare.

Use multiplication and addition to find the total cost for each troupe to travel each of the airlines.
56

It turns out that we can solve problems like these using a matrix operation, specifically matrix
multiplication!

We first note that matrix multiplication is only defined for matrices of certain sizes. For the product 𝐴𝐵
of matrices 𝐴 and 𝐵, where 𝐴 is an 𝑚 𝑥 𝑛 matrix, 𝐵 must have the same number of rows as 𝐴 has
columns. So, 𝐵 must have size ______ 𝑥 𝑝. The product 𝐴𝐵 will have size ________________.

Exercises

The following is a set of abstract matrices (without row and column labels):

2 4 1
1 −1 6
𝑀=2 < 𝑁 = L0 −1 3M 𝑂=2 <
2 0 −1
1 0 2

0 ! 4
" 3 1
𝑃=f !g 𝑄 = L1 M 𝑅=2 <
−1 −1 0
" 3
3 1 1 4 2 6 −1
𝑆=j1 0k 𝑇=j2 k 𝑈 = L5 3 1 0M
0 2 −3
−1 1 4 0 2 −1 1

List at least 5 orders of pairs of matrices from this set for which the product is defined. State the
dimension of each product.
57

Back to the opera…

Define two matrices that organize the information given:

𝐑𝐞𝐝 𝐒𝐨𝐮𝐭𝐡 𝐀𝐢𝐫


𝐬𝐭𝐚𝐫𝐬 𝐚𝐝𝐮𝐥𝐭𝐬 𝐜𝐡𝐢𝐥𝐝𝐫𝐞𝐧 𝐬𝐭𝐚𝐫𝐬
⎡ ⎤
𝑪𝒂𝒓𝒎𝒆𝒏 ⎢ ⎥
U ^ 𝐚𝐝𝐮𝐥𝐭𝐬 ⎢ ⎥
𝑳𝒂 𝑻𝒓𝒂𝒗𝒊𝒂𝒕𝒂
⎢ ⎥
𝐜𝐡𝐢𝐥𝐝𝐫𝐞𝐧 ⎣ ⎦

We can multiply these two matrices to obtain the same answers we obtained above, all in one matrix!

𝐑𝐞𝐝 𝐒𝐨𝐮𝐭𝐡 𝐀𝐢𝐫


𝐬𝐭𝐚𝐫𝐬 𝐚𝐝𝐮𝐥𝐭𝐬 𝐜𝐡𝐢𝐥𝐝𝐫𝐞𝐧
𝐬𝐭𝐚𝐫𝐬 ⎡ ⎤
𝑪𝒂𝒓𝒎𝒆𝒏 ⎢ ⎥
U ^ ∙ 𝐚𝐝𝐮𝐥𝐭𝐬 ⎢ ⎥
𝑳𝒂 𝑻𝒓𝒂𝒗𝒊𝒂𝒕𝒂
𝐜𝐡𝐢𝐥𝐝𝐫𝐞𝐧 ⎢ ⎥
⎣ ⎦

𝐑𝐞𝐝 𝐒𝐨𝐮𝐭𝐡 𝐀𝐢𝐫

= 𝑪𝒂𝒓𝒎𝒆𝒏
„ …
𝑳𝒂 𝑻𝒓𝒂𝒗𝒊𝒂𝒕𝒂

Carmen/Redwing:

Carmen/Southeastern:

Carmen/Air Atlanta:

La Traviata/Redwing:

La Traviata/Southeastern:

La Traviata/Air Atlanta:
58

Exercises2

3. The K.L. Mutton Company has investments in three states - North Carolina, North Dakota, and
New Mexico. Its deposits in each state are divided among bonds, mortgages, and consumer
loans. The amount of money (in millions of dollars) invested in each category on June 1 is
displayed in the table below.
NC ND NM
Bonds 13 25 22
Mort. 6 9 4
Loans 29 17 13

The current yields on these investments are 7.5% for bonds, 11.25% for mortgages, and 6% for
consumer loans. Use matrix multiplication to find the total earnings for each state.

4. Several years ago, Ms. Allen invested in growth stocks, which she hoped would increase in value
over time. She bought 100 shares of stock A, 200 shares of stock B, and 150 shares of stock C.
At the end of each year she records the value of each stock. The table below shows the price per
share (in dollars) of stocks A, B, and C at the
end of the years 1984, 1984 1985 1986 1985, and 1986.
Stock A 68.00 72.00 75.00
Stock B 55.00 60.00 67.50
Stock C 82.50 84.00 87.00

Calculate the total value of Ms. Allen’s stocks at the end of each year.

2 Adapted from Bartkovich, K. G., Goebel, J. A., Graves, J. L., Teague, D. J., Barrett, G. B., Compton, H. L., ... &
Whitehead, K. (2000). Contemporary Precalculus through Applications. New York: Glencoe/McGraw-Hill
59

3. The Sound Company produces stereos. Their inventory includes four models - the Budget, the
Economy, the Executive, and the President models. The Budget needs 50 transistors, 30
capacitors, 7 connectors, and 3 dials. The Economy model needs 65 transistors, 50 capacitors, 9
connectors, and 4 dials. The Executive model needs 85 transistors, 42 capacitors, 10 connectors,
and 6 dials. The President model needs 85 transistors, 42 capacitors, 10 connectors, and 12 dials.
The daily manufacturing goal in a normal quarter is 10 Budget, 12 Economy, 11 Executive, and 7
President stereos.

a. How many transistors are needed each day? Capacitors? Connectors? Dials?

b. During August and September, production is increased by 40%. How many Budget, Economy,
Executive, and President models are produced daily during these months?

c. It takes 5 person-hours to produce the Budget model, 7 person-hours to produce the


Economy model, 6 person-hours for the Executive model, and 7 person-hours for the
President model. Determine the number of employees needed to maintain the normal
production schedule, assuming everyone works an average of 7 hours each day. How many
employees are needed in August and September?
60

4. The president of the Lucrative Bank is hoping for a 21% increase in checking accounts, a 35%
increase in savings accounts, and a 52% increase in market accounts. The current statistics on the
number of accounts at each branch are as follows:

Checking Savings Market


Northgate 40039 10135 512
Downtown L15231 8751 105 M
South Square 25612 12187 97

What is the goal for each branch in each type of account? (HINT: multiply by a 3 × 2 matrix
with certain nonzero entries on the diagonal and zero entries elsewhere.) What will be the total
number of accounts at each branch?
61

Lesson 3: Guided Notes – Student Version


v Student version begins on next page
62

Introduction to Image Processing Name: ___________________________


Part I: Image representation and processing Date: _______________ Period: ______

In this lesson, we will discuss representations of images and methods to manipulate those images.

Figure: Image of a raccoon in grayscale, binary and copper coloring

Matrix representations:
• A grayscale image is a 2-dimensional array of numbers. An 8-bit image has entries between

______ and _______.

• The value ______ represents a white color, and the value ______ represents a black color.

• Lower numbers translate to _____________ pixels, while higher numbers translate to

_____________ pixels.

• For an image that has 𝑚 𝑥 𝑛 pixels (i.e., “picture elements”), we represent that image using a

matrix of size _____________. The entries of the matrix indicate the pixel value of the

corresponding part of the image.

Example: This table represents an image that has 4 𝑥 5 pixels.

Example: This 4 𝑥 4 image of the raccoon is represented by the matrix


on the right below:
63

Example: Write the matrix that represents the following image:

! "

Exercises:
1. Write a matrix that represents each of the following images.
c.

d.

2. Draw a visual representation of the following matrices.

0 255 255
0 255 255
d. „ …
255 0 0
255 255 0

0 255 255
e. L0 0 255M
0 255 255

255 0 0
f. 2 <
0 255 0
64

Color Images:
Color images can be stored in a similar fashion to a grayscale image. Instead of one number (0-255)
per pixel, one stores three numbers per pixel – these three numbers denote the “amount” of red,
“amount” of green, and “amount” of blue in each pixel. These three numbers can be used to depict
a wide range of colors.

Image transformations:
Once images are represented as matrices, we can describe many transformations of those images
using basic matrix operations!

Example: Suppose we have two separate images that can be represented by the matrices 𝐴 = 9255 0
@
0 255
and 𝐵 = 9 0 0
@.
255 0

4. Draw the images that correspond to 𝐴 and 𝐵.

5. Find and draw 𝐴 + 𝐵.

/
6. Compute 𝐶 = 0 𝐴. How would you describe the image represented by 𝐶 in relation to the image

represented by 𝐴?
65

Note: When mathematical operations on images result in entries that range outside of the integer values 0
through 255, image visualization tools treat them as 255 if the value exceeds 255, and as 0 if the value is
below 0.

Exercises:
2. a. Describe an image whose matrix representation contains entries of all zeros.

b. Describe an image whose matrix representation contains entries of all 255.

3. Let 𝐴 and 𝐵 be matrices that represent two images of the same size. Describe in words what each
of the following means.
a. 𝐴 − 𝐵 b. 5𝐴 + 𝐵

d. 255 ∗ 1 − 𝐴, where “1” is the matrix of all 1’s


Part II: Manipulating images
Reflecting/rotating images
Let us consider how we might reflect an image over the x or y-axis. Here’s an example!

How would we represent these reflections using matrices?

From our earlier work, we know that the image represented by the matrix 𝑋 = 9255 0
@ would
0 255
be:

If we were to reflect this image about the x-axis, we would obtain:

The matrix 𝑋′ that represents this image is 𝑋 = 9 0 255


@. We can generalize this result!
255 0
Exercises:
0 𝑎 𝑏 0
𝑐 𝑑 0 0
1. Which matrix represents the image that is the reflection of the matrix 𝐴 = „ …?
𝑒 0 𝑓 𝑔
0 0 0 ℎ
1

2. Write the matrix that corresponds to the reflection of each of the following about the
c. 𝑥 − axis
d. 𝑦 − axis

0 255 255
0 255 255
0 255 255 255 0 0
b. „ … b. L0 0 255M c. 2 <
255 0 0 0 255 0
0 255 255
255 255 0

Reflecting images using matrix-matrix multiplication


1 3
Consider the matrix 𝑋 = 2 < that represents an image3.
2 4

Question: From our work above, we know that the matrix representing the image reflected about

the 𝑥-axis is ! ". What matrix would we need to multiply 𝑋 by on the left in order to
obtain the matrix of the image reflected about the 𝒙-axis? Show that your answer gives you the
correct result.

3
(Note that these values each represent a shade of color between white and black, where 0 represents black, and 1 represents white.
While we have used only values of 0 and 255 thus far, we will use these values in this example to make the reflections clear.)
2

Question: From our work above, we know that the matrix representing the image reflected about

the 𝑦-axis is ! ". What matrix would we need to multiply 𝑋 by on the right in order to
obtain the matrix of the image reflected about the 𝒚-axis? Show that your answer gives you the
correct result.

The matrix you used above is a form of a __________________________ matrix (here referred to
as a reverse identity matrix). This matrix is always _____________, and its size is determined by the
size of the matrix it is multiplied to (i.e. in order for the matrix multiplication to be performed).

Exercises:

5. What size does the reverse identity matrix need to be to be used to reflect an image represented
by a 5 𝑥 3 matrix about the 𝑥-axis? Why?

6. What size does the reverse identity matrix need to be to be used to reflect an image represented
by a 5 𝑥 3 matrix about the 𝑦-axis? Why?
3

7. Use the reverse identity matrix of the appropriate size to reflect the images represented by the
following matrices about the 𝑥-axis.
0 255 255
a. L0 0 255M
0 255 255

0 255 255
0 255 255
b. „ …
255 0 0
255 255 0

255 0 0
c. 2 <
0 255 0

8. Use the reverse identity matrix of the appropriate size to reflect the images represented by the
following matrices about the 𝑦-axis.
0 255 255
a. L0 0 255M
0 255 255

0 255 255
0 255 255
b. „ …
255 0 0
255 255 0

255 0 0
c. 2 <
0 255 0
4

Reflecting images using matrix-vector multiplication


We can also manipulate images using matrix-vector multiplication. This method is a bit more
powerful than matrix-matrix multiplication, because it allows us with more flexibility in ways you can
manipulate those images.

Using this method, we first convert our matrices into vectors (i.e., single column or single row
matrices).

• We define 𝑣𝑒𝑐(𝑋) as the vector conversion of the matrix 𝑋. In general, for 𝑋 =



⎡𝑥 ⎤
⋮ ⋮ ⎢ ⋮/ ⎥
⎢ ⎥
L𝑥/ … 𝑥" M, we have 𝑣𝑒𝑐(𝑋) = ⎢ … ⎥.
⋮ ⋮ ⎢⋮⎥
⎢𝑥" ⎥
⎣⋮⎦

⎡𝑥 ⎤
⎢ ⋮/ ⎥
⎢ ⎥
• We define 𝑚𝑎𝑡(𝑋) as the matrix conversion of the vector 𝑌. In general, for 𝑌 = ⎢ … ⎥, we have
⎢⋮⎥
⎢𝑥" ⎥
⎣⋮⎦
⋮ ⋮
𝑚𝑎𝑡(𝑋) = L𝑥/ … 𝑥" M.
⋮ ⋮

Examples:

1 3
5. For 𝑋 = 2 <, 𝑣𝑒𝑐(𝑋) = „ ….
2 4
5

⎡ ⎤
⎢ ⎥
⎢ ⎥
1 4 7 ⎢ ⎥
6. For 𝑋 = L2 5 8M, 𝑣𝑒𝑐(𝑋) = ⎢ ⎥.
3 6 9 ⎢ ⎥
⎢ ⎥
⎢ ⎥
⎣ ⎦

3
5
7. For 𝑋 = „ …, 𝑚𝑎𝑡(𝑋) = 2 <.
6
1

1
⎡ 0 ⎤
⎢ 0 ⎥
⎢ ⎥
⎢ 0 ⎥
8. For 𝑋 = ⎢ 1 ⎥, 𝑚𝑎𝑡(𝑋) = L M.
⎢ 0 ⎥
⎢ 0 ⎥
⎢ 0 ⎥
⎣ 1 ⎦

Exercises:

3. Convert each of the following matrices into vectors.

5 0
a. 𝐴 = 2 < 𝑣𝑒𝑐(𝐴) = „ ….
3 4

2 3
b. 𝐵 = 2 < 𝑣𝑒𝑐(𝐵) = „ ….
1 6
6

⎡ ⎤
⎢ ⎥
⎢ ⎥
8 8 8 ⎢ ⎥
c. 𝐶 = L7 7 7M 𝑣𝑒𝑐(𝐶) = ⎢ ⎥.
8 8 8 ⎢ ⎥
⎢ ⎥
⎢ ⎥
⎣ ⎦

4. Convert each of the following vectors into matrices.


3
5
a. 𝑋 = „ … 𝑚𝑎𝑡(𝑋) = 2 <
6
1

8
⎡7 ⎤
⎢6 ⎥
⎢ ⎥
⎢5 ⎥
b. 𝑌 = ⎢ 4 ⎥ 𝑚𝑎𝑡(𝑌) = L M
⎢3 ⎥
⎢2 ⎥
⎢1 ⎥
⎣0 ⎦
7

Reflection about the axes using matrix-vector multiplication

1
1 3 2
Consider the matrix 𝑋 = 2 <. We know that 𝑣𝑒𝑐(𝑋) = „ ….
2 4 3
4
Question: From our earlier work, we know that the reflection of the image with matrix 𝑋 about the

2 4
𝑥-axis would be 𝑌 = 2 <. So, 𝑣𝑒𝑐(𝑌) = „ …. What matrix would we need to multiply
1 3

𝑣𝑒𝑐(𝑋) by on the left in order to obtain 𝑣𝑒𝑐(𝑌)? Show that your answer gives you the correct
result.

Question: From our earlier work, we know that the reflection of the image with matrix 𝑋 about the

3 1
𝑦-axis would be 𝑌 = 2 <. So, 𝑣𝑒𝑐(𝑌) = „ …. What matrix would we need to multiply
4 2

𝑣𝑒𝑐(𝑋) by on the right in order to obtain 𝑣𝑒𝑐(𝑌)? Show that your answer gives you the correct
result.
8

Blurring images

We can also blur images to get an effect we’re interested in, and we use linear algebra to do it! The
image on the left below is the picture, and the image on the right is the blurred version.

One way to do this is to average each entry’s “neighbors” (including the entry itself). The definition
of these neighbors can be determined by the user themselves. For example, a neighbor could be any
entry in the matrix representation that is directly left, right, above and below the original entry, along
with the entry itself.

1 1 2
Example: Consider an image whose matrix representation is 𝑋 = L2 1 1M. Suppose we define a
3 1 2
“neighbor” as an entry that is directly above, below, next to or diagonal from that entry. For
example, the entries that are neighbors of 𝑥1/ = 3 in the matrix are 𝑥2/ = 2, 𝑥22 = 1, 𝑥12 = 1, and
23/3/31 5
𝑥1/ = 3. So the entry 𝑦1/ in the new matrix would be 4
= 4.

⎡ ⎤
⎢ ⎥
This gives us 𝑌 = ⎢



.
⎢ ⎥
⎣7/4 ⎦

Challenge Question: Find the 9 𝑥 9 matrix 𝐴 such that 𝑌 = 𝐴 ∗ 𝑣𝑒𝑐(𝑋). Show that your choice
indeed results in 𝑌.
9

Lesson 5: Warm-Up – Student Version


v Student version begins on next page
10

Image Processing Name: ___________________________

Warm-Up Date: _________________Period: ____

Given the image below, write the corresponding matrix:

⎡ ⎤
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
𝑨=⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎣ ⎦
Reflect the image over the x-axis, write the new matrix, and draw the new image:

⎡ ⎤
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
𝑨=⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎣ ⎦
Reflect the previous image over the y-axis, write the new matrix, and draw the new image:

⎡ ⎤
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
𝑨=⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎣ ⎦
11

Reflect the previous image over the 45⁰ line, write the new matrix, and draw the new image:

⎡ ⎤
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
𝑨=⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎣ ⎦
Change the brightness of the previous image by a scalar of 1/2, write the new matrix, and draw the
new image:
*Note: you will use the color gray to draw the darkened or lightened image.

⎡ ⎤
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
𝑨=⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎣ ⎦

• Did you darken or lighten the image? Why?

Blur the original image and write the new matrix (you do not need to draw the new image):

⎡ ⎤
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
𝑨=⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥
⎣ ⎦
12

Lesson 5: Instagram Project Outline


v The outline begins on the next page
13

Project
This Photo by Unknown Author is
licensed under CC BY-SA
This Photo by Unknown Author is licensed under CC BY-SA

You are going to edit your given image to be Instagram ready! You will need to use a combination of
reflections, blurs, and brightness changes to post this image and get LOTS of likes and comments.

Step 1:
● Come up with an Instagram handle (Note: all Instagram handles must be school appropriate and
approved by the teacher before you can choose your image for step 2)
Step 2:
● Choose an image from your teacher to utilize throughout this project. First come first serve, so be
sure to pick your image quick!
Step 3:
● As a group, decide what types of reflections, inversions, and brightness changes you would like to
complete to post your picture. You MUST use one of each type of edit!
Step 4:
● Create matrices and a new image for each edit that you complete. You will need to turn this into your
teacher at the end of the project.
Step 5:
● Once your edits are complete, you must come up with a perfect caption for this photo (Note: all
captions must be school appropriate).
o Remember, the better the caption, the more likely you are to receive more likes and
comments!
Step 6:
● Post your final image to the classroom Instagram feed on the wall and turn in all other materials and
work to your teacher.
o All other materials and work must be turned in in an organized manner with the names of
each group member on them.
14

Grading Rubric:
Potential Actual Points
What the teacher is looking for:
Points Earned Earned

1. Did the student follow the directions? 1

2. Does the student show understanding of how to reflect the image? 4

3. Does the student show understanding of how to invert an image? 4

4. Does the student show understanding of how to adjust the


brightness of an image? 4

5. Did the student complete their math correctly? 2

Total Points: 15
15

Appendix B: Lesson Materials – Templates/Examples

Lesson 4: Math Symbols Image


16

Lesson 5: Instagram Project Stock Images

* *

** **

** **
17

** **

** ***

*** ***

*Image Source: https://www.woojr.com/printable-picross-grid-puzzles/


**Image Source: https://play.google.com/store/apps/details?id=org.popapp.jc&hl=en_US
***Image Source: https://nonogramskatana.wordpress.com/tag/10x10/
18

Lesson 5: Instagram Project Exemplar


Instagram Handle: @mathpeeps314

Original Image:
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡ 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎤
⎢𝟐𝟓𝟓
𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
𝑨=⎢
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢ 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦

Reflect the image over the x-axis:


𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡ 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎤
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢ ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 ⎥
𝑨=⎢
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦

Reflect the previous image over the y-axis:


𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 ⎤
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢ ⎥
⎢ 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
𝑨=⎢
⎢ 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 ⎥
⎣𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦
19

Reflect the previous image over the 45⁰ line:


𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟐𝟓𝟓
⎡𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎤
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ ⎥
⎢ 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟎 ⎥
𝑨=⎢
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟎 𝟎 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎦
Change the brightness of the previous image by a scalar of 1/2, write the new matrix, and draw the
new image: *Note: you will use the color gray to draw the darkened or lightened image.
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡ 𝟎 𝟎 ⎤
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎
𝟐𝟓𝟓 𝟐𝟓𝟓
𝟎 𝟎 𝟎
𝟐𝟓𝟓⎥
⎢ 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟎 𝟎 𝟎 𝟎 𝟎
𝟐 𝟐 𝟐 𝟐 ⎥
⎢ 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟎 𝟎 𝟎 𝟎
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢ 𝟐𝟓𝟓 𝟐𝟓𝟓 ⎥
⎢ 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
𝑨=⎢ 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 ⎥
⎢ 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎 𝟎
𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟎 𝟎 𝟎 𝟎 ⎥
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟎 𝟎 𝟎 𝟎
𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣ 𝟐 𝟎 𝟎
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎦
𝟏 ⋯ 𝟏
Image Inversion – 𝟐𝟓𝟓 ∙ E ⋮ ⋱ ⋮ I − 𝑨:
𝟏 ⋯ 𝟏
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
⎡ 𝟐𝟓𝟓 𝟐𝟓𝟓 ⎤
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟐𝟓𝟓 𝟐𝟓𝟓
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟐𝟓𝟓⎥
⎢ 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟐 𝟐 𝟐 𝟐 ⎥
⎢ 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 ⎥
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐
⎢ 𝟐𝟓𝟓 𝟐𝟓𝟓 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
𝑨=⎢ 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 ⎥
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎢ 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎥
⎢𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓 𝟐𝟓𝟓⎥
⎣ 𝟐 𝟐𝟓𝟓 𝟐𝟓𝟓
𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 𝟐 ⎦
20

You might also like