0% found this document useful (0 votes)
8 views23 pages

Lab1&2 Solution

Uploaded by

sh5701
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)
8 views23 pages

Lab1&2 Solution

Uploaded by

sh5701
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/ 23

Recitation 2.

based on material by Carles Domingo-Enrich

Center for Data Science

September 15, 2023


Concept Review: Guassian Elimination
Elimentary Row Operations
I Swapping two rows
I Multiplying a row by a nonzero number
I Adding a multiple of one row to another row
Gaussian Elimination - From Lecture 2
2 3 2 3
1 1 0 1 1
4
A= 2 0 1 5
1 2R n⇥m and y = 15 2 Rn
4
1 5 2 0 4
Cinean AxY if x =
(π) a ,
*2 X3 X4 ER
leading coefficieat
, ,

!x, ;

{


-
Xzt X4 = R
1 3


t x3 X4 1
) CRz
- =
r

ttpg
)
esxrtzx-
-

X4 = 1 3
R
X2 t


x ,
-

3-
( R2) 2 CRD
X 4 =- 1
-

→ + zX2+ X 3


5 ) +4X 2 +2 X 3+
X
4
= CR 3 ) + [R,

X, x
4= 1 3

δ
-

X 2 f R
o t 2x =+ X 3
) 3X 4 yR -
=

X4 = l
R
oto + 0 + 7x 4 7 =
Gaussian Elimination - From Lecture 2
x, 1 号


-

{
xz + 1 =
=
* -

> 1

1 xn +xr = x2 = 1 -

2x 4
= XΨ = 1

{(f ) H
∞| rtk =
s =
) tx }

{({ ) +v
| vaspanl
☆ a
Concept Review: Subspaces
Definition (Subspace)
A non-empty subset S of a vector space V is called a subspace if it
is closed under addition and scalar multiplication:
1. Closure under Addition: x + y 2 S for all x, y 2 S.
2. Closure under Scalar Multiplication: ↵x 2 S, for all x 2 S and
↵ 2 R.
I A subspace is also a vector space!
I A subspace always contains the zero vector.
Concept Review: Span & Linear Dependence

- Let x1 , ..., xk 2 V .
def
Span(x1 , ..., xk ) = {↵1 x1 + ... + ↵k xk |↵1 , ..., ↵k 2 R}.
Concept Review: Span & Linear Dependence

- Let x1 , ..., xk 2 V .
def
Span(x1 , ..., xk ) = {↵1 x1 + ... + ↵k xk |↵1 , ..., ↵k 2 R}.

- The family (x1 , ..., xk ) are linearly dependent if there exists


↵1 , ..., ↵k 2 R that are not all zero s.t.

↵ 1 x1 + · · · + ↵ k xk = 0

Concept Review: Span & Linear Dependence

- Let x1 , ..., xk 2 V .
def
Span(x1 , ..., xk ) = {↵1 x1 + ... + ↵k xk |↵1 , ..., ↵k 2 R}.

- The family (x1 , ..., xk ) are linearly dependent if there exists


↵1 , ..., ↵k 2 R that are not all zero s.t.

↵ 1 x1 + · · · + ↵ k xk = 0

Ex. Consider the two vectors v = (1, 1) and w = ( 1, 2), is


S = {↵v + w |↵,

0} a subspace of R2 ? F ) (i +r (点 )
(i ) → - 5) (i ) =
(f ) a+ 2
B ≥O
Concept Review: Basis & Dimension

- A family (x1 , . . . , xn ) of vectors of V is a basis of V if


1. x1 , . . . , xn are linearly independent,
2. Span(x1 , . . . , xn ) = V .
Concept Review: Basis & Dimension

- A family (x1 , . . . , xn ) of vectors of V is a basis of V if


1. x1 , . . . , xn are linearly independent, ∠

2. Span(x1 , . . . , xn ) = V . ←

- If V admits a basis (v1 , . . . , vn ), then every basis of V also has n


vectors. We say that V has dimension n and write

dim(V ) = n.

Concept Review: Basis & Dimension

- A family (x1 , . . . , xn ) of vectors of V is a basis of V if


1. x1 , . . . , xn are linearly independent,
2. Span(x1 , . . . , xn ) = V .
- If V admits a basis (v1 , . . . , vn ), then every basis of V also has n
vectors. We say that V has dimension n and write

dim(V ) = n.

0
Ex. Let v1 , v2 , v3 , v4 2 R3 . Let C1 = {v1 , v2 } and C2 = {v3 , v4 }.
⼀ ⼀

If C1 and C2 are both linearly independent, what are the possible


values for dim(Span(v1 , v2 , v3 , v4 ))? (No formal proof necessary)
2, 3 . 4
1 Linear Transforiuath

!
.
.

2 .
Matrix
Repesentcathm ,

3 ornel (
.

Imef ,

Recitation 2.2

based on material by Carles Domingo-Enrich

Center for Data Science

September 15, 2023


Concept Review: Linear Tranformations


Definition
A function L : Rm ! Rn is linear if 0 6
⼀号 I For all v 2 Rm and all ↵ 2 R we have L(↵v ) = ↵L(v ).

→ I For all v , w 2 R
m we have L(v + w ) = L(v ) + L(w ).

-p
Remark: < coto ) ∞
∞ I L(0) = L(0 + 0) = 2L(0) =) L(0) = 0
D

I L(⌃ki=1 ↵i vi ) = ⌃ki=1 ↵i L(vi ) ↑
2L ( )
0 =
< co 了

G spant
≈ =≥ C 0o) 20 ,
d
question 1: Linear Transformations fcx) fa α ) =α
{{ fcaey
x

is fcxltfoy)
) =

Which of the following functions are linear? If the function


µ
,

linear, what is the kernel?


v
1. f1 : R2 ! R2 such that f1 (a, b) = (2a, a + b)

!
{ 2. f2 : R2 ! R3 such that f2 (a, b) = (a + b, 2a + 2b, 0)
⼀…

→ 3. f2 : R2 ! R3 such that f3 (a, b) = (2a, a + b, 1) 身


p
4. f2 : R2 ! R such that f4 (a, b) = a2 + b 2
→ 5. f2 : R ! R such that f5 (x) = 5x + 3 x

Kercfis : fi 0
lab)

Ψ
=>
{皆
a (er (f ) =
(8 }
)
{ atb
2a
= 0 ,

a =0
= 0 .
.

frca b ) =0

= {
ercfbp
,
,

G+ b = 0 s a= b
- s )

=>
{ zaezb = 0
{
O = O
=
g
span (
Concept Review: Geometry of Linear Tranformations
Homothety

t
.
H : Rn ! Rn
x 7! x
.
i. =

]
Rotation


R ✓ : R2 ! R2
x 7! x rotated by angle✓

]
cos0
Sino

!
-

Ño -

no coso


question 2: Linear Transformations
Find a 2x2 matrix A (not identity matrix) such that A4 = I

-
p

1 icencescinny


d
x∅


"

乡∅

(∞
ei _
(。) ⼀

[ ∵)
0
巩 a
4
= 1
,
.

.
Concept Review: Matrix Product
Definition
Let L 2 Rnxm and M 2 Rmxk . We define the matrix product LM as
the nxk matrix of the linear transformation L M. Whose
coefficients are given by the formula:

(LM)i,j = ⌃m
p=1 Li,p Mp,j for all 1  i  n, i  j  k
K

n
t
:
t



question 3: Matrix Product
Calculate the product AB and verify the following properties for
matrix multiplication:
I Non-commutativity: AB 6= BA

I Associativity: A(BC ) = (AB)C

( (.
. ) 0
Concept Review: Matrix Inverse
Definition
A square matrix M 2 Rnxn is invertible if there exists M

1 2 Rnxn

such that
MM 1 = M 1 M = Idn

o is unique
such that M 1

M N . = N M
- = I
f
N = M
Question 5: Matrix Inverse
Find the inverse of the matrix below and verify. What do you
observe? θ 10 1I 江1
" p #
1 3
A= p2 2
3 1

l
2 2

1∴
p


AB⼆ I
⼼Δ

l ↑

ε …
,


*

:
:! ( 1 0)

皇誉 )
,


β“
(
1

* Cheer ac Hurme: AB
= BA I
=
)
.
Concept Review: Kernels and Images
m coam →
Kernel
The Kernel Ker (L) (or nullspace) of a linear transformation !
L : Rm ! Rn is defined as the set of all vectors v 2 Rm such that
L(v ) = 0. i.e. Inge .

def
Ker (L) = {v 2 Rm |L(v ) = 0}

Image
The image Im(L) (or column space) of a linear transformation
L : Rm ! Rn is defined as the set of all vectors u 2 Rn such that
there exists c 2 R m such that V (v ) = u. Im(L) is also the span of
⼀ θ

the columns of the matrix representation of L.



K
m

( C ( el Lie ) .
Lcem ) )
= L(x txmn ]
xeit at txmen Lx ← …

x= ,
. …

0 β Δ
Question 6: Kernels and Images xi) tx
= 2L (e) -


txmL(
)
Let T : M22 7!θ
R2 be defined by =
spa ( L (G ) Ez) ,

CC3),
 
a b a b
T =
c d c td

Then T is a linear transformation. Find a basis for Ker (T ) and ⼀

Im(T )

eamiitaim
Givie
-

…a
-
,

r ,
l
x

Span
↑ ↑
笻] ken() : bass ;

.( ' 0 d )
( ) } NOT
品 UNIQUE ANS


[ IuCr ] basis
, { ( ' ) 10
,
:
,

}ALSO NOTUNIQUEANS
6
Concept Review: Solving Linear Systems

You might also like