Linear Algebra _ Equation of a line (2-D) _ Plane(3-D) _ Hyperplane (n-D) _ Applied AI Course

### Article: Understanding Vectors and Hyperplanes in Linear Algebra

#### Introduction

In the realm of linear algebra, vectors and hyperplanes are fundamental concepts that form the basis for understanding higher-dimensional spaces. This article delves into the intricacies of these mathematical constructs, exploring their definitions, properties, and applications across various dimensions.

#### Understanding Vectors

A vector is a mathematical entity that possesses both magnitude and direction. In the context of linear algebra, vectors are often represented as arrows in space, where the length of the arrow corresponds to the magnitude, and its orientation represents the direction.

In two-dimensional (2D) space, a vector can be visualized as an arrow on a plane, defined by its components along the x-axis and y-axis. For instance, a vector \( \mathbf{v} \) in 2D can be written as:

\[

\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \end{bmatrix}

\]

where \( v_1 \) is the component along the x-axis, and \( v_2 \) is the component along the y-axis.

In three-dimensional (3D) space, vectors extend this concept with an additional component along the z-axis:

\[

\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix}

\]

Generalizing to n-dimensional space, a vector \( \mathbf{v} \) can be represented as:

\[

\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix}

\]

where \( v_i \) represents the component along the \( i^{th} \) axis.

#### Hyperplanes in Higher Dimensions

A hyperplane is a generalization of the concept of a line (in 2D) and a plane (in 3D) to higher-dimensional spaces. In n-dimensional space, a hyperplane can be defined as the set of all points \( \mathbf{x} \) that satisfy the equation:

\[

\mathbf{w}^T \mathbf{x} + b = 0

\]

where:

- \( \mathbf{w} \) is a vector perpendicular to the hyperplane (often referred to as the normal vector).

- \( \mathbf{x} \) is a point in n-dimensional space.

- \( b \) is a scalar.

This equation can be rewritten in a more intuitive form as:

\[

\mathbf{w}^T (\mathbf{x} + \mathbf{c}) = 0

\]

where \( \mathbf{c} \) represents the shift of the hyperplane from the origin. If \( b = 0 \), the hyperplane passes through the origin.

#### Geometric Interpretation of Hyperplanes

The geometric interpretation of a hyperplane is closely tied to its normal vector \( \mathbf{w} \). The normal vector determines the orientation of the hyperplane in space and is perpendicular to every vector lying on the hyperplane.

For example, consider a line in 2D space. The equation of the line can be written as:

\[

w_1 x + w_2 y + b = 0

\]

Here, \( \mathbf{w} = [w_1, w_2] \) is the normal vector to the line, and it determines the angle at which the line is inclined relative to the axes.

In 3D space, a plane can be represented as:

\[

w_1 x + w_2 y + w_3 z + b = 0

\]

Again, \( \mathbf{w} = [w_1, w_2, w_3] \) is the normal vector to the plane.

#### Applications of Hyperplanes

Hyperplanes have numerous applications in various fields, including machine learning, computer vision, and optimization. One prominent application is in the classification of data points. In machine learning, for instance, a hyperplane can be used to separate two classes of data points in a high-dimensional space (a process known as linear classification).

For example, consider a dataset in 2D space with two classes of points:

- Class A: \( (x_1, y_1) \)

- Class B: \( (x_2, y_2) \)

A hyperplane can be used to classify these points by finding a line that separates them. If the line is given by:

\[

w_1 x + w_2 y + b = 0

\]

then all points on one side of the line belong to Class A, and those on the other side belong to Class B.

#### Conclusion

Vectors and hyperplanes are essential tools in linear algebra that provide a framework for understanding and manipulating high-dimensional spaces. By generalizing the concepts of lines and planes to higher dimensions, we can tackle complex problems in fields like machine learning and computer vision with greater ease and precision.

Through this exploration, we have seen how vectors define directions in space and how hyperplanes serve as boundaries or separators in these spaces. As we delve deeper into linear algebra, these concepts will form the foundation for more advanced topics, such as eigenvalues, eigenvectors, and transformations.

#### References

1. Strang, G. (2016). *Introduction to Linear Algebra*. Wellesley-Cambridge Press.

2. Axler, S. (2015). *Linear Algebra Done Right*. Springer.

3. Boyd, S., & Vandenberghe, L. (2008). *Convex Optimization*. Cambridge University Press.

#### Further Reading

- Linear Transformations: A deeper dive into how vectors and hyperplanes are transformed in space.

- Eigenvalues and Eigenvectors: Understanding the intrinsic properties of linear transformations.

- Applications of Hyperplanes: Exploring real-world applications in machine learning and computer vision.

"WEBVTTKind: captionsLanguage: ensince we just learned about the pint or a vector let's go slightly ahead and understand the next big idea called a line right it may not sound very big but let's see let's see let's see how the idea transpired when we look at 2d 3d and high dimensional spaces so let's look at what a 2d plane is right suppose if this is your X 1 axis and this is your X 2 axis let's say a line here right if you remember your tenth grade math or level grade math we always wrote our line as y equals to MX plus C right if this was X if my X 1 is X if my X 2 is y I I could write my y equals MX plus C where m is the slope and C is the intercept on y-axis right this is one one equation of line that we already call and remember there's an other equation of line called ax plus B y plus C equals to zero this is called the general form of an equation for line and they both are equivalent you can prove it because by just rewriting this equation slightly I can write it as y equals 2 minus C by B minus a by B X right in such a case what happens is this becomes your C here right and your M is nothing but this term here alright so this is called this is called the general form of general equation or the general form of a line right will stick to this will stick to this notation because it's easier to interpret and this is much more general right if if my axes are X 1 and X 2 I can rewrite this equation as a times X 1 plus B times X 2 plus C equals to 0 instead of using ABC let me use a different notation because if you want to do it in 10 dimensions how would I write it I don't have to use all the alphabet for all these 100 dimensions I don't have enough alphabets so I'll read it as I can write as W 1 X 1 plus W 2 X 2 plus W 0 equals to 0 so I made instead of am writing W 1 instead of B I am writing W 2 instead of see I'm writing W 0 right this is the equation of a line in 2d right what I put 3d some of you might have learned 3d coordinate geometry in undergrad first year math course or probably sit in some cases even undergrad second year math courses right for those of you who don't recall it if I have three axes right if I have my axis as X 1 X 2 and X 3 the equivalent of a line so line is a linear surface in 2d the equivalent idea of a line in 3d is a plane right and the equation of a plane for those of you who might remember it looks like used use looks like this ax plus B y plus cz Plus D equals to 0 this is this this is an equation that some of you may be familiar with because you took a math course in your undergrad first um second layer let just generalize it what this looks like is w 1 X 1 plus W 2 X 2 plus W 3 X 3 plus W 0 equals to 0 this is the equation of a of a linear surface this is the equation of a plane this is a claim right this is a line the idea the equivalent idea of a line in 2d is plane so line in 2d is nothing but plane in 3d now the immediate question is what about n-dimensional space what is it called it's called something called a hyper plane hyper plane is basically a generalization of the concept of a line or a plane to two higher dimension space because if you think you line is called a linear surface because it separates your whole region with with a with a simple linear structure like a line or a plane into two regions one region on one side of the line the other region on the other side of the line similarly a plane can separate your 3d surface your 3d volume into two regions one above the plane and one below the plane right so the immediate question is what is the equation of a plane in in n dimensions suppose if I have n dimensions what the equation of a hyperplane you could have easily understood that by just looking at the form of this this is story this is 3d now just let's extend it and see what will it be in nd in nd it will be W 0 plus W 1 X 1 plus W 2 X 2 so on so forth since we have n dimensions W and X n equals to 0 this is the equation of an n-dimensional hyperplane now the immediate question we get is this is too cumbersome to write right is there a more concise way of do it but of course there is we can use summation here summation I equals to 1 to M wi x i equals to 0 right now is there a better way to write this still further this is still good this is certainly much more concise way of writing the equation of a hyperplane in n-dimensional space then writing out this whole expression there's a there's a slightly more interesting way of doing it which is I can write it as W 0 plus imagine if I create a vector right W this vector I'll call it W so those of you who remember how to multiply two vectors or multiply matrices you'll quickly recognize this let's assume I have W 1 W 2 so on so forth W n here imagine if I have X 1 X 2 so on so forth X n here this is this is nothing but a vector notation this is nothing but a vector notation this is nothing but a summation notation right I'm just I'm not changing any formula here I'm just changing the notation slightly so what does this product look like so when you when you multiply this vector with this vector those of you who have studied basic matrices and matrix multiplication probably in your lemons grade or 12th grade you'll easily recognize this so this is nothing but W 0 plus the first component here gets multiplied with the first component here right which is nothing but W 1 X 1 and then you add take the second component multiplied with the second component which is w 2 X - and so on so forth take your last component multiply to the last component which is W n XM equals to zero so this is a vector notation of writing it and you use this notation a lot with immediately after this section we'll understand what is the dot product and we and we'll write this in a much more concise form using vector notation now this vector I can since since this vector I can think of this as a vector W I can think of this as a vector X write this vector X has n rows right it has n rows and it has only one column this vector W has one row and it has n columns right so if you recall the vector the the matrix multiplication so you can multiply 1 Cross n with n cross 1 to get 1 cross 1 matrix so those of you who remember simple matrix multiplication will quickly understand that what we have here is nothing but a simple matrix multiplication of a row vector with a column vector right so this is this is how we represent a claim we look at a plane or hyperplane in n-dimensional space we look at many properties of lines and planes in the next few videos just a while ago we realized that the equation of a plane in any n dimensional space is w 0 plus a vector w like this where you have W 1 W 2 so on so forth of W n multiplied by a vector like this X 1 X 2 if you have n dimensional space xn equals to 0 so I just told you a while ago that given any vector if I write a vector W by default it's a column vector if I say I have a vector W which is which is of n dimensions by default the default convention is this is just for simplicity to to avoid confusion between whether a given vector is row vector or a column vector so the default notation is that I have n rows and 1 column so if I write a vector X of n dimensions I'm just writing a vector here okay let me define a bunch of vectors I've defined a vector which is of size M cross 1 let's be very specific I'm also defining a vector X of size n cross 1 where I have X 1 X 2 so on so forth xn right now using this using my W and X which are n dimensional column vectors how can I write this equation little more concisely right I can write it as W 0 plus w transpose x equals to 0 let's digest this my W 0 I've just copied w 0 asses since where W is a column vector I need to convert it into a row vector because this is a row vector right and how do I convert a column vector to a row vector I just apply the transpose part so your W transpose is nothing but will give you a row vector like this and your X is a column vector which is exactly like this so what I have here in a clumsy format I've just concisely written it as W 0 plus w transpose x equals to 0 of course where my W is a column vector with W 1 W 2 W and column W n components and similarly my X is a column vector with X 1 X 2 X and Goffman's so if you write the equation of a plane again planes are typically written with a capital PI right when you write pi pi here doesn't mean your 3.1415 pi so how do you represent an unknown value in algebra you write it with X right so planes are typically written as pi ok so a plane PI in any dimensional space can be written as W 0 plus w transpose x equals to 0 if your W is is an N cross 1 matrix and if your X is an N cross 1 vector or matrix of vector then this is the equation of a plane in n-dimensional space right you can write PI n to D to denote that this is an n dimensional plane if you choose to now the immediate question I have here is all this looks beautiful but this w 0 is still hanging around here what does it exactly mean so let's let us understand what W 0 actually is so it go to a two-dimensional geometry because that's why we can easily understand things and we can take whatever we learn from 2d into a higher dimensional space so we'll always learn ideas in 2d and take it in two nd using linear algebra that's is the part of linear algebra I can't I can I'm when I first learned about it I couldn't stop like stop thinking about how beautiful and how powerful it is now let's take let's say I have two axes X 1 and X 2 and I have a line like this my equation of the line let's say John I wrote it as y equals to MX plus C right where X 1 is your X Y or X 2 is your Y now what is M M is nothing but the slope of this line M is nothing but the slope of this line right M is nothing but the slope of this line and C is nothing but C is called the y-intercept see is this point on y-axis where does my line L where does my line L intersect the y-axis that is called my C it is called the y-intercept my C is called y-intercept right and my M is nothing but the slope of my line right now now if I write the general equation of a line let's so off of a 2d line right so general equation of a 2d line that we saw earlier is w 1 X 1 plus W 2 X 2 plus W 0 equals to 0 now let me just rearrange the terms here and I can write it as X 2 equals to minus W 0 by W 2 minus W 1 by W 2 X 1 right now what's happening here this is nothing but my C right this is nothing but my this is nothing but my C this is nothing but my Y right and this part is nothing but my M and my X 1 is nothing but X right now if a plane is past if a line is passing through origin okay so if Allah if this line L if line is passing through origin if it's passing through origin what what happens to C C becomes 0 right because this line would have so imagine that we had a line which was passing through origin what it's y-intercept 0 right let's say you have a line L - if it's passing through origin the C is zero and if C has to be zero your W 0 has to be 0 because C is nothing but minus W 0 by W 2 and if C is 0 if C equals to 0 that implies in my general form in my general notation here in my general notation or the general equation of a line that implies that my W 0 equals to 0 so what we learn from this is this is a general equation of a line but if I have to write the equation of a line that is passing through origin ok suppose if I have to write suppose I have a line L passing through origin passing through origin into D ok what will its equation be by just making my W 0 equal to 0 what will my equation remain my equation will remind W 1 X 1 plus W 2 X 2 equals to 0 what about 3 D same terminology my W 0 basically becomes W 2 X 2 plus W 3 X 3 equals to 0 in 3d it becomes a plane of course right this is a line and in higher dimensions it becomes a hyperplane right in the n-dimensional space what does this become this becomes nothing but W 1 X 1 plus W 2 X 2 so on so forth WN xn equals to 0 which is nothing but w transpose x equals to 0 this is a very very concise way of writing the equation of a line of a plane sorry this equate this is an equation of a plane of course this plane is passing through origin this is an equation of a plane passing through origin if it's not passing through origin then the equation of the plane will be W transpose X plus W 0 equals to 0 ok so this is the equation of a line not passing through origin if it is passing through origin it's nothing but w transpose x equals to 0 such an elegant term so using you the concept of a transpose using the concept of matrix of vector multiplication we wrote the equation of any dimensional hyper plane within a very very concise very very elegant form of course you have to add the w0 term if it's not passing through origin now let's understand the equation of a plane in a new way using using a slightly different geometric interpretation so let's assume I have a plane pi it's an n-dimensional plane and this plane passes through origin which means it's equation will be w transpose x equals to 0 where w is nothing but a column vector with w1 w2 so on so forth WN and X is also a column vector corresponding to your n dimensions right now if this is the equation of plane let's try to interpret it slightly differently forget about the fact that this is these this is an equation of a plane just for a second let's assume W and X are two vectors right we know of that W dot X is nothing but W transpose X and we know that W dot X is also can can also be written as the length of W the length of X and cos theta where theta is the angle between W and X right so here instead of looking at W and X as as part of an equation I'm just looking at W and X as two vectors this is this is the beauty of linear algebra so W is just I can think of it as an n-dimensional point so is X an n-dimensional fine so if these are two points if W and X are two points in an n-dimensional space let's assume this is W and let's assume this is X this is the angle between them theta right we said that this is equal to 0 for a plane right this is the equation of a plane w transpose x equals to 0 so the moment this is equal to 0 you know that your theta the angle between your W and X becomes 90 degrees right we discuss this red if W is perpendicular to X then w transpose x equals to 0 and that implies that the you theta between w and x equals to 90 degrees right with this connect let's let's understand a different way of interpreting this equation suppose I have a plane okay I'll write this plane a spy of course I don't want to draw a three dimensional plane so since a lie-in plane or a hyper plane everything is a linear surface just for simplicity I'll draw it like this instead of drawing a plane because this is easy to interpret and easy to understand because it's a two-dimensional surface on which I am drawing things drawing a line is much easier let's say you'll this is origin we said this plane is passing through origin right let's assume this is origin okay let's assume this is any point x1 on this plane right now we know that W is perpendicular so let's assume W is like this let's assume W is a vector like this which is perpendicular to plane I'll connect all the dots please bear with me now if W is a vector which is perpendicular to your plane and an at at origin let's assume W is a is a is a vector which is perpendicular to your plane pi passing through origin just for simplicity now let's assume X 1 is a vector X 1 is a point right a point can be thought of as a vector right now since these two vectors W and X 1 are perpendicular W dot X 1 equals to 0 so for any point on this plane if you take any point on this plane right if W if W is perpendicular to this plane then W dot x1 equals to 0 and that's what we are calling the equation of the plane so if instead of this X if I replace any point on the plane right instead of this X here if I replace it with any point on the plane then my W transpose X equals to zero because my if my W so if if W is perpendicular to my plane then W transpose X I so then then W dot X I equals to 0 for all X I which belong to my plane let me read it in English again if W is perpendicular to my plane file then W dot X I will be 0 for all X I belonging to plane right this how it's always important to read equations in English that simplifies things for us now having said that one way to interpret interpret this equation one way to interpret your w transpose x equals to zero equation is that you have a plane PI which is passing through origin and W is nothing but a vector which is perpendicular to your plane okay this is one way of interpreting what W is this is a very simple and elegant interpretation of W because till now we didn't explain what W is geometrically we just we just derived this W from your ax plus B Y plus C equals to 0 type of equation in 2d but we never said what does W actually mean geometrically so what W means geometrically is nothing but it's a vector which is perpendicular to this plane at at origin that's important ok so one thing that people often represent W is so because whether I have W or the unit vector W what is the unit vector W unit vector W is nothing but W by the length of W right so because instead of W let's assume I have unit vector W even then my W dot any X I he will be 0 for all X I belonging to my plane right oftentimes a plane pie is represented with a vector with a unit vector W cap oftentimes it is written as W okay it's represented with a unit vector which is perpendicular to the plane as long as of course we are assuming here fundamentally that this plane passes through origin for simplicity we often assume that our planes pass through origin just for generality because in coordinate geometry we know that I think so for example let's assume I my line doesn't pass through origin okay I can change my axis right I can change my axis light like it shift my axis slightly and make it pass through origin Drake I can just I'll keep my y-axis Isis I can just shift my X 1 axis slightly up right this is called shifting of the axis and make it pass through origin so just for generality and for simplicity we assume that our planes typically pass through origin so that the the equation form of it is much simpler to digest and so if it doesn't pass average and I just have to write W transpose X plus W 0 equals to 0 so I'm avoiding this for simplicity let's assume all of our planes from now on pass through origin unless I specifically say otherwise ok so the geometric interpretation of your W is nothing but it's it's a vector which is perpendicular to your plane so in 3d if this is if this was your plane I just draw it for simplicity and if this was origin right your plane so your W is a vector like this which is perpendicular to all the points which is perpendicular to all the points on this plane okay so the same the Mac Mac just works even when you go into 2d 3d for DND that's the beauty of it as a as I kept repeating myselfsince we just learned about the pint or a vector let's go slightly ahead and understand the next big idea called a line right it may not sound very big but let's see let's see let's see how the idea transpired when we look at 2d 3d and high dimensional spaces so let's look at what a 2d plane is right suppose if this is your X 1 axis and this is your X 2 axis let's say a line here right if you remember your tenth grade math or level grade math we always wrote our line as y equals to MX plus C right if this was X if my X 1 is X if my X 2 is y I I could write my y equals MX plus C where m is the slope and C is the intercept on y-axis right this is one one equation of line that we already call and remember there's an other equation of line called ax plus B y plus C equals to zero this is called the general form of an equation for line and they both are equivalent you can prove it because by just rewriting this equation slightly I can write it as y equals 2 minus C by B minus a by B X right in such a case what happens is this becomes your C here right and your M is nothing but this term here alright so this is called this is called the general form of general equation or the general form of a line right will stick to this will stick to this notation because it's easier to interpret and this is much more general right if if my axes are X 1 and X 2 I can rewrite this equation as a times X 1 plus B times X 2 plus C equals to 0 instead of using ABC let me use a different notation because if you want to do it in 10 dimensions how would I write it I don't have to use all the alphabet for all these 100 dimensions I don't have enough alphabets so I'll read it as I can write as W 1 X 1 plus W 2 X 2 plus W 0 equals to 0 so I made instead of am writing W 1 instead of B I am writing W 2 instead of see I'm writing W 0 right this is the equation of a line in 2d right what I put 3d some of you might have learned 3d coordinate geometry in undergrad first year math course or probably sit in some cases even undergrad second year math courses right for those of you who don't recall it if I have three axes right if I have my axis as X 1 X 2 and X 3 the equivalent of a line so line is a linear surface in 2d the equivalent idea of a line in 3d is a plane right and the equation of a plane for those of you who might remember it looks like used use looks like this ax plus B y plus cz Plus D equals to 0 this is this this is an equation that some of you may be familiar with because you took a math course in your undergrad first um second layer let just generalize it what this looks like is w 1 X 1 plus W 2 X 2 plus W 3 X 3 plus W 0 equals to 0 this is the equation of a of a linear surface this is the equation of a plane this is a claim right this is a line the idea the equivalent idea of a line in 2d is plane so line in 2d is nothing but plane in 3d now the immediate question is what about n-dimensional space what is it called it's called something called a hyper plane hyper plane is basically a generalization of the concept of a line or a plane to two higher dimension space because if you think you line is called a linear surface because it separates your whole region with with a with a simple linear structure like a line or a plane into two regions one region on one side of the line the other region on the other side of the line similarly a plane can separate your 3d surface your 3d volume into two regions one above the plane and one below the plane right so the immediate question is what is the equation of a plane in in n dimensions suppose if I have n dimensions what the equation of a hyperplane you could have easily understood that by just looking at the form of this this is story this is 3d now just let's extend it and see what will it be in nd in nd it will be W 0 plus W 1 X 1 plus W 2 X 2 so on so forth since we have n dimensions W and X n equals to 0 this is the equation of an n-dimensional hyperplane now the immediate question we get is this is too cumbersome to write right is there a more concise way of do it but of course there is we can use summation here summation I equals to 1 to M wi x i equals to 0 right now is there a better way to write this still further this is still good this is certainly much more concise way of writing the equation of a hyperplane in n-dimensional space then writing out this whole expression there's a there's a slightly more interesting way of doing it which is I can write it as W 0 plus imagine if I create a vector right W this vector I'll call it W so those of you who remember how to multiply two vectors or multiply matrices you'll quickly recognize this let's assume I have W 1 W 2 so on so forth W n here imagine if I have X 1 X 2 so on so forth X n here this is this is nothing but a vector notation this is nothing but a vector notation this is nothing but a summation notation right I'm just I'm not changing any formula here I'm just changing the notation slightly so what does this product look like so when you when you multiply this vector with this vector those of you who have studied basic matrices and matrix multiplication probably in your lemons grade or 12th grade you'll easily recognize this so this is nothing but W 0 plus the first component here gets multiplied with the first component here right which is nothing but W 1 X 1 and then you add take the second component multiplied with the second component which is w 2 X - and so on so forth take your last component multiply to the last component which is W n XM equals to zero so this is a vector notation of writing it and you use this notation a lot with immediately after this section we'll understand what is the dot product and we and we'll write this in a much more concise form using vector notation now this vector I can since since this vector I can think of this as a vector W I can think of this as a vector X write this vector X has n rows right it has n rows and it has only one column this vector W has one row and it has n columns right so if you recall the vector the the matrix multiplication so you can multiply 1 Cross n with n cross 1 to get 1 cross 1 matrix so those of you who remember simple matrix multiplication will quickly understand that what we have here is nothing but a simple matrix multiplication of a row vector with a column vector right so this is this is how we represent a claim we look at a plane or hyperplane in n-dimensional space we look at many properties of lines and planes in the next few videos just a while ago we realized that the equation of a plane in any n dimensional space is w 0 plus a vector w like this where you have W 1 W 2 so on so forth of W n multiplied by a vector like this X 1 X 2 if you have n dimensional space xn equals to 0 so I just told you a while ago that given any vector if I write a vector W by default it's a column vector if I say I have a vector W which is which is of n dimensions by default the default convention is this is just for simplicity to to avoid confusion between whether a given vector is row vector or a column vector so the default notation is that I have n rows and 1 column so if I write a vector X of n dimensions I'm just writing a vector here okay let me define a bunch of vectors I've defined a vector which is of size M cross 1 let's be very specific I'm also defining a vector X of size n cross 1 where I have X 1 X 2 so on so forth xn right now using this using my W and X which are n dimensional column vectors how can I write this equation little more concisely right I can write it as W 0 plus w transpose x equals to 0 let's digest this my W 0 I've just copied w 0 asses since where W is a column vector I need to convert it into a row vector because this is a row vector right and how do I convert a column vector to a row vector I just apply the transpose part so your W transpose is nothing but will give you a row vector like this and your X is a column vector which is exactly like this so what I have here in a clumsy format I've just concisely written it as W 0 plus w transpose x equals to 0 of course where my W is a column vector with W 1 W 2 W and column W n components and similarly my X is a column vector with X 1 X 2 X and Goffman's so if you write the equation of a plane again planes are typically written with a capital PI right when you write pi pi here doesn't mean your 3.1415 pi so how do you represent an unknown value in algebra you write it with X right so planes are typically written as pi ok so a plane PI in any dimensional space can be written as W 0 plus w transpose x equals to 0 if your W is is an N cross 1 matrix and if your X is an N cross 1 vector or matrix of vector then this is the equation of a plane in n-dimensional space right you can write PI n to D to denote that this is an n dimensional plane if you choose to now the immediate question I have here is all this looks beautiful but this w 0 is still hanging around here what does it exactly mean so let's let us understand what W 0 actually is so it go to a two-dimensional geometry because that's why we can easily understand things and we can take whatever we learn from 2d into a higher dimensional space so we'll always learn ideas in 2d and take it in two nd using linear algebra that's is the part of linear algebra I can't I can I'm when I first learned about it I couldn't stop like stop thinking about how beautiful and how powerful it is now let's take let's say I have two axes X 1 and X 2 and I have a line like this my equation of the line let's say John I wrote it as y equals to MX plus C right where X 1 is your X Y or X 2 is your Y now what is M M is nothing but the slope of this line M is nothing but the slope of this line right M is nothing but the slope of this line and C is nothing but C is called the y-intercept see is this point on y-axis where does my line L where does my line L intersect the y-axis that is called my C it is called the y-intercept my C is called y-intercept right and my M is nothing but the slope of my line right now now if I write the general equation of a line let's so off of a 2d line right so general equation of a 2d line that we saw earlier is w 1 X 1 plus W 2 X 2 plus W 0 equals to 0 now let me just rearrange the terms here and I can write it as X 2 equals to minus W 0 by W 2 minus W 1 by W 2 X 1 right now what's happening here this is nothing but my C right this is nothing but my this is nothing but my C this is nothing but my Y right and this part is nothing but my M and my X 1 is nothing but X right now if a plane is past if a line is passing through origin okay so if Allah if this line L if line is passing through origin if it's passing through origin what what happens to C C becomes 0 right because this line would have so imagine that we had a line which was passing through origin what it's y-intercept 0 right let's say you have a line L - if it's passing through origin the C is zero and if C has to be zero your W 0 has to be 0 because C is nothing but minus W 0 by W 2 and if C is 0 if C equals to 0 that implies in my general form in my general notation here in my general notation or the general equation of a line that implies that my W 0 equals to 0 so what we learn from this is this is a general equation of a line but if I have to write the equation of a line that is passing through origin ok suppose if I have to write suppose I have a line L passing through origin passing through origin into D ok what will its equation be by just making my W 0 equal to 0 what will my equation remain my equation will remind W 1 X 1 plus W 2 X 2 equals to 0 what about 3 D same terminology my W 0 basically becomes W 2 X 2 plus W 3 X 3 equals to 0 in 3d it becomes a plane of course right this is a line and in higher dimensions it becomes a hyperplane right in the n-dimensional space what does this become this becomes nothing but W 1 X 1 plus W 2 X 2 so on so forth WN xn equals to 0 which is nothing but w transpose x equals to 0 this is a very very concise way of writing the equation of a line of a plane sorry this equate this is an equation of a plane of course this plane is passing through origin this is an equation of a plane passing through origin if it's not passing through origin then the equation of the plane will be W transpose X plus W 0 equals to 0 ok so this is the equation of a line not passing through origin if it is passing through origin it's nothing but w transpose x equals to 0 such an elegant term so using you the concept of a transpose using the concept of matrix of vector multiplication we wrote the equation of any dimensional hyper plane within a very very concise very very elegant form of course you have to add the w0 term if it's not passing through origin now let's understand the equation of a plane in a new way using using a slightly different geometric interpretation so let's assume I have a plane pi it's an n-dimensional plane and this plane passes through origin which means it's equation will be w transpose x equals to 0 where w is nothing but a column vector with w1 w2 so on so forth WN and X is also a column vector corresponding to your n dimensions right now if this is the equation of plane let's try to interpret it slightly differently forget about the fact that this is these this is an equation of a plane just for a second let's assume W and X are two vectors right we know of that W dot X is nothing but W transpose X and we know that W dot X is also can can also be written as the length of W the length of X and cos theta where theta is the angle between W and X right so here instead of looking at W and X as as part of an equation I'm just looking at W and X as two vectors this is this is the beauty of linear algebra so W is just I can think of it as an n-dimensional point so is X an n-dimensional fine so if these are two points if W and X are two points in an n-dimensional space let's assume this is W and let's assume this is X this is the angle between them theta right we said that this is equal to 0 for a plane right this is the equation of a plane w transpose x equals to 0 so the moment this is equal to 0 you know that your theta the angle between your W and X becomes 90 degrees right we discuss this red if W is perpendicular to X then w transpose x equals to 0 and that implies that the you theta between w and x equals to 90 degrees right with this connect let's let's understand a different way of interpreting this equation suppose I have a plane okay I'll write this plane a spy of course I don't want to draw a three dimensional plane so since a lie-in plane or a hyper plane everything is a linear surface just for simplicity I'll draw it like this instead of drawing a plane because this is easy to interpret and easy to understand because it's a two-dimensional surface on which I am drawing things drawing a line is much easier let's say you'll this is origin we said this plane is passing through origin right let's assume this is origin okay let's assume this is any point x1 on this plane right now we know that W is perpendicular so let's assume W is like this let's assume W is a vector like this which is perpendicular to plane I'll connect all the dots please bear with me now if W is a vector which is perpendicular to your plane and an at at origin let's assume W is a is a is a vector which is perpendicular to your plane pi passing through origin just for simplicity now let's assume X 1 is a vector X 1 is a point right a point can be thought of as a vector right now since these two vectors W and X 1 are perpendicular W dot X 1 equals to 0 so for any point on this plane if you take any point on this plane right if W if W is perpendicular to this plane then W dot x1 equals to 0 and that's what we are calling the equation of the plane so if instead of this X if I replace any point on the plane right instead of this X here if I replace it with any point on the plane then my W transpose X equals to zero because my if my W so if if W is perpendicular to my plane then W transpose X I so then then W dot X I equals to 0 for all X I which belong to my plane let me read it in English again if W is perpendicular to my plane file then W dot X I will be 0 for all X I belonging to plane right this how it's always important to read equations in English that simplifies things for us now having said that one way to interpret interpret this equation one way to interpret your w transpose x equals to zero equation is that you have a plane PI which is passing through origin and W is nothing but a vector which is perpendicular to your plane okay this is one way of interpreting what W is this is a very simple and elegant interpretation of W because till now we didn't explain what W is geometrically we just we just derived this W from your ax plus B Y plus C equals to 0 type of equation in 2d but we never said what does W actually mean geometrically so what W means geometrically is nothing but it's a vector which is perpendicular to this plane at at origin that's important ok so one thing that people often represent W is so because whether I have W or the unit vector W what is the unit vector W unit vector W is nothing but W by the length of W right so because instead of W let's assume I have unit vector W even then my W dot any X I he will be 0 for all X I belonging to my plane right oftentimes a plane pie is represented with a vector with a unit vector W cap oftentimes it is written as W okay it's represented with a unit vector which is perpendicular to the plane as long as of course we are assuming here fundamentally that this plane passes through origin for simplicity we often assume that our planes pass through origin just for generality because in coordinate geometry we know that I think so for example let's assume I my line doesn't pass through origin okay I can change my axis right I can change my axis light like it shift my axis slightly and make it pass through origin Drake I can just I'll keep my y-axis Isis I can just shift my X 1 axis slightly up right this is called shifting of the axis and make it pass through origin so just for generality and for simplicity we assume that our planes typically pass through origin so that the the equation form of it is much simpler to digest and so if it doesn't pass average and I just have to write W transpose X plus W 0 equals to 0 so I'm avoiding this for simplicity let's assume all of our planes from now on pass through origin unless I specifically say otherwise ok so the geometric interpretation of your W is nothing but it's it's a vector which is perpendicular to your plane so in 3d if this is if this was your plane I just draw it for simplicity and if this was origin right your plane so your W is a vector like this which is perpendicular to all the points which is perpendicular to all the points on this plane okay so the same the Mac Mac just works even when you go into 2d 3d for DND that's the beauty of it as a as I kept repeating myself\n"