Udacity Session10
Udacity Session10
Recap
● Introduction
○ What is Linear Algebra?
○ What is it really about?
○ Why Linear Algebra?
○ Use cases of Linear Algebra in AI Programming.
● Vectors
○ Definition
○ Transpose
○ Vector Addition
○ Scalar-Vector Multiplication
Agenda
● Linear combinations
● Linear dependency / independency
● Linear Transformation
● Matrices
Linear Combinations
1 2
Linear Combinations
● You can notice that the result vector “[0, 3]” let’s call it <b>, is a
combination between the two co-officiant vectors “[2,-1]” <v1> and “[-1,2]”
<v2>
● Then
● b = constant_v1 * v1 + constant_v2 * v2
Linear Combinations
● In that example you can just take a look at the vectors and decide ‘c1 = 3’
and ‘c2 = 5’, then “b = 3 * v1 + 5 * v2”
● But you can’t always “SEE” the solution, can you?
● Mathematicians call the above “Solution by Inspection”, and no one can do
that always, so we need some mathematical systematic approach.
Linear Combinations
● Let’s decide whether ‘b’ is a linear combination from ‘v1’ and ‘v2’.
○ b = (1, 14, -9)
○ v1 = (1, 4, 1)
○ v2 = (2, 3, 7)
● Then, let’s type the equation and see how can we calculate.
○ c1* (1, 4, 1) + c2 * (2, 3, 7) = (1, 14, -9)
Linear Combinations
Linear Combinations
● Vectors v1, v2, …., vn are linearly independent if there are no non-trivial
linear relations among them; that is v1, v2, … vk are linearly independent if
the only way to express “0” as a linear combination “c1 v2 + …. “ is to have “
c1 = c2 = c3 …. = cn = 0”
Linear dependence / independence
Linear dependence / independence
● For the above example we could only find the trivial solution where “c1 = c2
= 0”
● That means; V1 and V2 are linearly independent
Linear Transformation
● You’ve also studied parametric curves like r(t) = [ cos(t), sin(t), t ] , where
the input (t) is a number and the output is a vector.
● In linear algebra, we’ll study functions where the input and output are both
vectors; such functions are often also called transformations. (A linear
transformation is a special kind of transformation, as we’ll explain soon.)
● Our functions will often be named T (for “transformation”),
Linear Transformation
Linear Transformation Visualization
● One dimensional matrices are often called vectors, as in row vector for a n
× 1 matrix or column vector for a 1 × m matrix but we are going to use the
word “vector” to refer to something different in Part II. We will use the
notation (Aij) to refer to the number in the i-th row and j-th column.
Matrices
Matrices
● A00 = a
● A22 =
● A02 =
● A01 =
● A20 =
Matrices
● Note two consequences of this. Just because you can form the matrix
product AB does not mean that you can form the product BA. Indeed, you
should be able to see that the products AB and BA only both make sense
when A and B are square matrices: they have the same number of rows as
columns
Matrices Multiplication
● Matrix multiplication
Extra materials
● Linear dependence
● Linear combinations
● Linear Transformation
● matrices