This is the slide deck to the first part of the "Fundamental math concepts" that one must understand before getting into Data Science in a honest to goodness way. This training covers fundamentals of calculus and linear algebra.
The second training covers probability and statistics and slightly advanced concepts in Linear Algebra and Calculus.
The third training covers math for various techniques like PCA / SVM, Neural Networks etc.
2. Intros and warm-up
• How many lines pass through a single point?
• How many lines pass through 2 distinct points?
• How many points form a line?
• What are Collinear points ?
• What are non-collinear points?
• To define a plane you need at least __ ______
points ?
• How many planes pass through a line?
• What is a line segment?
7. Try plotting following:
𝑥
𝑥2
𝑥3
log(𝑥)
𝑎 𝑥
See the effect of
shifting and
scaling on each of
these
• 𝑥 − 1 2
, 𝑥 + 𝑎 2
,
• 3𝑥2
, 𝑎𝑥2
Play with sliders
for the parameter
Plot Functions
https://www.desmos.com/calcul
ator
8. General Equation of Line
• 2 points define a line (Euclid)
• Slope of a line : m
• Intercept on y-axis : c
𝑦 = 𝑚𝑥 + 𝑐
11. What determines the shape of a function?
The direction in which tracer moves as we
move from one end of the x axis to the
other.
To get a sense of direction, we can choose
any 2 points on the curve and compute the
Shape of a Function
12. Rate of Change
• Slope indicates the rate of change
• 2 close points on the function
• Derivative = Slope of the tangent drawn
to a function at a point
• Formal definition
lim
ℎ→0
𝑓 𝑥 + ℎ − 𝑓(𝑥)
ℎ
13. Find the derivative of :
𝑓 𝑥 = 𝑥2
using the definition of derivatives
𝑓 𝑥 = 𝑥3
14. Derivative of Sum
𝑦(𝑥) = 𝑓 𝑥 + 𝑔(𝑥)
𝑑𝑦
𝑑𝑥
=
𝑑𝑓
𝑑𝑥
+
𝑑𝑔
𝑑𝑥
Derivative of sum is equal to sum of
derivatives
18. Exponential functions
•Lets say there’s mutual fund that doubles your
investment every year. You start with an
investment of 1$. Value as a function of time is?
𝑣 = 2 𝑡
•What is the rate of growth at any given time?
𝑑𝑣
𝑑𝑡
=
𝑑
𝑑𝑡
2 𝑡
19. Applications
Regression
• Hypothesize a relationship.
• Define a cost function
• find parameters that minimize the cost
Revenue Optimization
• Find the price for which revenue is
optimal
20. Integrals
• Example 1: Area of the circle
Sum of areas of the concentric strips
• Example 2: Distance covered.
• Area under the curve
• Definite Integral - Concept
• Definite Integral as the limit of the
sum
22. What are vectors?
•Vectors in physics:
•Arrows floating in space ex. Force, Velocity,
Displacement etc.
•Computer Science idea:
•List of numbers
•Generalizing the concept
•Arrows rooted at origin with the numbers
representing the walk along each direction
23. FundamentalVector
Operations•Adding Vectors
•Multiply by a constant number.
•Or in other words scale a vector
•Hence the multiplier is called scalar
•In fact every vector in 2 dimensions is the
result of an addition of 2 scaled unit vectors.
24. Some terminology
• Basis vectors
• Span of the vectors
• If third vector is a linear combination of the
2 vectors you are trapped into the same flat
sheet
•In other words, including scaled version of one
/ both the vectors as a third vector doesn’t give
you access to any new vectors (or even when
the third vector is got by scaling and adding the
2 vectors)
25. Linearly Dependent
VectorsWhenever you can remove a vector from the
set of vectors, without reducing the span, we
say they are linearly dependent vectors
Technical definition of basis vectors for a
given space – set of linearly independent
vectors that span that space
26. The single most important concept in
linear algebra that was never taught !!
•What is a matrix?
•set of vectors defining where each unit vector
lands
27. The single most important concept in
linear algebra that was never taught !!
•What do we mean when we say that Matrices
are Linear transformations?
•Transformations: Stretching, squishing,
rotation , flipping of space
•Linear
• Origin remains fixed in place
• All lines remain lines
In general keeping grid lines parallel and evenly
spaced
29. Matrix multiplication ≡
function composition
• If you apply M1 on A, then apply M2 on the
result it is the same as applying
M3 (=M1M2) on A
• Matrix multiplication is not commutative
M1M2 ≠ M2M1
• Matrix multiplication is associative
(M1M2)M3 = M1(M2M3)
30. Determinant
•Determinant of a matrix corresponds to the
area enclosed by the by the parallelogram
(parallelepiped) formed by the vectors in the
matrix
•i-hat and j-hat form a square of area 1
Thus determinant is nothing but the amount by
which the area scales when the space is
transformed by the given matrix
31. Determinant
•Interpretation of the negative value of the
determinant
•In 3 dimensions?
• the determinant of a transformation is the
volume of the parallelepiped enclosed by the 3
vectors in the that space.
•What happens in 1 dimension?
32. System of linear equations
•2𝑎 + 3𝑏 + 𝑐 = 5
•3𝑎 + 4𝑏 + 6𝑐 = 8
•5𝑎 + 3𝑏 + 9𝑐 = 3
Can these be represented as a matrix?
𝐴𝑥 = 𝑣
33. Inverse of a Matrix
A x = v
•Which means we are looking for a vector x
which was transformed by A into v
•To find x we can apply another
transformation B on Ax that reverses the
effect of A on x. i.e. it transforms v to back to
x.
•Since B reverses the effect of A , it called A
inverse, notation: A-1
34. Rank of a matrix
•Finding the transformation A-1 is possible when
determinant is non-zero
•When determinant is zero, the number of dimensions in
the output vector is less than the number of dimensions in
the input vector
•Rank of a transformation is the number of dimensions in
the output vector.
•Thus if the rank of the matrix is less than the number of
dimensions of the input vector it won’t be possible to find
the inverse of the transformation
35. What about non-square
matrices?
•3x2 matrix transforms a vector from 2
dimensions to 3 dimensions
•2x3 matrix transforms a vector from 3
dimensions to 2 dimensions
36. Dot Products
•Numerically is just multiplying the respective
coordinates and adding the result.
•Geometrically it is equivalent to projecting one
vector (v) onto the span of another vector (w) and
multiplying the magnitude of the projection (of v on
w) with the magnitude of w
37. Cross Products
•Numerically:
• v x w
| i-hat v1 w1 |
• Det | j-hat v2 w2 |
| k-hat v3 w3 |
•Geometrically:
•Cross-product is a vector with magnitude equal
to the area of the parallelogram enclosed by v
and w pointing in a direction perpendicular to v
and w as suggested by the right-hand-rule.
38. Eigen Values and Eigen
Vectors
•In case of some transformations, there exist
some vectors which are not knocked off from
their span, they are only scaled as a result of
the transformation –
•these are Eigen Vectors
39. Eigen Values and Eigen
Vectors
•The amount by which each Eigen vector gets
scaled (after transformation) is its Eigen
Value
•For a transformation A, if there exists a
vector v and scalar λ such that
𝐴 𝑣 = 𝜆 𝑣
Then v is called the Eigen Vector and λ is the
corresponding Eigen value
House keeping announcements:
We have 41 people participating in the workshop – more is the number of people longer it takes to understand – effectively you get less than your money’s worth
Thus, pay attention !!
Don’t get distracted and don’t distract others
Please be on time after each break !
Euclidean Rapid Fire
What is Pi? A greek letter? Yes .. It is!
Measurements.
Number Lines visualization. Draw 4 volunteers – 2 each holding out 2 number lines.
Try to cover rotations through various angles like 45, 30, 60 .. Try to use sin(theta), cos (theta) etc.Shear, flip and squishing to one line
Try to cover rotations through various angles like 45, 30, 60 .. Try to use sin(theta), cos (theta) etc.Shear, flip and squishing to one line
Average growth rate in the 4th year: 2^4 – 2^3 = $ 8 per year
Average growth rate in the 4th year: 2^5 – 2^ 4 = $ 16 per year.
It might be tempting to say that 𝑑𝑦 𝑑𝑡 = 2 𝑡
What is the growth in 1 month, 1 week, 1 day, 1 second ?
Calculations by hand for smaller and smaller values of h for lim ℎ→0 (2 ℎ −1) ℎ
Trivia about how calculus came into beingDistance covered by the car example.. Etymology of the word Integral.Integral as the anti-derivative.
Fundamental theorem of calculus
How to identify all points in 2 dimensional space.
Scaling of an organization
Basis vectors
We can choose any 2 distinct vectors to be the basis vectors and still represent each point in 2 dimensional space uniquely
i.e. we can represent every possible vector using the scalars
Only thing is that we get different values compared to i-hat and j-hat
If you fix one of those scalars and let the other one change freely, the tip of the second vector draws a straight line.
If you let both the scalars move freely – 3 things can happen
You cover every point in space
When the 2 vectors fall on same line you cover only points on the line
or when you can get one vector is a scalar multiple of the other.
When both your scalars are zero - You remain stuck at the origin!
The set of all possible vectors you can reach with a linear combination of given pair of vectors is called the Span of those 2 vectors
Start: talk about Transformation of space after 1End:Thus given any vector we can find out where it lands in the transformed space
In other words, a linear transformation of a 2-d space is completely described by just 4 numbers – the coordinates where i-hat lands and the coordinates where j-hat lands
End:Thus given any vector we can find out where it lands in the transformed space
In other words, a linear transformation of a 2-d space is completely described by just 4 numbers – the coordinates where i-hat lands and the coordinates where j-hat lands
Try to cover rotations through various angles like 45, 30, 60 .. Try to use sin(theta), cos (theta) etc.Shear, flip and squishing to one line
Non –commutative
At 2 Case of the transformation with zero determinant
At 2 Case of the transformation with zero determinant
End with - There is still a way to find the inverse in some cases. But that’s beyond the scope of discussion here
Illustrate using rubber bands
Perform the stretching squishing activity with 2 strong volunteers!
Transformation | 3 1 || 0 2 |
A v = λ I v
(A-λI) v = 0
The diagonal elements of
Transformation | 3 1 || 0 2 |
A v = λ I v
(A-λI) v = 0
The diagonal elements of