You are on page 1of 3

CS 100 T

First semester of the academic year 1442 H

Exercises 3-Lecture 3

Matrices

Prepared by : Dr. Sarah Alhammad


CS 100 T
First semester of the academic year 1442 H

Question#1:

Given the following matrices

𝟒 −𝟏 𝟐 𝟎
A= [ ] B=[ ]
𝟐 𝟎 𝟎 −𝟐
Answer the following questions

a. Is matrix A square matrix ? yes because it’s size is 2x2 then m=n

b. Is matrix B diagonal matrix? yes, because for each element mij=0 and
i≠j

c. Find A+B
𝟔 −𝟏
[ ]
𝟐 −𝟐

d .Find AB
(𝟒 ∗ 𝟐) + (−𝟏 ∗ 𝟎) (𝟒 ∗ 𝟎) + (−𝟏 ∗ −𝟐)
[ ]
(𝟐 ∗ 𝟐) + (𝟎 ∗ 𝟎) (𝟐 ∗ 𝟎) + (𝟎 ∗ −𝟐)

𝟖 𝟐
=[ ]
𝟒 𝟎
e .Find At , is A a symmetric matrix ? why ?
𝟐 𝟎
At = [ ] yes because A= At
𝟎 −𝟐
CS 100 T
First semester of the academic year 1442 H

Question#2:

Given the following binary matrices


1 0 0 0 0 1
A= 0 1 0 B= 1 1 1
0 0 1 0 1 0

Answer the following questions

a. Is matrix A identity matrix ? yes because it is a diagonal matrix and all


of whose diagonal elements are 1

b. Find A^ B
0 0 0
0 1 0
=
0 0 0

c. Find AvB
1 0 1
1 1 1
=
0 1 1

d. Find 𝑨 ⊙ 𝑩

(𝟏 ^ 𝟎) 𝐯 (𝟎 ^ 𝟏)𝐯 (𝟎 ^ 𝟎) (𝟏 ^ 𝟎) 𝐯 (𝟎 ^ 𝟏)𝐯 (𝟎 ^ 𝟏) (𝟏 ^ 𝟏) 𝐯 (𝟎 ^ 𝟏)𝐯 (𝟎 ^ 𝟎)


= [(𝟎 ^ 𝟎) 𝐯 (𝟏 ^ 𝟏)𝐯 (𝟎 ^ 𝟎) (𝟎 ^ 𝟎) 𝐯 (𝟏 ^ 𝟏)𝐯 (𝟎 ^ 𝟏) (𝟎 ^ 𝟏) 𝐯 (𝟏 ^ 𝟏)𝐯 (𝟎 ^ 𝟎) ]
(𝟎 ^ 𝟎) 𝐯 (𝟎 ^ 𝟏)𝐯 (𝟏 ^ 𝟎) (𝟎 ^ 𝟎) 𝐯 (𝟎 ^ 𝟏)𝐯 (𝟏 ^ 𝟏) (𝟎 ^ 𝟏) 𝐯 (𝟎 ^ 𝟏)𝐯 (𝟏 ^ 𝟎)

0 0 1
=
1 1 1
0 1 0

You might also like