Data Science Unit - 3 - 31.8.23
Data Science Unit - 3 - 31.8.23
UNIT III
MATHEMATICAL FOUNDATION
SYLLABUS
Linear Algebra:
• Vectors,
• Matrices
Statistics:
• Describe single set of data
• Correlation
• Bayes’s Theorem
• Random Variables
• Continuous Distributions and Normal Distribution.
2
Linear Algebra
3
Linear Algebra
Linear Algebra
Linear Algebra is a branch of mathematics that is extremely useful in data science and
machine learning.
Linear algebra is the most important math skill in machine learning.
Most machine learning models can be expressed in matrix form.
A dataset itself is often represented as a matrix.
Linear algebra is used in data preprocessing, data transformation, and model evaluation.
4
5
Scalars - A scalar is a quantity that only has magnitude and not direction. It is an
element that is used to define a vector space. In linear algebra, scalars are usually real
numbers.
Vector Space - The vector space consists of vectors that may be added
together and multiplied by scalars.
Vectors
17
Definition
Vectors are mathematical objects that contain both
magnitude and direction, and they can be represented by the
directed line segments (lines having directions) whose
lengths are their magnitude.
Magnitude
The magnitude of any vector can be easily calculated by taking the square root of its
component, i.e., if
A = ai + bj + ck, then,
Magnitude of A = |A| = sqrt (a2 + b2 + c2)
Example: a = 3i + 4j – 7k. Find the magnitude of a.
Answer:
21
Types of Vectors
22
types of vectors, but here we will discuss seven different types of vectors that are commonly
used:
Zero Vector
A vector is said to be a zero vector if the magnitude of the vector is zero.
It is denoted by: O = (0, 0, 0).
Also known as Additive Identity
i.e., A + O = A = O + A
23
Unit Vector
A vector is said to be a unit vector if the magnitude of the vector is one.
24
Negative Vector
A vector is said to be a negative vector of a given vector if it has the same magnitude but
points in the opposite direction.
In simple terms, when we multiply any vector with the -1, it changes the direction of the
vector.
i.e., (-1)v = -v
25
Equal Vectors
Two vectors (a and b) are said to be equal if they have the same
magnitude and direction.
If a = x1i + y1j + z1k, and b = x2i + y2j + z2k, then
a = b if and only if x1 = x2, y1 = y2, and z1 = z2
i.e., two vectors are equal if their corresponding components are equal.
Orthogonal Vectors
Two vectors, a, and b, are orthogonal if and only if they are
perpendicular to each other.
The angle between them is a right angle.
Mathematically, vectors are orthogonal if the dot product of vectors is
zero.
27
Co-Initial Vectors
A vector is said to be a co-initial vector when two or more vectors have the same starting point,
for example, Vectors AB and AC are called co-initial vectors because they have the same
starting point A.
28
Matrices
30
Algebra of Matrices is the branch of mathematics, which deals with the vector spaces between
different dimensions.
The innovation of matrix algebra came into existence because of n-dimensional planes present in
our coordinate space.
A matrix (plural: matrices) is an arrangement of numbers, expressions or symbols in a
rectangular array. This arrangement is done in horizontal-rows and vertical-columns, having an
order of number of rows x number of columns.
Every pair of points in a Three-dimensional space represent a unique equation with one or more
than one solution.
The basic idea or the central idea of applied mathematics revolves around Linear Algebra.
31
Algebra of Matrix
Algebraof matrix involves the operation of matrices, such as
Addition, subtraction, multiplication etc.
Addition/Subtraction of Matrices
Two matrices can be added/subtracted, iff (if and only if) the
number of rows and columns of both the matrices are same,
or the order of the matrices are equal.
For
addition/subtraction, each element of the first matrix is
added/subtracted to the elements present in the 2nd matrix.
32
33
34
Matrix Multiplication
Like Matrix can be Multiplied two ways,
(i) Scalar Multiplication
(ii) Multiplication with another matrix
Scalar Multiplication – It involves multiplying a scalar quantity to the matrix. Every element
inside the matrix is to be multiplied by the scalar quantity to form a new matrix.
For example-Scalar Multiplication
35
36
The matrices, given above satisfies the condition for matrix multiplication, hence it is possible
to multiply those matrices.
The resultant matrix obtained by multiplication of two matrices, is the order of m1, n2, where
m1 is the number of rows in the 1st matrix and n2 is the number of column of the 2nd matrix.
37
38
39
Also, see here rules for The inverse rules of matrices are
transposition of matrices: as follows:
(A’)’ = A AI = IA = A
(A+B)’ = A’+B’ AA-1 = A-1A = I
(AB)’ = B’A’ (A-1)-1 = A
(ABC)' = C’B’A’ (AB)-1 = B-1A-1
(ABC)-1 = C-1B-1A-1
(A’)-1 = (A-1)’
41
(vi) Geology
Applications of Matrices
(vii) Robotics and animation
(viii) Wireless communication and signal
Matrices have many applications in diverse
processing
fields of science, commerce and social
science. Matrices are used in: (ix) Finance ices
(i) Computer Graphics (x) Mathematics
(ii) Optics
(iii) Cryptography
(iv) Economics
(v) Chemistry
42
Statistics
43
What is Statistics?
A visual and mathematical portrayal of information is statistics.
Data science is all about making calculations with data.
We make decisions based on that data using mathematical conditions
known as models.
Numerous fields, including data science, machine learning, business
intelligence, computer science, and many others have become
increasingly dependent on statistics.
44
45
Structure:
Data sets can have structured or unstructured formats.
Structured data sets have a well-defined schema or
organization, typically represented in tabular form.
Unstructured data sets need a predefined structure, such
as text documents, images, or social media posts.
In addition, unstructured data requires specialized
extraction, transformation, and analysis techniques.
57
Correlation
58
For example, the height and weight of a person are related, and taller
people tend to be heavier than shorter people.
59