Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Introduction to Matrices, Cheat Sheet of Computer Science

An introduction to matrices, including definitions of key concepts such as the order of a matrix, matrix elements, and matrix multiplication. It covers examples of matrix operations like addition, scalar multiplication, and matrix multiplication. The document also discusses the identity matrix, determinants of 2x2 matrices, and the inverse of a matrix. The examples and exercises cover a range of matrix operations and properties, making this a comprehensive introduction to the topic of matrices. This document could be useful for students studying linear algebra, discrete mathematics, or other areas of mathematics that involve matrices.

Typology: Cheat Sheet

2023/2024

Uploaded on 12/07/2023

mazen-chareb
mazen-chareb 🇬🇧

1 document

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Matrices
A matrix is an array of numbers, each number being called an element.
Matricies are denoted by capital letters.
An
rc
(r by c) has r rows and c columns.
rc
is the order of the matrix.
1 2 3
4 5 6
7 8 9
10 11 1 2
A






has the order
43
Equal Matrices
Same order and identical elements.
Square Matrices
Same number of rows & columns. i.e.
22
,
33
Addition and Subtraction
Add or subtract the corresponding elements. The matrices must be of
the same order.
4 9 1 2 4 1 9 2 5 1 1
2 0 0 1 2 0 0 1 2 1
1 7 5 3 1 5 7 3 6 10


Addition is commutative (independent of order)
A B B A
Addition is associative (independent of the grouping of elements)
A B C A B C
Multiplication by a constant
Multiply each element by the constant.
e.g .
e.g .
e.g .
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Introduction to Matrices and more Cheat Sheet Computer Science in PDF only on Docsity!

Matrices

  • A matrix is an array of numbers, each number being called an element.
  • Matricies are denoted by capital letters.
  • An rc ( r by c ) has r rows and c columns.
  • rc is the order of the matrix.

A

 ^ 

has the order 4  3

Equal Matrices

Same order and identical elements.

Square Matrices

Same number of rows & columns. i.e. 2  2 , 3  3

Addition and Subtraction

Add or subtract the corresponding elements. The matrices must be of

the same order.

     ^    

  • Addition is commutative (independent of order)

A  B  B  A

  • Addition is associative (independent of the grouping of elements)

A^ ^ B^  ^ C^ ^ A^ ^  B^  C

Multiplication by a constant

Multiply each element by the constant.

e .g.

e .g.

e .g.

©F 22 j 0 b 131 W IKsuytxar QS 6 o 0 f 7 tqwJakr 1 ey DLvLaC 8 .w 4 qAflLlq qr 3 iqgCh 5 tksn 4 rleisKehr 2 vreddg. 7 w EMIa 2 dDeb lwRi 5 tihd cIpn 9 fViZnCiAtmej rAhl 3 g 0 eebrrJa 1 H 26 .A Worksheet by Kuta Software LLC Kuta Software - Infinite Algebra 2 Name___________________________________

Basic Matrix Operations Date________________ Period____

Simplify. Write "undefined" for expressions that are undefined.

3 6 −1 − −5 −

0 − 6 0 2 3

−5 2 − 4 −2 0 − 6 −5 − 1 3 −

  1. − 5 6 − 4 −2 −
  2. − −3 0 0 5
  3. 4 2 + −2 −
  4. 5 4 3
  5. −5 1 −2 −1 2
  6. 5 5 1 1 − 1 2
  7. −2 u 7 u 3 w

5 u 5

2 4

5 6

  1. 4 − 3 −

−4 n n + m −2 n −4 n

4 − 3 m 0

©P a 2 k 0 j 1 y 1 E LKsuqtoa 2 6 SiolfhtawPaFrKeC SLPLACn. 3 w 1 AAlIlz 3 rbi 8 g 5 h 8 tds 0 hr 2 e 3 sVepravReYdc.y m 7 MKaLdheL ewciYtGhp PI 0 njfaiynHixtHen DAilPgEeEb 0 rqa 1 Q 2 j.k Worksheet by Kuta Software LLC Kuta Software - Infinite Algebra 2 Name___________________________________

Basic Matrix Operations Date________________ Period____

Simplify. Write "undefined" for expressions that are undefined.

3 6 −1 − −5 −

0 − 6 0 2 3 3 5 5 − −3 2

−5 2 − 4 −2 0 − 6 −5 − 1 3 − −11 7 4 3 −5 3

  1. − 5 6 − 4 −2 − −25 −30 20 −20 10 5
  2. − −3 0 0 5 15 0 0 −
  3. 4 2 + −2 − 2 −
  4. 5 4 3 20 15
  5. −5 1 −2 −1 2 −5 10 5 −
  6. 5 5 1 1 − 1 2 25 5 5 − 5 10
  7. −2 u 7 u 3 w

5 u 5 −14 u

−6 uw

−10 u

−10 u

2 4

5 6 7 10

  1. 4 − 3 − − 12 −

−4 n n + m −2 n −4 n

4 − 3 m 0 −4 n + 4 n + m − 5 −2 n + 3 m −4 n

© 5 j 2 G 0 X 1 L 1 R dK 2 uxtVa 5 NSGoEfwtLw 2 ajrYeN mLPLXCs. 8 L dAulCl 4 Vr 1 iHg 6 hktbsa NrBe 8 sme 7 rQv 3 ewdV.C 7 jMHaYdrez owLiotrhA EIQnbfXiLnAict 1 ej 7 AAllgbe 2 bSr 0 aB U 2 U.H Worksheet by Kuta Software LLC

13) 2 −5 −3 + 1 −2 −

3 −7 −

x + y x − 6

− −6 xy x + y − 5 x − 6 − 6 xy

  1. 4 c 0 6 0 3 a 0 24 c 0 12 ca
  2. −3 y −2 x − y −4 y −3 x 6 yx 3 y

12 y

9 yx

  1. 3 2 u v

u

6 u 3 v

3 u

  1. − x − 1 −2 x −5 y − y −2 −3 x − x − 1 − y −2 x + 2 −5 y + 3 x

−6 r + t − r 6 s

6 r −4 t −3 r + 2 t − r − 4 t 6 s − 3 r + 2

z − 5 − −1 − 6 z 3 y

−3 y 3 z 5 + z 4 z z − 5 − 3 y −6 + 3 z 4 − 5 z 3 y + 4 z

  1. 5 6 1 2 −6 − 1 6 −6 6 29 −1 16 −

−10 10 −

5 3 5 1 − −6 0 1 − − 5 4 −2 − 6 − 6 11

1 1 6 − 0 0

  • 5 −4 6 1 1 −4 − −19 31 11 1 −20 − -2- Create your own worksheets like this one with Infinite Algebra 2. Free trial available at KutaSoftware.com

Matrix Multiplication

For matrix multiplication, MN is only possible if,

“ N u m b e r o f c o lu m n s o f M N u m b e r o f r o w s o f N

a c

M

b d

p r

N

q s

a p c q a r c s

M N

b p d q b r d s

 ^  

 ^  

M

N

M N

   ^ ^ ^  

   ^ ^ ^  

N M

   ^ ^  

  ^   

  ^   

  • Matrix multiplication is not commutative

M N  N M

  • Matrix multiplication is associative

L M^  N^  L^  M N

  • If M is rc & N is cs then MN is rs

e.g. M is 4  3 , N is 3  2.

MN is 4  2

NM doesn’t exist!!

e .g.

2  3 3  2

2  2

3  3

3  2 2 ^3

s a m e o rd e r

©u 32 U 01162 O BKduWtXae MSoodfNtB wuafrKeE MLRLXCQ.H O QAjlPlF 1 rsiUg 8 h 2 t 4 su crPeps 9 eHr 0 vOeld 4 .q v xMPadd 8 eB BwqiltIhn yIRnzfUi 3 nWiStteD VAdl 9 gxeGbnrsaX S 2 M.K Worksheet by Kuta Software LLC Kuta Software - Infinite Algebra 2 Name___________________________________

Matrix Multiplication Date________________ Period____

Simplify. Write "undefined" for expressions that are undefined.

0 2 −2 − ⋅ 6 − 3 0

6 − ⋅ −5 4

−5 − −1 2 ⋅ −2 − 3 5

−3 5 −2 1 ⋅ 6 − 1 −

0 5 −3 1 −5 1 ⋅ −4 4 −2 −

5 3 5 1 5 0 ⋅ −4 2 −3 4 3 −

− 6 0 ⋅ 3 −

3 2 5 2 3 1 ⋅ 4 5 − 5 −1 6

© 7 K 2 I 0 k 1 f 2 k FKQuSt 3 aC lSeoXfIt 0 wmaKrDeU RLMLECH.I m lAklMlz zrjiAgYh 2 thsF KrNeNsHetrevneFd 7 .Q R VMPaJdre 9 rwdiQtAho fIDntfMienWiwtQe 7 gAAldg 8 eTb 0 rBaw z 21 .e Worksheet by Kuta Software LLC Kuta Software - Infinite Algebra 2 Name___________________________________

Matrix Multiplication Date________________ Period____

Simplify. Write "undefined" for expressions that are undefined.

0 2 −2 − ⋅ 6 − 3 0 6 0 −27 12

6 − ⋅ −5 4 −30 24 15 −

−5 − −1 2 ⋅ −2 − 3 5 −5 − 8 13

−3 5 −2 1 ⋅ 6 − 1 − −13 − −11 −

0 5 −3 1 −5 1 ⋅ −4 4 −2 − −10 − 10 − 18 −

5 3 5 1 5 0 ⋅ −4 2 −3 4 3 − −14 − −19 22

− 6 0 ⋅ 3 − −15 5 18 − 0 0

3 2 5 2 3 1 ⋅ 4 5 − 5 −1 6 Undefined

© 4 e 2 b 0 i 1 r 2 N fK 7 uEtwaN ZSPoYfDt 4 wGanrSea ILxLVCx.q f GA 3 ldlX Vr 1 igg 3 hqtNsZ mrzeDsGe 9 rivRetdd.E U C MxamdoeA Ew 9 iutWhu NIGnRfPi 0 nHiutNeL 9 AvlQgyeHbfrFak u 2 Z. 6 Worksheet by Kuta Software LLC

3 − −3 6 −6 − ⋅ −1 6 5 4 −8 14 33 6 −24 −

5 4 2 − ⋅ − 3 − −

−1 1 − 5 2 − 6 −5 1 −5 6 0 ⋅ 6 5 5 − 6 0 −7 − 10 13 17 60 0 −

−2 − −4 3 5 0 4 − ⋅ 2 −2 2 −2 0 − 8 4 14 −14 8 − 10 −10 10 20 −8 26

  1. 2 −5 v ⋅ −5 uv 0 6 −10 u −32 v

−4 − y −2 x − ⋅ −4 x 0 2 y − 16 x − 2 y

5 y 8 x

− 8 y 20 Critical thinking questions:

  1. Write an example of a matrix multiplication that is undefined. Many answers. Ex: 1 2 3 4 ⋅ 1 2 3 4 5 6
  2. In the expression AB , if A is a 3 × 5 matrix then what could be the dimensions of B? 5 × Anything

Create your own worksheets like this one with (^) Infinite Algebra 2. Free trial available at KutaSoftware.com

Identity Matrix

Denoted by I , such that

M IIMM

I (^) 1  1  , 2

I

, 3

I

1 0 0

0 1 0

0 0 1

n I

 

 

 ^   

   

e.g.

M

M I

Determinant of a 2 by 2 Matrix

Example

Find

(a)

3 2 d e t 1 3

       

(b)

3 7

2 4

Question

Given that

3 2

x 6

     

is a singular matrix, find x

Example

3 2 2 1 , 2 5 4 0

A B

      (^)      ^ ^    

. Findd e t (^)  A B

Question

Given that

1 4

1 2

A

       

and

7 1 9

5 5

A B

      

, findd e t B

The determinant of the matrix

a b

c d

     

is

defined as a db c

If a matrix has a determinant of zero,

then it is called a singular matrix

d e t (^)  A B (^)   d e t (^)  A (^)  d e t B

©l R 2 w 0 i 1 T 2 q yKluRtB aJ wSGoifst 9 wia 6 rBeJ mLJLlCB .f 3 fA 2 l 2 lF CreiEgHhQtRsJ 2 roersreGrFvjehdg.N m 2 MAaHdreM B w 2 iJt 1 hb LIonafPiOnoietQeK GAjl 8 gIejbHrfaQ t 26 .Y Worksheet by Kuta Software LLC Kuta Software - Infinite Algebra 2 Name___________________________________

Determinants of 2×2 Matrices Date________________ Period____

Evaluate the determinant of each matrix.

0 − −6 − −

−6 0 6 − 36

−1 1 −1 4 −

0 4 6 5 −

0 − 6 − 6

5 3 6 6 12 Evaluate each determinant.

−5 3 4 2 −

−9 − −7 − 27

−1 8 5 0 −

8 − −10 9 12

0 6 −8 0 48

10 − −7 3 −

−5 0 2 10 −

2 − 7 − 0

  1. Evaluate: 1 2 3 4

5 2 −2 6 32

  1. Give an example of a 2×2 matrix whose determinant is 13. Many answers. Ex: 4 13 1 5 Create your own worksheets like this one with (^) Infinite Algebra 2. Free trial available at KutaSoftware.com

Inverse Matrix

If M & N are square matrices and M NI then

N M

.

M

is the inverse matrix.

M M I

a c

M

b d

w y

M

x z

 ^ 

a c w y

b d x z

Find w , x , y , z in terms of a , b , c , d.

 

 

 

 

a w c x

a y c z

b w d x

b y d z

 

 

b a b w b c x b

a a b w c d x

 

 

d a d w c d x d

c b c w c d x

b c x c d x b

b

b c a d

b

x

a d b c

d

w

a d b

a d b c w d

c

w  

 

 

d a d y c d y

c b c y c d z c

 

 

b a b y b c z

a a b y a d z a

b c y c d y c

c

b c a d

c

y

a d b c

a

z

a d b

a d b c z a

c

z  

d c

a d b c a d b c

M

b a

a d b c a d b c

When

a c

M

b d

1 1 d c M a d b c b^ a

         

  • (^) a db c is known as the determinant of the matrix M , denoted by

a c

b d

  • If (^) a db c  0 , the inverse matrix doesn’t exist. M is said to be singular
  • If a db c  0 , the inverse exists. M is said to be non-singular

Inverse of a 2 by 2 matrix

Example

Find the inverse of

2 4

1 3

      

Question

2

3 4

3

A k

        

(a) Find the two possible values for which A has no inverse

(b) Show that when k  2 , A is self-inverse (i.e. the inverse is the same as the original

matrix)

Example

9 2 3 4 , 3 1 7 6

A B

              

Find

(a)

1 A

(b)

1 B

(c)  

1 B A

The identity matrix is

1 0

0 1

I

      

The inverse

1 A

 of the matrix A has the property 1 1 A A A A I

     

The inverse of the matrix

a b

c d

     

is given by

1

d e t

d b

A c^ a

       

If a matrix is singular then it has no inverse

 

(^1 1 ) A B B A

 (^)   

©Z A 2 J 02152 P 6 K 6 uhtPaa bSrovf 5 tIwkaUrqef pLNLmCE.m q GA 0 lLl 0 prsiggxhUttsd yreeEsqecrrvCewda.p A kMKaadIeN fweiKt 9 ho mI 9 nafAiGnDiYtSeQ pAblQgpejbsryaz 22 E.S Worksheet by Kuta Software LLC Kuta Software - Infinite Algebra 2 Name___________________________________

Inverse Matrices Date________________ Period____

For each matrix state if an inverse exists.

−9 − −2 −

−2 1 −6 1

4 − −9 6

0 0 −6 4 Find the inverse of each matrix.

11 − 2 −

0 − −1 −

−1 7 −1 7

1 − −6 −