Linear Algebra _ Vectors(2-D, 3-D, n-D) _ Row Vector _ Column Vector _ Applied AI Course

**Understanding Distance Between Points**

The distance between two points can be calculated using various methods depending on the dimensionality of the space. In 2D, we learn that the distance between two points A (1, 1) and B (1, -1) is simply the absolute value of the difference in their y-coordinates, which is |1 - (-1)| = 2. Similarly, for 3D, if we have two points P(1, 2, 3) and Q(B1, B2, B3), the distance between them can be written as √(A1 - B1)^2 + (A2 - B2)^2 + (A3 - B3)^2. This concept is a direct extension of the Pythagorean theorem in higher dimensions.

**Vector Notation**

In linear algebra, vectors are represented using notation that makes calculations easier. A vector can be either a row vector or a column vector. A row vector is written with its elements on one side of an arrow, while a column vector has its elements on top. For example, the vector a = [1, 2, 3] is written as [1, 2, 3]^T, which means it's a row vector with three columns. On the other hand, the vector b = [4, 5, 6] is written as [4; 5; 6], which indicates that it has one row and three columns.

**Matrices**

Matrices are another fundamental concept in linear algebra. A matrix is typically represented as a double array of arrays, where each inner array represents a row of the matrix. The number of rows in a matrix is denoted by m, and the number of columns is denoted by n. When we write a matrix with m rows and n columns, we use the notation M × n to indicate this. For example, the matrix [1 2; 3 4] represents a matrix with two rows and two columns.

**Column Vectors**

A column vector is a special type of vector that has one row and multiple columns. The number of rows in a column vector is always 1, while the number of columns can vary. If we have a vector B = [B1, B2, ...], we can represent it as n × 1, where n represents the number of elements in the vector.

**Row Vectors**

Similarly, a row vector is a special type of vector that has multiple rows and one column. The number of columns in a row vector is always 1, while the number of rows can vary. If we have a vector a = [a1, a2, ...], we can represent it as 1 × n, where n represents the number of elements in the vector.

**Matrix Operations**

Matrices are used to perform various operations such as addition, multiplication, and inversion. Matrix addition involves adding corresponding elements of two matrices element-wise, while matrix multiplication involves multiplying corresponding elements of two matrices. Inversion involves finding a matrix that, when multiplied by the original matrix, results in the identity matrix.

**Conclusion**

In conclusion, understanding distance between points, vector notation, and matrices are fundamental concepts in linear algebra. These concepts form the basis of various mathematical operations and have numerous applications in physics, engineering, computer science, and other fields.

"WEBVTTKind: captionsLanguage: enone of the very basic concepts in linear algebra is a concept of a point or a vector so let me explain it to you with with with simple coordinate geometry that you might have learned in your 10th grade or even in your eleventh or twelfth grades so let's assume I have a coordinate system like this let's assume this is my x-axis and this is my y-axis right just just for generality what I will say is instead of saying x-axis and y-axis I'll call this X 1 axis and I will call this X 2 axis from going forward from the one right because the problem is if I have five axis what will their name them XYZ WK so I would rather say X 1 X 2 X 3 X 4 X 5 right so let's assume these are my two axis and if I have a point here right geometrically speaking this is a 2d surface this is a this is a 2d coordinate system let's say you have a point P here how do I represent this point I represent this point with two values the first value corresponding to how far away is this point so I basically draw these two points so this point is let's say two units away from my origin this is my origin origin is basically 0 comma 0 where your X X X 1 axis value is 0 and X 2 axis value is 0 so here I would say this point has my x coordinate as 2 and my y coordinate could be 3 right so this is how I represent a point I represent a point basically using a vector so I can write my P to be a vector 2 dimensional vector right this is a two dimensional vector right so I write my P to be a two dimensional vector with components two and three just note that that knowledge that I'm using this is called the component of a vector this is called the x1 component and this is called the X 2 component of your vector now what if I want to represent a point in three-dimensional space for example I have 3d space like this I have X 1 axis I have X 2 axis and have X 3 axis suppose there is a point here right this point Q now can be represented using a vector of size 3 let's assume it is 2 units away from X 1 3 units away from X 2 and let's say five units away then I can represent my Q with a vector of size 3 right so a three dimensional point can be represented with a vector of size three with each component corresponding to how far away's it origin on that component right now the immediate question that I get is how do this is this is a two dimensional point and this is a three dimensional point okay it's a three dimensional point what about an n dimensional point what if I what how do I represent an N dimensional find because I promised you that linear algebra is all about taking a learnings from 2d and 3d and extending it to n dimensional spaces right so given any point suppose if I have a point X I can represent it in n dimensions with with n components right I could have 2 3 4 1 5 so on so forth if I have n values if I have n values here it will represent upon an N dimensional point in an N dimensional space so this is a two dimensional space this is a 2d space right this is a 3d space of course all three of them are perpendicular of course we can't visualize a for T space or a Phi T space but mathematically I can write a point in n dimensional space by using n components here right so this this is this is very simple this is a very simple idea of what a point is now the next immediate question here is what is the distance what is the distance of a point from origin right so what is the distance of a point distance of a point from origin we learnt all these simple ideas in coordinate geometry probably in your high school right let's take 2d right we'll always learn a concept in 2d and 3d annexin into higher dimensional space let's assume I have two dimensions X 1 X 2 imagine if I have a point here alright with components a and B what does that mean that means that this length is a and this length is being right now what is it what is a distance oh and this is the origin right this is my origin so what is this length this is nothing but the length of or the distance this is this distance D is nothing but distance between origin right endpoint P right this this distance and what what will that distance be if you just simply apply Pythagoras theorem this length is B right this length is a so what is D D is nothing but a square plus B square under root simple Pythagoras theorem right this this comes by just applying your simple Pythagoras theorem okay this is this is including what about 3d in 3d I can have the same argument suppose if I have x1 x2 and x3 and if I have a point here but if I have a point P which has three components ABC right again by simply using pythagoras theorem i can prove that the distance of this point from origin let's call this D the distance of this point here in this case is nothing but okay let's call this P - and D - just for simplicity your D - is nothing but a square plus B square plus C square again this you can prove very simply very easily using using pythagoras theorem multiple terms right now my immediate question is this is this is what it is in 2d right this is what it is in 3d what I put nd if I have an N dimensional point right what is the distance of that point from origin the distance is nothing but so let's assume I have an N dimensional point with a 1 as the distance from distance from as a first component so I will take a 1 square a 2 square so on so forth a n square if my point if my point B is a 1 a 2 a 3 so on and so forth am right if a point is if my point P is has components a1 a2 a3 am in the distance of this point from origin is nothing but a1 square plus a2 square so on so forth a and square underhook so what we have learnt in 2d and 3d we can easily extend it to n dimensional space right as a promise to you this is what linear algebra provides you as a basic tool now the next important concept that we'll see is distance between two points right distance between two points so let's say again let's let's learn it in 2d first then we'll extend it to 3d and then to n dimensional spaces right so let's say humi let's assume i have two axis x1 and x2 and have two points P and Q right let's assume P has a 1 and a 2 and Q has B 1 and B 2 as their as a respective components now I want to find the distance between these two points right I want to find this D and I can find that D if you remember your basic coordinate geometry this D is nothing but a 1 minus B 1 square plus a 2 minus B 2 square under root again this you can easily prove using using using pythagoras theorem let me show you how right so what is this distance this distance is nothing but this distance Plus this distance square right if this is perpendicular and what is this distance this distance is nothing but on x-axis you have B 1 as this fine you have a 1 this distance is nothing but B 1 minus a 1 sorry I should have yeah it's basically saying B 1 minus a 1 square or a 1 minus B 1 square is just 1 on the same now this is nothing but a 2 minus B 2 this is this height right now your distance between these two points is nothing but a 1 - B 1 square plus a 2 minus B 2 square like this a similar thing in 3d if you have two points P which is a 1 a 2 a 3 and your point Q which is a B 1 B 2 and B 3 the distance between P and Q write the distance between P and Q if it is D I can write it simply a square root of a 1 minus B 1 square plus a 2 minus B 2 square plus a 3 minus B 3 Square just on the root of all of that like this again you can prove using basic Pythagoras theorem by applying it multiple times similarly in nd space if you have two points P and Q such that P Oh point P is a 1 a 2 so on so forth a.m. and point Q is B 1 B 2 so on B M we can write the distance between P and Q the distance between P and Q can be written as square root of AI minus bi square right and I'll submit this from I equals to 1 to M I've just written in a more concise form basically I am taking each a 1 minus B 1 squaring it plus a 2 minus B 2 square and I'm instead of writing it in like this expanded form I've just written with the summation notation right so this is nothing but square root of this so again this is between two points same idea that we learnt in 2d and 3d we're extending 2 ND through a linear algebra when we learn our basics of energy but this is what we do we will learn a concept in 2d and 3d and extend it to haider let's learn some simple terminology and notation here so we have two concepts one is called a row vector the other is called a column vector column vector suppose if I write my vector as a row where I have elements let's say I have a vector a and I write it as a 1 a 2 a 3 so on so forth in let's assume it is a it is a vector which has components right then we write when we write it like this it basically has one row and n columns like first column second column third column so on so 14th column so when we have something like this we write as a subscript we write it as 1 into n this represents the number of rows and this represents the number of columns some of you have studied matrices in your 11th grade or 12th grade will easily understand this rotation right so typically what I write is I write a 1 Cross n as soon as I see this I know that my vector a actually has one row and n columns right when a vector has only one row it's called our ho vector similarly for a column vector suppose if I have a vector B suppose you have a vector B and if I have components B 1 B 2 so on so forth B n right now it has n rows first row second row zones of what n rows but it has only one column so I will represent this as n cross 1 where n represents the number of rows again and 1 represents the number of columns so if I write a vector like a column I can write given given a vector right given an array I can write it as a either as a row vector or a column vector right we'll see how these are useful I just I'm just explaining some notation here and how do how do so if somebody gives it says be n cross 1 I immediately understand that this is a column vector because it has n rows and only one column right ok just extending this idea matrices are typically represented as a M cross n so if I have a matrix here with n M rows 1 2 so on so forth M rows and if have n columns 1 2 3 so on so forth and columns this is called a matrix of cross of size m cross n we can think of matrices as double array as a as basically a array of arrays right double array of arrays for those of you who are from computer science background those of you are from other backgrounds might have come across what a matrix is in your high school or even in your undergrad it's a very very simple and straightforward concept so what you represent here as a subscript basically tells you how many rows and how many columns existone of the very basic concepts in linear algebra is a concept of a point or a vector so let me explain it to you with with with simple coordinate geometry that you might have learned in your 10th grade or even in your eleventh or twelfth grades so let's assume I have a coordinate system like this let's assume this is my x-axis and this is my y-axis right just just for generality what I will say is instead of saying x-axis and y-axis I'll call this X 1 axis and I will call this X 2 axis from going forward from the one right because the problem is if I have five axis what will their name them XYZ WK so I would rather say X 1 X 2 X 3 X 4 X 5 right so let's assume these are my two axis and if I have a point here right geometrically speaking this is a 2d surface this is a this is a 2d coordinate system let's say you have a point P here how do I represent this point I represent this point with two values the first value corresponding to how far away is this point so I basically draw these two points so this point is let's say two units away from my origin this is my origin origin is basically 0 comma 0 where your X X X 1 axis value is 0 and X 2 axis value is 0 so here I would say this point has my x coordinate as 2 and my y coordinate could be 3 right so this is how I represent a point I represent a point basically using a vector so I can write my P to be a vector 2 dimensional vector right this is a two dimensional vector right so I write my P to be a two dimensional vector with components two and three just note that that knowledge that I'm using this is called the component of a vector this is called the x1 component and this is called the X 2 component of your vector now what if I want to represent a point in three-dimensional space for example I have 3d space like this I have X 1 axis I have X 2 axis and have X 3 axis suppose there is a point here right this point Q now can be represented using a vector of size 3 let's assume it is 2 units away from X 1 3 units away from X 2 and let's say five units away then I can represent my Q with a vector of size 3 right so a three dimensional point can be represented with a vector of size three with each component corresponding to how far away's it origin on that component right now the immediate question that I get is how do this is this is a two dimensional point and this is a three dimensional point okay it's a three dimensional point what about an n dimensional point what if I what how do I represent an N dimensional find because I promised you that linear algebra is all about taking a learnings from 2d and 3d and extending it to n dimensional spaces right so given any point suppose if I have a point X I can represent it in n dimensions with with n components right I could have 2 3 4 1 5 so on so forth if I have n values if I have n values here it will represent upon an N dimensional point in an N dimensional space so this is a two dimensional space this is a 2d space right this is a 3d space of course all three of them are perpendicular of course we can't visualize a for T space or a Phi T space but mathematically I can write a point in n dimensional space by using n components here right so this this is this is very simple this is a very simple idea of what a point is now the next immediate question here is what is the distance what is the distance of a point from origin right so what is the distance of a point distance of a point from origin we learnt all these simple ideas in coordinate geometry probably in your high school right let's take 2d right we'll always learn a concept in 2d and 3d annexin into higher dimensional space let's assume I have two dimensions X 1 X 2 imagine if I have a point here alright with components a and B what does that mean that means that this length is a and this length is being right now what is it what is a distance oh and this is the origin right this is my origin so what is this length this is nothing but the length of or the distance this is this distance D is nothing but distance between origin right endpoint P right this this distance and what what will that distance be if you just simply apply Pythagoras theorem this length is B right this length is a so what is D D is nothing but a square plus B square under root simple Pythagoras theorem right this this comes by just applying your simple Pythagoras theorem okay this is this is including what about 3d in 3d I can have the same argument suppose if I have x1 x2 and x3 and if I have a point here but if I have a point P which has three components ABC right again by simply using pythagoras theorem i can prove that the distance of this point from origin let's call this D the distance of this point here in this case is nothing but okay let's call this P - and D - just for simplicity your D - is nothing but a square plus B square plus C square again this you can prove very simply very easily using using pythagoras theorem multiple terms right now my immediate question is this is this is what it is in 2d right this is what it is in 3d what I put nd if I have an N dimensional point right what is the distance of that point from origin the distance is nothing but so let's assume I have an N dimensional point with a 1 as the distance from distance from as a first component so I will take a 1 square a 2 square so on so forth a n square if my point if my point B is a 1 a 2 a 3 so on and so forth am right if a point is if my point P is has components a1 a2 a3 am in the distance of this point from origin is nothing but a1 square plus a2 square so on so forth a and square underhook so what we have learnt in 2d and 3d we can easily extend it to n dimensional space right as a promise to you this is what linear algebra provides you as a basic tool now the next important concept that we'll see is distance between two points right distance between two points so let's say again let's let's learn it in 2d first then we'll extend it to 3d and then to n dimensional spaces right so let's say humi let's assume i have two axis x1 and x2 and have two points P and Q right let's assume P has a 1 and a 2 and Q has B 1 and B 2 as their as a respective components now I want to find the distance between these two points right I want to find this D and I can find that D if you remember your basic coordinate geometry this D is nothing but a 1 minus B 1 square plus a 2 minus B 2 square under root again this you can easily prove using using using pythagoras theorem let me show you how right so what is this distance this distance is nothing but this distance Plus this distance square right if this is perpendicular and what is this distance this distance is nothing but on x-axis you have B 1 as this fine you have a 1 this distance is nothing but B 1 minus a 1 sorry I should have yeah it's basically saying B 1 minus a 1 square or a 1 minus B 1 square is just 1 on the same now this is nothing but a 2 minus B 2 this is this height right now your distance between these two points is nothing but a 1 - B 1 square plus a 2 minus B 2 square like this a similar thing in 3d if you have two points P which is a 1 a 2 a 3 and your point Q which is a B 1 B 2 and B 3 the distance between P and Q write the distance between P and Q if it is D I can write it simply a square root of a 1 minus B 1 square plus a 2 minus B 2 square plus a 3 minus B 3 Square just on the root of all of that like this again you can prove using basic Pythagoras theorem by applying it multiple times similarly in nd space if you have two points P and Q such that P Oh point P is a 1 a 2 so on so forth a.m. and point Q is B 1 B 2 so on B M we can write the distance between P and Q the distance between P and Q can be written as square root of AI minus bi square right and I'll submit this from I equals to 1 to M I've just written in a more concise form basically I am taking each a 1 minus B 1 squaring it plus a 2 minus B 2 square and I'm instead of writing it in like this expanded form I've just written with the summation notation right so this is nothing but square root of this so again this is between two points same idea that we learnt in 2d and 3d we're extending 2 ND through a linear algebra when we learn our basics of energy but this is what we do we will learn a concept in 2d and 3d and extend it to haider let's learn some simple terminology and notation here so we have two concepts one is called a row vector the other is called a column vector column vector suppose if I write my vector as a row where I have elements let's say I have a vector a and I write it as a 1 a 2 a 3 so on so forth in let's assume it is a it is a vector which has components right then we write when we write it like this it basically has one row and n columns like first column second column third column so on so 14th column so when we have something like this we write as a subscript we write it as 1 into n this represents the number of rows and this represents the number of columns some of you have studied matrices in your 11th grade or 12th grade will easily understand this rotation right so typically what I write is I write a 1 Cross n as soon as I see this I know that my vector a actually has one row and n columns right when a vector has only one row it's called our ho vector similarly for a column vector suppose if I have a vector B suppose you have a vector B and if I have components B 1 B 2 so on so forth B n right now it has n rows first row second row zones of what n rows but it has only one column so I will represent this as n cross 1 where n represents the number of rows again and 1 represents the number of columns so if I write a vector like a column I can write given given a vector right given an array I can write it as a either as a row vector or a column vector right we'll see how these are useful I just I'm just explaining some notation here and how do how do so if somebody gives it says be n cross 1 I immediately understand that this is a column vector because it has n rows and only one column right ok just extending this idea matrices are typically represented as a M cross n so if I have a matrix here with n M rows 1 2 so on so forth M rows and if have n columns 1 2 3 so on so forth and columns this is called a matrix of cross of size m cross n we can think of matrices as double array as a as basically a array of arrays right double array of arrays for those of you who are from computer science background those of you are from other backgrounds might have come across what a matrix is in your high school or even in your undergrad it's a very very simple and straightforward concept so what you represent here as a subscript basically tells you how many rows and how many columns exist\n"