Linear Algebra for Machine Learning — Transcript
Full transcript
- 0:00this in-depth course provides a
- 0:02comprehensive exploration of all
- 0:03critical linear algebra Concepts
- 0:06necessary for machine learning you'll
- 0:09learn the mathematical foundations to
- 0:11excel in AI tdiv from lunar Tech
- 0:15developed this course she has created
- 0:18many popular machine learning courses
- 0:20machine learning is at the Forefront of
- 0:22the Innovation powering the most
- 0:24advanced and transformative systems for
- 0:27the companies like apple Tesla Netflix
- 0:30Amazon open Ai and many others it
- 0:33enables the creation of the intelligent
- 0:35systems that can predict Trends
- 0:38personalized user experience and
- 0:40automate complex tasks to develop these
- 0:44practical applications a deep
- 0:46understanding of the underlying
- 0:47mechanics is important this requires a
- 0:50solid grasp of mathematics behind the
- 0:53machine learning so all these technical
- 0:55details with a particular focus on
- 0:58linear algebra
- 1:00this all-encompassing course explores
- 1:03the linear algebra in an interactive and
- 1:06machine learning Focus manner welcome to
- 1:08the linear algebra for machine learning
- 1:10course you will acquire the critical
- 1:13principles needed to build optimize and
- 1:16analyze sophisticated machine learning
- 1:18models from designing customer
- 1:20algorithms to enhancing curent
- 1:23Technologies this course provides the
- 1:25mathematical foundations with vital
- 1:28interest for the those for pioneering
- 1:31advancements in machine learning for
- 1:33those dedicated to mastering the
- 1:35mathematical aspect and the technical
- 1:37details behind machine learning our
- 1:40extensive 26 plus hour course of
- 1:43fundamentals of machine learning within
- 1:45the mathematics boot camp as well as a
- 1:47separate course offers an in-depth
- 1:50exploration this extensive program
- 1:53includes certification and is tailored
- 1:55for individuals that are serious about
- 1:58advancing their career in the field of
- 2:00machine learning Andi engineering this
- 2:03crash course in mathematics will serve
- 2:06you as a great starting point by
- 2:08establishing a robust foundation in
- 2:11linear algebra you will be well prepared
- 2:13to excel as machine learning
- 2:15practitioner equipped with the
- 2:17mathematical knowledge that drives the
- 2:20Innovation and efficiency in this field
- 2:23so if you're ready I'm really excited
- 2:26and without further Ado let's get
- 2:28started welcome to the course on the
- 2:31fundamentals of linear algebra presented
- 2:34by Lun Tech Academy my name is D Vasan
- 2:38and today we are going to start with
- 2:39some basic concepts that are important
- 2:42for understanding linear algebra linear
- 2:45algebra is one of the most applicable
- 2:46areas of mathematics it is used by pure
- 2:49mathematicians that you will see in a
- 2:52universities doing research publishing
- 2:54research papers but also by the
- 2:56mathematically trained scientists of all
- 2:58disciplines this is really one of those
- 3:01areas in mathematics that you will see
- 3:03time and time again appearing in your
- 3:06professional life if you want to become
- 3:09a job ready data scientist or you want
- 3:11to do some handson machine learning deep
- 3:15learning and AI stuff but also linear
- 3:17algebra is used in cryptology it is used
- 3:20in cyber security and in many other
- 3:22areas of computer science and artificial
- 3:25intelligence so if you want to become
- 3:28this well-rounded professional you want
- 3:30to go beyond using libraries and you
- 3:33want to truly understand the uh
- 3:36mathematics and the technical side of
- 3:38these different machine learning
- 3:39algorithms from very basic ones like
- 3:41linear regression to most complex ones
- 3:44coming from Deep learning like
- 3:45architectures in neural network how the
- 3:47optimization algorithms work how the
- 3:50gradient descent works and all these
- 3:52other different methods and models then
- 3:54you are in the right place because you
- 3:56must know linear algebra such that you
- 3:59will understand these different concepts
- 4:01from very basic ones to most advanced
- 4:04ones in data science machine learning
- 4:07deep learning artificial intelligence
- 4:09data analytics but also in many other
- 4:13applied science
- 4:14disciplines so before starting this
- 4:17comprehensive course that will give you
- 4:19everything that you need to know about
- 4:21linear algebra first I'm going to tell
- 4:23you what we assume that you already know
- 4:26because linear algebra it comes from
- 4:28about third PA of Bachelors of different
- 4:31highly technical studies and here we are
- 4:35assuming that you already know certain
- 4:38Concepts so to ensure that this course
- 4:41stays really on the topic of linear
- 4:43algebra and that you understand all
- 4:46these Concepts really well for that we
- 4:49need to be able to know different topics
- 4:53so before we dive into this Concepts
- 4:55let's familiarize ourselves with the
- 4:57basic prerequisites and notation used
- 5:00throughout this course and you will
- 5:02really need to know this in order to
- 5:05understand these Concepts really well
- 5:06such that instead of memorizing you'll
- 5:09actually just hear me once or maybe
- 5:11twice and then every time you hear later
- 5:14on or you see it in the papers or in
- 5:16some algorithms you will recognize this
- 5:18is something that we already
- 5:20learned so some key prerequisites
- 5:23overview is here first of all to fully
- 5:26grasp the upcoming material you should
- 5:28be familiar with some basic concept like
- 5:30real numbers Vector spaces so you don't
- 5:33need to know this idea of vectors though
- 5:36you already most likely are familiar
- 5:39with this given that you know how to
- 5:41plot different lines you know the idea
- 5:44of exes and wise and how to plot these
- 5:47different graphs but here we are going
- 5:50to touch base on this every time when we
- 5:52come close to these Concepts I will
- 5:53refresh you your memory and we will go
- 5:56through this numbers the idea of norms
- 5:59and distance measures because when it
- 6:01comes to the vectors when it comes to
- 6:03the magnitude and all these different
- 6:05topics that we are going to discuss as
- 6:07part of linear algebra knowing the what
- 6:10Norm is and what is the definition of
- 6:13distance what is the length between two
- 6:16points when we plot it into
- 6:18two-dimensional space or
- 6:19three-dimensional space those are all
- 6:22very basic concept that usually use as
- 6:24part of a basic pre-algebra or just
- 6:27common algebra courses and lessons in
- 6:30order to truly understand what the new
- 6:33algebra is about to understand the
- 6:35direction of vectors the angle and then
- 6:38the dimensionality reduction how linear
- 6:41algebra is applied for instance in
- 6:42different algorithms in machine learning
- 6:44deep learning data science statistics
- 6:47you really need to understand this
- 6:48Cartesian coordinate system so this is
- 6:51not only important for linear algebra
- 6:54but I assume you already know it given
- 6:56that you have passed those other courses
- 6:58like calcul or usually they are covered
- 7:01as part of pre-algebra or algebra so the
- 7:04cartisian coordinate system I mean here
- 7:07understanding what is for instance the
- 7:09the common description of them for
- 7:11instance when you when we write like X
- 7:14and then y on the vertical axis and then
- 7:16we can we have here zero and then we can
- 7:20always plot this different plots you
- 7:22know we have a clear understanding what
- 7:24is this Y is equal to X line we
- 7:27understand how by knowing certain points
- 7:29we can plot different plots for instance
- 7:32that this is the Y is equal to X line
- 7:34that here it means that if we have here
- 7:37one then this is just one two this is
- 7:39two so we understand when we have the
- 7:42function of the line and we have a
- 7:44certain value at is our y coordinate or
- 7:47x coordinate then the corresponding
- 7:49coordinate can be found then you also
- 7:52need to know some basic things that I
- 7:55just didn't mention right now so for
- 7:57instance that the numbers here can be
- 7:59like 1 2 three up to Infinity so you
- 8:02understand this concepts of infinity and
- 8:04then here the same story then here we
- 8:07have minus one you know minus two uh and
- 8:11then this is then used later on and we
- 8:15will be pouch basing this one we will be
- 8:18describing our vectors and how we can
- 8:21visualize our vectors either two
- 8:23dimensional space like we have here
- 8:25because this is two dimensional so we
- 8:26have X and Y but we can also of course
- 8:29visualize it in three-dimensional
- 8:32Etc so this idea of basic coordinate
- 8:35system is really important usually
- 8:37covered as part of algebra if not
- 8:40pre-algebra then we have basic triog
- 8:43genetry which means that you need to
- 8:45have a clear understanding what sinus is
- 8:47what cosine is what tangent is and their
- 8:49reciprocals and here I mean that you
- 8:52know for instance what is cosine
- 8:54function what is s function you know
- 8:57that you have an understanding
- 9:00for instance that what is this line you
- 9:02know whether it's a sinus line or cosine
- 9:05line you have also an understanding what
- 9:08this Pi is one thing that I didn't
- 9:11mention but it it just goes around all
- 9:13these topics some basic things that you
- 9:16understand what is X what is y why we
- 9:19use them and this idea of
- 9:22variables and also you need to
- 9:25understand this idea of square or you
- 9:28know 90
- 9:30degree angle and then Pythagoras Theorem
- 9:33here we have the same so what is this
- 9:35relationship between different sides of
- 9:37a triangle that is a very unique
- 9:40triangle and that has one of the angles
- 9:43as 90° and this idea of you know the
- 9:48sides how this relates to the sinus
- 9:50cosinus tangent cotangent and also how
- 9:53the Pythagorean Pythagorean theorem
- 9:55applies when we have triangular but it
- 9:59is is no longer with angle that is 90°
- 10:02what is the sum of all the angles of
- 10:05triangle so those are basic stuff that
- 10:07are com commonly covered as part of
- 10:10trigonometric lessons or part of General
- 10:15geometry then another prerequisite is
- 10:18this understanding of identities and
- 10:21equations in triog genometric lessons
- 10:24something part of which I already
- 10:25covered and this is goes around of basic
- 10:29having a basic un uh understanding of
- 10:31algebra and geometry those are super
- 10:33important to understand more Advanced
- 10:35Techniques from linear algebra then we
- 10:38have finally this idea of orthogonality
- 10:40perpendicularity in vectors so this also
- 10:43comes from geometry and from a
- 10:46trigonometric lessons so you understand
- 10:49that if we have for instance the two
- 10:51lines that don't have any intersections
- 10:53then we are talking about two orthogonal
- 10:56lines and otherwise for instance if we
- 10:58have and the two lines like this then we
- 11:01are talking about perpendicular vectors
- 11:05when you have two lines that are
- 11:06actually parallel so they don't have any
- 11:09intersection and you won't find any
- 11:11point that is common for the two so when
- 11:14it comes to this R so as part of real
- 11:17numbers and Vector spaces R represents
- 11:20the set of all real numbers so you can
- 11:22be dealing with for instance an integers
- 11:25like 1 2 three this can Al this will
- 11:27also cover all the negative numbers like
- 11:29-1 - 2 - 3 but also the floting numbers
- 11:34like 1. 223 and all the other numbers
- 11:39that you can think of those are the set
- 11:41of all real
- 11:43numbers so this is in one dimensional
- 11:45space right so you can see that I'm
- 11:47writing just one number you know two
- 11:50three and other numeric numbers then we
- 11:53have the idea of R2 R3 up to RN where
- 11:57now all these numbers they represent
- 11:59represent in this case the N it
- 12:01represents the N dimensional aidian
- 12:04space so when it comes to this idea of n
- 12:08dimensional numbers so for instance
- 12:12R2 here we just mean 2D plane so I'm
- 12:16pretty sure you are familiar with this
- 12:17idea of for instance
- 12:19xais and Y AIS here we are dealing with
- 12:23two dimensional plane so for every point
- 12:27that we can find here we can describe
- 12:29them by assigning them a value X so
- 12:32coordinate X and a coordinate y that's
- 12:36exactly what we mean by saying that the
- 12:39number can be represented in a 2d plane
- 12:42so here we are dealing with this two
- 12:44dimensional space this is our two
- 12:47dimensional Elan space and every number
- 12:50in
- 12:51here that is part of this R2 can be
- 12:55pictured here can be represented in this
- 12:57visualization so for instance if I have
- 13:00this number and let's assume that the
- 13:02value on the x-axis is two and we can
- 13:07see here that the corresponding Y is
- 13:08zero I can describe this number which I
- 13:11will call a I can describe this by
- 13:13writing down first the x coordinate
- 13:16which is two and then the y-coordinate
- 13:18which is zero so I'm then saying that a
- 13:21which is a point with x coordinate 2 and
- 13:24y coordinate Z it is part of my R2
- 13:29and it's part of my two dimensional
- 13:31alian space when it comes to R3 similar
- 13:35thing we can do with that only in that
- 13:36case we need not just x axis and y AIS
- 13:40but we need to add our third
- 13:42dimension so here for instance when it
- 13:45comes to the r
- 13:48Tre then we need to do y AIS we need to
- 13:53have xaxis but also we need to have some
- 13:57Z axis so
- 13:59such that every time every point in the
- 14:03space we can then describe by x y and
- 14:08Zed
- 14:09coordinates so if we write it in terms
- 14:12of the vector something that we will see
- 14:14very soon as part of our first unit of
- 14:17this course we will then need to
- 14:19represent every number in this
- 14:21three-dimensional Alan Space by writing
- 14:23down first the x coordinate let's say
- 14:25one and then y coordinate let's say
- 14:28another one and then Z coordinate which
- 14:30is one or even better even easier let's
- 14:33use 0 0 0 which means that we are
- 14:36dealing with this initial number which
- 14:38is the center of this three-dimensional
- 14:40Alan space when it comes to the N
- 14:44dimensional or the higher dimensional
- 14:46spaces it's much harder to visualize
- 14:49therefore usually when it comes to
- 14:52visualizations we do usually we usually
- 14:54only visualize the onedimensional two
- 14:57dimensional and thre dimensional spaces
- 14:59above then it just no longer does make
- 15:01sense to visualize it but we definitely
- 15:04deal with them and they are part of
- 15:07Applied linear
- 15:10algebra so understanding this spaces is
- 15:13very important for analyzing vectors for
- 15:16their interactions and this holds not
- 15:19just for this two-dimensional and
- 15:20three-dimensional but really for
- 15:23multidimensional
- 15:27spaces let's now quickly Define this
- 15:29idea of Norm so the norm of a vector
- 15:32denoted by this V which you can see kind
- 15:35of like similar to the absolute value
- 15:38from
- 15:39pre-algebra you can see here that we
- 15:41have this double straight lines like
- 15:44from absolute value then we have the
- 15:47name of the vector or the variable name
- 15:49that we are assigning to our vector and
- 15:52then you might notice here on the top of
- 15:54this this Arrow this basically says that
- 15:58we are deing not with just a variable
- 16:01but really we are dealing with a vector
- 16:04this is really important because you can
- 16:05see that there makes a huge difference
- 16:08if we have for instance just V or V1 I
- 16:11have to say or just V those are really
- 16:14important and things that you need to
- 16:16keep in mind when it comes to Leading
- 16:18your algebra and trying to differentiate
- 16:20vectors from a
- 16:22point you will notice that when it comes
- 16:24to Norm we can represented it either by
- 16:29this notation or this usually it's a
- 16:32common notation in machine learning or
- 16:34in data science with this two bars and
- 16:38when we do this we automatically also
- 16:41know that we are dealing with aladine
- 16:43distance we call it also L2 norm and
- 16:47this is something very common and
- 16:49usually used as part of
- 16:52retrogression which is an application of
- 16:55linear algebra and it's used in
- 16:57regularization so we are regularizing
- 17:00our machine learning algorithms so when
- 17:02you get into machine learning you will
- 17:04see time and time again this notation so
- 17:07next time when you see this then you
- 17:08know automatically that you are dealing
- 17:10with L2 norm and L2 Norm which is also
- 17:13used a lot in machine learning it is
- 17:16referring to the usage of L2 Norm to uh
- 17:20in the retrogression and retrogression
- 17:23or L2 regularization is a very popular
- 17:27regularization techniques as part of
- 17:29machine learning so right now even you
- 17:32can see this intersection or linear
- 17:34algebra or this idea of norms in machine
- 17:39learning all right so now let's see why
- 17:42we call it actually L2 Norm or often
- 17:46referred as Eline distance so Eline
- 17:50distance you can see here which is also
- 17:52the in this case this V which describes
- 17:56the norm of the vector v is equ Al to
- 17:59square roof and then we have all these
- 18:01coordinates assuming that the vector
- 18:03comes from an N dimensional space so you
- 18:05can see here the RN the V Vector the
- 18:09idian distance or the norm of this
- 18:12vector v is equal to square roof and
- 18:14then V1 2 plus vs2 S Plus and all this
- 18:18in between numbers plus VN squ so here
- 18:22basically it means take square root of
- 18:25V1 2 V2 S Plus plus V3 2 blah blah blah
- 18:31plus VN s so basically take all the
- 18:36units that form this vector and then so
- 18:39are on this vector and use them Square
- 18:43them and then add them and then take the
- 18:45square root of that that's the distance
- 18:48or I have to say the norm of this Vector
- 18:52so why this is important this idea of
- 18:54norms and equity in distance beside of
- 18:56being used in machine learning and why
- 18:58is it used
- 18:59so Norms they provide a way to measure
- 19:01the size or the length of a vector in
- 19:03Vector spaces which means that when we
- 19:06want to measure a distance a similarity
- 19:10relationship between for instance
- 19:12vectors then it becomes much easier to
- 19:15use this idea an Elan distance is not
- 19:18only used in regularization techniques
- 19:21like L2 regularization or retrogression
- 19:24but it's also used in other machine
- 19:27learning or deep learning Al items as a
- 19:29way to measure the distance or the
- 19:31relationship or the similarity between
- 19:34two different entities those can be
- 19:36variables those can be two people that
- 19:38we want to compare in our algorithm or
- 19:41two entities um for instance the Norms
- 19:45or the Al and distance they are also
- 19:47used as part of K me algorithm something
- 19:50that you might have heard and if you
- 19:51follow later on the machine learning and
- 19:53the clustering section of machine
- 19:55learning you will see that Alan distance
- 19:57is used as part of C's algorithm that
- 20:00aims to Cluster observations into
- 20:02different groups so this also yet
- 20:04another highly applicable uh topic that
- 20:07you must know in order to understand
- 20:09different linear algebra top topics but
- 20:12also machine learning topics let's now
- 20:14talk about simple topic that we must
- 20:16know about and refresh our memory very
- 20:18quickly before moving forward to our
- 20:21next topic that is a prerequisite for
- 20:23this course so the cartisian coordinate
- 20:26system is just a fancy word of
- 20:28describing this idea of X and Y or XY Z
- 20:32when we just want to visualize them and
- 20:35showcase this numbers related to the
- 20:38space so we just learned the and I just
- 20:42quickly was talking about this idea of X
- 20:44and and Y and how we can visualize that
- 20:47in plain so the cial coordinate system
- 20:49is a framework for specifying points in
- 20:52a plane or a space using ordered list of
- 20:55numbers so we know for instance when we
- 20:58plot this then here we need to put X and
- 21:02Y in our two dimensional space R2 and we
- 21:06know that here in the middle we have
- 21:08zero and here we have 1 2 three four and
- 21:12the same here one two and then three
- 21:15four which means that everyone that is
- 21:18in the industry whether it's in
- 21:20mathematics in physics in data science
- 21:22or ml or AI we all universally agree on
- 21:27this system we know this is this ordered
- 21:30list of numbers and we know that if we
- 21:32have for instance a point here then for
- 21:35this point we know that the xaxis and Y
- 21:38AIS is definitely positive even if we
- 21:40know don't know the corresponding
- 21:42numbers and then once we have more
- 21:44General lines here so not General but
- 21:47specific lines then we even know the
- 21:50exact coordinates and values here and we
- 21:52definitely know that this number should
- 21:54be so the x coordinate should be between
- 21:56two and three so first we have the two
- 21:59and then tree and not the other way
- 22:00around so this ordered nature helps us
- 22:03to understand how we can put all these
- 22:06different numbers and organize them in
- 22:08our two dimensional space and we also
- 22:10know the corresponding y so we know that
- 22:13for instance our Y is not minus three
- 22:16because it's lying in here in this part
- 22:19of our coordinate system and not
- 22:20somewhere here where the y axis are
- 22:24negative and why do we know that because
- 22:27it's an ordered list of numbers that we
- 22:29can visualize in this 2D plane and here
- 22:33you also need to keep in mind and we
- 22:35need to remind ourselves about this idea
- 22:38of these four different parts that we
- 22:40got so we have our here the first part
- 22:42the second part the third part and then
- 22:45the four you know part of our coordinate
- 22:48system and here we we are dealing with a
- 22:51two dimensional plane but if we were to
- 22:54deal with the three-dimensional plane we
- 22:57no longer have just x-axis and y axis
- 23:00where X AIS were on the horizontal and
- 23:03y- axis on the vertical but we have our
- 23:05third line which is the Z so we have now
- 23:10three different dimensions so X Y and Z
- 23:15and we are basically extending our
- 23:17two-dimensional plane to
- 23:19three-dimensional so this system is
- 23:21fundamental for visualizing and working
- 23:24with vectors geometrically so then we
- 23:26can just use this two dimension
- 23:29uh plane in order to visualize this
- 23:32Vector for instance knowing what are all
- 23:34these points that appear on this Vector
- 23:37what is its direction where is it headed
- 23:40you know what is the beginning and then
- 23:43we can also find out all the so the
- 23:46relationship of these vectors with all
- 23:48the other vectors for instance if we
- 23:49have an other Vector here then we can
- 23:52use the coordinates of them and
- 23:54information about vectors to understand
- 23:56that we are dealing with two parallel
- 23:58vectors that don't have anything in
- 24:00common so no intersection points where
- 24:02to say if we have another Vector like
- 24:04this and we know that here we are
- 24:06dealing with perpendicular you know
- 24:09orthogonal
- 24:11vectors so this is why those this
- 24:13coordinates Cartesian coordinate system
- 24:15is important and it's not just important
- 24:17for linear algebra but just in general
- 24:20for mathematics and for data science and
- 24:22for AI and you will see this coordinate
- 24:25system time and time again in different
- 24:26visualizations even when you want to
- 24:28visualize the mean of your data or you
- 24:31want to visualize the probability
- 24:33distribution function describing your
- 24:35population from statistics or from data
- 24:38science you want to visualize for
- 24:41instance how your optimization is
- 24:43working or you want to visualize how
- 24:45your model is performing in terms of its
- 24:48evaluation Matrix for all these cases
- 24:51and for any visualizations this idea of
- 24:54the Cartesian coordinate system is going
- 24:56to become very handy let's now talk
- 24:58about this idea of angles and the idea
- 25:00of circles radian the pi as well as this
- 25:05degree sign so this comes usually from
- 25:09geometry or
- 25:10tonometry and this is very important
- 25:13when it comes to the vectors because
- 25:14when we have two different
- 25:17vectors then we want to understand their
- 25:20relationship do they form this less than
- 25:2390° or so are we dealing with sharp
- 25:26corner sharp angle or with we are
- 25:28dealing with 90° angle so we are dealing
- 25:31with this type of vectors where we have
- 25:34you know 90° or we are dealing with um
- 25:39this type of vectors when the angle is
- 25:43180° which is by the way uh something
- 25:47that we are referring as
- 25:49Pi and here is one thing that is
- 25:52important here is that it's not just Pi
- 25:54but it's Pi
- 25:56radians why because in mathematics we
- 25:59also have this idea of Pi which is
- 26:01usually a number that is 3.14 so we
- 26:04should not confuse this Pi with pi
- 26:06radians so the relationship between the
- 26:08two is something that we have also seen
- 26:10as part of our pre-algebra and algebra
- 26:12courses so if it's something that you
- 26:14want to just refresh your memory on this
- 26:16will be super helpful to check our very
- 26:19initial course on um all these Basics so
- 26:22pre-algebra so this number comes from
- 26:24per algebra and then this idea of P
- 26:26radians and just in general all this
- 26:28information about what is 180° what is
- 26:31this angle what is 360° and all the
- 26:34information that comes from triogen
- 26:36metry and geometry can be found in our
- 26:39corresponding course so the next topic
- 26:41is the unit circle unit circle is highly
- 26:45related to this idea of radians degrees
- 26:47cosine sign but also understanding the
- 26:50Cartesian coordinate system will help
- 26:52you to understand the unit circle so
- 26:54this also comes from theog gometry and
- 26:57geometry and it's basically a fancy way
- 27:00of saying we have x-axis we have y AIS
- 27:03we have here zero so our common
- 27:06Cartesian coordinate system only we are
- 27:09trying to focus on this part of the
- 27:12system where we have here one we have
- 27:13here one so on the x-axis we have one
- 27:16and then here minus one here minus one
- 27:18for y AIS and here y the Y is equal to 1
- 27:22so we have here all these points and
- 27:24then we have the circle with the radius
- 27:26of one so here is this you know this is
- 27:29the radius and here we plot this circle
- 27:33and this will help us to understand this
- 27:36concepts of sinus cosinus you know the
- 27:38Theta is just variable that we use to
- 27:41describe the angle and for instance here
- 27:44we are dealing with
- 27:4545° this angle is
- 27:4890° this entire thing is
- 27:51360° and half of it so this part only is
- 27:56180° so those are all important part of
- 28:01understanding this idea of unit circle
- 28:03so you might have already guessed that
- 28:06unit circle refers to this idea that we
- 28:08have here one unit here one unit one
- 28:10unit one unit forming this entire circle
- 28:12so with the radius that is equal to
- 28:15one all right so this is something that
- 28:18is very easy and this comes from the
- 28:21geometry and pre and triog
- 28:23gometry uh you also need to understand
- 28:26this concept of the sinus and and
- 28:28cosinus and how sinus and cosinus are
- 28:30related to this what do we refer by the
- 28:34sinus and cosine you know what is this
- 28:37what are these points so 1 Z for
- 28:39instance we understand that here the x
- 28:42is equal to one and Y is equal to zero
- 28:45so here this point is simply 1 Z so this
- 28:50point and then we have 2 p radians so
- 28:54what is this idea of P so we know that a
- 28:57p Radian
- 28:58so P radians is simply the 180° which
- 29:03means that you also need to understand
- 29:05this concept of P2 which is simply the
- 29:0890° so you can see here one thing that I
- 29:11forgot to mention you need to understand
- 29:12this concept the relationship between
- 29:14the pi and so Pi radians and radians and
- 29:18this unit circle you need to know that
- 29:20here the pi ided two is simply this
- 29:24angle and then the entire Pi is this
- 29:27angle
- 29:28and then this entire thing the entire
- 29:31angle with
- 29:35360° is equal to 2 pi so 2 pi radians is
- 29:39simply this entire thing so those are
- 29:42very easy Concepts that come from
- 29:44geometry and trometry and if you want to
- 29:47refresh them then head towards those
- 29:49sores because this will help you to
- 29:52understand all this concept from scratch
- 29:55let's now continue our refreshment when
- 29:57it comes to so genometric identities and
- 30:00we just spoke about this unit circle we
- 30:02talked about the sinus cosinus it's
- 30:05really important to relate this back to
- 30:07bit more advanced topics coming from the
- 30:10same do domain and from the same area of
- 30:14mathematics and here we we need to know
- 30:17this concept before learning linear
- 30:19algebra few other things that um would
- 30:22be really great if you know but it's
- 30:24actually not a must to understand all
- 30:26these different topics it is the idea of
- 30:29Pythagorean identity so don't confuse
- 30:31this with Pythagoras Theorem this is the
- 30:34Pagan identity so this one that the
- 30:37square of the S of an angle plus the
- 30:39cosine squared is equal to one and all
- 30:42these different rules that go around the
- 30:44S and cosine and also the what is for
- 30:47instance the S 2 Theta which is equal to
- 30:502 s of theta and cosine of theta you
- 30:54know those are all different rules that
- 30:57would be handed to know and if you are
- 30:59so far I assume that you also know
- 31:02geometry and fundamentals to triogen
- 31:05ometry which means that you also know
- 31:07these trues but this might be just a
- 31:09great time to go ahead and quickly
- 31:11refresh your memory on these Concepts
- 31:13because those might become handy in your
- 31:17applied linear algebra and Applied
- 31:19Mathematics Journey but for now I would
- 31:21say this is not one of the most
- 31:24important things to know to learn this
- 31:26and to go through this course
- 31:28but just something to keep in mind so
- 31:31when it comes to the triog genometric
- 31:33equations uh this can become very handy
- 31:36later on when we want to prove something
- 31:38in linear algebra so to follow along
- 31:41it's actually a good idea to know for
- 31:43instance what is how you can solve this
- 31:45different equations and this will go
- 31:48back and refer to the unit circle that
- 31:50we just saw for instance if the sinus
- 31:53Theta is equal to 1 / 2 then you will
- 31:56need to quickly remember what is that
- 31:58angle for which the sinus is equal to 1
- 32:01/ 2 then you realize that is actually
- 32:05the angle where you take the p and
- 32:08remember that Pi is equal to
- 32:11180° and that is the one corresponding
- 32:14to and then Pi / to 6 is simply 180 / to
- 32:196 so this is basically the 30 degree so
- 32:23those are things that you can do when
- 32:25you know for instance all these
- 32:27different sinus and cosinus so you have
- 32:29memorized for these different angles so
- 32:32what is the sinus and cosinus for 30°
- 32:34for
- 32:3560° um let me actually remove this to
- 32:39make it easier so this type of problems
- 32:42is very easy to solve when we keep in
- 32:44mind and we memorize what are these
- 32:47different values for sinus and cosinus
- 32:49when it comes to different angles for
- 32:52instance for the angle equal to zero let
- 32:55me actually remove this and clean this
- 32:59part for better understanding so if we
- 33:01have for instance 0 degrees then we know
- 33:04that the sinus for this is zero and the
- 33:06cosine of this is one so we are
- 33:09basically dealing so if I plot a unit
- 33:14circle we are dealing with this number
- 33:17so remember that sinus and cosinus those
- 33:21refer to the Y and X on our unit circle
- 33:26so keep this one in mind
- 33:28so if the cosine Theta is then equal to
- 33:311 and the sinus so Y is equal to Z we
- 33:33are dealing automatically this number
- 33:35with this number and you can see that
- 33:37here the angle is also zero so here we
- 33:40are dealing with one and zero coordinate
- 33:44so this is
- 33:45our
- 33:48cosine of zero angle and this is then
- 33:52our sinus of zero angle so we
- 33:55automatically even from this graph can
- 33:57see very easy easily that the S of 0° is
- 34:00equal to 0 and the cosine is equal to 1
- 34:04all right so let's quickly also refresh
- 34:07our memory on few other degrees so for
- 34:11the
- 34:1230° which is simply the Pi / to 6 so
- 34:17this is
- 34:1930° then the sinus or the Y AIS is equal
- 34:23to 1 / 2 and the cosine or the X x value
- 34:28x coordinate is equal to square root of
- 34:303 2 so we are dealing with this this
- 34:33corner or angle so
- 34:3630° so even from here you can see that
- 34:39the coordinates make sense make sense
- 34:41then we have the pi for another famous
- 34:44value which is corresponding to the 45°
- 34:47it's simply this angle and for this
- 34:50angle the X AIS which is the coine so
- 34:54this number is equal to 1 / to 2
- 34:58and then for the sinus the so the y
- 35:01coordinate is equal to 1 / 2 square root
- 35:05of 2 as you might have guessed because
- 35:07in this number the x-axis and y axis is
- 35:09equal to is the same so you can see that
- 35:12this distance and this distance is the
- 35:14same because we are dealing with this
- 35:17type of figure so here we have 45° here
- 35:21we have 45° so this values are the same
- 35:24and this is something that you would
- 35:25know knowing the pag Ian Pagan
- 35:29theorem so then you can go ahead and
- 35:32refresh your memory for the
- 35:3460° so here I'm referring to the Pi / to
- 35:39three and then the 90° which is the very
- 35:43easy case this one obviously the x-axis
- 35:45is equal to zero so here you should have
- 35:47zero and the y axis is equal to one so
- 35:50here you should have one and so
- 35:53on all right so we went into quite
- 35:55detailed here but I think this is a very
- 35:57important topic knowing this idea of a
- 36:01trigonometric equations identities this
- 36:03idea of unit circle are super important
- 36:06because they are highly applicable to
- 36:09different fields in artificial
- 36:10intelligence data science machine
- 36:12learning and will definitely set you
- 36:15apart all right let's now talk about the
- 36:18law of signs and cosiness those are
- 36:20things that I won't be going on into too
- 36:23much details I just wanted to quickly
- 36:24showcase to you if you want to get the
- 36:27proof of those definitely check out our
- 36:29corresponding courses but for here I'm
- 36:32assuming that you already know so you
- 36:34know the law of signs which means that
- 36:36if you have this triangle you know you
- 36:39have this different sides so you have an
- 36:41angle a the corresponding side is a and
- 36:44then you have angle B corresponding side
- 36:46is B and then here C and the
- 36:48corresponding side is C then you know
- 36:50that a / to sinus of that angle is equal
- 36:53to B / to the sign of that angle and
- 36:56then is equal to C divided to the sign
- 36:58of that angle so basically take this
- 37:01value divide it to the sinus of this
- 37:04angle you know right in front of it is
- 37:08equal to taking this value and then
- 37:10dividing into the sinus of this angle so
- 37:13the proof of this low is outside so out
- 37:16of the scope of this course but knowing
- 37:18this will help you to understand
- 37:19different concepts and then the law of
- 37:22cosine is simply saying take the side of
- 37:26a Target angle so in our triangular we
- 37:30have here a we have here angle B and the
- 37:33C and if we go and look into this
- 37:36specific angle so angle C just randomly
- 37:39picking one of the three angles then the
- 37:42side right in front of that angle so the
- 37:45C c^ squ is equal to if we take this you
- 37:49know the other two sides forming that
- 37:51angle so A and B is equal to a s so this
- 37:55is just a constant a distance of this
- 37:58side a 2 + b 2 so this side squar minus
- 38:032 * a * B times the cosine of that angle
- 38:09this is what we are referring as the law
- 38:11of cosin quite easy we are not going to
- 38:13prove it again if you want to get the
- 38:15proofs make sure to check our other
- 38:18courses on the geometry and triog
- 38:20genetry we're almost done with the
- 38:22prerequisites just a quick refreshment
- 38:24we saw already the norm here is just a
- 38:27not EX exle what Norm is and on a
- 38:30specific two dimensional Vector when we
- 38:32have for instance that a vector is equal
- 38:35to three and four which means for the
- 38:37First Dimension let's say on xaxis we
- 38:39have three and then on Y axis is equal
- 38:41to four then the norm or the Alid
- 38:43distance so this is equal to we take the
- 38:47x value so three and then we Square it
- 38:50so V you can see here this is the case
- 38:53when n is equal to 2 this is simply
- 38:56equal to square Ro of v1^2 + v2^ 2 and
- 39:00as V1 is equal to 3 so this is our maybe
- 39:05I can make this just V1 and this is my
- 39:09V2 then the norm or the equan distance
- 39:12for this Vector so this thing is equal
- 39:15to V1 2 + v2^ 2 which is equal to 3^ 2 +
- 39:214 S and this value is square root of 25
- 39:25and it's equal to 5 so let's now see the
- 39:28difference between aladine distance and
- 39:30the norm so you could see here the norm
- 39:33here we have just one vector like here
- 39:38and this Norm it has just two
- 39:41corresponding values into two
- 39:42dimensional space you see here we have
- 39:45just three and then four so this is V1
- 39:47and V2 when it comes to the Alan
- 39:50distance this is kind of the
- 39:51generalization of this idea of Norm so
- 39:54the aladine distance between two points
- 39:57a and B in RN so in the N dimensional
- 40:00space is the norm of the vector
- 40:03connecting a to B so we see that the
- 40:06norm and the elidan distance are highly
- 40:09related to each other only we are
- 40:12talking about the norm when it comes to
- 40:14one vector but when we have this Vector
- 40:18a and the vector
- 40:21B this is simply the Alan distance so
- 40:27for the Aline distance we know already
- 40:31this idea of distance how we can measure
- 40:32it and you can see that this comes very
- 40:35similar to what we see here notation and
- 40:38here we are saying well we have this
- 40:41vector and then it has the two
- 40:43coordinates in N is equal to 2 in two
- 40:45dimensional space when it comes to the
- 40:47Alan distance Alan distance helps you
- 40:50understand what is this distance between
- 40:53two points in an N dimensional space so
- 40:57the aladan distance between two points
- 40:59let's say A and B in N dimensional space
- 41:03is the norm of the vector connecting a
- 41:07to B so for instance if we have a point
- 41:09a and we have a point B we are
- 41:13connecting this and this is the vector
- 41:15connecting these two points then the
- 41:17aladan distance is simply the norm of
- 41:21this Vector so this is the aladan
- 41:24distance so we can see that nor
- 41:27and the distance they are highly related
- 41:30to each other in the Alan distance we
- 41:32are using this idea of norm and
- 41:34specifically the norm two as I mentioned
- 41:38before so here you can see that the
- 41:40definition of aladine distance so the
- 41:43distance between A and B the two point
- 41:45is equal to square root of A1 - B1 2 + a
- 41:50and then here we have basically A2 - b
- 41:532^ 2 and then plus A3 - B 3 squ those
- 41:58are things that we cover as part of this
- 42:00dot dot dot and then plus up to the last
- 42:02point when we have a n minus BN 2 so
- 42:05here what we mean basically is that if
- 42:08we
- 42:10have two points here is a and here's B
- 42:13and this s vector and we know all these
- 42:16different points so A1 B1 A2 B2 A3 B3
- 42:23blah blah blah and then here a n BN we
- 42:26know all these points lying here in this
- 42:29distance then we are taking them and
- 42:31using them to calculate the line
- 42:33distance so here for instance if we have
- 42:37point A and B so in this example let's
- 42:42do quick one specific example when we
- 42:45have a point a which has coordinates 1
- 42:47and two so this is basically A1 A2 and
- 42:51then point B with points in it like B1
- 42:55B2 you can notice that the da AB so the
- 42:58distance or the Eid in distance of these
- 43:00two points which is equal to the norm of
- 43:04this
- 43:07vector or here this is a and this is B
- 43:10and this is this Vector this is equal to
- 43:13Square < t of 4 - 1 so it takes the B1
- 43:17so this is B1 and this is
- 43:21A1 takes the square and then says plus
- 43:25B2 minus H ^ 2 takes the square root of
- 43:30that and says this equal to 5 now you
- 43:33might be wondering but hey why do we do
- 43:35then instead of 1 - B1 2 we do B1 - A1 2
- 43:39and the answer to this question lies in
- 43:42the uh properties that we learn as part
- 43:44of prealgebra because it doesn't matter
- 43:47when we take A1 - B1 squ or B1 - A1
- 43:51squared because this squared ensures
- 43:53that it doesn't matter which one we take
- 43:55first and subtract the other now the
- 43:57proof of that is outside of the scope of
- 43:59this of course is this is part of
- 44:01pre-algebra but I just wanted to put
- 44:03this out there to ensure that you are
- 44:06seeing what we are seeing here because
- 44:08here it says A1 minus B1 but in this
- 44:10example we are taking instead depth B1
- 44:13and we are subtracting A1 this is a
- 44:15common thing that we do in prealgebra
- 44:18and just in general in different cting
- 44:21distance or distance related cases so I
- 44:23just wanted to put this here to ensure
- 44:25that later on this is something that can
- 44:28be clear from the first view right and
- 44:30in here we will quickly refresh our
- 44:32memory on the Pythagorean theorem which
- 44:34basically says in the right angle
- 44:36triangle so if we have this type of
- 44:41triangle so here we have
- 44:4490° this is a right angle
- 44:47triangle the square of the length of the
- 44:51the side opposite to the right angle so
- 44:53this side this we over refer C and this
- 44:56as B uh and then a those two are not
- 44:59very important but this is commonly
- 45:01referred by C so the the side opposite
- 45:05to the right
- 45:06angle then we know that the square of
- 45:09the C so c^ s is equal to a 2 + b^2 this
- 45:13is super important theorem and a
- 45:16fundamental principle for defining the
- 45:18Norms the distances in equity and spaces
- 45:21in and in many other
- 45:24applications so the angles play Cru Ro
- 45:27in understanding the direction of the
- 45:28vectors and you know how they can be
- 45:30measured in degrees or in radians we saw
- 45:33also the pi radian this idea of you know
- 45:36that the P radian is equal to 180° those
- 45:39are all very important when it comes to
- 45:41linear algebra and just in general
- 45:43application of mathematics in machine
- 45:46learning in Ai and other applications
- 45:48the relationships between this angle
- 45:50measurements and the triog genometric
- 45:53functions is foundational in solving
- 45:56different problems
- 45:57that are about these vectors and their
- 46:01orientations for instance this angle of
- 46:03s cosine you know what is this idea of
- 46:06tangent they are very important just to
- 46:09give you an idea the um uh Tang tangent
- 46:14is specifically used as part of the
- 46:16activation functions we call it tank
- 46:18activation function and knowing this
- 46:20tank will help you to understand the
- 46:22activation functions that I use as part
- 46:24of deep learning which are more advanced
- 46:26machine learning type of models and they
- 46:30are fundamentals in all these different
- 46:32new and Cutting Edge techniques large
- 46:35like large large language models
- 46:37Transformers encoder and decoder based
- 46:39algorithms Etc they're also important in
- 46:42this idea of computing dot products so
- 46:45very important and must know when it
- 46:48comes to linear algebra so this is just
- 46:51an simple example when it comes to this
- 46:53right angle triangle and Pythagorean
- 46:56theorem and how is applied I will skip
- 46:58this for now it's also important to
- 47:00understand this idea of orthogonality so
- 47:03the two vectors let's say A and B they
- 47:06are orthogonal to each other if their
- 47:10dotproduct is zero so later on as part
- 47:13of the vectors when we will talk about
- 47:15dot product we will see what we mean
- 47:18when we say that the dot product is
- 47:20equal to zero and here you can even see
- 47:22that if the a norm if the a vector so
- 47:27you see here and B Vector if those
- 47:30vectors if we multiply them to each
- 47:32other their dot product is equal to zero
- 47:35it means they are orthogonal so this
- 47:38angle that they form is equal to 90°
- 47:41orthogonality implies that the vectors
- 47:43from the from a right angle with each
- 47:46other they are in you know we we are
- 47:48dealing with that in R2 in R Tre so they
- 47:51are super important when it comes also
- 47:54to visualizing them correctly
- 47:57this concept is visually represented all
- 48:00this you know Vector a and then Vector B
- 48:03and they are perpendicular in the 2D uh
- 48:06coordinate
- 48:08system all right so when it comes to the
- 48:11applications of orthogonality
- 48:12orthogonality plays a crucial role in
- 48:14various aspect of linear algebra it's
- 48:16fundamental in defining Vector spaces
- 48:19subspaces in solving a systems of linear
- 48:22equation later on when we pass the
- 48:24vector ideas and we go on to the
- 48:27matrices solving linear systems so
- 48:30equations with many unknowns and then we
- 48:32use this idea of reductions or gausian
- 48:35reductions we will see how this idea of
- 48:37orthogonality can be important and how
- 48:40also it relates back to the norm of two
- 48:43vectors so it's fundamental in defining
- 48:46all these different identities and
- 48:48solving system of linear equations and
- 48:50also orthogonal vectors are used in
- 48:52finding the shortest distance from a
- 48:55point to the plane um something that is
- 48:58important when it comes to the
- 49:00optimizations and here you can see an
- 49:03example the vector a which is equal to 2
- 49:05three and then Vector B which is equal
- 49:07to minus 3 and 2 you can see that when
- 49:10we multiply 2 by minus 3 so we obtain
- 49:13basically the dot product by the way
- 49:15this is something that we are going to
- 49:16cover also as part of this course but
- 49:18for now you can see that if we take this
- 49:21number we multiply with this so 2 * - 3
- 49:25we take this number multiply with this
- 49:27so we take three and multiply with two
- 49:30you can see that this equal to minus 6
- 49:32this is equal to 6 so - 6 + 6 is equal
- 49:35to zero so you can see that the
- 49:38dotproduct of these two vectors is
- 49:41simply equal to zero and this is what we
- 49:43are referring as orthogonality this
- 49:45means that these two vectors form a
- 49:48right angle where we see here this angle
- 49:51is equal to 90° why this prerequisites
- 49:55matter and why I meant those
- 49:57understanding this concept is very
- 49:59crucial they underpin this geometric
- 50:01interpretation of linear algebra they
- 50:03will help you to better understand these
- 50:05Concepts and not just to memorize them
- 50:07but really understand and later on when
- 50:10you go into your machine learning and AI
- 50:12journey and in your data science Journey
- 50:14seeing these Concepts will help you to
- 50:18better understand those different alori
- 50:20this optimization techniques what we
- 50:22mean when we say we want our
- 50:24optimization algorithm to move towards
- 50:27local minimum Global minimum but this
- 50:29idea of movement this idea of vectors
- 50:32later on will you will also understand
- 50:34this different concepts in deep learning
- 50:37how these models work how the neural
- 50:38networks work and those are essential
- 50:42Concepts that you need for solving
- 50:44different systems of linear equation a
- 50:46core part of this course they also help
- 50:50you in visualizing vectors spaces which
- 50:53are critical to understand this concept
- 50:55of linear algebra the applications of
- 50:57linear algebra when it comes to the real
- 51:00world applications so those are things
- 51:03that you can definitely must by
- 51:06following some of our other courses but
- 51:08for this course I assume that you are
- 51:10already familiar with this Concepts
- 51:13right so now we are ready to actually
- 51:15begin and with this prerequisites in
- 51:17mind you are prepared to start your
- 51:20linear arbra Journey we are going to
- 51:23learn everything in the most efficient
- 51:25way in such a way that you will learn
- 51:27the theory you are going to see many
- 51:29examples we are going to learn
- 51:31everything in detail but at the same
- 51:33time you're going to learn the must know
- 51:35Concepts and I'm not going to overwhelm
- 51:37you with this most difficult concept
- 51:39that you will not be seeing in your
- 51:41career I'm going to give you this bare
- 51:44minimum when it comes to really knowing
- 51:47and the must know for linear algebra
- 51:49such that you will be ready to apply
- 51:52linear algebra in your professional
- 51:54Journey whether you want to get into
- 51:56machine learning deep learning
- 51:58artificial intelligence data science
- 52:00knowing these different concepts in
- 52:02linear algebra you will be a pro in your
- 52:05field going to give you everything that
- 52:07you need the theory examples
- 52:10implementations everything in detail but
- 52:13at the same time you will be doing that
- 52:15in the most efficient and time-saving
- 52:18way so without further Ado let's get
- 52:23started let's Now quickly Define this
- 52:25idea of norm so the normal of a vector
- 52:27denoted by this uh uh V which you can
- 52:31see kind of like similar to the absolute
- 52:34value from
- 52:35pre-algebra you can see here that we
- 52:37have this double straight lines like
- 52:41from absolute value then we have the
- 52:43name of the vector or the variable name
- 52:46that we are assigning to our vector and
- 52:48then you might notice here on the top of
- 52:51this this Arrow this basically says that
- 52:55we are dealing not with just a variable
- 52:57but really we are dealing with a vector
- 53:00this is really important because you can
- 53:02see that there makes a huge difference
- 53:05if we have for instance just V or V1 I
- 53:08have to say or just V those are really
- 53:11important and things that you need to
- 53:13keep in mind when it comes to linear
- 53:15algebra and trying to differentiate
- 53:17vectors from a
- 53:18point you will notice that when it comes
- 53:21to Norm we can uh represented it either
- 53:25by this not ation or this usually it's a
- 53:28common um notation uh in machine
- 53:31learning or in data science um with this
- 53:34uh two bars and um when we do this we
- 53:39automatically also know L2 norm and this
- 53:42is something very common and uh usually
- 53:45used as part of um
- 53:47retrogression which is an application of
- 53:51um linear algebra uh and it's used in uh
- 53:54regularization so we are regularizing
- 53:57our machine learning algorithms so when
- 53:59you get into machine learning you will
- 54:00see time and time again this um notation
- 54:03so uh next time when you see this then
- 54:05you know automatically that you are
- 54:07dealing with L2 norm and L2 Norm which
- 54:10is also used a lot in machine learning
- 54:13it is referring to the usage of L2 Norm
- 54:16to uh in the uh regression and
- 54:19regression or L2 regularization is a
- 54:23very popular regularization techniques
- 54:25as part of machine learning so right now
- 54:28even you can see this uh intersection or
- 54:31linear algebra or um this uh idea of
- 54:34norms in machine learning the norm of
- 54:37this vector v is equal to square roof
- 54:40and then V1 S Plus V2 squ plus and all
- 54:43this in between numbers plus VN squ so
- 54:47here basically it means take square root
- 54:50of V1 squ then V2 squar plus V3 squ blah
- 54:56blah BL plus VN 2 so basically take all
- 55:01the units that form this vector and then
- 55:04so are on this vector and use them
- 55:08Square them and then add them and then
- 55:11take the square root of that that's the
- 55:13distance or I have to say the norm of
- 55:16this Vector we saw already the norm here
- 55:19is just a not example what Norm is in um
- 55:22on a specific two dimensional Vector
- 55:25when we have for instance that the
- 55:27vector is equal to three and four which
- 55:29means for the First Dimension let's say
- 55:31on xaxis we have three and then on Y
- 55:34axis is equal to four then the norm or
- 55:36the AL in distance so this is equal to
- 55:39we take the x value so three and then we
- 55:42Square it so V you can see here this is
- 55:46the case when n is equal to 2 this is
- 55:49simply equal to square root of V1 2 +
- 55:52v2^ 2 and as V1 is equal to 3
- 55:56so this is our maybe I can make this
- 55:59just V1 and this is my V2 then the norm
- 56:04or the in distance for this Vector so
- 56:07this thing is equal
- 56:09to V1 2 + V2 s which is equal to 3^ 2 +
- 56:154^ 2 and this value is square root of 25
- 56:19and it's equal to five so let's now see
- 56:21the difference between aladine distance
- 56:24and the norm so you you could see here
- 56:26the norm here we have just one vector
- 56:30like here and this Norm it has just two
- 56:35corresponding values into two
- 56:36dimensional space you see here we have
- 56:38just three and then four so this is V1
- 56:41and V2 when it comes to the Alan
- 56:43distance this is kind of the
- 56:45generalization of this idea of Norm so
- 56:48the Alan distance between two points A
- 56:51and B in RN so in the N dimensional
- 56:54space is the norm of the the vector
- 56:57connecting a to B so we see that the
- 57:00norm and the elidan distance are highly
- 57:03related to each other only we are
- 57:06talking about the norm when it comes to
- 57:08one vector but when we have this Vector
- 57:12a and the vector
- 57:15B this is simply the Alan distance so
- 57:21for the Aline distance we know already
- 57:24this idea of distance how we can measure
- 57:26it and you can see that this comes very
- 57:29similar to what we see here notation and
- 57:32here we are saying well we have this
- 57:35vector and then it has this two
- 57:37coordinates in N is equal to two in two
- 57:39dimensional space when it comes to the
- 57:41AQ in distance Eline distance helps you
- 57:44understand what is this distance between
- 57:47two points in an N dimensional space so
- 57:51the aladan distance between two points
- 57:53let's say A and B in n dimens space is
- 57:57the norm of the vector connecting a to B
- 58:01so for instance if we have a point a and
- 58:04we have a point B we are connecting this
- 58:07and this is the vector connecting these
- 58:09two points then the aladan distance is
- 58:12simply the norm of this Vector so this
- 58:17is the aladine distance so we can see
- 58:20that the norm and the distance they are
- 58:23highly related to each other in the Alan
- 58:25distance where using this idea of norm
- 58:28and specifically the norm two as I
- 58:31mentioned before so here you can see
- 58:34that the definition of alodine distance
- 58:36so the distance between A and B the two
- 58:39point is equal to square root of A1
- 58:41minus B1 2qu plus a and then here we
- 58:44have basically A2 minus b 2 2ar and then
- 58:48plus A3 minus B3 2 those are things that
- 58:52we cover as part of this dot dot dot and
- 58:55then plus up to the last point when we
- 58:56have a n minus bn^ 2 so here what we
- 59:00mean basically is that if we
- 59:03have two points here is a and here is B
- 59:07and this s vector and we know all these
- 59:10different points so A1 B1 A2 B2 A3 B3
- 59:17blah blah blah and then here a n BN we
- 59:20know all these points lie in here in
- 59:22this distance then we are taking them
- 59:25and using them to calculate the Lan
- 59:27distance so here for instance if we have
- 59:31um point A and B so in this example
- 59:36let's do a quick one specific example
- 59:38when we have a point a which has
- 59:40coordinates 1 and two so this is
- 59:42basically A1 A2 and then point B with u
- 59:47points in it like B1 B2 you can notice
- 59:51that the da AB so the distance or the
- 59:53equid distance of these two points which
- 59:56which is equal to the norm of this um
- 1:00:02vector or here this is a and this is B
- 1:00:05and this is this Vector this is equal to
- 1:00:08square root of 4 - 1 so it takes the B1
- 1:00:12so this is B1 and this is
- 1:00:16A1 takes the square and then says plus
- 1:00:21B2 - A2 2 takes the square root of that
- 1:00:25and says this equal to 5 now you might
- 1:00:28be wondering but hey why do we do then
- 1:00:31instead of 1 - B1 2 we do B1 - A1 2 and
- 1:00:35the answer to this question lies in the
- 1:00:37um uh properties that we learn as part
- 1:00:40of pre-algebra because it doesn't matter
- 1:00:43when we take uh A1 - B1 squ or B1 - A1
- 1:00:47squ because this squared ensures that it
- 1:00:49doesn't matter which one we take first
- 1:00:51and subtract the other now the proof of
- 1:00:54that is outside of the scope of this um
- 1:00:57course is this is part of pre-algebra
- 1:00:59but I just wanted to put this out there
- 1:01:00to ensure that uh you are uh seeing what
- 1:01:04we are seeing here because here it says
- 1:01:06A1 minus B1 but in this example we are
- 1:01:08taking instead depth uh B1 and we are
- 1:01:11subtracting A1 this is a common thing
- 1:01:14that we do in um pre-algebra and just in
- 1:01:17general uh in different um eling
- 1:01:20distance or distance related cases so I
- 1:01:22just wanted to put this here to ensure
- 1:01:24that uh later on this is something that
- 1:01:27can be clear um from the first view why
- 1:01:29this is important this idea of norms and
- 1:01:32Al IND distance beside of being used in
- 1:01:34machine learning and why is it used so
- 1:01:36Norms they provide a way to measure the
- 1:01:38size or the length of a vector in Vector
- 1:01:41spaces which means that when we want to
- 1:01:44measure a distance a similarity a
- 1:01:47relationship between for instance
- 1:01:49vectors then it becomes much easier to
- 1:01:52use this idea an Alan distance is not
- 1:01:55only used in regularization techniques
- 1:01:58like L2 regularization or retrogression
- 1:02:02but it's also used in other machine
- 1:02:04learning or deep learning algorithms as
- 1:02:06a way to measure the distance or the
- 1:02:09relationship or the similarity between
- 1:02:12two different entities those can be
- 1:02:14variables those can be two people that
- 1:02:16we want to compare in our algorithm or
- 1:02:18two entities um for instance the um
- 1:02:23Norms or the Al and distance they are
- 1:02:25also used as part of K algorithm
- 1:02:28something that you might have heard and
- 1:02:29if you follow later on the machine
- 1:02:31learning and the clustering section of
- 1:02:33machine learning you will see that Elin
- 1:02:35distance is used as part of C's
- 1:02:37algorithm that aims to Cluster
- 1:02:39observations into different groups so
- 1:02:42this is also yet another highly
- 1:02:44applicable uh topic that you must know
- 1:02:46in order to understand different linear
- 1:02:48algebra top topics but also machine
- 1:02:51learning topics welcome to the course on
- 1:02:53the fundamentals of linear arbra
- 1:02:56my name is D Vasan and today we are
- 1:02:58going to start with some basic concepts
- 1:03:01that are important for understanding
- 1:03:02linear algebra linear algebra is one of
- 1:03:05the most applicable areas of mathematics
- 1:03:08it is used by pure mathematicians that
- 1:03:10you will see in universities doing
- 1:03:13research publishing research papers but
- 1:03:15also by the mathematically trained
- 1:03:17scientists of all disciplines this is
- 1:03:20really one of those areas in mathematics
- 1:03:22that you will see time and time again
- 1:03:24appearing in your professional life if
- 1:03:27you want to become a job ready uh data
- 1:03:31scientist or you want to do some handson
- 1:03:33machine learning deep learning and AI
- 1:03:36stuff but also linear algebra is used in
- 1:03:38cryptology it is used in cyber security
- 1:03:41and in many other areas of computer
- 1:03:43science and artificial
- 1:03:45intelligence so if you want to become
- 1:03:48this well-rounded professional you want
- 1:03:50to go beyond using libraries and you
- 1:03:53want to truly understand the uh
- 1:03:56mathematics and the technical side of
- 1:03:58this different machine learning
- 1:03:59algorithms from very basic was like
- 1:04:02linear regression to most complex ones
- 1:04:04coming from Deep learning like
- 1:04:06architectures in neural network how the
- 1:04:08optimization algorithms work how the
- 1:04:10gradient descent works and all these
- 1:04:12other uh different methods and models
- 1:04:15then you are in the right place because
- 1:04:17you must know linear algebra such that
- 1:04:19you will understand these different
- 1:04:21concepts from very basic ones to most
- 1:04:24advanced ones in the data science
- 1:04:26machine learning deep learning
- 1:04:28artificial intelligence data analytics
- 1:04:31but also in many other applied science
- 1:04:35disciplines so before starting this
- 1:04:38comprehensive course that will give you
- 1:04:40everything that you need to know about
- 1:04:41linear algebra first I'm going to tell
- 1:04:44you what we assume that you already know
- 1:04:47because linear algebra it comes from
- 1:04:49about third uh year of bachelors's um of
- 1:04:53different uh highly technical studies
- 1:04:56and um here um we are assuming that you
- 1:04:59already know certain Concepts so uh to
- 1:05:03ensure that this course Tes really on
- 1:05:05the topic of linear algebra and that you
- 1:05:08uh understand all these Concepts really
- 1:05:11well for that we need to uh be able to
- 1:05:14know different topics so before we dive
- 1:05:18into this Concepts uh let's familiarize
- 1:05:21ourselves with the basic prerequisites
- 1:05:23and notations used throughout this
- 1:05:25course and you will really need to know
- 1:05:27this in order to understand these
- 1:05:29Concepts really well such that instead
- 1:05:31of memorizing you will actually just
- 1:05:34hear me once or maybe twice and then
- 1:05:37every time you hear later on or you see
- 1:05:39it in the papers or in some algorithms
- 1:05:41you will recognize ah this is something
- 1:05:43that we already
- 1:05:45learned so uh some key prerequisites
- 1:05:48overview is here um first of all to
- 1:05:51fully grasp the upcoming material you
- 1:05:53should be familiar with some basic
- 1:05:55concept like real numbers Vector spaces
- 1:05:58so you don't need to know this idea of
- 1:06:00vectors though you uh already most
- 1:06:04likely are familiar with this given that
- 1:06:06you know how to plot different uh lines
- 1:06:09you know the idea of x's and y's and how
- 1:06:13to plot these different graphs but um
- 1:06:16here we are going to touch base on this
- 1:06:18every time when we come close to this
- 1:06:20Concepts I will refresh you uh your
- 1:06:22memory and we will go through this
- 1:06:24numbers the idea of norms and distance
- 1:06:27measures because when it comes to the
- 1:06:30vectors when it comes to the magnitude
- 1:06:32and all these different uh topics that
- 1:06:34we are going to discuss as part of
- 1:06:36linear algebra knowing the what Norm is
- 1:06:39and um what is the definition of
- 1:06:41distance what is the length between uh
- 1:06:45two points when we plot it in the
- 1:06:47two-dimensional space or
- 1:06:48three-dimensional space those are all
- 1:06:50very basic concept that usually you see
- 1:06:53as part of a basic pre-algebra or is uh
- 1:06:56common algebra ques and um lessons in
- 1:07:01order to truly understand what the your
- 1:07:03algebra is about to understand the
- 1:07:05direction of vectors the angle and then
- 1:07:09um the uh dimensionality reduction how
- 1:07:11linear algebra is applied for instance
- 1:07:13in different algorithms in machine
- 1:07:15learning deep learning data science
- 1:07:17statistics you really need to understand
- 1:07:19this Cartesian coordinate system so uh
- 1:07:22this is not only important for linear
- 1:07:25algebra but I assume you already know it
- 1:07:27given that you have passed those um uh
- 1:07:29other courses like calculus or usually
- 1:07:33they are covered as part of pre-algebra
- 1:07:34or algebra so the cartisian coordinate
- 1:07:38system I mean here understanding uh what
- 1:07:41is for instance the the common um
- 1:07:44description of them for instance when
- 1:07:45you when we write like X and then y on
- 1:07:48the vertical axis and then we can uh we
- 1:07:51have here zero and um then uh we can
- 1:07:54always PL this different plots you know
- 1:07:57we we have a clear understanding what is
- 1:07:59this um Y is equal to X line we
- 1:08:02understand how by knowing certain points
- 1:08:05we can plot different plots for instance
- 1:08:07that this is the Y is equal to X line
- 1:08:10that here it means that if we have here
- 1:08:12one then this is just one two this is
- 1:08:15two so we understand when we have the
- 1:08:17function of the line and we have a
- 1:08:19certain value where is our y coordinate
- 1:08:22or x coordinate then the corresponding
- 1:08:24uh coordinate can be found then um you
- 1:08:28also need to know um some basic things
- 1:08:31that I just didn't mention uh right now
- 1:08:34so for instance that the numbers here
- 1:08:36can be like 1 2 three up to Infinity so
- 1:08:39you understand this concepts of infinity
- 1:08:42and then here the same uh story then
- 1:08:45here we have minus one you know minus
- 1:08:48two uh and then this is then used later
- 1:08:52on and we will be uh touch basing this
- 1:08:55is when we will be describing our
- 1:08:57vectors and how uh we can visualize our
- 1:09:00vectors either two dimensional space
- 1:09:02like we have here because this is two
- 1:09:04dimensional so we have X and Y but we
- 1:09:06can also of course visualize it in
- 1:09:09three-dimensional
- 1:09:10Etc so this idea of basic coordinate
- 1:09:13system is really important um usually
- 1:09:16covered as part of algebra if not
- 1:09:19pre-algebra then we have basic triog
- 1:09:22genetry which means that you need to
- 1:09:24have a clear understanding what sinus is
- 1:09:26what cosine is what tangent is and their
- 1:09:29reciprocals and here I mean uh that you
- 1:09:31know for instance um what is cosine
- 1:09:34function what is s function um you know
- 1:09:38that you have an
- 1:09:40understanding for instance that um uh
- 1:09:43what is this line you know um whether
- 1:09:46it's a sinus line or cosine line you
- 1:09:49have also an understanding what this Pi
- 1:09:51is um one thing that I didn't mention
- 1:09:54but it it just goes um around all these
- 1:09:58topics some basic things that you
- 1:10:00understand what is X what is y why we uh
- 1:10:03use them and this idea of uh
- 1:10:07variables uh and also uh you need to
- 1:10:10understand this idea of a square uh or
- 1:10:14you know a
- 1:10:1690° uh angle and then uh Pythagoras
- 1:10:20Theorem here we have the same so what is
- 1:10:23this relationship between different
- 1:10:24sides of the triangle uh that is a very
- 1:10:27unique triangle and that has one of the
- 1:10:30uh angles as 90° um and uh this idea of
- 1:10:36um you know the sides how this relates
- 1:10:38to the sinus cosinus tangent cotangent
- 1:10:41um and also um how the Pythagorean um
- 1:10:45Pythagorean theorem applies when we have
- 1:10:48uh a triangular but it is no longer with
- 1:10:52a angle that is 90° what is the sum of
- 1:10:55all the angles of triangle so those are
- 1:10:58basic stuff that are com commonly
- 1:11:01covered as part of uh trigonometric uh
- 1:11:04lessons or part of General
- 1:11:07geometry then another prerequisite um is
- 1:11:11this uh understanding of uh identities
- 1:11:15and equations in triog genometric um
- 1:11:18lessons something part of which I
- 1:11:20already covered and this is goes around
- 1:11:23of basic having a basic
- 1:11:25understanding of algebra and geometry
- 1:11:27those are super important to understand
- 1:11:29more Advanced Techniques uh from linear
- 1:11:32algebra then we have finally this idea
- 1:11:34of orthogonality perpendicularity in
- 1:11:37vectors for instance if we have um the
- 1:11:41two lines like this then we are talking
- 1:11:43about uh perpendicular vectors when you
- 1:11:46have two lines that are actually
- 1:11:48parallel so they don't have any
- 1:11:50intersection and you won't find any
- 1:11:52point that is common for the tube hi
- 1:11:55there so let's get started with our
- 1:11:57first module which is foundations of
- 1:11:58vectors in this module we are going to
- 1:12:00talk about fundamentals of linear
- 1:12:02algebra vectors we are going to make a
- 1:12:04differentiation with between scalers and
- 1:12:07vectors we are going to Define them so
- 1:12:09first we will learn the theory then we
- 1:12:11will Implement them into practice by
- 1:12:13plotting them by looking into different
- 1:12:15examples then we will look into this
- 1:12:17representation of vectors by looking
- 1:12:20into the magnitude and the direction of
- 1:12:22it and the representation of them just
- 1:12:25in general we are going to plot them in
- 1:12:27our coordinate system then we are going
- 1:12:30to see the common notational vectors and
- 1:12:32indexing of them vectors are super
- 1:12:36important when it comes to linear
- 1:12:37algebra and application of it and uh
- 1:12:40they matter not only in mathematics but
- 1:12:43beyond so uh vectors help us in many
- 1:12:46ways from figuring out how objects move
- 1:12:49to solving math problems in science and
- 1:12:52just in general in technology including
- 1:12:54in data science
- 1:12:55machine learning artificial intelligence
- 1:12:57Etc they are super useful tool so uh
- 1:13:02let's start our journey with looking
- 1:13:04into scalers so scalers they are just
- 1:13:07plain numbers and by definition a scaler
- 1:13:11is a single numeric volume often
- 1:13:13representing magnitude or
- 1:13:15quantity for example uh scalers can be
- 1:13:20describing um the temperature outside
- 1:13:23for instance the temperature
- 1:13:25of um a
- 1:13:2722° uh can be represented by a scaler or
- 1:13:31a height of a person can be represented
- 1:13:33it's a scaler so let's assume we have a
- 1:13:37scaler that we will Define by a letter s
- 1:13:39it's just a variable this scaler is then
- 1:13:42equal to 22 for instance and we are
- 1:13:45measuring it in degrees so it means that
- 1:13:49uh if this s measures a room temperature
- 1:13:52then the scaler s which is equal to
- 1:13:5522° which represents the room
- 1:13:57temperature it can be for instance 18°
- 1:14:00or 9° if it's very called uh it just
- 1:14:04measures a single volume it represents
- 1:14:07just a single number or it can be for
- 1:14:10instance 17 100
- 1:14:132.22 so all these they are just scalers
- 1:14:17they represent a single numeric volume
- 1:14:21they often represent a magnitude or a
- 1:14:23quantity very we will see that scalers
- 1:14:26they are a value that represent the
- 1:14:28magnitude of a
- 1:14:30vector so uh now when we are clear on
- 1:14:33this very basic concept of scalers let's
- 1:14:37actually move to this idea of vectors so
- 1:14:40by definition a vector is an ordered
- 1:14:42array of numbers which can represent
- 1:14:45both magnitude and direction in space so
- 1:14:49uh vectors they are bit more they
- 1:14:51represent bit more than scalers there
- 1:14:53are numbers that also show show
- 1:14:55direction like a car spitting down the
- 1:14:58highway or a bow uh being
- 1:15:01thrown for instance uh when it comes to
- 1:15:04our previous example we were using this
- 1:15:06uh uh room temperature as a way to uh
- 1:15:10think about the scaler a scaler for
- 1:15:14instance scaler that we just saw was
- 1:15:17this room temperature room temperature
- 1:15:20which was
- 1:15:2222° when it comes to the vector
- 1:15:25Vector is different for Vector for
- 1:15:28instance we can have an example when a
- 1:15:31bird for instance bird it
- 1:15:35flies
- 1:15:37flies at 10
- 1:15:41kilomet per
- 1:15:44hour and I also add here another
- 1:15:47information which will make this as a
- 1:15:49vector which is that it flies
- 1:15:53South so here as you can see what I'm
- 1:15:56doing is that I'm not just oh let me
- 1:16:00actually remove this part to make it
- 1:16:02easier to
- 1:16:04understand okay so uh in this example
- 1:16:08let me write it down that the
- 1:16:12example
- 1:16:14bird
- 1:16:16FES
- 1:16:19s at 10 kilomet per hour so you can see
- 1:16:26that I'm not just adding the scaler
- 1:16:29which is in this case the
- 1:16:32magnitude we will see very soon the
- 1:16:34formal definition of it so I'm writing
- 1:16:37down the speed I'm defining the speed
- 1:16:40but also the direction so I'm
- 1:16:43saying I know that the bird is flying
- 1:16:46south that's the direction and I know
- 1:16:49also the speed of it which is the
- 1:16:51magnitude so 10 kilomet per hour so here
- 1:16:54in the vector I have much more
- 1:16:56information than in the scaler because
- 1:16:59in the scaler I just got temperature
- 1:17:01room temperature single volue but in
- 1:17:03case of a vector I not only have um
- 1:17:07magnitude or speed like 10 kilm per hour
- 1:17:10but I have extra information which is
- 1:17:12the direction of it for instance flying
- 1:17:14to the South so let's now look into some
- 1:17:17real examples and plotting them to make
- 1:17:20more sense out of this idea of vectors
- 1:17:23and what is this magnitude what is the
- 1:17:25direction so let's assume we have a 2d
- 1:17:29plane so we have xaxis we have y AIS
- 1:17:33here like usual we have our z0 Center
- 1:17:37and we want to plot a simple Vector so
- 1:17:42uh usually the way we represent Vector
- 1:17:44in tutorials or just writing down is by
- 1:17:47writing the name of the vector this can
- 1:17:49be just a a random name let's assume
- 1:17:52that it's a v letter v and then on the
- 1:17:56top we are always adding this Arrow so
- 1:17:59this Arrow it says and it tells the
- 1:18:02person who is reading that we are
- 1:18:04dealing with the vector arrow on the top
- 1:18:06is that reference so let's assume this
- 1:18:10uh vector v it starts from the center of
- 1:18:14our coordinate system and it goes to
- 1:18:17this point so let's say in here this is
- 1:18:21our vector v
- 1:18:25so let's assume that this point in here
- 1:18:28is equal to 4 which means that the x
- 1:18:32coordinate is four and the y-coordinate
- 1:18:33is zero as the um uh Arrow it just as
- 1:18:38the point in here it has a a y value of
- 1:18:42zero so you can see that it goes
- 1:18:43straight from zero to this one to this
- 1:18:47point okay so what tells this Vector uh
- 1:18:51to us is that we have a value that
- 1:18:54describes the length of the vector so it
- 1:18:57goes from 0 to 4 which means that the
- 1:19:00length is equal to unit four so it's
- 1:19:04equal to
- 1:19:05four um
- 1:19:08and we have just learned and we were
- 1:19:10just talking about that the magnitude is
- 1:19:14the length in this case so the length
- 1:19:16describes the magnitude in this
- 1:19:20case so this means that the magnit ude
- 1:19:25of this Vector is equal to 4 and then um
- 1:19:29what else we can see here we can see the
- 1:19:31direction of the vector which means that
- 1:19:33the direction is also something that we
- 1:19:36can see here this is the direction of
- 1:19:39the vector so this going straight from
- 1:19:42this point to this point in a horizontal
- 1:19:46way
- 1:19:48so independent whether I plot this
- 1:19:51Vector from 0 to 4 in here or in here
- 1:19:54here or in here or in here or in here in
- 1:19:59all cases as long as the length is this
- 1:20:02I'm dealing with the same Vector because
- 1:20:04I am basically in this entire
- 1:20:09R2 space I have exactly the same Vector
- 1:20:12all I care is about the magnitude and
- 1:20:15the Direction Where will this Vector
- 1:20:19start and where will it
- 1:20:20end I am not interested I'm interested
- 1:20:23that the uh that the magnitude in this
- 1:20:26case the length is equal to the
- 1:20:28direction of the vector so let's now
- 1:20:30look into another example where we go a
- 1:20:33bit more difficult on our coordinates
- 1:20:35and on our Vector we already saw that we
- 1:20:38had this Vector where we went let me
- 1:20:41change the color so this was our vector
- 1:20:45v and it went from zero till 4 so this
- 1:20:48point to be more specific is so this
- 1:20:51Vector it goes the vector B it goes from
- 1:20:550 0
- 1:20:58to 40 so the coordinate X was 4 and the
- 1:21:03Y was Zero now let's plot another one um
- 1:21:08where the direction is no longer
- 1:21:09horizontal for this Vector let's call it
- 1:21:12Vector
- 1:21:13W and for this Vector w we will again
- 1:21:16start with Z 0 so we will start again in
- 1:21:18here but this time we will go bit like
- 1:21:23this so let's say we go all the way to
- 1:21:26this
- 1:21:27point so this
- 1:21:30point has a value for an x- axis of
- 1:21:35three and for y axis it has a value of
- 1:21:38four which means it goes from this point
- 1:21:41to this point and this is the direction
- 1:21:45of our vector v so it goes to
- 1:21:4934 because this point is 3 0
- 1:21:55and this point is 04 so xaxis is 0o x
- 1:22:00coordinate and y coordinate is 4 so now
- 1:22:03you can see that the direction of this
- 1:22:07Vector is like
- 1:22:09this while the direction of the vector v
- 1:22:12was like
- 1:22:14this and like in case of vector v i
- 1:22:18again no longer care about where exactly
- 1:22:21my Vector W stars and ends but all I
- 1:22:24care is about its magnitude so the
- 1:22:27length and the direction so for
- 1:22:30instance I can have the same Vector in
- 1:22:33here the same Vector in
- 1:22:36here as long as the length the magnitude
- 1:22:40is the same and the direction I am
- 1:22:43dealing with the same Vector that's all
- 1:22:44I care so the magnitude and the
- 1:22:46direction is all that you care about all
- 1:22:50right so now about the length um that's
- 1:22:53uh something that you can see very
- 1:22:55easily from this specific example
- 1:22:57because by using the Pythagoras Theorem
- 1:23:00or P Pythagorean theorem we can see very
- 1:23:03quickly that as the length of this side
- 1:23:06of our uh right angle
- 1:23:1030° so right triangle we can see that
- 1:23:12this side is three this side is
- 1:23:15four which means that this side is 5
- 1:23:19because 4 2 + 3^ 2 then we take the
- 1:23:23square root of that square root of 25
- 1:23:25and it's equal to 5 so the length or the
- 1:23:29magnitude of this vector v is simply
- 1:23:31equal to
- 1:23:335 all right this was about this uh
- 1:23:36specific vectors let's now look into the
- 1:23:38uh common representation of the vectors
- 1:23:41so we always use the magnitude as well
- 1:23:43as the direction you know to represent
- 1:23:45the vectors and they commonly are
- 1:23:47represented by two different uh ways
- 1:23:50let's now look into the first way that
- 1:23:52the vectors can be represented and then
- 1:23:54we will move on to the next one so when
- 1:23:56it comes to the vector v so we saw that
- 1:23:59vector v was moving from
- 1:24:010 till uh to the point of 40 so we can
- 1:24:07represent the vector B by 4 and
- 1:24:11zero when it comes to the vector w we
- 1:24:15can represent that uh Vector so Vector w
- 1:24:19we can again do the parenthesis and we
- 1:24:21can say that it's equal to 3 four so by
- 1:24:25using the coordinates from the
- 1:24:26coordinate system we can then represent
- 1:24:30our uh vectors so this is just one way
- 1:24:33of representing a vector another way of
- 1:24:36representing these vectors is by using
- 1:24:38this Square braces given that we are in
- 1:24:41a two dimensional space first we will
- 1:24:43mention here the four then we will
- 1:24:45mention the zero in here twoo so we can
- 1:24:50say three and four this is yet another
- 1:24:53way of represented the vectors in a two
- 1:24:56dimensional
- 1:24:57space so if we were to have a
- 1:25:00threedimensional space so let me
- 1:25:02actually show it on a new page so if we
- 1:25:05were to um if we were um to have vectors
- 1:25:09in three dimensional space so we are
- 1:25:11dealing with
- 1:25:13R3 so we have points that can be
- 1:25:16described by X Y and Z
- 1:25:20so coordinate space like this so X and
- 1:25:24and the Y and then the Z then every
- 1:25:27point so let's say we have this Vector
- 1:25:30then we had to represent it by a value
- 1:25:33let's say x uh X1 y1 and Z1 or um better
- 1:25:39let me actually use a different
- 1:25:42letters a b and c and this would be my
- 1:25:47vector v and I could also represent this
- 1:25:50Vector
- 1:25:51B is the same so vector v can be
- 1:25:55represented as a b and c so one thing
- 1:26:00that you can notice is that unlike the
- 1:26:02R2 now I have three different entries
- 1:26:06what we are also referring as rows and
- 1:26:09we just got one column so um we can uh
- 1:26:13often represent and usually that's a
- 1:26:15common way of representing vectors by
- 1:26:18using this um columns so columns help us
- 1:26:22to represent our vectors and you can see
- 1:26:26very clearly then when it comes to the
- 1:26:28two dimensional space so when we have
- 1:26:32R2 so then our vectors have just two
- 1:26:37rows so three and four four zero like in
- 1:26:40here when it comes to three dimensional
- 1:26:42space we have three entries and so on so
- 1:26:45the same holds of course also for for
- 1:26:47instance R5 then for R5 um our vectors
- 1:26:51so coordinate space can be for instance
- 1:26:53x y Zed and then GMA and then let's say
- 1:26:57Delta and then the coordinates uh of a
- 1:27:01vector in that space can be V and then
- 1:27:04arrow is equals sh and then we would
- 1:27:06have uh let's say A B C D E you get the
- 1:27:11idea so depending on the space the
- 1:27:13coordinate space and the dimension of
- 1:27:15that space then the corresponding
- 1:27:17vectors can be represented accordingly
- 1:27:24so the vectors are quantities that have
- 1:27:27both magnitude and direction as we just
- 1:27:29so distinguishing them from scalers
- 1:27:32which only have magnitude so we saw that
- 1:27:34the scalers got only magnitude while in
- 1:27:37case of vectors we saw both for the
- 1:27:39vector v and for the vector w we didn't
- 1:27:42we didn't only have the magnitude so the
- 1:27:44length of the vector but also the
- 1:27:46corresponding
- 1:27:48Direction so uh when it comes to the um
- 1:27:52vectors so the this is exactly what we
- 1:27:55just saw in our example a vector in a
- 1:27:57two dimensional space so in
- 1:28:01R2 uh can be represented by using this
- 1:28:04Square braces and the corresponding
- 1:28:07entries for X and Y where X is basically
- 1:28:09the x coordinate in our coordinate
- 1:28:12system so in our X and Y system whenever
- 1:28:16you have this x and y
- 1:28:19coordinate then uh this x coordinate
- 1:28:22Will then describe your magnitude and
- 1:28:25the y coordinate Will then describe your
- 1:28:27second entry that you need to put when
- 1:28:29representing your
- 1:28:32vectors so here the X and Y indicate the
- 1:28:36movement in the horizontal and in the
- 1:28:38vertical Dimensions respectively so for
- 1:28:41X's it's always the x coordinate so how
- 1:28:44far you move towards the horizontal
- 1:28:46Direction in here in here or independent
- 1:28:49in here so always take the x coordinate
- 1:28:52that is the value that you need to put
- 1:28:54first and then the Y need to be put it
- 1:28:56in here so indexing in vectors when it
- 1:29:00comes to the um indexing the standard
- 1:29:02mathematical notation uh indices in the
- 1:29:05N vectors goes from I is equal to 1 to I
- 1:29:09is equal to n so the um notation here
- 1:29:13can be bit ambiguous so AI uh could mean
- 1:29:16the E element of AI uh the a vector or
- 1:29:19the each Vector in a collection so let's
- 1:29:22start with a simple one and then move
- 1:29:24move on to this next part so what this
- 1:29:27means and what this means we will look
- 1:29:29into now so uh usually uh when we have a
- 1:29:35um n dimensional space we are having
- 1:29:38hard time visualizing it therefore we
- 1:29:40use this two dimensional space or
- 1:29:42maximum three-dimensional space in order
- 1:29:44to get an understanding of what these
- 1:29:46vectors are so we just s examples of
- 1:29:49them uh when uh creating our vectors in
- 1:29:52um V and V uh and W in uh R2 and also in
- 1:29:58R3 but we can have similar vectors also
- 1:30:02in R4 in
- 1:30:04R5 or all the way down to RN where n can
- 1:30:09be 100 200 500 any number as large as
- 1:30:13you want the thing is is that
- 1:30:16visualizing R 4 R5 RN is very hard but
- 1:30:20we can still benefit from this great
- 1:30:22properties of the vectors metrices and
- 1:30:25in general linear algebra in order to
- 1:30:27describe different things that have more
- 1:30:29than three dimensions therefore we have
- 1:30:32this a bit more ambiguous notation where
- 1:30:36we use r n and this n can be any real
- 1:30:40number and it can be all the way to
- 1:30:42Infinity so very large
- 1:30:44number and uh let's say we have a vector
- 1:30:47in this RN then this Vector is usually
- 1:30:51described by using similar Square uh
- 1:30:55brackets like before only with uh more
- 1:30:58entries so like before we got just one
- 1:31:01column so that's something that we
- 1:31:03didn't uh change but here we have
- 1:31:06instead of just two entries or three
- 1:31:08entries like in the two dimensional or
- 1:31:09three dimensional spaces now we have A1
- 1:31:12A2 A3 all the way down to a n minus one
- 1:31:18and a n so we got in total n elements in
- 1:31:23our column and this describes our uh
- 1:31:26single Vector so this Vector in an N
- 1:31:29dimensional space this we can call also
- 1:31:33a so one thing that we just saw is that
- 1:31:36it was saying in our definition and
- 1:31:38notation that uh we might also be
- 1:31:40dealing with the E Vector in a
- 1:31:43collection which means that sometimes
- 1:31:46you will
- 1:31:47see this while here the A1 A2 they are
- 1:31:51vector themselves so here
- 1:31:54we saw that these are just entries so A1
- 1:31:57is a number A2 is a number A3 is a
- 1:31:59number a n is just a number but it's
- 1:32:02also possible uh when you have a much
- 1:32:05more difficult and complicated case that
- 1:32:08you got an
- 1:32:09A let's write it down with a capital
- 1:32:12letter A which is equal to
- 1:32:17A1 or let's actually remove
- 1:32:21this so we got
- 1:32:24let's say
- 1:32:26A1
- 1:32:28A2 A3 all the way down to a n minus one
- 1:32:34and a
- 1:32:37n where you can already see what is
- 1:32:39going on so instead of having just a
- 1:32:41number as an entries instead we have
- 1:32:44vectors in here so our first element is
- 1:32:48actually Vector our second element is
- 1:32:50actually Vector so A2 Arrow A3 Arrow all
- 1:32:52the way down to a n arrow so while here
- 1:32:57this can be for instance some numbers
- 1:32:59let's say one one one all the way down
- 1:33:01to one
- 1:33:02one here we have a vector vector another
- 1:33:07vector and all the way down here yet
- 1:33:09another Vector where for instance let me
- 1:33:13remove this
- 1:33:16part where for
- 1:33:19instance A1 arrow is actually equal to
- 1:33:25A1 1 A1 2 A1 3 all the way down to A1 n
- 1:33:34one thing that you will notice here is
- 1:33:36that unlike in
- 1:33:39here here I got double indices so I got
- 1:33:44here a11 and then A1 2 and then a13 all
- 1:33:49the way to A1 n so the first index it
- 1:33:53doesn't change as I have here a one so
- 1:33:57I'm writing down the index corresponding
- 1:33:59to this Vector but the second index it
- 1:34:04changes per entry indicating which
- 1:34:07element specifically in the vector I'm
- 1:34:09talking about so from the first index
- 1:34:12you can identify the vector that I'm
- 1:34:15referring to which is A1 and from the
- 1:34:17second index you can see the
- 1:34:20corresponding um entry or the volume you
- 1:34:24that that um element is positioned in
- 1:34:28this Vector so you can see that this
- 1:34:30values for instance in the um Vector one
- 1:34:34so A1 to be more specific but then it is
- 1:34:37in the first position this is in the
- 1:34:39second position in the third position
- 1:34:41all the way down to the end position so
- 1:34:45this is something that is really
- 1:34:47important to understand well because
- 1:34:49this notation is going to appear time
- 1:34:52and time again across various
- 1:34:54applications of matrices and vectors so
- 1:34:57is really important to understand well
- 1:34:59therefore I want to go one more time
- 1:35:02through this to make sure that we are
- 1:35:04clear on what this indexes represent so
- 1:35:07whenever we have an index uh an a vector
- 1:35:11that we want to uh represent and it's um
- 1:35:14it has just um it is just a vector which
- 1:35:17means that it's not a nested vector
- 1:35:20vector in a vector then um we can Define
- 1:35:24it by let's say a and then on top an
- 1:35:26array and it's equal to and here we can
- 1:35:29have A1 A2 all the way down to a n so
- 1:35:35you can see what we are also referring
- 1:35:37as dimension of this Vector is equal to
- 1:35:41n by 1 so I got n entries and just one
- 1:35:46column so n by
- 1:35:49one which means that this already gives
- 1:35:51me an indication that most likely this
- 1:35:54A1 is a number this A2 is a number this
- 1:35:57a and is a number so let's say this
- 1:35:58equal to 1 2 uh three blah blah blah and
- 1:36:03then here I have let's say
- 1:36:07100 but if I'm dealing with the nested
- 1:36:11Vector later we will see that this can
- 1:36:13be represented by a matrix then um I can
- 1:36:18also Define
- 1:36:20this by capital letter A
- 1:36:24which is a common way to refer to either
- 1:36:26matrices or nested vectors and then this
- 1:36:30is equal to A1 Arrow A2 Arrow A3 Arrow
- 1:36:37this already sends a message to the
- 1:36:39reader that we are dealing with no
- 1:36:41longer U constants within a vector but
- 1:36:46rather vectors in a vector and uh what
- 1:36:50can we see here is that the dimension of
- 1:36:53this nested vector or which we can also
- 1:36:56refer to as a matrix here the number of
- 1:37:00rows so the number of entries this
- 1:37:02elements we can see it's equal to n but
- 1:37:05then this time the number of values that
- 1:37:08form these vectors is no longer one
- 1:37:11because we are not dealing with just a
- 1:37:13constant this is not some constant but
- 1:37:16rather this is yet another Vector so
- 1:37:19let's assume this Vector has a length of
- 1:37:21M so let's say this has a length of M
- 1:37:26then the dimension of this Matrix a is
- 1:37:29equal to M so something that we will see
- 1:37:32also when talking about
- 1:37:34matrices so let me actually clarify this
- 1:37:37bit more for better understanding let's
- 1:37:40say we look into one of those um one uh
- 1:37:44one other example of an entry so let's
- 1:37:47say we look into this specific Vector
- 1:37:49which is in the uh the third uh vector
- 1:37:53within this Vector capital A so this
- 1:37:58A3
- 1:38:02Vector so one thing to see here already
- 1:38:06is that I assumed that these vectors
- 1:38:09they got M elements and keep in mind
- 1:38:12that all these vectors they should be of
- 1:38:13the same size so it means that I already
- 1:38:16know that this specific Vector A3 has M
- 1:38:21elements so m elements so I'm
- 1:38:25representing this uh A3 Vector from here
- 1:38:29I'm taking this out from this entire uh
- 1:38:32nested a vector and I just want to
- 1:38:34represent this and now unlike this
- 1:38:38elements that got an arrow on the top
- 1:38:41this time I will have uh constants
- 1:38:45forming the A3 Vector so I no longer
- 1:38:47have vectors but I have elements in it
- 1:38:51so in here I will have
- 1:38:54a a let me actually write down all the
- 1:38:57A's but to refer and to make sure that I
- 1:39:00recognize that I'm dealing with the
- 1:39:02third a vector so a Tre Arrow here I
- 1:39:06will put three Tre all the way here Tre
- 1:39:09so they all come from the same third A3
- 1:39:11Vector but then their positions is
- 1:39:14different because this is let's say uh
- 1:39:17one two and then all the way down
- 1:39:20to Ed position
- 1:39:24so this indices help us to keep track
- 1:39:28what are the um position that these
- 1:39:32values are taking part in the vector A3
- 1:39:37errow this might seem bit complicated at
- 1:39:39the moment but once we move on onto bit
- 1:39:42more complex material like uh matrices
- 1:39:45it will make much more sense this is bit
- 1:39:47of an extra I just wanted to Showcase
- 1:39:50this but this is what uh is at its core
- 1:39:53and what you need to uh understand at
- 1:39:55the moment to understand this concept of
- 1:39:57vectors so you need to know that vectors
- 1:40:00can be represented by this arrow on the
- 1:40:02top so let's say Vector a and it has
- 1:40:05let's say n elements then you can write
- 1:40:07the square brackets and then you will
- 1:40:09need to mention A1 A2 all the way to a n
- 1:40:12which means that you have n different
- 1:40:14entries describing your vector so you
- 1:40:17have A1 which is the first element in
- 1:40:19your vector A2 the second element all
- 1:40:21the way to a n which is the end element
- 1:40:23where here you can see for instance so
- 1:40:26if I had here A3 that uh A1 is simply
- 1:40:30equal to one A2 is equal to 2 A3 is
- 1:40:33equal to 3 all the way to a n is equal
- 1:40:36to 100 so this numbers I'm basically
- 1:40:40taking and I'm representing them I'm
- 1:40:43putting them in here within Square
- 1:40:44braces in order to get a representation
- 1:40:47of my Vector so my Vector a has all
- 1:40:50these different entries and different
- 1:40:52entries and it starts with one and it
- 1:40:54ends with 100 this is a vector and then
- 1:40:57when it comes to the vectors within
- 1:40:59vectors here we need to be a bit more
- 1:41:02careful CU here we not just have uh
- 1:41:05constant values forming a vector but we
- 1:41:08have vectors that form yet not vectors
- 1:41:11so our Vector a our nested Vector a
- 1:41:15which we uh later will refer as Matrix a
- 1:41:20has actually entries that also are
- 1:41:22vectors so we have a 1 Vector A2 Vector
- 1:41:25A3 Vector they are not just constants
- 1:41:27but only own they are vectors so here
- 1:41:30for instance we have defined also an
- 1:41:32example of it we have said let's look
- 1:41:34into this third specific Vector that is
- 1:41:37part of a which is A3 uh vector and uh
- 1:41:41that one has M different
- 1:41:45elements here we have then the index
- 1:41:47referring to the which Vector from the
- 1:41:50nested Vector a it is which is the third
- 1:41:52one because we have taken it from here
- 1:41:55but then on its own this Vector has
- 1:41:57different members and different members
- 1:41:59to be more specific therefore we have
- 1:42:01also an index to keep track of the
- 1:42:04position of this value one to up to M
- 1:42:07and this can be yet another uh this time
- 1:42:10it can contain some elements an example
- 1:42:12of which is for instance Z 1 2 all the
- 1:42:16way to let's say 500 and this can be
- 1:42:20different numbers it doesn't need to be
- 1:42:22ordered it doesn't need to have a
- 1:42:24specific pattern they can be just random
- 1:42:26numbers describing this A3 Vector so
- 1:42:30hopefully this makes sense if it doesn't
- 1:42:32don't worry because we are going to see
- 1:42:34this time and time again I just wanted
- 1:42:36to give you a brief of an intro such
- 1:42:39that you can uh remember this when we
- 1:42:42come uh back to bit more uh complex
- 1:42:46topics like uh indexing in matrices so
- 1:42:50now let's talk about special vectors and
- 1:42:52operation
- 1:42:53here we are going to talk about zero
- 1:42:55vectors unit vectors the concept of
- 1:42:57sparcity in vectors as well as vectors
- 1:43:00in higher Dimensions like we just saw
- 1:43:02about this n dimensional space we will
- 1:43:05also talk about different operations we
- 1:43:07can apply when it comes to vectors like
- 1:43:09uh addition subtraction and then later
- 1:43:12on in the next module we will also talk
- 1:43:15about multiplication we will also be
- 1:43:17looking into the properties of vector
- 1:43:19addition after we have looked into some
- 1:43:21detailed examples when it comes to
- 1:43:23operations on
- 1:43:25vectors all right so let's start with
- 1:43:28the zero vectors and unit vectors when
- 1:43:30it comes to zero vectors you can see
- 1:43:32here already that um the zero and arrow
- 1:43:36on the top it basically refers to the
- 1:43:39vector like we saw before only with the
- 1:43:42difference that all its members are zero
- 1:43:45so you can see here that we have zero
- 1:43:49and then an arrow and then underneath
- 1:43:51here we have some number tree and then
- 1:43:53this is described by this common
- 1:43:56representation with the square braces
- 1:43:58and then three different members z0 0 so
- 1:44:02all zero and then it says in R
- 1:44:06Tre okay so why are we doing this well
- 1:44:10uh when it comes to uh different linear
- 1:44:13Lal operation sometimes we just need to
- 1:44:16add zero vectors or we just want to
- 1:44:18create zero vectors it's just easier to
- 1:44:21work with you we want to uh just create
- 1:44:24an empty uh Vector we want we know the
- 1:44:27length but we want to keep it empty such
- 1:44:30Laton we can add something on the top or
- 1:44:33knowing that when we add a zero on a
- 1:44:36number the number stays the same we can
- 1:44:38make use of this property to uh do
- 1:44:41different um uh tricks when it comes to
- 1:44:45programming in Python in SCAR or in C++
- 1:44:47Etc so therefore this idea of zero
- 1:44:50vectors can become very handy now one
- 1:44:53thing that you need to notice here is
- 1:44:55that we are not just writing down this
- 1:44:57zero to emphasize we are dealing with
- 1:45:00the vector but like uh before we have
- 1:45:02this error on the top emphasizing that
- 1:45:05we are dealing with a vector then what
- 1:45:08we are doing is that we are also adding
- 1:45:11the dimension of this Vector so in what
- 1:45:15dimension in what space are we um uh
- 1:45:18creating this zero Vector that this
- 1:45:20Vector is located is it in r R 2 in RN
- 1:45:24in R3 in this specific case you can see
- 1:45:26that in this example the uh index that
- 1:45:29we got here is three which basically
- 1:45:31indicates we are dealing with a zero
- 1:45:34Vector in threedimensional
- 1:45:36space so in the
- 1:45:39R3 uh in general we would just note this
- 1:45:42by n keeping the uh notation general
- 1:45:46which means that we are dealing with 0 0
- 1:45:49all the way down to zero so it has n one
- 1:45:53dimension in r
- 1:45:57n all right so this is about zero
- 1:46:00vectors it is just a way to uh make our
- 1:46:03programming life easier also to use it
- 1:46:05in different uh algorithms when it comes
- 1:46:08to bit more advanced
- 1:46:09algebra uh the next type of special
- 1:46:12vectors that we will look into is this
- 1:46:14unit vectors so vectors with a single
- 1:46:18element equal to one and all the others
- 1:46:21zero denoted as EI for the E unit Vector
- 1:46:25in N dimensions are referred by unit
- 1:46:28vectors
- 1:46:30so uh what we mean here when it comes to
- 1:46:34the unit
- 1:46:35vectors um if we have for instance E1 it
- 1:46:39means that we have a vector where the e
- 1:46:43in this case the first element is equal
- 1:46:45to one so you can see that E1 is equal
- 1:46:48to 1 0 0 so in the first element we got
- 1:46:53one and the remaining is zero and this
- 1:46:55is really important that we are dealing
- 1:46:57with vectors that contain only elements
- 1:47:00of zeros and ones and the only member
- 1:47:05that is equal to the only element in
- 1:47:06that Vector that is equal to one is the
- 1:47:08E element in the entire Vector all the
- 1:47:11remaining ones are zero and you can see
- 1:47:13here that the dimension is no longer
- 1:47:16specified but just the um index of the
- 1:47:19entry where the um uh the uh one is
- 1:47:24located so let's look at another example
- 1:47:27in here for instance when it comes to
- 1:47:29the um uh unit Vector yet another unit
- 1:47:33Vector is E2 which basically means that
- 1:47:36in the second element so in the second
- 1:47:40place uh the uh Vector contains one and
- 1:47:44all the other members are zero so here
- 1:47:46you can see Zero here it can see Zero
- 1:47:48only in the second element we have one
- 1:47:51and then in the E3 what we have here is
- 1:47:54that the third element is one and all
- 1:47:57the other ones are zero so let's
- 1:47:59actually look into uh one um bigger
- 1:48:04Vector uh in higher Dimension to make it
- 1:48:07even more sense so first I will Define
- 1:48:10and assume that we are dealing with a
- 1:48:12vector in RN so in an N dimensional
- 1:48:15space this gives me an idea that we are
- 1:48:17dealing with um so we are not dealing
- 1:48:20with nested Vector we are dealing with a
- 1:48:21simple and dimensional Vector so it has
- 1:48:24n rows and one column so using the
- 1:48:27square braces I'm going to represent my
- 1:48:30Vector so I have all these different
- 1:48:32members n members C so e let's say it is
- 1:48:40E5 so what does this mean it means that
- 1:48:43I is equal to 5 and this I element so
- 1:48:46the fifth element is equal to one and
- 1:48:49all the other entries the elements in
- 1:48:51this Vector are zeros so let's look into
- 1:48:54this is
- 1:48:56z0 0 Z I'm approaching the fifth element
- 1:49:01in my Vector so it's this one this is
- 1:49:04one and the remaining all zeros so this
- 1:49:09is a unit Vector in an N dimensional
- 1:49:12space and I'm defining it by
- 1:49:15E5 because my fifth element is equal to
- 1:49:18one now those are very handy when it
- 1:49:22comes to some other uh techniques in
- 1:49:24linear algebra and just in general think
- 1:49:27about techniques like um uh row etum
- 1:49:31form solving linear equation something
- 1:49:34that we will see as part of the next
- 1:49:36unit so many things um we can do by
- 1:49:40using unit vectors unit vectors are
- 1:49:42super important so you need to
- 1:49:45understand this concept uh very well
- 1:49:47such that later on you will understand
- 1:49:49uh more advanced concepts in linear
- 1:49:52algebra let now look into the topic of
- 1:49:54sparsity in vectors so by definition a
- 1:49:58sparse Vector is characterized by having
- 1:50:00many of its entries as zero so its
- 1:50:03parity pattern indicates the position of
- 1:50:06a nonzero
- 1:50:08entries so uh what we are basically
- 1:50:10saying is that if we are dealing with a
- 1:50:12vector that contains too many zeros we
- 1:50:16are dealing with the sparse Vector so uh
- 1:50:19this sparsity pattern indicates uh all
- 1:50:22Al the positions of a nonzero elements
- 1:50:26so um if we have um unit Vector it means
- 1:50:31that we are already dealing with a
- 1:50:33sparse uh Vector this is a concept that
- 1:50:37is super important when it comes to
- 1:50:38linear algebra but also in general data
- 1:50:41science machine learning and AI because
- 1:50:44having a spity in your vector it means
- 1:50:46that you don't have much of an
- 1:50:48information usually a value zero it
- 1:50:50means you don't know much about that
- 1:50:53specific volum and if you got just too
- 1:50:56many of zeros and too few numbers which
- 1:50:59do um provide information it means that
- 1:51:02you are dealing with a vector that
- 1:51:04doesn't provide you much information and
- 1:51:06there's always a problem when it comes
- 1:51:08to data science machine learning and AI
- 1:51:11so sparcity is something that you need
- 1:51:13to be aware of you need to know how to
- 1:51:15recognize it and you also need to know
- 1:51:17whe there's a problem in your specific
- 1:51:19case or not so let's look into an
- 1:51:22example let's say we are dealing with
- 1:51:25this Vector X that has five different
- 1:51:28elements so X is a vector coming from um
- 1:51:32five dimensional space so we have for
- 1:51:36instance an element of three the first
- 1:51:38entry then we have z0 in the second and
- 1:51:40third uh entries then we have an entry
- 1:51:43um four which coincident also contains
- 1:51:46value four and then the last element in
- 1:51:49our five dimensional Vector X is equal
- 1:51:52to zero
- 1:51:53now what do we see here we see that the
- 1:51:55majority of elements of a vector X is
- 1:51:59equal to zero because we got in total
- 1:52:01five
- 1:52:02elements and then we got three of it
- 1:52:06actually uh being equal to zero and only
- 1:52:09two of them containing information like
- 1:52:11equal to three and four so only two
- 1:52:14elements that are not zero so non-zero
- 1:52:17elements it means that 3 / to 4 which is
- 1:52:20basically 60% 60% of all the entries in
- 1:52:25the vector X are equal to zero so the
- 1:52:3060% it means that is above half so above
- 1:52:3450% 60% of all the information in this
- 1:52:38Vector um the majority is simply equal
- 1:52:41to zero this type of vectors we are uh
- 1:52:44calling sparse vectors and sparcity is
- 1:52:47really important concept uh that we need
- 1:52:49to keep in mind later on
- 1:52:53so uh while we can visualize vectors in
- 1:52:55two and three dimensions in linear
- 1:52:57algebra like we just saw in case of this
- 1:53:00n dimensional vectors
- 1:53:02visualizing uh the this type of higher
- 1:53:05dimensional vectors becomes very
- 1:53:07difficult so uh this mathematical
- 1:53:10flexibility uh to work with uh this type
- 1:53:14of uh information so when we can
- 1:53:17represent uh information many with many
- 1:53:20entries we can represent it by vector s
- 1:53:23which we can actually not visualize
- 1:53:25becomes very handy for complex data
- 1:53:28structures for different simulations in
- 1:53:30physics and much more so uh we just saw
- 1:53:33in couple of examples uh how we can
- 1:53:36represent vectors in a high dimensional
- 1:53:38space using this Square braces and this
- 1:53:41common Vector notation representation we
- 1:53:44saw that in an N dimensional space we
- 1:53:46could uh very easily represent this uh
- 1:53:50very large Matrix or
- 1:53:52vectors uh by just um using this Vector
- 1:53:56representation for instance if we got a
- 1:53:58vector that had any different entries
- 1:54:01where n is for instance thousand so
- 1:54:03let's say we have thousand then uh we
- 1:54:06can
- 1:54:07represent uh this uh vector or this
- 1:54:11information by using common Vector
- 1:54:13notation so A1 A2 all the way to a th000
- 1:54:18so of course we cannot visualize this it
- 1:54:21just doesn't make sense we can visualize
- 1:54:23two dimensional vectors we can visualize
- 1:54:25three dimensional vectors but we cannot
- 1:54:28uh visualize thousand dimensional
- 1:54:31vectors so Vector that comes from uh
- 1:54:35r, but what we can do is still make use
- 1:54:39of this very useful
- 1:54:41information in order to uh do different
- 1:54:44operations when and later on we will see
- 1:54:47that uh this property and specifically
- 1:54:50this part of linear algebra it helps us
- 1:54:53to work with vectors in any number of
- 1:54:55Dimensions whether thousands million
- 1:54:57billions this mathematical flexibility
- 1:55:00is super important for more complex data
- 1:55:03structures uh for metrix multiplications
- 1:55:07when for instance we are doing different
- 1:55:09uh algorithms including how we can
- 1:55:12represent uh very large matrices very
- 1:55:15large feature spaces all this different
- 1:55:18information we can represent just by
- 1:55:21making use of
- 1:55:22vectors coming from this specific uh
- 1:55:26part of linear
- 1:55:28algebra let's now finish of this module
- 1:55:31by looking into some applications of
- 1:55:33vectors so one common application of
- 1:55:36making use of vectors is uh when we are
- 1:55:39performing different operations while
- 1:55:41having words and we want to count those
- 1:55:44words so this is a super common
- 1:55:46application of vectors and we can
- 1:55:49account this words and you can even plot
- 1:55:50a histogram over how often each of these
- 1:55:53words appear in a document so a vector
- 1:55:57of a length n for instance can represent
- 1:56:00the number of times each of these words
- 1:56:02in a dictionary of n words appears in a
- 1:56:05document so uh just for the sake of
- 1:56:08Simplicity let's assume that we got um
- 1:56:11dictionary that contains only three
- 1:56:13words of course in the reality uh the um
- 1:56:17dictionary what we also refer often as
- 1:56:20Corpus it contains much many much more
- 1:56:22many words but for the Simplicity we
- 1:56:25will assume that we just got three
- 1:56:26different words in our dictionary so
- 1:56:28that's a total now let's assume that we
- 1:56:31got a document uh with these different
- 1:56:33words and we want to count how many
- 1:56:36times each of those words that we got in
- 1:56:38dictionary actually appear in our
- 1:56:40document so uh if our document is
- 1:56:44described by this Vector so it contains
- 1:56:47an entry of 25 2 and zero it means that
- 1:56:51in our our document we got
- 1:56:5625 word one in now from our dictionary
- 1:57:00so in the position one two * word two
- 1:57:06and zero *
- 1:57:09word three so basically we have a
- 1:57:13predetermined set of words in our
- 1:57:15dictionary in this case three words word
- 1:57:18one word two and word three and they
- 1:57:21have a specific IND specific position in
- 1:57:23our vector and when we are putting these
- 1:57:27values in here then the machine or the
- 1:57:31uh computer the program will understand
- 1:57:33that if we have 25 in the first position
- 1:57:36then the word one in the dictionary
- 1:57:40appeared 25 times in our document
- 1:57:43whereas the second word appeared only
- 1:57:45two times and the last word for three
- 1:57:47didn't appear at all so zero times in
- 1:57:50the entire document
- 1:57:52so let's look into a practical example
- 1:57:55actually to make even more
- 1:57:59sense so um this is by the way a common
- 1:58:03practice to count different variations
- 1:58:05of a word there are common application
- 1:58:07in engrams large language models
- 1:58:10Transformers they are just the
- 1:58:11Cornerstone of many language models when
- 1:58:14we want to count the words in the
- 1:58:18document to understand how often the
- 1:58:20word appears because this gives us a
- 1:58:22idea what this document is about knowing
- 1:58:24how many times the same word appears in
- 1:58:26that uh document it gives us an
- 1:58:29indication of the topic of uh the do
- 1:58:32document also we can make use of a to do
- 1:58:35sentiment analysis to understand what
- 1:58:37this document is about not only in terms
- 1:58:39of the topic but also is it a positive
- 1:58:42is it a natural or a negative uh
- 1:58:45document so to say so uh for instance if
- 1:58:50we got uh the following words uh that
- 1:58:53correspond to our dictionary and in our
- 1:58:56dictionary we got just um let's say 6
- 1:59:00different words then what we can do is
- 1:59:03that we can say 3 2 1 let's say Zer 4
- 1:59:09two and the corresponding words are
- 1:59:12word
- 1:59:14row
- 1:59:16[Music]
- 1:59:17number
- 1:59:20horse is
- 1:59:23and then
- 1:59:24document what this means is that we have
- 1:59:28a text what we refer as a document that
- 1:59:31contains three times the word
- 1:59:33word that contains two time the word row
- 1:59:37contains one time the word number zero
- 1:59:40times the word horse and four times the
- 1:59:42word eel and two times the word
- 1:59:47document so uh this is basically a
- 1:59:50common way represent presenting the uh
- 1:59:53frequency of the words in the
- 1:59:55document let me actually give you uh
- 1:59:58another example
- 2:00:01and in here I want to emphasize another
- 2:00:05thing the concept of stop words so uh
- 2:00:09let's say I make
- 2:00:12this 10 and then
- 2:00:16here I say there is a three times the
- 2:00:20word I
- 2:00:23two times the
- 2:00:25word uh
- 2:00:29reading two * the word
- 2:00:33library four times the word
- 2:00:36book 0er * the word
- 2:00:40shower and 10 times the word
- 2:00:45uh so uh you can see a that in here we
- 2:00:50are dealing with the document that
- 2:00:52contains 10 times the word uh which is
- 2:00:56what something that we refer as a stop
- 2:00:58word so those are things that actually
- 2:01:00don't give us too much information about
- 2:01:03what the document is about because uh
- 2:01:05it's just used everywhere but it is
- 2:01:07appearing too often so you can see 10
- 2:01:10times the most frequently appearing word
- 2:01:13this is what we refer as a stop word and
- 2:01:16then another thing that we can observe
- 2:01:18the second thing we can observe is that
- 2:01:20we are dealing most like ly with a
- 2:01:22document that describes library reading
- 2:01:25uh because you see the words like
- 2:01:26reading you see the word like book
- 2:01:29library but another word shower that is
- 2:01:32totally unrelated to reading book or
- 2:01:34library is appearing zero times so even
- 2:01:37by looking at discounts we can already
- 2:01:39get an idea what a topic of this
- 2:01:41document is about so uh you can see
- 2:01:45already know from this very basic
- 2:01:47example where I made too many
- 2:01:49assumptions regarding how small the the
- 2:01:51uh dictionary should be uh you can even
- 2:01:54see now how we can use discounts in our
- 2:01:58dictionary from our text in order to get
- 2:02:01idea about the topic of the document or
- 2:02:04topic of the conversation it can be
- 2:02:06topic of the uh tweets if you have a
- 2:02:08tweet data it can be topic uh regarding
- 2:02:12book if you have many book um uh book
- 2:02:16text it can be for instance the topic of
- 2:02:19the review if you got a reviews from uh
- 2:02:23Amazon for instance using this count can
- 2:02:26help you to get a topic regarding topic
- 2:02:31from that text then you can also use it
- 2:02:34to remove the stop wordss because
- 2:02:35usually the stop words are the most
- 2:02:37frequently P words it can also give you
- 2:02:40an idea about the sentiment for instance
- 2:02:42here we are dealing with natural
- 2:02:43sentiment it's not positive it's not
- 2:02:45negative it's just reading a book in
- 2:02:47library that kind of topic so all this
- 2:02:50can be super helpful when it comes to
- 2:02:52natural language processing that's a
- 2:02:54field where this uh text processing text
- 2:02:57cing and then using that for modeling
- 2:03:00purposes is what uh what plays a central
- 2:03:03role it also plays a super important
- 2:03:05role in the large language models in the
- 2:03:07Transformer models and uh in simple
- 2:03:10matters like uh back of words or uh in
- 2:03:15the uh TF IDF all these they are based
- 2:03:17on this idea of counting words and how
- 2:03:21we can use it information and you can
- 2:03:23see how vectors come into play in the
- 2:03:26different applications of linear algebra
- 2:03:29in data science natural language
- 2:03:31processing in artificial intelligence in
- 2:03:34machine learning so they are super
- 2:03:39important another application of vectors
- 2:03:42can be representing customer purchases
- 2:03:45for example an N Vector P so let's say p
- 2:03:51can record a customer purchases over
- 2:03:53time with pi being the quantity or
- 2:03:56dollar value of an item I now what does
- 2:03:59this mean so let's say we have Vector P
- 2:04:03that represents the customer purchases
- 2:04:06and we are dealing with a single
- 2:04:07customer and we are just saving over
- 2:04:10time that information how many time this
- 2:04:12customer has made purchases over
- 2:04:16time so the quantity is in the um
- 2:04:20dollars so the dollar value of item I
- 2:04:23purchase so we are basically keeping
- 2:04:25track of uh what is the value of the
- 2:04:29item I that the customer has purchased
- 2:04:34so what we can
- 2:04:36do is we can assume that in here
- 2:04:40actually it already Mak that assumption
- 2:04:42it says n Vector which means that the
- 2:04:45number of rows or number of um items
- 2:04:49that the customer purchases is
- 2:04:53n now what the um the problem says that
- 2:04:59it represents is that in each
- 2:05:03entry and here we have in total n
- 2:05:06entries we got a dollar value of item I
- 2:05:09which means that here if I have P1 P2
- 2:05:14all the way to PN and here somewhere in
- 2:05:16the middle I got Pi in the East position
- 2:05:20it means p Pi represents the
- 2:05:25value of
- 2:05:28item I so for example if I'm dealing
- 2:05:33with a
- 2:05:34customer that buys um let's say uh
- 2:05:40courses and uh the first item that the
- 2:05:44customer is buying is a mathematics
- 2:05:46course so I'm writing
- 2:05:49mathematics course and this is the first
- 2:05:52course that it buys e is by the way just
- 2:05:57a um way to refer to the E purchase so
- 2:06:02let's say um here somewhere in the
- 2:06:04middle the um customer decides to buy a
- 2:06:08deep learning course deep
- 2:06:12learning
- 2:06:14learning
- 2:06:17course and then it continues buying uh
- 2:06:20the customer continues buying courses
- 2:06:22and the last course that a customer buys
- 2:06:24is let's say um career
- 2:06:29coaching
- 2:06:31course
- 2:06:33now let's say the mathematics course
- 2:06:36costs uh around
- 2:06:40$1,000 let's say the uh deep learning
- 2:06:43course costs
- 2:06:46$33,000 and then let's say the career
- 2:06:48coaching service which is usually one of
- 2:06:50the most apply and personalized one can
- 2:06:53cost all the way to
- 2:06:56$5,000 now we see that in the each
- 2:07:00position this is the East position let
- 2:07:02me change the color by the
- 2:07:04way so let's say this is the East
- 2:07:07position this is the first position and
- 2:07:09this is the last position so those are
- 2:07:11just
- 2:07:13indices we can see that in the E
- 2:07:15position we got the
- 2:07:173,000 which means that the p e is equal
- 2:07:21equal to
- 2:07:24$3,000 so this indicates that in the
- 2:07:27East
- 2:07:28purchase the customer purchased deep
- 2:07:31learning course and the value of that
- 2:07:34item was equal to
- 2:07:40$3,000 all right so now we are ready to
- 2:07:43go on to next major topic which is about
- 2:07:46vector addition and subtraction so we
- 2:07:48are going to do some operations and
- 2:07:50apply this operations two vectors so
- 2:07:53let's first formally Define this ideal
- 2:07:55of vector addition so uh two vectors of
- 2:07:59the same size are added by adding their
- 2:08:01corresponding elements the result is a
- 2:08:04vector of the same size so uh let's
- 2:08:08unpack this it says two vectors of the
- 2:08:12same size are added by their
- 2:08:14corresponding elements so here it refers
- 2:08:18to two different vectors let's say
- 2:08:20vector v and Vector W and it says let's
- 2:08:24add them what we refer as vector
- 2:08:27addition and says for that what we need
- 2:08:30to do is to take all the elements of v
- 2:08:33and then all the elements of w and using
- 2:08:37their corresponding elements so
- 2:08:40indices that helps us to understand
- 2:08:43where those elements are located we are
- 2:08:45using in order to add each
- 2:08:47element in the vector v to the element
- 2:08:51of the vector W in the same position and
- 2:08:55do note that in the second part it says
- 2:08:58the result is a vector of the same size
- 2:09:01because we are adding two different
- 2:09:03vectors of the same size it's mentioning
- 2:09:07here it means if we add two different
- 2:09:09vectors to the same uh that have the
- 2:09:11same size we are going to end up with a
- 2:09:14vector that has the same
- 2:09:17size now once I go into the examples it
- 2:09:20will make much more per let's quickly
- 2:09:23also look into this concept of
- 2:09:25substraction so on its own uh
- 2:09:27substraction is very similar to this
- 2:09:29idea of addition so if we have a
- 2:09:31substraction let's say we have vector v
- 2:09:34We substract Vector W then we are doing
- 2:09:37basically uh what we just did to the
- 2:09:39addition only instead of uh doing add we
- 2:09:43are doing subtract so again we are just
- 2:09:46uh we are just subtracting from vector v
- 2:09:49Vector W they have the same size so we
- 2:09:52end up having the result which is a
- 2:09:55vector of the same size only one thing
- 2:09:59that you can see is that this can be
- 2:10:01also written as V Vector plus and then
- 2:10:05minus W so we basically can represent
- 2:10:09subtraction um on its own as a way of
- 2:10:13adding only we take the negative so the
- 2:10:16um opposite directed Vector so this will
- 2:10:20make even much more
- 2:10:22uh once we go on to the examples so
- 2:10:24let's look into our first operation
- 2:10:27example where we are adding two
- 2:10:29different vectors this a basic example
- 2:10:31we got just two dimensional two vectors
- 2:10:34we got Vector a that has entries two
- 2:10:37three and Vector B that has entries one
- 2:10:40form and what we are doing is that we
- 2:10:42are adding Vector a to Vector B we just
- 2:10:45learned that a we need to have the same
- 2:10:48size of vectors so you can see that
- 2:10:50Vector a has a dimension 2 by one vector
- 2:10:53B has a dimension of 2 by one so their
- 2:10:56sizes is the same both they got two
- 2:10:59entries only two
- 2:11:02elements and at the same time we just
- 2:11:04learned that what we need to do is to
- 2:11:06take their corresponding elements and
- 2:11:09add them to each other now what does
- 2:11:11this mean it means that we take from a
- 2:11:16the first element
- 2:11:19two and then we take the first element
- 2:11:22of the second Vector which is the B so
- 2:11:25we take the two from here and one from
- 2:11:28here the first element of a and the
- 2:11:30first element of B and then we are
- 2:11:32adding them to each other 2 + 1 is equal
- 2:11:35to three and then the same holds for the
- 2:11:38second and Tre so three which is the
- 2:11:40second element of vector a and then four
- 2:11:43which is the second element of vector B
- 2:11:45we are saying 3 + 4 is = to 7 so let me
- 2:11:49write it down even in a simpler manner
- 2:11:51such that it will make much more sense
- 2:11:54so Vector a has elements 2 three in the
- 2:11:57first element we got two in the second
- 2:11:59element we got three so a then we want
- 2:12:04to add B which has in the first element
- 2:12:07element equal to 1 and the second
- 2:12:09element is equal to 4 this means that if
- 2:12:12we want to add these vectors 2
- 2:12:153+ 1 4 this is equal to we need to take
- 2:12:20two we need to add one so this element
- 2:12:24and this element and then we need to
- 2:12:25take three we need to add to four so
- 2:12:28this one and this one which is equal to
- 2:12:312 + 1 is equal to 3 3 + 4 is equal to 7
- 2:12:34so we got uh Vector
- 2:12:3837 do you note that this Vector the
- 2:12:41result Vector contains again two
- 2:12:43elements and just one column so 2 by 1
- 2:12:47so you notice that the sign that the
- 2:12:49size is the same of this result
- 2:12:53Vector now let's actually generalize
- 2:12:55this concept before moving on to the
- 2:12:57next example so if we got let's say
- 2:13:03Vector
- 2:13:05a that contains n elements A1 A2 all the
- 2:13:10way down to a
- 2:13:13n and it is
- 2:13:16from n dimensional
- 2:13:19space and we got Vector
- 2:13:24B that also has n elements so remember
- 2:13:27that they both need to have the same
- 2:13:29size so B1 B2 all the way to b
- 2:13:34n so they come also so B comes also from
- 2:13:39n dimensional
- 2:13:44space so then when we add a to B this is
- 2:13:50equal to
- 2:13:55A1 A2 all the way to a
- 2:14:00n
- 2:14:02plus B1 B2 all the way
- 2:14:07to
- 2:14:10BN so n by one n by one the sizes this
- 2:14:14is equal
- 2:14:16to let me actually use this color to
- 2:14:19make it even more visible so I for the
- 2:14:21first entry for my result factor I will
- 2:14:26get A1 + B1 then A2 + B2 so all the way
- 2:14:32down onto the end element which is a n
- 2:14:40plus then me use a different color A1
- 2:14:44B1
- 2:14:45B2 b
- 2:14:48n so you can notice is now in general
- 2:14:53terms what we are doing here so we are
- 2:14:55taking the A1 coming from the vector a
- 2:15:00we are adding in the same
- 2:15:03uh position the value that comes from
- 2:15:07Vector B which is B1 we are saying take
- 2:15:10the A1 Plus B1 this is the uh first
- 2:15:14element so the position stays the same
- 2:15:16and then in the result Vector so we take
- 2:15:19all the corresponding values that are
- 2:15:22have the same position in the
- 2:15:24corresponding Vector first from Vector a
- 2:15:26and then Vector B we are adding them and
- 2:15:28this forms our new vector and this new
- 2:15:31Vector will again have a size n by one
- 2:15:35so you can see that a the sizes of the
- 2:15:38two vectors are the same both have n
- 2:15:40elements and then we are using their
- 2:15:43corresponding elements to add them to
- 2:15:45each other element wise and then we are
- 2:15:47getting the result that has the same
- 2:15:49size so n by 1 so this is a more General
- 2:15:53description of how you can add two
- 2:15:58vectors let's now look into this
- 2:16:00specific example so we have a vector
- 2:16:03with the entry 073 so this comes from R
- 2:16:07three you can see so three dimensional
- 2:16:09vectors the second Vector is 1 2 0 and
- 2:16:13then the final result is 1 193 so how we
- 2:16:16got this we took zero we added 1 7 we
- 2:16:20added two and then three we added zero
- 2:16:23so you can see all these
- 2:16:25elements element Y and then this is
- 2:16:28equal to 0 + 1 is 1 7 + 2 is 9 and then
- 2:16:313 + 0 is 3 exactly what we got here so
- 2:16:35again the same sizes and the result is
- 2:16:38from the same
- 2:16:39size so quite
- 2:16:41straightforward now when it comes to the
- 2:16:43vector substruction what are we doing
- 2:16:46that um so what are we doing here so we
- 2:16:50are doing kind of very similar thing we
- 2:16:53are taking this element one we are
- 2:16:56subtracting the other one in this first
- 2:16:59element then we are taking the nine in
- 2:17:01the second position and subtracting this
- 2:17:05again from the second position of the
- 2:17:06second vector and we are putting in here
- 2:17:091 and then 1 - 1 is = to 0 9 y - 1 is =
- 2:17:13to 8 so we get result Factor 08 like in
- 2:17:17here and you can see that the sizes stay
- 2:17:20the same so also in this case let's
- 2:17:22write more General um this idea of
- 2:17:25subtraction if we got a vector
- 2:17:29a
- 2:17:31from RN so n dimensional space and it
- 2:17:34can be represented by A1 A2 all the way
- 2:17:38down to a n so it has n elements n by
- 2:17:43one and then we got
- 2:17:47B also from RN so coming from the n
- 2:17:51dimensional space which means that it
- 2:17:53got n elements so B1 B2 all the way down
- 2:17:57to BN again with the same size n by one
- 2:18:02then a minus B is simply equal
- 2:18:08to a A1 let me actually use the same
- 2:18:13colors to make it easier to
- 2:18:18follow so let me first draw my Square
- 2:18:23races and then here I will use blue for
- 2:18:28a and then red for the uh color for
- 2:18:32second Vector which is
- 2:18:34B here I will use black
- 2:18:44minus then given that the same size
- 2:18:48should be for the result Vector I I
- 2:18:50already know that I expect n different
- 2:18:53elements for this and then
- 2:18:56here I'm taking
- 2:19:01this first element that comes from
- 2:19:04Vector
- 2:19:05a I substracting from this the first
- 2:19:09element that comes from Vector B so
- 2:19:11element wise subtraction B1 and I'm
- 2:19:15already getting the result for the first
- 2:19:18element in my result Vector so you can
- 2:19:22see A1 minus B1 I'm taking this element
- 2:19:26and this element and subtracting them
- 2:19:28from each other to get A1 minus B1 and
- 2:19:31then the same holds for all the other
- 2:19:34values only coming from different
- 2:19:37elements from Vector
- 2:19:40a subtracting from this the
- 2:19:44corresponding values element Wise from
- 2:19:47the vector B so B2 B3 all the way to a n
- 2:19:52so you can see that in my result
- 2:19:55Vector a vector minus B Vector in the
- 2:19:58first element I get A1 minus B1 then A2
- 2:20:02- B2 then A3 - B3 in the third element
- 2:20:05all the way down to the end element
- 2:20:07which is equal to oh this should be b a
- 2:20:11n minus
- 2:20:12BN so um this already should makes uh
- 2:20:16much more sense so every time we take
- 2:20:18the element in the same position from
- 2:20:20one vector than the other we subtract
- 2:20:23from each other in order to get the
- 2:20:24corresponding element in the final
- 2:20:29Vector all right so let's now uh before
- 2:20:33moving on to the
- 2:20:34properties um I want to to show you um
- 2:20:39this only in a coordinate space so what
- 2:20:43this means in terms of visualization in
- 2:20:45a coordinate
- 2:20:47space so uh let's say we have a
- 2:20:52coordinate
- 2:20:58space this is my Y
- 2:21:05axis this is my x axis
- 2:21:09so this is X and the Y and this is my
- 2:21:14Center so 0
- 2:21:160 and what I'm doing here
- 2:21:21is
- 2:21:22simply I want to have Vector a let's say
- 2:21:27this is just um Vector a simple one with
- 2:21:31the coordinates um let's say four and
- 2:21:35minus
- 2:21:372 and I got Vector
- 2:21:40B let me use a different
- 2:21:44color Vector
- 2:21:47B that has coordinates
- 2:21:51let's
- 2:21:53say
- 2:21:56minus 4 and
- 2:22:00four so let's actually visualize them
- 2:22:03let's first start with D Vector a uh
- 2:22:07which has a x value of
- 2:22:10four three
- 2:22:12four one 2 three and
- 2:22:15four and the Y value minus 2 so this
- 2:22:25is my Vector
- 2:22:30a and let's now visualize the vector B
- 2:22:35so minus 4 and
- 2:22:374 which means
- 2:22:43that let me
- 2:22:45actually extend
- 2:22:48this this is minus 4 so the x coordinate
- 2:22:52is min - 4 so it should be here and then
- 2:22:56the y coordinate is four so 1 2 3 and 4
- 2:23:01it's this one which means that my Vector
- 2:23:06B is this
- 2:23:13one all
- 2:23:16right so you can see now that the vector
- 2:23:20a is in here and the vector B is in
- 2:23:23here now what I want to do is to add
- 2:23:27these two vectors to each other so what
- 2:23:30I want to do is to take this Vector
- 2:23:34a and add to
- 2:23:37this the vector B which
- 2:23:42is is equal to 4 - 4 = 0 and then - 2 +
- 2:23:484 is = 2 so zero and then two it
- 2:23:57is z and
- 2:24:03two
- 2:24:11two so this is my result Vector so now
- 2:24:18when we are clear on how we can in
- 2:24:20vector s how we can perform these
- 2:24:21different operations and what it means
- 2:24:24in practice when it comes to looking at
- 2:24:26the vectors in a cordan space and adding
- 2:24:29them or subtracting them we are ready to
- 2:24:31look into the properties of vector
- 2:24:35additions so this is something that will
- 2:24:37definitely seem familiar to you uh from
- 2:24:40pre-algebra where we are basically using
- 2:24:43all these properties that we already
- 2:24:45know that holds for uh numeric values
- 2:24:48for the scalers that being transferred
- 2:24:50to this Vector space so we are going to
- 2:24:54talk about this four different
- 2:24:56properties that a vectors have the first
- 2:24:58one is the cumulative property which
- 2:25:01says that if we add a vector a to Vector
- 2:25:05B then this is the same as adding a
- 2:25:08vector B to Vector a so basically the
- 2:25:11order of the vectors doesn't really
- 2:25:13matter when it comes down to adding them
- 2:25:16so formally A + B is equal to B+ a for
- 2:25:19any vectors A and B of the same size
- 2:25:23then we have associative property which
- 2:25:26says A + B + C is equal to a + b + C we
- 2:25:33can write both As A + B + C now what
- 2:25:37does this mean we know from pre-algebra
- 2:25:39that this parenthesis means first do
- 2:25:42this addition and then do the the rest
- 2:25:45of operations in here it basically says
- 2:25:47if you add a to the B first and then you
- 2:25:51add the C is the same as first you add B
- 2:25:55to the C and then on the top of that you
- 2:25:57add D Vector a so then the third
- 2:26:02property is addition of zero vectors
- 2:26:04which says if we add a zero Vector to
- 2:26:06Vector a then this is equal to adding a
- 2:26:10vector zero to a and this is equal to
- 2:26:13Vector a so adding the zero Vector has
- 2:26:16basically no impact on the vector
- 2:26:19whatsoever
- 2:26:21then the final property is subtracting a
- 2:26:23vector from itself which means if we
- 2:26:25take the vector we substract the same
- 2:26:27Vector from itself so a minus a and we
- 2:26:30get a zero Vector so a minus a is equal
- 2:26:34to zero vector and this heals the zero
- 2:26:37Vector now let's look into each of those
- 2:26:39properties one by one and let's uh look
- 2:26:42into specific examples uh in some cases
- 2:26:45we will prove this on the example that
- 2:26:47we have to make this Concepts much more
- 2:26:50clear so let's start with this
- 2:26:52cumulative property of vector additions
- 2:26:56so we want to see whether A+ B is equal
- 2:26:58to B + a so let's say we have a vector
- 2:27:03a that has coordinates or magnitude and
- 2:27:08direction that is equal to one and two
- 2:27:12then we have a vector uh let's say
- 2:27:18B that has a magnitude and direction of
- 2:27:22- 2 and
- 2:27:253 so the first thing that we want to
- 2:27:28check is indeed whether the A + B is
- 2:27:32equal to B +
- 2:27:34a so therefore let's first calculate
- 2:27:37this part and then we will calculate
- 2:27:39this part that I will Define by one and
- 2:27:41two and we will see whether we are
- 2:27:43indeed having the same value the same
- 2:27:46vector or not so let's see so we have
- 2:27:48here a
- 2:27:50so A + B which is the first value that
- 2:27:55we want to calculate a plus b is = to 1
- 2:28:012+ -
- 2:28:0323 and we learned before that this is
- 2:28:06simply equal 2 take this value and then
- 2:28:09add this one so 1 + - 2 and then 2 +
- 2:28:153 so this gives us a vector 1 - 2 is =
- 2:28:20to - 1 and 2 + 3 is = 5 so we get that A
- 2:28:25+ B is = to -1 5 this Vector now let's
- 2:28:30look at the second quantity so B Vector
- 2:28:33B plus Vector a this is equal to - 2 3 +
- 2:28:391 2 and this is equal to - 2 + 1 and
- 2:28:44then 3 + 2 this gives us - 2 + 1 is =
- 2:28:49to- 1 and 3 + 2 is equal to 5 so we can
- 2:28:53already see from here that the quantity
- 2:28:57one is indeed equal to quantity 2 which
- 2:29:01proves that indeed the A + B is equal to
- 2:29:05B+ a what this basically means is that
- 2:29:09adding two different vectors the
- 2:29:11direction or the order is not important
- 2:29:14whether you add a on the top of the b or
- 2:29:16B to a it doesn't matter at the end is
- 2:29:19the same and actually you can also see
- 2:29:21it if you uh combine this or if you do
- 2:29:25this in more general terms so let's say
- 2:29:28if we
- 2:29:29have a vector a which is equal to in an
- 2:29:33N dimensional space A1 A2 up to a n so
- 2:29:39it has n by one dimension and you have a
- 2:29:42vector B with the same size from the
- 2:29:46same RN
- 2:29:48Dimension and it has element B1 B2 up to
- 2:29:52BN and the dimension is equal to M by1
- 2:29:56then if we calculate first
- 2:29:59A+
- 2:30:01B and this is equal to Simply A1 + B1 A2
- 2:30:07+ B2 up to a n +
- 2:30:12BN and if you calculate the second uh
- 2:30:16amount which is B+ a
- 2:30:20this is equal to B1 + A1 B2 + A2 up to
- 2:30:27BN + a n you can see that A1 + B1 is
- 2:30:35equal to B1 + A1 simply from prealgebra
- 2:30:39you know that if those are all constants
- 2:30:41for instance 2 + 3 is equal 3 + 2 in the
- 2:30:45same way A2 + B2 is = to B2 + A2 and
- 2:30:50then here up to a n + BN is equal to BN
- 2:30:55+ a n what this means is that all these
- 2:30:58elements they are basically the same
- 2:31:01which means that we already have a proof
- 2:31:04so we get this proof and we can see that
- 2:31:07even for the general term independent
- 2:31:10what this Vector a is what this Vector B
- 2:31:12is that a + b is equal to B + a
- 2:31:20this is exactly what we saw before in
- 2:31:23the first property which is called
- 2:31:24commutative property of the vectors that
- 2:31:27a plus b is equal to B+ a now let's move
- 2:31:30on to the other property which is called
- 2:31:32associative property of the vectors now
- 2:31:35what this property does and says is that
- 2:31:38a plus b so first we do this plus C is
- 2:31:41equal to a + b + C and this is then
- 2:31:46equal to a + b + C now let's then see um
- 2:31:50this specific property on an actual
- 2:31:54example so what this basically says is
- 2:31:57that if we have this example where a is
- 2:32:00equal to actually I had this before let
- 2:32:03me simply just remove this part let's
- 2:32:07then add our third Vector which is C and
- 2:32:11let's call it let's say it has a
- 2:32:14representation of four and
- 2:32:17five then the IDE behind this property
- 2:32:21is that what we need to prove here that
- 2:32:25A + B within the parenthesis plus C is
- 2:32:29equal to
- 2:32:34a
- 2:32:43plus B+
- 2:32:46C and then this is equal to a plus b
- 2:32:52plus C so let's see actually whether
- 2:32:55this is indeed true for this specific
- 2:32:57case now this should come very intuitive
- 2:33:01so I'm going to do it very
- 2:33:02quickly so first we have this quantity
- 2:33:05this one then we have this one and the
- 2:33:07third one let's do it very quickly so A
- 2:33:11+
- 2:33:12B plus
- 2:33:15C is equal to
- 2:33:20one Tu
- 2:33:24plus and then we had C so it is
- 2:33:30simply 4
- 2:33:32five and then this is equal to we saw
- 2:33:36before when doing this that we were
- 2:33:38getting
- 2:33:391 - 2 2 + 3 and then we add this four
- 2:33:46five this is simply equal to 1 - 2 is
- 2:33:52-1 and 2 + 3 is
- 2:33:565 + 4
- 2:34:005 now given that it doesn't really
- 2:34:02matter no longer that we have uh here
- 2:34:05parenthesis or not this basically means
- 2:34:09that this volue is simply equal
- 2:34:14to -1 + 4 so here -1 + 4 here 5 +
- 2:34:215 so this is then equal to three and
- 2:34:26then
- 2:34:2610 all
- 2:34:29right let's then now quickly do the
- 2:34:33second amount which says first add the
- 2:34:36vector B to Vector
- 2:34:39C and only then add the vector a on the
- 2:34:42top what this means is that we need to
- 2:34:45take one two this is Vector a and we
- 2:34:47will only add this once we have added D
- 2:34:50minus 23 the vector B plus to the Vector
- 2:34:5645 okay
- 2:34:58so we can see that we are just leaving
- 2:35:01this in here let's first add this two
- 2:35:04minus
- 2:35:072 + 4 3 +
- 2:35:125 so this gives us 1
- 2:35:162+ - 2 + 4 is uh 2 and then 3 + 5 is 8
- 2:35:22so this gives
- 2:35:24us let me remove this
- 2:35:30calculations so this gives us 1 + 2 is =
- 2:35:34to 3 and then 2 + 8 is equal to 10 okay
- 2:35:40great so now we got already the quantity
- 2:35:441 being equal to quantity 2 let's check
- 2:35:47whether this is all equal to this one it
- 2:35:50should already be um something that you
- 2:35:53see now given that um we know just from
- 2:35:56mathematics that parentheses doesn't
- 2:35:58really matter when it comes to the
- 2:35:59scalers and adding two vectors is
- 2:36:02basically very close to this idea of
- 2:36:04addited property um of the edited
- 2:36:07property of the scalers but just let's
- 2:36:10quickly do it to be 100% sure so when we
- 2:36:13take this Vector a to the B and to the C
- 2:36:16we had all this this is equal to one
- 2:36:19want to added to minus 2 three and then
- 2:36:24added this to four and five now what
- 2:36:27this is equal
- 2:36:29to let me actually write this in bit
- 2:36:32shorter way such that it can be all fit
- 2:36:35in in the small place so 1 2 + - 2 3 + 4
- 2:36:445 this is equal to basically 1 - 2 + + 4
- 2:36:50and then 2 + 3 +
- 2:36:525 now what is this
- 2:36:59number 1 - 2 + 4 is simply equal to 1 -
- 2:37:032 is = to -1 and then + 4 is equal to 3
- 2:37:07so first element is three 2 + 3 + 5 is
- 2:37:10equal to 5 + 5 which is equal to 10
- 2:37:14perfect so now we get the confirmation
- 2:37:16that indeed a + b plus c C is = to A + B
- 2:37:21+ C is = to A + B +
- 2:37:26C so let's quickly also look into this
- 2:37:29addition of zero vector and the
- 2:37:31subtracting a vector from itself
- 2:37:32properties and uh the detailed
- 2:37:35explanation of this or example of this I
- 2:37:37will leave it to you so when it comes to
- 2:37:39this A+ um 0 is equal to 0 + a is equal
- 2:37:43to a so this property let's say if a is
- 2:37:47equal to this 23 and then we are adding
- 2:37:51on this a plus some zero Vector which
- 2:37:55basically means take two three and then
- 2:37:58added the same size of zero Vector you
- 2:38:01can see that this is the same as adding
- 2:38:04this zeros on these values now what do
- 2:38:08we get we get that this is equal to 2 +
- 2:38:120 is 2 and then 3 + 0 is
- 2:38:15three there we go so we already see very
- 2:38:18quickly that it doesn't really matter
- 2:38:21whether we add a zero Vector to this
- 2:38:23original a vector or not we in all cases
- 2:38:27it just adding a zero Vector has no
- 2:38:29effect and seeing from the commutative
- 2:38:32property that a plus b is equal to B+ a
- 2:38:35we already know that if um a + 0 is
- 2:38:38equal to uh a and is equal to this then
- 2:38:42also 0 + a will be the same and we can
- 2:38:47see indeed that we just saw that a a + 0
- 2:38:50is simply equal to a so we basically
- 2:38:52have quickly proven all
- 2:38:54this now when it comes to the
- 2:38:56subtracting Vector from itself I think
- 2:38:59this is a very nice one just to see how
- 2:39:01we um uh take the same vector and
- 2:39:04subtract from that value and we get zero
- 2:39:07and this is very similar to working with
- 2:39:09just real numbers in the same way as 3
- 2:39:12minus 3 is equal to Z also when we have
- 2:39:15a vector consisting of the scalers like
- 2:39:18a is equal 2
- 2:39:2123 in the same manner if we take this a
- 2:39:25and we subtract it from itself so A Min
- 2:39:27- A then what we will get is 23 - 23 and
- 2:39:33this will give us 2 - 2 is 0 and then 3
- 2:39:36- 3 is zero so we get a vector zero so
- 2:39:39zero
- 2:39:41Vector so now when we are clear on how
- 2:39:44we can perform different operations on
- 2:39:45our vectors and also we know uh what are
- 2:39:48the prop properties of uh adding and
- 2:39:51subtracting uh different vectors we are
- 2:39:54ready to move on to a bit more advanced
- 2:39:56topics so uh in this module we are going
- 2:39:58to discuss this idea of scalar
- 2:40:01multiplication we're going to look into
- 2:40:03the example how uh what happens and how
- 2:40:06we can do the uh Vector multiplication
- 2:40:09with the scalar then we are going to uh
- 2:40:11look into the span of vectors what it
- 2:40:14means to have a sp of vectors uh what is
- 2:40:17this IDE of linear combination and the
- 2:40:19relationship between the span and linear
- 2:40:21combination and the unit vectors then we
- 2:40:24are going to look into the application
- 2:40:26of scalar Vector multiplication in audio
- 2:40:29scaling uh example and then finally we
- 2:40:32are going to finish off this module by
- 2:40:34looking into the length of a vector and
- 2:40:36a DOT product and we are going to uh go
- 2:40:39back to this idea of distance
- 2:40:42understanding vector magnitude and
- 2:40:44understanding Vector
- 2:40:46l so let's get started now before we
- 2:40:49look into this idea of span and linear
- 2:40:51combination I quickly wanted to look
- 2:40:54into this idea of scalar multiplication
- 2:40:56and the um specific definition of it so
- 2:41:00formally the scalar multiplication
- 2:41:02involves multiplying each component of a
- 2:41:05vector by scalar value effectively
- 2:41:07scaling the vector's magnitude so what
- 2:41:10do I mean here let's say we have a
- 2:41:13vector and I will write it in the
- 2:41:16general terms to keep everything General
- 2:41:18so let's see we have a vector a let me
- 2:41:21pick up my pen a and this Vector a is
- 2:41:26from n dimensional space so it is from
- 2:41:30RN and it can be represented by A1 A2 up
- 2:41:35to a
- 2:41:36n and I have this magnitude um of a
- 2:41:41vector and now I want to scale this uh
- 2:41:45Vector for which I know the magnitude
- 2:41:47and the direction I want to scale it
- 2:41:49with a scaler and we learned before that
- 2:41:51the scaler is just a number so um scaler
- 2:41:55in this case I will be uh referring it
- 2:41:58to uh by C so c will be my scaler and uh
- 2:42:02this comes from R which means that it's
- 2:42:05a real
- 2:42:06number let me actually use a different
- 2:42:10color to make it easier to
- 2:42:13follow okay so my scaler will be with
- 2:42:16the color uh red so C and C comes from
- 2:42:23R
- 2:42:25so what do I mean by scalar
- 2:42:27multiplication I mean that I want to
- 2:42:29find what is
- 2:42:32this c
- 2:42:35times
- 2:42:37a this is what we mean by scalar
- 2:42:41multiplying with Vector now what does
- 2:42:44this definition say it says when we are
- 2:42:47multiplying scalar we Vector so the
- 2:42:50scalar multiplication meaning
- 2:42:51multiplying Vector with the scalar it
- 2:42:54involves multiplying each component of a
- 2:42:57vector by a scalar volume so if we
- 2:43:00translate it to this specific example it
- 2:43:03means
- 2:43:04that this
- 2:43:06amount so this amount is equal
- 2:43:16to taking C and multiply find it with
- 2:43:20each
- 2:43:21element of this Vector so each component
- 2:43:25of vector and what are the components of
- 2:43:27my Vector the A1 A2 a up to the point of
- 2:43:31a n so all these
- 2:43:33components so that means that the first
- 2:43:35element of this new Vector the scalar
- 2:43:39multiplication result will be C *
- 2:43:44A1 C * A2
- 2:43:49dot dot dot so all this middle elements
- 2:43:51and at the end again c times and then a
- 2:43:57n and then in both cases of course the
- 2:44:01number of elements doesn't change so the
- 2:44:03so the number of rows of my Vector
- 2:44:06doesn't change it's n so here also n and
- 2:44:09then number of columns is the same so
- 2:44:11it's just a column Vector so one
- 2:44:15column so what we see here is that we go
- 2:44:18from a 1 to C * A1 we go from A2 to C C
- 2:44:23* A2 up to the a n transforms into C * a
- 2:44:29n so we see very easily that I keep all
- 2:44:33the elements from this Vector I take
- 2:44:35them in here and instead what I'm doing
- 2:44:37is that I'm multiplying every element
- 2:44:40from this vector by the scaler
- 2:44:44C so this is exactly what this
- 2:44:46definition says and let's actually go
- 2:44:50ahead and do a Hands-On example with
- 2:44:54some real numbers to have this um method
- 2:44:58and to have this uh definition very
- 2:45:00clear in our mind because we are going
- 2:45:02to make use of this fundamental
- 2:45:04operation scalar multiplication on and
- 2:45:07on in the upcoming lectures and just in
- 2:45:09general in your journey in any applied
- 2:45:13sciences so this is an example of scalar
- 2:45:16multiplication uh here what we are doing
- 2:45:18is that we want to multiply this Vector
- 2:45:21C so in this case the vector is defined
- 2:45:25by a letter C and then on the top we can
- 2:45:27see the arrow indicating that this is
- 2:45:29the vector now and here we refer the
- 2:45:32scalar by a letter K we are saying we
- 2:45:36want to perform scalar multiplication
- 2:45:38which means that we want to
- 2:45:40multiply the uh a vector C by the scaler
- 2:45:45K so how we can do that so what we want
- 2:45:49is to multiply K by C and we just
- 2:45:52learned that for that what we need to do
- 2:45:56let me write this
- 2:45:57over so this equal to minus 2 multiply
- 2:46:04it by 4 - 3 this is my Vector so this is
- 2:46:09the K and this is the C this is equal to
- 2:46:13so I take my
- 2:46:15scaler and I multiply it with the each
- 2:46:18of the ele element of the C so - 2 * 4
- 2:46:21and then - 2 *
- 2:46:25-3 so - 2 * 4 is = to - 8 and then - 2 *
- 2:46:32- 3 so- minus it goes away it becomes a
- 2:46:35plus and 2 * 3 is 6 so my end result the
- 2:46:39K * C is equal to - 8 6 this is my final
- 2:46:45result so let's quickly also do yet
- 2:46:49another example and this one is a unique
- 2:46:52one because it's relating to this idea
- 2:46:54of U multiplying something with a zero
- 2:46:59uh which is something that we also uh
- 2:47:01know from a high school that when we
- 2:47:03multiply number let's say seven by zero
- 2:47:06we are getting zero and here in this
- 2:47:09example the uh problem is describe the
- 2:47:13effect of a scalar multiplication by
- 2:47:15zero on any Vector which means
- 2:47:19what we are doing is that in this
- 2:47:21example is we want to know what is this
- 2:47:24result
- 2:47:25of any Vector let's say Vector uh C so
- 2:47:29we will use the same example C only this
- 2:47:32time instead of multiplying it with
- 2:47:34scalar k equal to minus 2 our scalar
- 2:47:36will be zero which means that c is equal
- 2:47:39to 4 - 3 and then K is now equal to zero
- 2:47:43and we want to find out what is this K *
- 2:47:47C let me actually write down the K with
- 2:47:50a different
- 2:47:58color k is equal to zero so what we want
- 2:48:02to find out is K * and then
- 2:48:05C and this is that equal
- 2:48:12to0 so I'm taking the
- 2:48:15k0 times then I'm taking each of the
- 2:48:19elements of C which is four and then
- 2:48:22minus 3 and I know that when multiplying
- 2:48:25the number with is 0 it gives me 0o
- 2:48:28which means that I end up with 0 here 0
- 2:48:31* 4 is 0 0 * - 3 is also 0 so I end up
- 2:48:35with a zero Vector now this gives me an
- 2:48:40idea already that I can make a general
- 2:48:43conclusion that independent of the type
- 2:48:47of vector that I have independ and what
- 2:48:49are this values in my C uh if I have any
- 2:48:53Vector C and I'm multiplying it with
- 2:48:58zero then this will always give me a
- 2:49:01vector of zero because all the members
- 2:49:05of this final Vector will be just zeros
- 2:49:10so if for instance the C comes from uh
- 2:49:15let's say r n so it has n different
- 2:49:18elements it comes from n dimensional
- 2:49:20space then my final result of 0 * C so
- 2:49:27this zero Vector this one so zero that
- 2:49:31this one will come also from RN so you
- 2:49:35will be having a vector so 0
- 2:49:40* c will then be equal to z0 blah blah
- 2:49:45blah blah zero so n time zeros
- 2:49:49so this is then the idea of multiplying
- 2:49:52so scaling a vector with zero and this
- 2:49:56is our example two all right so let's
- 2:50:01now move on on to our application of
- 2:50:04scalar vectal multiplication and then
- 2:50:06after this we will go back to this idea
- 2:50:08of linear combinations and
- 2:50:10dispense so in this specific application
- 2:50:13we have a scalar Vector multiplication
- 2:50:15and we are looking into application of
- 2:50:17audio scaling
- 2:50:19so the scalar Vector multiplication
- 2:50:21audio processing uh this can change the
- 2:50:23volume for instance of an audio signal
- 2:50:25without altering its content so um you
- 2:50:29might have noticed that um when uh when
- 2:50:33you are listening to video you can
- 2:50:35simply increase the volume of that video
- 2:50:38or decrease it but you will notice that
- 2:50:40the content doesn't change you are just
- 2:50:42increasing the volume or decreasing it
- 2:50:44even on the TV when you are watching a
- 2:50:46show you are increasing The Voice or
- 2:50:48decreasing
- 2:50:49now what you're basically doing behind
- 2:50:51and this is super interesting is that
- 2:50:53behind the scenes what is happening is
- 2:50:55that there is simply um audio that um
- 2:51:00contains that show and the audio of that
- 2:51:03show is being multiplied with a scaler
- 2:51:06and that scale is simply the volume
- 2:51:08scale if you scale it in such way that
- 2:51:12you want to decrease the volume so the
- 2:51:15audio will then have a lower volume then
- 2:51:18you are simply multiplying it uh your
- 2:51:21vector containing the audio information
- 2:51:24in such way that those newer volume
- 2:51:27indications they will be they will be
- 2:51:30containing lower
- 2:51:31numbers hope this makes sense let's look
- 2:51:33into the example this make uh this will
- 2:51:36definitely clear this out so um let's
- 2:51:39assume we have an a vector a that
- 2:51:42represents the audio signal and we want
- 2:51:46to multiply Vector a a by scalar B to
- 2:51:50adjust the volume so B is some sort of
- 2:51:53number it can be so B comes from R so is
- 2:51:59a real number while
- 2:52:01a is simply a vector given that it
- 2:52:04doesn't mentioning here I'm assuming
- 2:52:06that a comes from RN so it comes from r
- 2:52:10n dimensional space so imagine of a as
- 2:52:14this Vector A1 A2 blah blah blah blah to
- 2:52:19a n and each of these values it
- 2:52:22basically describes uh an uh the audio
- 2:52:25signal so it represents um uh an amount
- 2:52:29so it contains an amount that represents
- 2:52:31the audio signal of your uh video or uh
- 2:52:35your uh
- 2:52:37show and then the b in this case for
- 2:52:40instance in this example you can see
- 2:52:42that the B is then uh equal to for
- 2:52:45instance 1.2 1 / 2 or B is equal to Min
- 2:52:49- 1 / 2 so you can see that b is equal
- 2:52:53to 1 / 2 which basically is a fensive of
- 2:52:56saying that b is equal to 0.5 or B can
- 2:53:01be equal to minus1 / 2 which is minus
- 2:53:060.5 now then it says then the B * a
- 2:53:10which basically means multiplying our um
- 2:53:15scalar
- 2:53:16beta by the Vector containing the audio
- 2:53:20signal a so this B * a is perceived as
- 2:53:24the same audio signal but at the lower
- 2:53:27volume now why lower because you can see
- 2:53:30that b is equal to 0.5 or minus 0.5 it
- 2:53:34means that once you take all these
- 2:53:37elements of your a and you multiply it
- 2:53:40with a number that is smaller than one
- 2:53:42in this case 0.5 then all these numbers
- 2:53:45will decrease which means that also your
- 2:53:48audio volume will
- 2:53:51decrease so let me actually uh show you
- 2:53:55an
- 2:53:56example so let's say our talk show is
- 2:54:00very short and you know the audio
- 2:54:02variation is very low you have a vector
- 2:54:06a that is quite small it comes from a
- 2:54:10three dimensional space so R Tre and it
- 2:54:13has numbers like three uh six and then
- 2:54:16five so 3x1 vector and then we have our
- 2:54:22audio adjustment scalar beta which is
- 2:54:25equal to
- 2:54:260.5 now when we take the beta we're
- 2:54:29multiply it by our audio
- 2:54:31signal then what we
- 2:54:34do
- 2:54:36times is clear so times what we are
- 2:54:40doing is that we are simply taking all
- 2:54:44the elements of our a so Three 6 and
- 2:54:47five and what we are doing is that we
- 2:54:50are multiplying it by
- 2:54:520.5 0.5 and 0.5 or you can also say 1 /
- 2:54:582 so what this is equal is that 3 * 0.5
- 2:55:02is
- 2:55:031.5 6 * 0.5 is 3 and then 5 * 0.5 is
- 2:55:102.5 and you can see that all this
- 2:55:12numbers 1.5 3 and 2.5 they are smaller
- 2:55:17and specifically two times times less
- 2:55:19than all the original values in the um
- 2:55:22original audio so original audio is a
- 2:55:27which was 3 6 and 5 and the new audio
- 2:55:32the the scaled one is so audio scaled so
- 2:55:38B * a is equal to
- 2:55:411.5 3 and
- 2:55:432.5 so you can clearly see this
- 2:55:46transformation where this element three
- 2:55:49is larger than 1.5 6 is larger than
- 2:55:52three and then the last element five is
- 2:55:54larger than 2.5 which means that this
- 2:55:57audio
- 2:55:59audio is much at a higher volume so the
- 2:56:05volume two times
- 2:56:08higher than this
- 2:56:16audio so this is basically the idea of
- 2:56:20uh applying scalar multiplication to our
- 2:56:23audio pre-processing I will leave the
- 2:56:25other example to you that will show that
- 2:56:27when your scaler is equal to minus 0.5
- 2:56:31you again will end up with the lower
- 2:56:34volume only that time the volume will be
- 2:56:36much much lower than the original one so
- 2:56:39now that we know how we can perform
- 2:56:41scale multiplication in theory as well
- 2:56:44as we have looked into an example how we
- 2:56:46can do it in terms of the numbers and
- 2:56:47multiply apping them and we have also
- 2:56:50seen uh applying SK multiplication in
- 2:56:53practice uh so we have seen in this
- 2:56:56audio processing stage the uh
- 2:56:59multiplication process we are ready to
- 2:57:02look into the visualization of it this
- 2:57:04will help us to get a better
- 2:57:07understanding on uh what exactly happens
- 2:57:10when we are scaling different vectors
- 2:57:13let's look actually in the following
- 2:57:14example so let's assume we have a vector
- 2:57:18oh let me remove
- 2:57:22that so let's usum we have a vector and
- 2:57:27the vector is let me get a color this
- 2:57:31one for instance a vector a and this
- 2:57:35Vector a consists of elements one and
- 2:57:38two so where does this Vector Li the
- 2:57:43vector is with um one so here in our
- 2:57:47coord system this is our xaxis this is
- 2:57:50our y AIS and here we got uh let me
- 2:57:53actually pick another color let's say
- 2:57:56black
- 2:57:59one and then we got one and then two
- 2:58:04right this is two this is one so it is
- 2:58:06this one so the line that we get here it
- 2:58:10is this one so this is our Vector
- 2:58:14a now let's assume I want to multiply
- 2:58:18my Vector a so I want to scale my Vector
- 2:58:21a by a constant Tree by scalar tree so I
- 2:58:25have a scaler let's say I call K and
- 2:58:28this
- 2:58:29k a different number let's say k is
- 2:58:33equal to
- 2:58:35three so what I wanted to do is to
- 2:58:38perform a scale of multiplication so I
- 2:58:40want to obtain K multiplied by a and we
- 2:58:45learned that this is simply equal to
- 2:58:49three
- 2:58:51times and
- 2:58:53then one
- 2:58:55two and then this is equal
- 2:59:01to 3 * 1 3 * 2 which is equal to 3 and
- 2:59:08then
- 2:59:09six so let's also visualize this scaled
- 2:59:13uh
- 2:59:14Vector so let me pick this yellow color
- 2:59:18this will be our scaled Vector so we
- 2:59:21have done scale multiplication and we
- 2:59:23are going to visualize that so we have
- 2:59:26three and six so this is three 1 2 three
- 2:59:30and this is
- 2:59:32six so we have this
- 2:59:34point so you should already see what is
- 2:59:37going on
- 2:59:38here
- 2:59:40so we
- 2:59:43got 3A
- 2:59:47here so you can see that this part is
- 2:59:50our Vector a and this longer one is 3 a
- 2:59:54and even visually you can see that this
- 2:59:57longer Vector is simply the three times
- 3:00:00of the shorter Vector so we got this and
- 3:00:05then if you add on the top of this the
- 3:00:07same three times you will then end up
- 3:00:11with
- 3:00:13the
- 3:00:15original so scaled version of that
- 3:00:22so basically this is a this is a this is
- 3:00:25a we combine three different so we scale
- 3:00:28a three times and we simply get a three
- 3:00:32times longer version with the same
- 3:00:35direction so you can see that when we
- 3:00:37are scaling even visually it makes sense
- 3:00:40so we are scaling our Vector a three
- 3:00:43times and we are just getting that
- 3:00:45Vector so we are transforming
- 3:00:48oh let me remove
- 3:00:55this so
- 3:00:58basically we are taking this vector and
- 3:01:02we are scaling it up to this
- 3:01:06point if I would do it only two times
- 3:01:10then it would be something like
- 3:01:14this or one and a half times it would be
- 3:01:18something like this so only half of
- 3:01:24it so now this should make much more
- 3:01:27sense let us actually do yet another
- 3:01:29example to uh make sure that we are
- 3:01:32clear on this visualizations because we
- 3:01:34are going to make use of it when uh
- 3:01:36looking into this idea of linear
- 3:01:38combination in a span so let's say we
- 3:01:42have a vector B and this Vector B has
- 3:01:46elements zero and three
- 3:01:48so let's visualize and uh plot this
- 3:01:51Vector so it contains elements Z zero
- 3:01:55and three so zero and three so this is
- 3:01:59the X element and the Y element on the Y
- 3:02:02AIS we can see this is three which means
- 3:02:04that our Vector B is this
- 3:02:08Vector all right perfect so this is our
- 3:02:11B let's now multiply so scale our Vector
- 3:02:15B by scaler t Q so let's say we want to
- 3:02:20get 2
- 3:02:22*
- 3:02:24B so what is this amount this is equal
- 3:02:28to 2 * 2 times and I'm simply taking
- 3:02:31each of those elements zero and then
- 3:02:34three
- 3:02:37so this is then equal to 2 * 0 is 0 and
- 3:02:40then 2 * 3 is equal to
- 3:02:436 so this is my new scaled Vector 2 *
- 3:02:47time B Vector this one so let's
- 3:02:50visualize this the xais value is zero so
- 3:02:54we are still here and then the y- axis
- 3:02:57value is six so what is sixth this thing
- 3:03:02all right so you already should see that
- 3:03:05this is very similar what we had before
- 3:03:08so this is 2
- 3:03:11B all right so this all uh should make
- 3:03:15sense uh also we learned as part of the
- 3:03:18um High School when visualizing
- 3:03:20different plots so this is quite similar
- 3:03:22to this idea of having Y is equal to X
- 3:03:25and then scaling it getting like Y is
- 3:03:27equal to 2x so in this case only we know
- 3:03:31exactly where the vector starts and ends
- 3:03:34uh so we have a much more specific
- 3:03:38definition instead of having all this
- 3:03:40infinite number of points on the
- 3:03:42line but the idea stays the same so we
- 3:03:45are taking this vector and we are then
- 3:03:48scaling it two times so we get 2 B
- 3:03:51vector and I could do the same only
- 3:03:55instead what I could also do is I could
- 3:03:57do like uh 0.5 or 1 / 2 * B so I take
- 3:04:02the half of it which means I would get
- 3:04:04this
- 3:04:06vector or I could multiply it with minus
- 3:04:09one so
- 3:04:12minus - 1 * B so I was scale with minus1
- 3:04:17and and then I will simply get the
- 3:04:19negative
- 3:04:21version of
- 3:04:23my original Vector so this thing this
- 3:04:27would be minus b or min-1 * B so this is
- 3:04:32basically the idea of uh scaling
- 3:04:35multiplication when visualizing it in
- 3:04:37our coordinate system cartisian
- 3:04:40coordinate system and now when we know
- 3:04:42all this we are ready to move on on this
- 3:04:45idea of linear combin
- 3:04:48and now when we know all this we are
- 3:04:50ready to move on on this idea of linear
- 3:04:54combination so let's now formally Define
- 3:04:56this ideal linear combinations a linear
- 3:04:59combination of vectors A1 up to a m
- 3:05:02using scalers B1 up to BM or what we
- 3:05:05also refer as beta 1 to Beta m is the
- 3:05:09vector beta 1 * A1 Plus up to Beta M * a
- 3:05:14m and the scalers are called the
- 3:05:17coefficient
- 3:05:18of linear
- 3:05:19combination and any Vector B in N
- 3:05:23Dimensions can be expressed as a linear
- 3:05:26combination of the standard unit vectors
- 3:05:28E1 up to n the coefficients in this
- 3:05:31combination are then the entries of B
- 3:05:34itself well this is whole bunch of
- 3:05:37information uh let's unpack them one by
- 3:05:40one firstly um I want to mention about
- 3:05:43this m so far we have seen this idea of
- 3:05:45n so I just wanted P to experiment with
- 3:05:49a different one just to ensure that we
- 3:05:51are clear that you can use any source of
- 3:05:54identifier to describe the size of your
- 3:05:58um uh number of vectors that you got and
- 3:06:02uh in this case we got M different
- 3:06:05vectors because so far we were using
- 3:06:07this n in order to describe the size of
- 3:06:10a vector and now we are no longer
- 3:06:12talking about the size of a vector but
- 3:06:14the number of vectors therefore I
- 3:06:16specifically didn't use use the letter N
- 3:06:18so here m is simply the number of
- 3:06:24vectors so don't confuse this with this
- 3:06:27thing where we were plotting this and we
- 3:06:29were saying this A1 A2 up to a n because
- 3:06:33in here we basically mean that we are
- 3:06:35dealing with some Vector a and this has
- 3:06:39n different elements whereas in here we
- 3:06:42are already moving from this idea of one
- 3:06:45vector and now we are talking about mve
- 3:06:47multiple vectors so we have M different
- 3:06:50vectors they all look like kind of this
- 3:06:53only with bit more complex indexing that
- 3:06:56we also saw
- 3:06:58before all right but we will learn this
- 3:07:01um that's not an issue I just wanted to
- 3:07:04mention this to ensure we are at the
- 3:07:06same page so then let's move on to this
- 3:07:09idea of using scalers beta 1 till beta M
- 3:07:14so it's a common uh practice in linear
- 3:07:17algebra in just in general in
- 3:07:19mathematics but also definitely in data
- 3:07:22science statistics and in artificial
- 3:07:23intelligence to use beta 1 as a way to
- 3:07:27describe the coefficient so what do you
- 3:07:30mean by coefficient it is just a scalar
- 3:07:32so it's just a constant or a number so
- 3:07:35in this case for instance this beta 1
- 3:07:38can be 0.5 beta 1 can be uh two bet one
- 3:07:43can be let's say 100 it just describes
- 3:07:46how much we are multiplying scaling this
- 3:07:49Vector A1 so so far we have done a lot
- 3:07:53of scal and multiplication already lot
- 3:07:56of details there and we have seen
- 3:07:58different times different scalers that
- 3:07:59we use we can use um zero as a scaler we
- 3:08:02can use any other number as long as it's
- 3:08:05a real number so this beta 1 should
- 3:08:09belong uh in the a real number space so
- 3:08:13it's a real number and of course the
- 3:08:15same holds for uh all the betas so we
- 3:08:19have M different vectors which means we
- 3:08:20are going to have M different scalers
- 3:08:23because each of those vectors we are
- 3:08:25going to multiply with their
- 3:08:27corresponding or respective scalers so
- 3:08:31beta one is basically the scaler uh or
- 3:08:34the um uh coefficient that we are using
- 3:08:38to
- 3:08:40scale a one maybe I can actually write
- 3:08:44this down on a new page such that we can
- 3:08:46save this as a SL Light page for you
- 3:08:49let's write it down so what do we have
- 3:08:51as this idea of linear combination so a
- 3:08:54linear combination simply involves
- 3:08:57taking several vectors uh to go from
- 3:09:00this uh formal definition to more
- 3:09:02practical uh terms so we got this
- 3:09:06A1 A2 up to
- 3:09:10a and what we want to do is to take the
- 3:09:13linear combination of this m different
- 3:09:16vectors so we got m is the number of
- 3:09:21vectors and to get a linear combination
- 3:09:25we need to uh scale each of those
- 3:09:28vectors which means that we need to have
- 3:09:32this different scalers let's say beta
- 3:09:361 for
- 3:09:38A1 and then plus beta 2 for A2 so each
- 3:09:43time we are scaling each of those
- 3:09:45vectors where beta 1 is the uh scaler or
- 3:09:49the coefficient of the vector A1 and we
- 3:09:53are multiplying we are performing scalar
- 3:09:56multiplication of our scalar beta 1 with
- 3:09:59the vector A1 and then we are adding to
- 3:10:02this our beta 2 which is the coefficient
- 3:10:06corresponding to the vector A2 and then
- 3:10:08adding beta 3 * A3 and then dot dot dot
- 3:10:12so all these different uh vectors up to
- 3:10:15the point of beta
- 3:10:17M time a
- 3:10:21m and all this so A1 A2 up to a those
- 3:10:27are all vectors belonging to the
- 3:10:31m space so those are all vectors coming
- 3:10:35from the um M dimensional
- 3:10:39space so um in
- 3:10:43here this is the linear combination of
- 3:10:47our
- 3:10:47M different vectors and the uh beta
- 3:10:531 beta 2 up to Beta M those are all
- 3:11:01constants so those are scalers or real
- 3:11:05numbers that belong to R so those are
- 3:11:10real
- 3:11:12numbers all right so now when we are
- 3:11:14clear on that let's also unpack this
- 3:11:16idea of coefficients so the scalers are
- 3:11:19called the coefficients of linear
- 3:11:20combination so basically all this
- 3:11:24members so beta 1 beta 2 of two beta M
- 3:11:31that belong to real number
- 3:11:34space they are
- 3:11:38called
- 3:11:42coefficients this is what we are
- 3:11:43referring as coefficients and this
- 3:11:45coefficients this IDE and name is super
- 3:11:48important because you will see this time
- 3:11:50and time again appearing in your uh very
- 3:11:52basic machine learning models or some
- 3:11:55other applications of linear algebra
- 3:11:57because the end goal is always to find
- 3:11:59these coefficients so these coefficients
- 3:12:02those are numbers that we are using to
- 3:12:05scale these different vectors and uh the
- 3:12:08idea of coefficients is very Central
- 3:12:11because those are numbers that Define
- 3:12:14how exactly we are combin ining all
- 3:12:18these different vectors because this
- 3:12:20beta 1 beta 2 Beta 3 they can be
- 3:12:22different numbers real numbers and every
- 3:12:25time when we are choosing these
- 3:12:27coefficients or these betas we will then
- 3:12:30end up with a different combination of
- 3:12:33these vectors so we are basically mixing
- 3:12:37all these different vectors and the way
- 3:12:39we mix it and how we will mix it it will
- 3:12:42depend on the values of this beta 1 beta
- 3:12:452 Beta 3 up to Beta m so these
- 3:12:48coefficients so therefore coefficients
- 3:12:50are super important and they Define the
- 3:12:53end results from our linear
- 3:12:56combination so any Vector B in N
- 3:13:00Dimensions can be expressed as a linear
- 3:13:03combination of standard unit vectors E1
- 3:13:06up to n so when looking into this um
- 3:13:09idea of unit vectors uh we saw already
- 3:13:14what this E1 is what is E2 is up to e n
- 3:13:19and we saw that E1 is for instance if
- 3:13:22it's from an N dimensional
- 3:13:24space and it says from n
- 3:13:27dimensions then E1 simply means 1 0 0
- 3:13:32dot dot dot dot Z then E2 means 0 1 Z
- 3:13:37dot dot dot dot zero so we already saw
- 3:13:39this this is not something new that we
- 3:13:41are seeing so 0 Z blah blah blah and
- 3:13:44then one at the end and what this
- 3:13:47definition basically says is that any
- 3:13:51Vector b as long as the B comes from n
- 3:13:55dimensional space we can represent this
- 3:13:59by using this uh unit vectors and by
- 3:14:04linearly combining
- 3:14:05them so this is yet another part of this
- 3:14:08definition and we are going to by the
- 3:14:11way um go through each of the parts of
- 3:14:13this definition one by one going to each
- 3:14:16of the examp examples as well as
- 3:14:18visualizing them so now I just want to
- 3:14:20quickly unpack all the parts in this
- 3:14:23definition before moving on to step by
- 3:14:25step examples and
- 3:14:27explanation so this is about this linear
- 3:14:30combination of any n dimensional uh
- 3:14:33Vector B that we can uh create by using
- 3:14:37a linear combination of these unit
- 3:14:39vectors I will come to this in a bit so
- 3:14:42then the final part of this definition
- 3:14:45is that the coefficient in this
- 3:14:48combination are the entries of B
- 3:14:51itself so it says that the coefficients
- 3:14:56so beta 1 up to Beta m in this linear
- 3:14:59combination that we can create are the
- 3:15:02entries of B
- 3:15:05itself so we will come to this section
- 3:15:08once we are done with the first part so
- 3:15:11first let's have a good understanding of
- 3:15:13what this linear combination is and also
- 3:15:17touch base and we will also formally
- 3:15:19Define the idea of span and after that
- 3:15:22we will move on on uh representing and
- 3:15:26expressing any Vector B in N Dimension
- 3:15:29Space by using standard unit vectors E1
- 3:15:32up to e n and this idea of coefficients
- 3:15:35and then entries of B so let's start
- 3:15:38with the first one so let's assume we
- 3:15:41have two different
- 3:15:43vectors we have Vector a
- 3:15:47and this Vector a is equal to one
- 3:15:512 so let's plot
- 3:15:54this one and two in our coordinate space
- 3:15:58that is this one which means that our
- 3:16:00Vector a is this
- 3:16:03one and let's assume that we have a
- 3:16:07vector
- 3:16:10B and this Vector
- 3:16:13B is equal to Z
- 3:16:1803 so 0 is here and then three is here
- 3:16:22which means that our Vector B is this
- 3:16:25one this is Vector
- 3:16:27B now I want to create a linear
- 3:16:31combination of this Vector a and Vector
- 3:16:35B so we just learned from the formal
- 3:16:38definition that in order to do so I need
- 3:16:41a beta
- 3:16:431 to
- 3:16:45multiply the vector
- 3:16:58a and then I need beta 2 which is the
- 3:17:01coefficient corresponding to to my
- 3:17:03second Vector in order to multiply the
- 3:17:06second Vector which is
- 3:17:08B Vector B okay so I'm getting the
- 3:17:11linear combination of A and B by taking
- 3:17:15any beta 1 and beta 2 which are real
- 3:17:18numbers so beta 1 and beta 2 belong to R
- 3:17:24so they are real numbers and then I'm
- 3:17:26getting a linear combination of the two
- 3:17:29so let's look into a few examples of a
- 3:17:31linear combination of vector A and B
- 3:17:35depending on the different choice of the
- 3:17:37coefficients like beta 1 and beta 2 so
- 3:17:41example one is that beta 1 is equal to
- 3:17:45zero and then beta beta 2 is equal to Z
- 3:17:49Now what is the linear combination of A
- 3:17:52and B when my coefficients beta 1 and
- 3:17:54beta 2 both are zero it just means that
- 3:17:57I'm
- 3:17:59getting 0
- 3:18:05time
- 3:18:08A
- 3:18:12Plus 0 times
- 3:18:19B which is of
- 3:18:27course 0 * 1 0 *
- 3:18:332
- 3:18:35plus and then multiplying Vector B with
- 3:18:38a scaler zero which is 0 * 0 0 * 3 so
- 3:18:43let's quickly do this what this value is
- 3:18:46this is equal to 0 * 1 is 0 0 * 2 is
- 3:18:520 0 * 0 is equal to 0 0 * 3 is equal to
- 3:18:570 and this is then equal to 0 + 0 0 0 +
- 3:19:030 is0 so I'm basically getting a vector
- 3:19:08zero all right so this is then equal to
- 3:19:14zero so this equal to vector is
- 3:19:20zero so I can also say that this vector
- 3:19:26or it's actually a point so this
- 3:19:30point is simply a linear combination of
- 3:19:34these two
- 3:19:35vectors now this is a super basic case
- 3:19:38let's look at another case when our in
- 3:19:41our second example the beta 1 and beta 2
- 3:19:43so our coefficients they are actually
- 3:19:46not zero there are some other nonzero
- 3:19:49real
- 3:19:58numbers so in this example I will then
- 3:20:02take beta 1 = to 3 and then beta 2 is =
- 3:20:06to
- 3:20:092 and then what I will do is that I will
- 3:20:13take actually I will take the um minus
- 3:20:16two
- 3:20:18then I can also get rid of one of the
- 3:20:20elements and I can get actually a zero
- 3:20:22for one of the elements I will show you
- 3:20:23in a bit so then the linear combination
- 3:20:28of A and B using these coefficients beta
- 3:20:311 and beta 2 where beta 1 isal to 3 and
- 3:20:33beta 2 is equal to minus 2 is then equal
- 3:20:37to so this
- 3:20:42amount this
- 3:20:45amount is equal =
- 3:20:482 3
- 3:20:51* 1
- 3:20:542 and then
- 3:20:57plus we got - 2
- 3:21:04* 0 and three now what does this give
- 3:21:10us 3 * 1 is = 3 3 * 2 is = 6 plus and
- 3:21:17then - 2 * 0 is = to
- 3:21:200 and then - 2 * 3 is = - 6 so you might
- 3:21:25have already noticed why I picked the
- 3:21:27beta 2 equal to minus 2 I wanted these
- 3:21:29two numbers to actually cancel each
- 3:21:32other so you see because 6 + - 6 is
- 3:21:36equal to Z so what do I get in my final
- 3:21:38result as a linear combination of these
- 3:21:40two vectors I get 3 + 0 so 3 + 0
- 3:21:51so 3 + 0 and then 6 + -
- 3:21:576 and this gives me 3 + 0 is 3 6 + - 6
- 3:22:02is zero there we go so this is my linear
- 3:22:06combination of the vector A and B when
- 3:22:10using the coefficients equal to 3 and
- 3:22:12minus 2 respectively so this value is
- 3:22:16actually = to three and zero in this
- 3:22:20case all right so let me actually clean
- 3:22:23this up because I also want to visualize
- 3:22:26this idea and then we will go uh back to
- 3:22:29this uh linear combination let just
- 3:22:32summarize uh what we got before moving
- 3:22:35on to the plotting part so if we simply
- 3:22:37take a and we add to this B so this is
- 3:22:41the first case so this is as you might
- 3:22:44have already guessed this is also l your
- 3:22:46combination here we are saying take 1 *
- 3:22:49a and take a 1 * B and this is yet in
- 3:22:54our linear combination here the beta 1
- 3:22:57is equal to 1 and then beta 2 is equal
- 3:23:00to 1 so this linear combination gives us
- 3:23:04a vector that is 1 + 0 is = to 1 and
- 3:23:08then 2 + 3 is = 5 this is our first
- 3:23:13linear combination when the beta 1 and
- 3:23:15beta 2 is equal to one this is a basic
- 3:23:18case so doesn't require too much
- 3:23:20explanation here we have seen already
- 3:23:22this let's now look into the other
- 3:23:25example that we saw when we use uh the
- 3:23:28zeros as our coefficient so that is 0 *
- 3:23:33A+ 0 * B then this gave
- 3:23:38us 0 0 this was our second linear
- 3:23:43combination when beta 1 and beta 2 were
- 3:23:46both equal to
- 3:23:48zero and then the third linear
- 3:23:50combination that we saw was that 3 *
- 3:23:55A+ - 2 * B this gave
- 3:24:01us 3 and zero this was our third linear
- 3:24:05combination where beta 1 was three and
- 3:24:07then beta 2 was minus
- 3:24:102 so so then the linear combination of
- 3:24:14these two vectors is basically
- 3:24:17all the possible combinations of these
- 3:24:19two vectors that I can get when scaling
- 3:24:23or when multiplying these two different
- 3:24:26vectors by different sorts of uh vector
- 3:24:29by different sorts of scalars so in all
- 3:24:33these different cases what I'm simply
- 3:24:34doing is I'm taking different sorts of
- 3:24:36coefficients beta 1 and beta 2 and then
- 3:24:40I'm getting the linear combination of
- 3:24:42these two vectors we saw that in the
- 3:24:44simple case when we take a and we had to
- 3:24:47B so basically the coefficients are
- 3:24:48equal to 1 so 1 * a + 1 * B then the
- 3:24:52corresponding linear combination is
- 3:24:54equal to one and five it means that we
- 3:24:57are getting this vectors so one and five
- 3:24:59is in here which means that we are
- 3:25:01getting this one this Vector if we get
- 3:25:04if we take the zero as a scal so beta 1
- 3:25:06and beta 2 are both equal to zero then
- 3:25:09the linear combination of these two
- 3:25:10vectors is simply the vector zero which
- 3:25:13means that it is this point then if if
- 3:25:16we take the linear combination using
- 3:25:18three and minus 2 as coefficients then
- 3:25:20we are getting this so 0o and three so
- 3:25:24one two and three this is three then
- 3:25:26this is our linear
- 3:25:28combination I can also take any other uh
- 3:25:33like scaled version of my B and of my a
- 3:25:37and then I will get entirely different
- 3:25:39sort of vector so let me actually show
- 3:25:43you a few more times um a couple of
- 3:25:45other examples so let's say I keep my a
- 3:25:48so I just take the beta 1 equal to 1 but
- 3:25:51instead I scale my Vector B two times so
- 3:25:55this was at three I'm taking two times
- 3:25:58of my Beta which means that I'm
- 3:26:01here then I can take this I can add this
- 3:26:05to my a so this is 2
- 3:26:07B this will give me another linear
- 3:26:11combination of these two different
- 3:26:15vectors I can also you might recall that
- 3:26:18we said that the starting point and the
- 3:26:20end point doesn't really matter for for
- 3:26:22us what matters is that we uh have the
- 3:26:26same magnitude and the same direction
- 3:26:28for our vectors so this means that for
- 3:26:32me the vector being here and the vector
- 3:26:35being here doesn't matter when I scale
- 3:26:37it with two I can be here with three I
- 3:26:40can be here so this is the same as my B
- 3:26:43only 3 * B this is basically basically
- 3:26:46scaling B with three and this in here
- 3:26:51means that my Beta 2 is simply equal to
- 3:26:54tree and then this means that I can
- 3:26:57combine this with my a which was in here
- 3:27:02you remember so this here this means
- 3:27:06that I get yet another linear
- 3:27:08combination of these vectors which means
- 3:27:11that I'm
- 3:27:12taking
- 3:27:143B and I'm on this my a so 1 * a my beta
- 3:27:211 is equal to 1 my Beta 2 is equal to 3
- 3:27:24which means that the linear combination
- 3:27:26of this is equal to one two plus and
- 3:27:29then 3 * B is equal to 0 and then 3 * 3
- 3:27:32is 9 this is then the new linear
- 3:27:35combination which is 1 and 11 so the new
- 3:27:38linear combination is equal to 1 and
- 3:27:4211 so this thing
- 3:27:48which is the same
- 3:27:50as this
- 3:27:53thing and then you can go on and on you
- 3:27:57can also calculate the same with a
- 3:27:59negative B so you can take B and then
- 3:28:01you can scale it with minus one so this
- 3:28:04is minus b or you can go in here in here
- 3:28:09the same holds for a so you can scale it
- 3:28:11all the way to here or in the negative
- 3:28:14side so so this already uh give us the
- 3:28:19idea that we will go into to the next
- 3:28:21point which is the span so when it comes
- 3:28:24to the linear combination and in this
- 3:28:26specific case when we have these two
- 3:28:28vectors we can combine these two vectors
- 3:28:31in anyway and uh we can mix them up by
- 3:28:35using different sorts of coefficients of
- 3:28:37beta 1 and beta 2 and we will can we can
- 3:28:40get any Vector in our R2 so this means
- 3:28:45that any vector in our R2 we can
- 3:28:47represent by using only these two
- 3:28:50vectors and this is not always the case
- 3:28:53for this specific case we are dealing
- 3:28:55with two vectors that we can use to
- 3:28:57represent any Vector in our r
- 3:29:03two so what I mean here is that let me
- 3:29:07clean this
- 3:29:09up so independent what kind of vector
- 3:29:13you will give me in the R2 so it has two
- 3:29:17different elements it is 2x one I can
- 3:29:21use a linear combination of A and B so a
- 3:29:25linear combination of A and B is beta 1
- 3:29:28* a
- 3:29:30plus beta 2 * B in order to
- 3:29:35represent this
- 3:29:37Vector X1 and
- 3:29:40X2 therefore we are saying and we will
- 3:29:43come to this um in the next slide too
- 3:29:46that the
- 3:29:48spend of the vectors A and B so this is
- 3:29:52the set of all possible combinations of
- 3:29:55these two vectors is equal to R2 because
- 3:29:59any Vector in R2 can be represented as a
- 3:30:04linear combination of these two vectors
- 3:30:08so we have a linear combination of A and
- 3:30:10B and I'm saying that I can represent
- 3:30:13any Vector so here vector X and this
- 3:30:17Vector X I'm representing by X1 and X2
- 3:30:20and X1 and X2 can be any real numbers so
- 3:30:24X1 and X2 they belong to R and X is
- 3:30:30simply a two-dimensional Vector so X1
- 3:30:34and X2 those can be any numbers 0 1 2us
- 3:30:38100 anything and I'm saying any number
- 3:30:42in this two dimensional space so whether
- 3:30:45it is this one any Vector this one this
- 3:30:47one or this vector or this one any
- 3:30:51Vector that you give me in two
- 3:30:52dimensional space I can find a linear
- 3:30:56combination of this A and B that is
- 3:30:59equal to that Vector so I can represent
- 3:31:01that Vector as a linear combination of
- 3:31:03vector A and B that we saw before so
- 3:31:06let's actually prove that so I'm going
- 3:31:09to represent this uh X1 and X2 by a
- 3:31:13linear combination of this Vector A and
- 3:31:15B and how we can do that so we have beta
- 3:31:171 * a plus beta 2 * B it is equal to X1
- 3:31:21and X2 where beta 1 and beta 2 so beta 1
- 3:31:24and beta 2 they are constants so they
- 3:31:27are also real
- 3:31:30numbers so let's unpack this which is
- 3:31:34beta 1 * 1 2 + beta 2 *
- 3:31:4003 and this should be equal to X1 and X2
- 3:31:46now
- 3:31:48this is
- 3:31:51equivalent of so beta 1 * 1 beta 1 * 2
- 3:31:58plus beta 2 * 0 and then beta 2 * 3 and
- 3:32:04this should be equal to X1
- 3:32:08X2 so this is my beta 1 a this is my
- 3:32:12Beta 2 B and this is my
- 3:32:21X all right so now what we get is that
- 3:32:25and this is
- 3:32:31equivalent beta 1 *
- 3:32:341 is equal to beta 1 beta 1 * 2 is 2
- 3:32:39beta
- 3:32:401
- 3:32:41plus then here beta 2 * 0 is 0 and then
- 3:32:45beta 2 * 3 is 3 beta
- 3:32:562 so we have learned U from the uh
- 3:32:59operations on the vectors that beta one
- 3:33:02uh so in this case when we are adding
- 3:33:04two vectors so beta 1 +0 is the uh
- 3:33:08amount that we need to put as our first
- 3:33:10element so when we are adding two
- 3:33:11vectors we just need to take their
- 3:33:12corresponding elements we need to add
- 3:33:14them up so equal to beta 1 + 0 and then
- 3:33:182 beta 1 + 3 beta 2 this is the result
- 3:33:23and this should be equal to X1 and X2 at
- 3:33:26least this is what I'm
- 3:33:34claiming so this zero doesn't matter so
- 3:33:37we what we are getting from here is that
- 3:33:39beta 1 is = to X1 and then 2 beta 1 + 3
- 3:33:46b. 2 is equal to X2 this is the two
- 3:33:49expressions that we are getting based on
- 3:33:51all these different calculations so let
- 3:33:53me actually remove all
- 3:34:05this so we have beta 1 is equal to X1
- 3:34:10and 2 beta 1 + 3 beta 2 is equal to
- 3:34:18X2 so here given that we have already
- 3:34:21that beta 1 is equal to X1 and here we
- 3:34:23have two unknowns I'm going to fill in
- 3:34:27the value for beta 1 in here so I'm
- 3:34:30going to take
- 3:34:33this and I'm going to fill in it in here
- 3:34:37so for this
- 3:34:40volue so remember that beta 1 and beta 2
- 3:34:43are two unknowns and each one and next
- 3:34:45to are just uh numbers that we will get
- 3:34:49when we uh know exactly the vector and
- 3:34:51we just want to represent the vector as
- 3:34:54a linear combination of two vectors so
- 3:34:58when I take this uh value for beta 1
- 3:35:01which is equal to X1 and I'm going to
- 3:35:03fill that in in here it means that I'm
- 3:35:06going to get from here that beta 1 is
- 3:35:10equal to X1 and 2 *
- 3:35:17X1 because beta 1 is equal to X1 and
- 3:35:20here I got beta 1 I'm just filling in
- 3:35:22that value for beta 1 which is equal to
- 3:35:24X1 so 2 *
- 3:35:27X1 and then the rest I'm just taking
- 3:35:29over 3 beta 2 is equal to
- 3:35:34X2 let me remove this and from here what
- 3:35:38we are getting is that beta 1 is equal
- 3:35:41to X1 and I will solve this equation for
- 3:35:44the unknown which is equal beta 2 so I
- 3:35:48will just take the three beta 2 from
- 3:35:51left hand side I will leave it there and
- 3:35:53I will take this and I will take it over
- 3:35:54to the right so I'm taking X2 over and
- 3:35:58this two X1 so this part I'm just taking
- 3:36:02to the right two of the equation so Min
- 3:36:05- 2
- 3:36:09X1 which then on its turn is equal to so
- 3:36:14it goes to B 1 is = to X1 and then beta
- 3:36:192 is = to X2 - 2 X1 / 2
- 3:36:26three perfect so what do we get
- 3:36:30here what is our end result and why is
- 3:36:33it
- 3:36:36significant so what we are getting here
- 3:36:39is that based on all this information
- 3:36:42without knowing beta 1 and beta 2 we got
- 3:36:46that beta 1 should be equal to X1 and
- 3:36:49beta 2 should be equal to X2 -
- 3:36:532x1 / to three this means that
- 3:36:58independent what kind of x's you will
- 3:37:02give me so what kind of vector we have
- 3:37:05in our R2 so this X1 and X2 they are
- 3:37:09just real numbers we can always find
- 3:37:12beta 1 and beta 2 that we can use to
- 3:37:16represent that X1 X2 so our X Vector as
- 3:37:21a linear combination of these two
- 3:37:24vectors let me actually give you an
- 3:37:27example so let's remove
- 3:37:40this so let's assume we have a vector X
- 3:37:44and this x is is equal to four and let's
- 3:37:51say
- 3:37:53three so if we got this Vector X and we
- 3:37:57are saying we can use this Vector A and
- 3:37:59B to represent X as a linear combination
- 3:38:03of vector A and B which means that I can
- 3:38:05find I can find real number beta 1 and
- 3:38:09beta 2 that I can use to multiply the
- 3:38:12vector A and B respectively combine them
- 3:38:14together so their linear combination
- 3:38:17that will be equal to this Vector X so
- 3:38:20this is my
- 3:38:21X1 this is my
- 3:38:24X2 so this is equal to 4 and three Now
- 3:38:30using
- 3:38:31this let's actually see whether that is
- 3:38:35true so based on this example my beta 1
- 3:38:40should be equal to X1 which is four my
- 3:38:43Beta 2 should be equal to X2 which is 3
- 3:38:46so beta 2 should be equal to X2 which is
- 3:38:503 - 2 * X1 which is 4 / to three and
- 3:38:56what's this number this means that my
- 3:38:59beta 1 should be equal to 4 and my Beta
- 3:39:012 should be equal to 3 - 8 so 3 - 8 / to
- 3:39:063 and this is equal to Minus 5 / to
- 3:39:123 so this means that I use a
- 3:39:16coefficients beta 1 is equal to 4 and
- 3:39:18beta 2 = to - 5 / to 3 to represent my
- 3:39:22Vector X as a linear combination of
- 3:39:26vector a and Vector B so let's actually
- 3:39:30prove that too as a final
- 3:39:37step
- 3:39:39so let's see where the four
- 3:39:42times Vector a which is 1
- 3:39:462 + - 5 / to 3 whether this is indeed
- 3:39:52equal to Vector X so my Vector B is
- 3:39:5803 so this is the first part
- 3:40:16and I want to prove that this is indeed
- 3:40:18equal to X and we already know what x is
- 3:40:24so this is equal to 4 * 1 4 * 2 plus and
- 3:40:31then here we got - 5 / 3 * 0 and then -
- 3:40:355 / to 3 *
- 3:40:373 this is equal
- 3:40:41to 4 * 1 is = to 4 4 * 2 is = to 8
- 3:40:46and then here we need to subtract minus
- 3:40:4953 5 5 / 3 * 0 is equal to 0 so this one
- 3:40:54is zero and then minus 5 / to 3 so 5/3 *
- 3:40:593 this ones are canceling out and we got
- 3:41:028 + - 5 so here the plus and here minus
- 3:41:06just to make sure we got everything
- 3:41:08right and this is equal to 4 and then 8
- 3:41:12+ - 5 is equal to 3
- 3:41:15so you can see already that this amount
- 3:41:18that we got here is equal to X which was
- 3:41:21equal to 4 / to3 and this helps us to uh
- 3:41:27verify and to know for sure that indeed
- 3:41:32while given any Vector in a two
- 3:41:35dimensional space in R2 X independent
- 3:41:39what this X1 is or X2 is we can always
- 3:41:42find a pair of beta 1 and beta 2 that
- 3:41:46will ensure that the beta 1 a plus beta
- 3:41:502 B is actually equal to this
- 3:41:54x where X A and B they are part of
- 3:42:00R2 and a is equal to 1 2 and then B is
- 3:42:06equal to
- 3:42:0803 so we can represent any Vector in our
- 3:42:12two-dimensional space as a linear comp
- 3:42:15combination of this Vector a with
- 3:42:16elements 1 2 and um Vector B with
- 3:42:20elements 03 and that's exactly what we
- 3:42:22saw here because we could find any
- 3:42:25vector and we can represent this Vector
- 3:42:27as a linear combination of this Vector A
- 3:42:29and B this Vector as a linear
- 3:42:31combination of this A and B this Vector
- 3:42:33as a linear combination in any vector or
- 3:42:36a point in this plane we can represent
- 3:42:38as a linear combination of this Vector a
- 3:42:42and Vector B and in this specific case
- 3:42:45with this Vector a and Vector B we are
- 3:42:47saying that Vector a and Vector B they
- 3:42:50spin
- 3:42:51R2 so Vector
- 3:42:56A and
- 3:42:58B
- 3:43:00span R 2 now we will come to these
- 3:43:05definitions of the span and uh just in
- 3:43:08general for different sorts of vectors
- 3:43:11we will see what this IDE of span is but
- 3:43:13for now given that we just proved that
- 3:43:16we can represent any Vector in R2 as a
- 3:43:19linear combination of these two vectors
- 3:43:22A and B therefore we can say and we
- 3:43:25usually say it in linear algebra that
- 3:43:28the vector a and Vector B they spend R2
- 3:43:32before moving on onto this concept of
- 3:43:34Spence that we just touched upon in our
- 3:43:37example I wanted to quickly go back to
- 3:43:40this example that I promised to discuss
- 3:43:43uh which was part of the definition of
- 3:43:45the linear combinations and unit vectors
- 3:43:48because we saw in our definition and let
- 3:43:51me just show you that uh the uh
- 3:43:53definition was providing these two
- 3:43:56highlights these two bullet points and
- 3:43:57was saying any Vector B in N Dimensions
- 3:44:00can be expressed as a linear combination
- 3:44:02of the standard unit vectors E1 to up to
- 3:44:05e n and the coefficients in this
- 3:44:07combination are the entries of B itself
- 3:44:11so let's look into the example and see
- 3:44:13what we mean by that in this specific
- 3:44:16example we have this Vector B it is
- 3:44:19coming from the three dimensional space
- 3:44:21which we can see given that we have
- 3:44:22three different uh three entries so
- 3:44:24three uh elements in our Vector so it's
- 3:44:273 by one and this means that b belongs
- 3:44:32to
- 3:44:34R3 and in here we can see that B can be
- 3:44:38written as a linear combination of these
- 3:44:42three vectors so you can see that b e is
- 3:44:45equal to -1 * this Vector 1 0 0 so this
- 3:44:52one then we have + 3 * 0 1 0 Vector so
- 3:44:59this
- 3:45:00one and plus 5 * this third Vector which
- 3:45:05is 0
- 3:45:0601 now we already know from the unit
- 3:45:10vectors that
- 3:45:13E1 is equal to
- 3:45:151 0
- 3:45:170 assuming that we are in three
- 3:45:19dimensional
- 3:45:22space E2 is equal to 0 1
- 3:45:260 and E3 is equal to 0 01 you can notice
- 3:45:33that that's exactly what we got here
- 3:45:35this Vector is E1 this Vector is E2 and
- 3:45:39this Vector is E3 where E1 E2 and E3
- 3:45:44belong to three-dimensional
- 3:45:47space okay so another thing that we can
- 3:45:50see is that here we got coefficients
- 3:45:54minus one here three and here five so
- 3:45:57this is basically how beta 1 beta 2 and
- 3:46:00beta 3 using the common conventions that
- 3:46:02we saw before when describing the linear
- 3:46:05combination so let's actually check that
- 3:46:08and then we will comment on these values
- 3:46:16so let's check whether -1 * E1 + 3 * E2
- 3:46:21+ 5 * E3 is indeed equal to this B so
- 3:46:25this is equal to -1 * this Vector gives
- 3:46:29us -1 0
- 3:46:310 three times this E2 gives us 0 3 and
- 3:46:37zero and then 5 * E3 gives us 0 0 5 and
- 3:46:44this is equal to
- 3:46:45-1 + 0 + 0 is = -1 0 + 3 + 0 is = 3 and
- 3:46:52then 0 + 0 + 5 is equal to
- 3:46:555 now what do we get here we see that
- 3:46:58this which is equal to this it is equal
- 3:47:02to this Vector B indeed okay so now when
- 3:47:06we have indeed checked that B can be
- 3:47:10represented as a linear combination of
- 3:47:14this three vectors this unit vectors E1
- 3:47:19E2 E3 another thing that we can notice
- 3:47:22and I'm sure you already
- 3:47:24did is that those coefficients they are
- 3:47:27not just randomly picked coefficients
- 3:47:30those are the entries of this Vector B
- 3:47:34so this is exactly what that definition
- 3:47:37was about it was saying that any Vector
- 3:47:39B including this example in in this case
- 3:47:42threedimensional space can be Express as
- 3:47:45a linear combination of the standard
- 3:47:48unit vectors E1 A2 E3 Etc so this
- 3:47:53coefficients in this combination so you
- 3:47:55can see that the beta 1 beta 2 and beta
- 3:47:583 which are our coefficients in our
- 3:47:59linear combination they are the entries
- 3:48:02so this
- 3:48:04values of the B
- 3:48:06itself so the same will hold for
- 3:48:09four-dimensional case five dimensional
- 3:48:12case n dimensional case so this means
- 3:48:15that if we write this down for General
- 3:48:19case just to ensure that we are clear on
- 3:48:23this part of the
- 3:48:26definition so if we got
- 3:48:30B Vector in N dimensional space so it
- 3:48:34got B1 B2 up to BN as the elements of it
- 3:48:39comes from
- 3:48:41RN then we can represent this B
- 3:48:45as a linear combination of unit vectors
- 3:48:49coming from the N dimensional space so
- 3:48:52we got E1 E2 up to e n that belong to n
- 3:48:58dimensional space and we can represent
- 3:49:00this B as a linear combination of these
- 3:49:03unit vectors so by using beta 1
- 3:49:08time so this this is a common Convention
- 3:49:10of the coefficient as you Rec called
- 3:49:12time C1 then B beta 2 * E2 blah blah
- 3:49:17blah plus beta n * e n and what is
- 3:49:22important here is that this beta 1 beta
- 3:49:252 and beta
- 3:49:28n those are not just some coefficients
- 3:49:31but we already know what these
- 3:49:32coefficients are
- 3:49:35because we can then represent this
- 3:49:40beta by taking the values so those are
- 3:49:44the entries the elements of the vector B
- 3:49:47itself so it is B1
- 3:49:52*
- 3:49:55B1
- 3:49:57plus b2 time E2 dot dot dot
- 3:50:04plus BN
- 3:50:07times e
- 3:50:10n where B1 B2 up Q BN they are all real
- 3:50:18numbers so basically knowing what these
- 3:50:22Vector is these elements of this
- 3:50:25Vector we can always describe and
- 3:50:28express it as a linear combination of
- 3:50:31the standard unit vectors and if you're
- 3:50:33wondering why is this important in some
- 3:50:36cases when performing different
- 3:50:38operations or working on different
- 3:50:40algorithms it just becomes handy to
- 3:50:43represent your vector as a linear
- 3:50:45combination of multiple
- 3:50:47vectors and in those cases exactly you
- 3:50:50can make use of this property of linear
- 3:50:52combinations to express your n
- 3:50:54dimensional Vector b as a linear
- 3:50:56combination of the standard unit vectors
- 3:50:59because everything is then down to you
- 3:51:01by having this Vector B you will already
- 3:51:03know what are the entries that you can
- 3:51:05use as your coefficients in this case
- 3:51:08beta 1 beta 2 so those are all these
- 3:51:10values coming from your vector itself
- 3:51:12and then the remaining is also none
- 3:51:14because you know exactly what these unit
- 3:51:16vectors are and how they are represented
- 3:51:19so here for instance the E1 is basically
- 3:51:22one 0 0 blah blah blah blah 0 and then
- 3:51:25this is n by1 Vector here the E2 is
- 3:51:28equal to 0 1 Z blah blah blah and then
- 3:51:31zero here so n * 1 again up to the point
- 3:51:35where you have the N where you have all
- 3:51:38the zeros only the last element is one
- 3:51:41again n by one vector so this is the
- 3:51:44idea behind this second part of this
- 3:51:46definition which says that any Vector
- 3:51:49being in N dimensional space can be
- 3:51:51expressed as a linear combination of the
- 3:51:53standard unit vectors E1 up to e n let's
- 3:51:58now talk about other concept which is
- 3:52:00also super important which is the span
- 3:52:03of vectors so by definition the span of
- 3:52:06a set of vectors is a set of all
- 3:52:08possible linear combinations of these
- 3:52:10vectors so if V is equal to V1 V2 up to
- 3:52:14V K and is a set of vectors then the
- 3:52:17span of V is written as a span V and it
- 3:52:21includes any vectors that can be
- 3:52:23expressed as C1 V1 up to C2 V2 up to CK
- 3:52:29VK so basically it is a common uh
- 3:52:34notation uh to say that if we got for
- 3:52:37instance vectors V1 V2 up to VN so we
- 3:52:43have n different vectors then we say
- 3:52:46that the
- 3:52:49span
- 3:52:51of
- 3:52:53V1 V2 up to
- 3:52:58VN that this is simply the notation that
- 3:53:02we use in order to describe the span of
- 3:53:04these vectors and we briefly spoke about
- 3:53:07this concept of span when we were
- 3:53:10looking into our example that we saw
- 3:53:12before so you might recall vectors A and
- 3:53:15B that we had and we saw and we said
- 3:53:19that the span of a and b is the entire
- 3:53:23space in the two dimensional uh real
- 3:53:25number space so we said that span of a
- 3:53:28and b is equal to R2 where our Vector a
- 3:53:33was simply equal to one 2 and B was
- 3:53:39equal to
- 3:53:4103 so we proved that the span
- 3:53:45of one two and
- 3:53:4903 was the
- 3:53:52entire R2 and how we knew that because
- 3:53:56we proved that any Vector in R2 could be
- 3:54:00represented as a linear combination of
- 3:54:03these uh two vectors so you might recall
- 3:54:05that we solved this equations we saw
- 3:54:08that in depend what kind of X1 and X2 uh
- 3:54:11one will give us we can always use the
- 3:54:14uh
- 3:54:15um we we found this amount let me see
- 3:54:18where I can find it back I no longer
- 3:54:20have this so we saw that for uh specific
- 3:54:23values of um beta 1 and beta 2 we can
- 3:54:28always get a linear combination of this
- 3:54:31A and B in order to get our desired
- 3:54:34factor
- 3:54:35x so beta 1 * a plus beta 2 * e will
- 3:54:39always then be equal to X1 and X2 if our
- 3:54:42Vector a and Vector B are those but of
- 3:54:45course this doesn't hold for all the
- 3:54:47vectors so not for all two-dimensional A
- 3:54:51and B uh we can say that the span of
- 3:54:54these vectors is the entire R2 therefore
- 3:54:57to better understand this concept of
- 3:54:59span and this concept of span of vectors
- 3:55:01I wanted to distinguish five different
- 3:55:04cases one of which we already spoke
- 3:55:06about and that is the case when we had
- 3:55:08this Vector a and Vector B and we said
- 3:55:10that the span of a and b is the entire
- 3:55:13R2 but we will also look into the case
- 3:55:16when we for instance have a span of the
- 3:55:18zero Vector the span of a single vector
- 3:55:21and the span of perpendicular vectors we
- 3:55:24might also look if there is time left we
- 3:55:26will also look into the span of parallel
- 3:55:29vectors so let's now look into this
- 3:55:32cases one by
- 3:55:36one so let's say we have a vector of
- 3:55:42zero so we have a zero vector so this is
- 3:55:45a very simple case we will start with
- 3:55:46the simplest case and we will move on B
- 3:55:48to two more advanced cases if we have a
- 3:55:51vector a that is a zero
- 3:55:58Vector 0
- 3:56:000 then
- 3:56:02independent what kind of scaler we will
- 3:56:05use to scale this so let's say um we
- 3:56:08Define it by C so C * Z independent what
- 3:56:13kind of scale we will use this will
- 3:56:16always end up being equal to 0 0 so if C
- 3:56:19is equal
- 3:56:20to0 C * 0 will be equal to
- 3:56:250 if C is equal to 1 C * 0 will be equal
- 3:56:30to
- 3:56:32Z or C is equal to 100 C * 0 will still
- 3:56:38be 0 0 so independent what kind of scal
- 3:56:42we will be using what kind of lead
- 3:56:44linear combination we will create from
- 3:56:47our Vector
- 3:56:50a this will always stay in here so the
- 3:56:54point the vector will always stay in
- 3:56:57here in our two Dimension space so this
- 3:57:00is completely different from what we saw
- 3:57:02before when we could create and we could
- 3:57:04take any Vector in our R2 and we could
- 3:57:06represent it as a linear combination of
- 3:57:08these two vectors that we saw in the
- 3:57:10previous example so in this specific
- 3:57:13case
- 3:57:14um scaling the zero with independent of
- 3:57:19any scalers we use this will not change
- 3:57:21the magnitude nor it will change the
- 3:57:23direction of our Vector so no matter how
- 3:57:26we scale it we still get zero this means
- 3:57:30that
- 3:57:31the
- 3:57:33span of zero
- 3:57:40Vector is just the zero Vector itself
- 3:57:45so you can see that independent what I
- 3:57:47scale the zero Vector I always end up
- 3:57:49with the same zero Vector so therefore
- 3:57:52this span of the zero Vector is equal to
- 3:57:54zero because by definition this Spen of
- 3:57:57set of vectors is the collection of all
- 3:58:00possible vectors that I can reach by
- 3:58:02performing linear combination and in
- 3:58:04this case I will always Reach This Z 0
- 3:58:08Vector so all possible collections of
- 3:58:11these vectors are the vector 0 0 which
- 3:58:13is single vector and the same as the
- 3:58:17input so this is the basic case now
- 3:58:20let's move on onto bit more uh Advanced
- 3:58:23case so bit more complicated than this
- 3:58:26one but itself also very easy which is
- 3:58:29when we got a single Vector
- 3:58:32a so let's say a is equal
- 3:58:40to one and two now I want to know what
- 3:58:45is the span of
- 3:58:48a in order to know what is the span of a
- 3:58:52we simply need to understand what are
- 3:58:54all these possible collections of
- 3:58:56vectors that I can get when I'm uh
- 3:58:59combining um a I'm multiplying a with
- 3:59:02different coefficients so what are the
- 3:59:05all possible linear combinations of this
- 3:59:09Vector because I got just single Vector
- 3:59:11a so a is one one two which means one in
- 3:59:15here and then two here my a is this
- 3:59:21vector and let's look into uh different
- 3:59:24uh scalar multiplications of this Vector
- 3:59:27so let's say I want to calculate C
- 3:59:30* a so the scalar multiplication of this
- 3:59:35where C is equal
- 3:59:37to C is equal to 2 C is equal to 3 C is
- 3:59:43equal to uh Min -1 C is = to - 3 and of
- 3:59:48course C is = to
- 3:59:501 so in all these cases when C is equal
- 3:59:54to
- 4:00:031 then the linear combination in this
- 4:00:07case just the scale multiplication of
- 4:00:09this single Vector a so 1 * a is simply
- 4:00:14equal
- 4:00:16to one and two so the same Vector
- 4:00:21a c is equal to 2 this will give me 2
- 4:00:26and
- 4:00:27four C is equal three this will give me
- 4:00:303 and
- 4:00:326 C is = to min-1 will give me -1 - 2
- 4:00:36for my a and then C is equal to -3 will
- 4:00:40give me -3 and then - 6
- 4:00:45so let's plot each of
- 4:00:47those so if we got for instance C is
- 4:00:50equal to one case you can see that we
- 4:00:53already got that Vector in here so it is
- 4:00:55this
- 4:00:56Vector when C is equal to two then we
- 4:00:59got this one so two and four so where is
- 4:01:02that it is in
- 4:01:07here let me use another color it is in
- 4:01:12here when when we got C is equal to
- 4:01:17three then we got so this one three and
- 4:01:22six so this is three and this is
- 4:01:26six so it gives me this
- 4:01:35Vector in the next example so in the
- 4:01:37next linear
- 4:01:39combination we have C is equal to minus
- 4:01:42one so we got Min -1 and Min
- 4:01:45-2 so where is min -1 it is in here
- 4:01:48where is min-2 it is in here so I'm
- 4:01:50getting this
- 4:01:53vector and then
- 4:01:56finally when I have let me change the
- 4:01:59color when I have C is equal to minus 3
- 4:02:02so this case then I got minus 3 and 6
- 4:02:05which means that here is my minus 3 here
- 4:02:08is my minus
- 4:02:106 so we got this thing
- 4:02:14so you already should see what is going
- 4:02:16on here when we got just the single
- 4:02:19Vector for which we need to know what is
- 4:02:21a linear combination and that Vector is
- 4:02:23not a zero Vector it has nonzero
- 4:02:25elements but um it's still it is just a
- 4:02:29single Vector then all its linear
- 4:02:32combinations given that it is simply a
- 4:02:34scaled multiplication of
- 4:02:37it we are all getting them on the same
- 4:02:41line so you can see all the linear
- 4:02:44combinations of this single Vector is
- 4:02:47just a scaled version of it and it lies
- 4:02:49on the same
- 4:02:51line so what this tells us is that
- 4:02:53essentially you can move along the line
- 4:02:56defined by this Vector a but you cannot
- 4:02:58leave it so you cannot get a vector that
- 4:03:01is in here that is in here that is in
- 4:03:03here in here so you cannot leave this uh
- 4:03:07line you will always stay on this line
- 4:03:10so this line essentially spend of
- 4:03:14a so when we got a single vector and
- 4:03:19that Vector is not equal to Z Vector
- 4:03:22then the span of a is equal to and this
- 4:03:25can be expressed as C * a given that the
- 4:03:30C is a real
- 4:03:32number so we already saw this
- 4:03:34independent of what kind of scalar we
- 4:03:36will take any linear combination of it
- 4:03:38will end up simply the C * a so
- 4:03:42therefore we are generally izing this
- 4:03:44and we are seeing that the span of a so
- 4:03:46to set of all possible linear
- 4:03:48combinations of this a is simply equal
- 4:03:51to C * a given that the C is a real
- 4:03:55number this is basically the spend of a
- 4:03:58real uh uh Vector in a two dimensional
- 4:04:02space let's now look into the next case
- 4:04:04the next example when we will calculate
- 4:04:07or we will Define the span of a
- 4:04:11perpendicular vectors so let's look in
- 4:04:13into another example when we are looking
- 4:04:15for a case when the um when we want to
- 4:04:19find out the span of perpendicular
- 4:04:21vectors so imagine we have these two
- 4:04:23vectors Vector a and Vector B where a is
- 4:04:26equal to 1 0 and then B is equal to 0 1
- 4:04:29so we are still in our lovely uh
- 4:04:32two-dimensional space so let's first
- 4:04:35visualize the vector a it's quite basic
- 4:04:37it is this one and then Vector B it is
- 4:04:40simply this one so we can already see
- 4:04:43why they are perpendicular so you can
- 4:04:45see that they are forming this um 90°
- 4:04:48angle so right angle
- 4:04:50here and then we know that the span so
- 4:04:55that's exactly what we want to find out
- 4:04:57so the span of a and b and this is what
- 4:05:03we want to find
- 4:05:05out and we know that the span of two
- 4:05:09vectors is the set of all possible
- 4:05:12linear combination of these vectors so
- 4:05:16we want to see what are these all
- 4:05:18possible inar combinations of
- 4:05:23C1 so all the possible outcomes that we
- 4:05:26will get when we get a linear
- 4:05:28combinations of these two vectors so
- 4:05:30basically C1 *
- 4:05:35a
- 4:05:37plus C2
- 4:05:40* B
- 4:05:44because those are all the linear
- 4:05:47combinations of these two
- 4:05:50vectors C1 * a + C2 *
- 4:05:56B nothing thing that we can see here
- 4:05:58quickly is that C1 * a so this part
- 4:06:03those are all the scaled versions of a
- 4:06:05so scaling multiplications of a and this
- 4:06:10second term in the linear combination
- 4:06:12those are all the scal
- 4:06:14variations so scalar multiplications of
- 4:06:17vector B which means that and we already
- 4:06:21have seen this time and time uh again
- 4:06:24that when it comes to Vector a all its
- 4:06:27linear combinations they will lie on the
- 4:06:29same line so let me take this color so
- 4:06:34if I do 2 a so C1 is equal C2 then I
- 4:06:38will be in here if C1 is equal to three
- 4:06:41then I will be here C1 is equal to 4 I
- 4:06:44will be here C1 is equal to 10 I will be
- 4:06:47in here and then the opposite holds as
- 4:06:51well if C1 is equal to for instance
- 4:06:52minus uh 2 then I will be in here if
- 4:06:55it's equal to Minus 5 I will be uh my
- 4:06:58Vector will look like this and so on so
- 4:07:01this means that all the scaled
- 4:07:04multiplications of vector a will lie on
- 4:07:07this
- 4:07:09line so I can also say that the span of
- 4:07:13see uh the span of a so span of
- 4:07:20a is simply equal
- 4:07:25to
- 4:07:28C1
- 4:07:31a so you can
- 4:07:34see in here so on this line basically so
- 4:07:37this
- 4:07:38is
- 4:07:41C1 a so this basically means independent
- 4:07:44what kind of C1 I will take with is 1 2
- 4:07:473 0 - 5 - 100 I will always end up on
- 4:07:51this line so this
- 4:07:54line so this about the uh scaled
- 4:07:58multiplication of a but of course to
- 4:08:01create this linear combination of A and
- 4:08:02B we also have the second element which
- 4:08:05is the all possible scaled
- 4:08:07multiplications with a vector B so C2 B2
- 4:08:11so let's see what that looks like
- 4:08:13so if I for instance take C2 is equal to
- 4:08:17Z I will be in here if I take C2 is
- 4:08:20equal to uh 2 I will be in here C2 is
- 4:08:24equal to 5 I will be in here C2 is equal
- 4:08:28to Minus 5 I will be here so you are
- 4:08:30already seeing what is happening here so
- 4:08:33all the possible scaled
- 4:08:36multiplications with Vector B will be on
- 4:08:39this line so now we are then getting
- 4:08:42that
- 4:08:45the
- 4:08:47span of B will then be equal
- 4:08:52to
- 4:08:54C2 and then
- 4:08:57B and here I'm not uh using formal
- 4:09:00notation I'm just trying to um I'm just
- 4:09:03trying to uh draft the idea of the spin
- 4:09:06of vector a and uh span of vector B
- 4:09:09because we are not uh done yet we still
- 4:09:12need to combine the two in order to find
- 4:09:14the span of vectors A and B when they
- 4:09:17are perpendicular so when this angle is
- 4:09:20simply
- 4:09:2190° okay so let's also add this on our
- 4:09:26plot so this is C2 and
- 4:09:30then
- 4:09:34B so this already gives us an idea that
- 4:09:40all the
- 4:09:41possible combination of the two so when
- 4:09:44we add these two elements to each
- 4:09:46other the outcome will always lie on
- 4:09:49these two
- 4:09:52lines but there is no way that we can
- 4:09:56find any other coefficient for C1 or C2
- 4:10:00that can help us to get a value that
- 4:10:02will be so a vector that will be in here
- 4:10:05or in here or in here or in here that's
- 4:10:07just not possible so just you can try to
- 4:10:11go ahead and solve that equations like
- 4:10:12we did before before and you will see
- 4:10:14that there there is no way that you can
- 4:10:18pick here a line and you can represent
- 4:10:21it as a linear combination of these two
- 4:10:24vectors it just not possible and later
- 4:10:27on we will see why but just keep in mind
- 4:10:31for now that once we have this this type
- 4:10:34of vectors when two vectors are
- 4:10:37perpendicular then um we cannot find a
- 4:10:41line a vector that is outside of the
- 4:10:45two lines so here you can see the xaxis
- 4:10:48and the Y AIS but it can also be like
- 4:10:51this it can also be like this but then
- 4:10:54you cannot find any other line that lies
- 4:10:56outside of this area that you can uh
- 4:11:00create a linear combination of these two
- 4:11:03different vectors and then you say then
- 4:11:05you cannot say that you can create a
- 4:11:07linear combination of these two vectors
- 4:11:10A and B so therefore
- 4:11:13when it comes to defining the span of
- 4:11:16the two
- 4:11:18perpendicular line we say that the
- 4:11:21span of a and
- 4:11:26b given
- 4:11:28that A and B are perpendicular but also
- 4:11:32given that these values in this case you
- 4:11:34know a is equal to 1 is z b is equal to
- 4:11:370 and one then their spend you might
- 4:11:40have already guessed is equal to
- 4:11:44C1 a plus C2 B given that C1 and C2 are
- 4:11:52of course real
- 4:11:54numbers so in this case C1 and and C2 as
- 4:11:58expected are just scalar so they are
- 4:12:00just some real numbers coming from R and
- 4:12:03uh this A and B those are vectors that
- 4:12:06are being spent and in this case
- 4:12:08specifically the vector a is equal to
- 4:12:11this one zero and Vector B is equal to 0
- 4:12:131 and this expression that we see here
- 4:12:16this pen this simply describes the set
- 4:12:19of all possible vectors that can be
- 4:12:21formed by adding the scaled versions of
- 4:12:23this A and B so C1 a plus C2 B in order
- 4:12:27to form this linear combination so this
- 4:12:30set this set of C1 a plus c2b which is a
- 4:12:33linear combination all possible linear
- 4:12:36combinations of the two
- 4:12:37vectors so um it effectively covers the
- 4:12:41entire plane illustrating that any point
- 4:12:44in 2B space can be reached by some
- 4:12:48combination of A and B let's now move
- 4:12:52towards our final example that we saw
- 4:12:54also as part of our definition for the
- 4:12:56span of vectors in order to check and to
- 4:12:59learn how we can usually check uh
- 4:13:02whether the two vectors they really
- 4:13:04spend the entire space so in this case
- 4:13:07we got two vectors we got Vector uh V1
- 4:13:10which is equal to one two and Vector V2
- 4:13:12which is it's equal to three4 so in here
- 4:13:16and also um we uh have in our example
- 4:13:20that it says the span of V1 and V2 is
- 4:13:23all over the R2 because any Vector in R2
- 4:13:27can be expressed as a linear combination
- 4:13:29of V1 and V2 so the example basically is
- 4:13:32saying that if we know that um we can
- 4:13:37express any Vector in R2 as a linear
- 4:13:41combination of V1 and V2 2 then we say
- 4:13:44that the span of V1 and V2 is the entire
- 4:13:47R2 so let's actually go ahead and prove
- 4:13:50that from our example so we have X which
- 4:13:53we can represent as X1 and X2 and X1 and
- 4:13:56X2 are just real numbers and we got V1
- 4:14:00which is 1 2 V2 which is 3 4 and we got
- 4:14:04in our example that uh we need to prove
- 4:14:08that the
- 4:14:10span of V1
- 4:14:14and
- 4:14:15V2 is the entire
- 4:14:18R2 so for that what we need to do is we
- 4:14:22need to prove that we can express our
- 4:14:26coefficients C1 and C2 in such way using
- 4:14:29X1 and X2 that independent of what these
- 4:14:33X1 and X2 are so what kind of X Vector
- 4:14:36we have whether this is like one two or
- 4:14:40this is 04 or this is th000 and uh 5,000
- 4:14:46independent what kind of vector we get
- 4:14:49uh we give here so X1 and X2 values as
- 4:14:52long as those are real uh numbers we can
- 4:14:56always find a set of C1 and C2 that we
- 4:15:00can use as coefficients in order to
- 4:15:02create a linear combination from vectors
- 4:15:05V1 and V2 and in that case we say then
- 4:15:09the span of V1 and V2 is the in par
- 4:15:14R2 okay so let's go ahead and actually
- 4:15:17prove that using our previous knowledge
- 4:15:20that we already gained so keeping in
- 4:15:22mind that C1 and C2 are unknown numbers
- 4:15:26for us whereas X1 and X2 are just a way
- 4:15:29to describe those elements in our Vector
- 4:15:32X that will be provided to us so X1 and
- 4:15:35X2 will be basically know and C1 and C2
- 4:15:38are the unknowns that we are chasing so
- 4:15:41for that the first thing that I'm going
- 4:15:42to do is to describe this linear
- 4:15:44combination that we got here C1 V1 plus
- 4:15:47C2 V2 with actual equations unknown
- 4:15:51equations and the way I'm going to do it
- 4:15:53is by simply filling in this Vector V1
- 4:15:56and Vector V2 um
- 4:15:59values so we have C1 and then C2 here
- 4:16:05and then here I got one two
- 4:16:09plus and then three and four here and
- 4:16:13what is this amount so this is equal
- 4:16:20to let me actually go on to the next
- 4:16:25row so we can create um set of equations
- 4:16:31for this so this is equal to X
- 4:16:43and we get
- 4:16:46C1 *
- 4:16:501+ C2 * 3 is =
- 4:16:552 and remember that this is X and we
- 4:16:59said that the x is equal to X1 and X2 so
- 4:17:01this basically equal to we can B right
- 4:17:05here is equal to X1 and
- 4:17:09X2 so this is then equal 2
- 4:17:15let's not skip all the
- 4:17:17steps X1 and
- 4:17:21X2 so here then the second elements need
- 4:17:25to be added so C1 *
- 4:17:302 and C2 *
- 4:17:384 which is then the same as
- 4:17:44C1 + 3 C2 and then 2 C1 + 4 C2 and
- 4:17:52then this we are saying this Vector is
- 4:17:54equal to X1 and
- 4:17:57X2 so this is what we have here and
- 4:18:00let's move from the vectors to equations
- 4:18:04so given that we have this we are
- 4:18:07allowed to say that this gives us
- 4:18:08actually two equations this means that
- 4:18:11this element this element from this part
- 4:18:14should be equal to this and this element
- 4:18:17should be equal to this now let's write
- 4:18:19it down we see that
- 4:18:22c1+ 3 C2 should be equal to
- 4:18:26X1 2
- 4:18:28c1+ 4
- 4:18:30C2 is equal to X2 this is all that we
- 4:18:34see in
- 4:18:35here let's remove this to keep the space
- 4:18:40clean now what this means is
- 4:18:43that we have two equations with two
- 4:18:46unknowns C1 and C2 and X1 and X2 are the
- 4:18:50numbers that will be provided to us as
- 4:18:52part of our Vector so what we want to
- 4:18:55prove is that we can describe and we can
- 4:18:58express C1 and C2 which are our
- 4:19:01unknowns using X1 and X2 so you see here
- 4:19:05this is C1 C2 those are our nouns and we
- 4:19:10want to describe them by using X1 x 1
- 4:19:12and
- 4:19:14X2 and very soon we will also see why so
- 4:19:18for now let's try to express those two
- 4:19:21unknowns using our nouns like X1 and X2
- 4:19:25so here I already see that C1 is alone
- 4:19:28so there is no scaler so I will make use
- 4:19:31of that opportunity to keep the C1 on
- 4:19:33the left hand side and I will take this
- 4:19:36this amount to the right so I will say
- 4:19:38C1 is equal to X1 minus 3 C2
- 4:19:43two okay slightly better so I have C1 at
- 4:19:46the left I do have X1 in the right but I
- 4:19:49also have three C2 in here but another
- 4:19:53thing that you will notice is that in my
- 4:19:55second expression here I got 2 C1 + 4 C2
- 4:19:58plus X2 I want to have the C2 only
- 4:20:04because then I will have an expression
- 4:20:06of my C2 only using X1 and X2 um so
- 4:20:12numbers that are that will be provided
- 4:20:14to me that are n so for that what I'm
- 4:20:17going to do is basically trying to solve
- 4:20:20uh two equations with two unknowns
- 4:20:22exactly the same um process so I'm going
- 4:20:25to take this C1 from the first equation
- 4:20:28and I'm going to fill in in the second
- 4:20:30equation so I am going to say two times
- 4:20:35and here I'm going to fill in that C1
- 4:20:38expression from here so X1 - 3 C2
- 4:20:442 so this is my C1 plus just taking over
- 4:20:48this part so 4 C2 is equal to X2 okay
- 4:20:57perfect so now what I end up with is C1
- 4:21:02is = to X1 - 3 C2 just taking it over
- 4:21:06and then here I'm opening parenthesis
- 4:21:08which is 2 X1 - 6
- 4:21:11c2+ 4 C2 is equal to here I forgot an X2
- 4:21:16is equal to X2 okay one step
- 4:21:20closer why because I in my second
- 4:21:23equation I no longer have a C1 I only
- 4:21:27have a C2 which is great which means
- 4:21:29that this gives me an
- 4:21:31indication that I can rewrite the C2
- 4:21:35which is unknown with nouns with X1 and
- 4:21:38X2 so let's make use of that opportunity
- 4:21:41the first equation I would just take
- 4:21:43over so C1 is equal to and then
- 4:21:47X1 - 3
- 4:21:51C2 and
- 4:21:53then here I will do 2 X1 and then here
- 4:21:57we got 2 * c2s which means we can
- 4:22:00combine them so Min - c - 6 * C2 + 4 C2
- 4:22:05it gives me - 2 *
- 4:22:09C2 and this is equal to
- 4:22:13X2 all right let's now solve that
- 4:22:18part so what I want to have is just the
- 4:22:21C2 in the left hand side which means I
- 4:22:23need to bring all this to the right and
- 4:22:25I need to get rid of them such that I
- 4:22:27can leave the C2 in the left entirely
- 4:22:30alone so this is what I'm basically
- 4:22:34chasing for that I'm going to once again
- 4:22:38rewrite C1 is equal to X1 - 3 C2
- 4:22:43and this time I'm going to take them
- 4:22:46minus 2 C2 here I'm going to leave that
- 4:22:49in the left but then this one I'm going
- 4:22:51to bring to the right so X2 - 2
- 4:22:56X1 here I need to be very careful to not
- 4:22:59make a mistake CU that will mess up my
- 4:23:01entire
- 4:23:05calculation all right so now we are one
- 4:23:07step closer just taking over the first
- 4:23:10equation again so C1 is equal to X1 - 3
- 4:23:14C2 and here what I need to do to get rid
- 4:23:17of this minus two is to divide the two
- 4:23:20sides so both 2 minus 2 CU that will
- 4:23:25help me to keep the C2 only in the left
- 4:23:30alone without any scaler so the C2 is
- 4:23:33then equal to X2 minus 2
- 4:23:37X1 / 2 - 2 so this is what I end up
- 4:23:43with
- 4:23:45perfect so we are very close stay with
- 4:23:48me so uh here what we are getting is
- 4:23:52that C2 is equal to this amount we see
- 4:23:55that now we no longer have any other C
- 4:23:59in here which is great and remember that
- 4:24:01X1 and X2 will be numbers that it will
- 4:24:03be provided to us I just wanted to give
- 4:24:05everything General and then uh another
- 4:24:08thing that I want to fix is this C2
- 4:24:11because this C2 is an unknown and I want
- 4:24:14to fill in uh this value of C2 in here
- 4:24:18such that for the C1 I will have a
- 4:24:21similar picture so in the left hand side
- 4:24:23I will have C1 in the right hand side I
- 4:24:25will Express the C1 with no number so X1
- 4:24:28and X2 but not the C2 or others all
- 4:24:32right so let's then go ahead and do that
- 4:24:37first I will write C2 in a simpler way
- 4:24:39so C2 is equal to here I got a min I
- 4:24:42will just write here minus so I will
- 4:24:45take the minus over here and then I will
- 4:24:47write X2 - 2 X1 to U be super careful
- 4:24:51with this minus therefore I'm using
- 4:24:53parenthesis so now I'm going to use this
- 4:24:56C2 and I'm going to fill that in in here
- 4:24:58so C1 is equal to
- 4:24:59X1 minus 3 * I can also make it plus
- 4:25:04because minus of
- 4:25:06here so minus of here and minus of here
- 4:25:10will cancel out therefore I will
- 4:25:14do plus three times and then X2 - 3
- 4:25:22X1 /
- 4:25:2522 and this then gives me
- 4:25:29C1 is equal to X1
- 4:25:33+ 3 / 2 * X2 - 3 sorry 2 almost made a
- 4:25:41mistake 2
- 4:25:43X1 and then C2 is = to X2 - 2
- 4:25:48X1 /
- 4:25:502 2 and here we
- 4:25:55got
- 4:25:57minus
- 4:25:58Perfect all right awesome so now we have
- 4:26:03expressed X1 and
- 4:26:07X2 well careful with this X1 and X2 we
- 4:26:12only noun numbers now what I'm going to
- 4:26:15do is that I'm going to prove that
- 4:26:18independent what kind of X we will be
- 4:26:20taking here we will end up getting the
- 4:26:23C1 and C2 using this what we just found
- 4:26:27here that will give us a linear
- 4:26:29combination of these two vectors that
- 4:26:31will be equal to that eight so for that
- 4:26:34so to prove that this pen of V1 and vs2
- 4:26:37is the entire R2 I need to prove that
- 4:26:40independent what kind of X I will take
- 4:26:42so X1 and X2 I can always find the C1
- 4:26:46and C2 that I um just calculate in here
- 4:26:49using that X1 and X2 that I can then use
- 4:26:53to combine with my V1 and V2 to find the
- 4:26:56linear combination of these two vectors
- 4:26:59with that C1 and C2 which will be equal
- 4:27:02to this
- 4:27:03x so for that what I need to do first is
- 4:27:07to take such a uh random X so let's say
- 4:27:11my X is equal to 0 and 4 this means that
- 4:27:16my X1 is equal to 0 and X2 is equal to 4
- 4:27:20what this means is that this gives me C1
- 4:27:22which is equal to and here X1 so I'm
- 4:27:26basically filling these two values for
- 4:27:28here to obtain my C1 so C1 corresponding
- 4:27:31to this specific Vector X so X1 is equal
- 4:27:35to 0 which means I end up C1 is = 0 + 3
- 4:27:39/ 2 * X2 is = 4
- 4:27:42so 4 minus and then 2 * X1 is equal to -
- 4:27:462 * 0 which is
- 4:27:480 and then C2 is = to minus and then X2
- 4:27:54is equal to 4 so 4 and then minus 2 * XY
- 4:27:59is = to 0 0 and then this divided to two
- 4:28:03now what are those
- 4:28:05numbers
- 4:28:07so C1 is equal
- 4:28:10to 3 / 2 * 4 which is 3 * 2 so 6 and
- 4:28:16then C2 is equal
- 4:28:18to- 4 and then minus so this is zero
- 4:28:22this cancels out which means 4 / 2 is 2
- 4:28:25and then C2 is equal to minus
- 4:28:282 so basically I have calculated the
- 4:28:33coefficients C1 and C2 by just knowing
- 4:28:38what is this Vector so knowing X the
- 4:28:41provide X1 and X2 I have calculated my
- 4:28:45C1 and C2 using my
- 4:28:49derivations in here so let's now get rid
- 4:28:52of
- 4:28:56this this calculations to clear some
- 4:29:00space and to do the final part which is
- 4:29:03compute the linear combination of vector
- 4:29:06V1 and V2 for this specific coefficients
- 4:29:08well knowing what this given Vector now
- 4:29:11is example random Vector so the C1 is
- 4:29:17equal to 6 which means 6 * and then
- 4:29:20Vector V1 is one 2 so this is first part
- 4:29:24of my linear combination
- 4:29:27plus and then C2 is equal to - 2
- 4:29:33times then here 3 4
- 4:29:46what is this this is equal
- 4:29:50to 6 and then 6 * 2 is
- 4:29:5512
- 4:29:57plus now let's calculate the second part
- 4:30:00- 2 * 3 is -
- 4:30:046 and - 2 * 4 is
- 4:30:09-8 so what does this give
- 4:30:14us 6 - 6 and 12 - 8 this gives
- 4:30:21us zero and
- 4:30:25four nice so this confirms that we have
- 4:30:29done everything also correctly which is
- 4:30:31great because we have seen that using
- 4:30:35this C1 and C2 that we have just
- 4:30:38calculated we have successfully uh
- 4:30:42computed the 6
- 4:30:45V1 so linear combination of this uh two
- 4:30:50vectors V1
- 4:30:55plus -
- 4:31:002 minus 2 and then
- 4:31:05V2 and we have seen that this linear
- 4:31:07combination is equal to 04 which is
- 4:31:09exactly our 8 so in this way we have
- 4:31:13proven that independent what kind of
- 4:31:15vector we will pick what kind of X we
- 4:31:18will pick here we can always find and
- 4:31:21calculate the corresponding coefficients
- 4:31:24C1 and C2 in the same way as I just did
- 4:31:27and then by using those when we
- 4:31:30calculate the linear combination of
- 4:31:32these two vectors with this specific
- 4:31:35coefficient this will be exactly equal
- 4:31:37to X and this proves that independent
- 4:31:41what kind of vector we have in our R2 we
- 4:31:44can always express that as a linear
- 4:31:47combination of the vector V1 and V2 and
- 4:31:50this proves and this concludes our proof
- 4:31:52that
- 4:31:54span of V1 and V2 is the entire
- 4:32:02R2 all right so we are very close to
- 4:32:05finishing up this unit so the next topic
- 4:32:08we are going to talk about is a linear
- 4:32:10Independence and all this important
- 4:32:13stuff that we learned as part of the
- 4:32:15previous modules are going to become
- 4:32:17super handy as part of this specific
- 4:32:20concept so we just spoke about the idea
- 4:32:22of span we have plotted a lot of vectors
- 4:32:25we have seen the linear combination of
- 4:32:27that and how we can find out whether the
- 4:32:30span of multiple vectors is the entire
- 4:32:32space uh for instance the R2 or it is
- 4:32:35just the line or it's maybe the zero
- 4:32:38Vector we have seen many examples and
- 4:32:40many operations we have we have also
- 4:32:42seen this idea of unit vectors and we
- 4:32:44are finally ready to come to this very
- 4:32:46important concept which is a concept of
- 4:32:49linear
- 4:32:51Independence so by definition linear
- 4:32:54Independence says that the set of
- 4:32:56vectors is linearly independent if no
- 4:32:59Vector in a set can be written as a
- 4:33:02linear combination of the others
- 4:33:05otherwise they are linearly
- 4:33:08dependent so vectors V1 V2 up to VN are
- 4:33:13linearly independent if and only
- 4:33:17if the only solution to the equation C1
- 4:33:21V1 + C2 V2 plus CN VN is equal to zero
- 4:33:27is C1 is equal to C2 up to CN is equal
- 4:33:31to Zer in other words in a l linearly
- 4:33:35independent set the equation C1 V1 + C2
- 4:33:39V2 plus CN VN is put zero has only the
- 4:33:43trial solution where all CIS are
- 4:33:48zeros so now what do we mean here there
- 4:33:51is a ton of information in this
- 4:33:53definition so let's unpack them firstly
- 4:33:55it's really important to uh keep in mind
- 4:33:58this idea of
- 4:34:00Independence and dependence Independence
- 4:34:03and dependence there are things that we
- 4:34:05commonly use in data science in
- 4:34:07artificial intelligence in statistics so
- 4:34:10those are really important so we
- 4:34:13basically have linear independent
- 4:34:17condition so there is a certain
- 4:34:19condition that our vectors should
- 4:34:20satisfy vectors in our set in our Vector
- 4:34:24space for them to be named as linearly
- 4:34:27independent and otherwise we are calling
- 4:34:30them linearly dependent and you can see
- 4:34:32that here there are a couple of Parts as
- 4:34:35part of this definition first it talks
- 4:34:38about um being unable to create a vector
- 4:34:42in the vector set while using the
- 4:34:45remaining vectors in our set so it says
- 4:34:48if you can use the remaining vectors in
- 4:34:51your vector space and linear create a
- 4:34:55linear combination of them so linearly
- 4:34:57combine them and we have already seen
- 4:35:00the definition of linear combination so
- 4:35:03if we cannot create such linear
- 4:35:05combination from the remaining vectors
- 4:35:08to get our Target vector
- 4:35:12then we are saying that we have a
- 4:35:14linearly independent vectors so if we
- 4:35:17want to say that all our vectors in our
- 4:35:20Vector set they are linearly independent
- 4:35:23it means that each of those vectors we
- 4:35:26should not be able to recreate out of
- 4:35:29the remaining vectors so we should not
- 4:35:31be able to find coefficients to create
- 4:35:34linear combination using the remaining
- 4:35:36vectors in order to get our Target
- 4:35:40vector now what do I mean by this target
- 4:35:43Vector what do I mean by this linear
- 4:35:45combination uh I will come to this in a
- 4:35:47bit for now let's just try to unpack
- 4:35:49this definition cuz uh with examples uh
- 4:35:53we will definitely go through this step
- 4:35:55by step in detail such that this ideal
- 4:35:58linear Independence and dependence is
- 4:36:00super clear so in the second part of the
- 4:36:03definition it says vectors V1 V2 up to
- 4:36:06VN are linearly independent if and only
- 4:36:10if the only solution to the equation and
- 4:36:13we have here in the left hand side you
- 4:36:15might recognize the linear combination
- 4:36:17of our vectors V1 up to VN so in in the
- 4:36:21right hand side you have zero so you are
- 4:36:22saying our linear combination of vectors
- 4:36:24is equal to zero if and only if C1 C2 up
- 4:36:29to CN is equal to zero so linear
- 4:36:33Independence basically claims that we
- 4:36:36will have linearly independent vectors
- 4:36:39only if and only in the condition when
- 4:36:44um the only way we can create linear
- 4:36:47combination of these vectors equal to
- 4:36:50zero only if those coefficients are zero
- 4:36:54there is no other way that we can get a
- 4:36:56linear combination that is equal to zero
- 4:36:59while those coefficients are not zero so
- 4:37:03the only way that we can get a linear
- 4:37:05combination out of all our vectors equal
- 4:37:07zero is only when all of the
- 4:37:10coefficients C1 1 C2 up to CN is equal
- 4:37:13to zero that's something that we will
- 4:37:15come later to this again this something
- 4:37:18also that we are going to come back in
- 4:37:20our next module and the next one so um
- 4:37:24this one will be also super clear once
- 4:37:26we go through those modules but for now
- 4:37:29keep in mind that the uh linear
- 4:37:31combination of all these vectors can
- 4:37:33only be zero in case when all these
- 4:37:36coefficients are equal to zero so and
- 4:37:40then we have the third part in our
- 4:37:42definition which says that in other
- 4:37:45words in a linearly independent set the
- 4:37:49equation C1 V1 plus C2 V2 up to CN VN is
- 4:37:54equal to zero has only the trivial
- 4:37:57solution where all CIS are zero so this
- 4:38:00explanation is basically what we just
- 4:38:02spoke about as part of this second part
- 4:38:04where we said that only in case the
- 4:38:07coefficients are all zero we can have a
- 4:38:09linear combination of our vector V1 V2
- 4:38:12up to VN which is equal to
- 4:38:16Zer and why we would like this linear
- 4:38:18combination to be equal to zero because
- 4:38:21it's a common way to find solution to
- 4:38:23our linear system so this is something
- 4:38:26that we will also see as part of the
- 4:38:28next module when we'll be discussing the
- 4:38:31idea of solving linear systems we will
- 4:38:33go into more uh Advanced topics but for
- 4:38:36now in order to understand this idea of
- 4:38:38linear Independence we should just keep
- 4:38:40in mind that we cannot find any CIS so
- 4:38:45C1 C2 so any coefficients that is not
- 4:38:48equal to zero and then expect that the
- 4:38:50linear
- 4:38:51combination of these uh linearly
- 4:38:54independent vectors is equal to zero so
- 4:38:56that's the uh if and only uh if and only
- 4:38:59uh if part which means that this holds
- 4:39:01from both sides on one hand we have V1
- 4:39:04V2 up to VN which are linearly
- 4:39:07independent only if the linear equation
- 4:39:11so the linear combination of all these
- 4:39:13vectors is equal to zero if all these
- 4:39:14coefficients are zero but also the other
- 4:39:17way around holds as well so if we have a
- 4:39:19linear combination that is equal to zero
- 4:39:22only if those coefficients are zero that
- 4:39:24means that we are dealing with a
- 4:39:26linearly independent vectors this is the
- 4:39:30if and only if part which means that we
- 4:39:33have this uh conditions from both sides
- 4:39:35if one holds the other one holds but
- 4:39:37also the other way
- 4:39:39around all right so let's now look into
- 4:39:42specific examples that will make our
- 4:39:44journey in understanding linear
- 4:39:46dependence much more convenient so let's
- 4:39:49say we have our coordinate system and we
- 4:39:52have these two different vectors so we
- 4:39:55have Vector let's
- 4:40:06say 2 and three which is our Vector a
- 4:40:11and we have a vector
- 4:40:14B that is equal
- 4:40:162 6 and
- 4:40:20N so those two are our vectors and what
- 4:40:24we want to understand is where those two
- 4:40:26vectors are linearly independent or
- 4:40:29linearly
- 4:40:31dependent so one thing that you can
- 4:40:34quickly notice is that b looks quite
- 4:40:38similar to a in terms of its scal so
- 4:40:42there is a way that we can recreate
- 4:40:45Vector B by using Vector a now you can
- 4:40:50see that if I take Vector
- 4:40:55a which is equal to
- 4:40:5923 if I take Vector a and I multiply it
- 4:41:03by three so three * Vector a this is a
- 4:41:07scale
- 4:41:08multiplication then what I can get is
- 4:41:14three times and then I have here two
- 4:41:18three and this is then equal
- 4:41:21to 3 * 2 is 6 3 * 3 is 9 this gives me 6
- 4:41:27and 9 which is our uh Vector now another
- 4:41:31thing that you can notice that that is
- 4:41:33exactly my B so you can see that those
- 4:41:37two are similar which means that three *
- 4:41:43a is equal to
- 4:41:47B now what this means is that I can
- 4:41:50recreate Vector B by using Vector a so
- 4:41:56in our definition we saw that a set of
- 4:41:59vectors is linearly independent if no
- 4:42:03Vector in the set can be written as a
- 4:42:06linear combination of the
- 4:42:08others so here I can take this 3A as a
- 4:42:13way to write down a linear
- 4:42:17combination so 3A + 0 *
- 4:42:22B is then equal to
- 4:42:27B which is basically saying 3 a is equal
- 4:42:30to B so by using these two vectors in a
- 4:42:34set I can then create a linear
- 4:42:36combination of the two and actually even
- 4:42:40basic way of writing this is saying I
- 4:42:44can use the vector a to write a linear
- 4:42:48combination from this so 3A is a linear
- 4:42:51combination so just a scaled
- 4:42:53multiplication in this case of course
- 4:42:55but if we have just two vectors our
- 4:42:58Target Vector is B and I want to write
- 4:43:00this uh I want to see whether I can
- 4:43:02rewrite the vector b as a linear
- 4:43:05combination of the remaining vectors
- 4:43:07which is Vector a so I can then write
- 4:43:10Vector B as a linear combination of
- 4:43:13vector a because I can say that 3 * a is
- 4:43:16equal to Vector
- 4:43:21B so this means that Vector a and Vector
- 4:43:27B they are
- 4:43:31linearly
- 4:43:34dependent this means that I can use
- 4:43:37Vector a to recreate Vector B and of
- 4:43:40course I can also do the other way
- 4:43:42around right what I can do is that I can
- 4:43:45just
- 4:43:46take Vector B so I can take Vector
- 4:43:53B I can multiply it by one ided to
- 4:43:58three 1 / 3 is real number so I'm just
- 4:44:01performing a linear combination using B
- 4:44:05and this will give me 6 / to 3 is 2 9 /
- 4:44:10to 3 is Tre and I'm getting exactly what
- 4:44:13I have under a so I can then also
- 4:44:16rewrite Vector a by using Vector B so I
- 4:44:21created a linear
- 4:44:23combination using Vector B in order to
- 4:44:26get a vector a and that's exactly the
- 4:44:29opposite what we have learned here
- 4:44:31because we should not be able to write
- 4:44:34this a vectors using the other ones in
- 4:44:36our set cuz otherwise we have a linearly
- 4:44:40dependent set
- 4:44:41therefore we are saying that Vector a
- 4:44:43and Vector B they are not a set that is
- 4:44:46linearly independent but they are
- 4:44:49linearly dependent before moving on to
- 4:44:52another example I also wanted to
- 4:44:54visualize these vectors just to see what
- 4:44:56is going on with this pan and uh how the
- 4:44:59two linearly dependent vectors look like
- 4:45:03in R2 so this is our r t we have a
- 4:45:06vector a which has two tree elements so
- 4:45:09we know already the magnitude and the
- 4:45:11direction this is two this is three
- 4:45:13which means here let me actually use
- 4:45:17another
- 4:45:18color so 2 three which means this is my
- 4:45:22Vector a and then my Vector B is simply
- 4:45:27six and N so it is this
- 4:45:32one so you can already see what is going
- 4:45:35on so this is Vector a and this entire
- 4:45:39thing is Vector B
- 4:45:47and you can see that those two vectors
- 4:45:52no matter how I combine them I can I
- 4:45:55will always get the combination so
- 4:45:58linear combination of the two on this
- 4:46:01line if I want to
- 4:46:05get um Vector that is for instance in
- 4:46:09here I can never
- 4:46:11find a scalers of
- 4:46:14C1 and C2 in such way that these
- 4:46:21vectors so A and B they can form a
- 4:46:25linear combination that will give me
- 4:46:27this Vector there is no way that I can
- 4:46:29do that and that's why uh we say that
- 4:46:33this span of this two
- 4:46:36vectors so span
- 4:46:40of A and B with this A and B is this
- 4:46:47line and we cannot express any of these
- 4:46:51other vectors like this one or this one
- 4:46:54using a linear combination of these
- 4:46:56vectors A and B the only linear
- 4:46:58combinations that we can recreate using
- 4:47:00these vectors A and B are on this line
- 4:47:04so you can see that even if I have two
- 4:47:07different vectors I actually just got um
- 4:47:10single Vector because I have two Tre and
- 4:47:13both of these vectors they are actually
- 4:47:16um uh scaled multiplication of the other
- 4:47:19one so B is equal
- 4:47:22to I'm missing here something 1 / 3 so B
- 4:47:27is simply equal to 3 * a and then a is
- 4:47:30equal to 1 / to 3 * B so in both cases
- 4:47:35they are simply a version of scaled
- 4:47:37multiplication of this Vector Q3
- 4:47:41so a is simply equal
- 4:47:46to
- 4:47:49B * 13 and then B is equal to 3 *
- 4:47:57a and both of them they are actually
- 4:47:59based on this Vector 2 Tre on this
- 4:48:02Vector
- 4:48:05a so therefore they both actually form
- 4:48:09and they span or round this single
- 4:48:16line and they are
- 4:48:18both linear we also call it collinear
- 4:48:21and they are linearly
- 4:48:25dependent okay so let's now move on to
- 4:48:28the next uh example where we will have
- 4:48:30bit more interesting case and we will
- 4:48:32look into this example when we have
- 4:48:35linear Independence
- 4:48:41look into another example bit more
- 4:48:43interesting one as we want to see
- 4:48:44whether those two are linearly
- 4:48:46independent or not so the first Vector
- 4:48:49that we got is the vector a the vector a
- 4:48:53is equal to 6 and Z so it is this
- 4:49:00Vector this is Vector a the vector
- 4:49:05B it is this
- 4:49:08one and it contains element of Z 0 and
- 4:49:137 so it is
- 4:49:16this Vector this is the vector B now in
- 4:49:21our definition of linearly independent
- 4:49:25vectors we saw that the idea of linear
- 4:49:28Independence is that the two vectors can
- 4:49:31only be linear independent if we cannot
- 4:49:34rewrite one of them by using the other
- 4:49:37so this means that we cannot rewrite a
- 4:49:41in terms of B and we cannot rewrite B in
- 4:49:44terms of a so there is no way that we
- 4:49:47can scale the vector a to get Vector B
- 4:49:50and there is no way that we can scale
- 4:49:51Vector B with vect with some uh scaler
- 4:49:54in order to get the vector a so there is
- 4:49:57no way that we can create a linear
- 4:49:59combination of this one vector to get
- 4:50:02the other one and the other way around
- 4:50:04so let's see whether this is the case
- 4:50:06just from uh trial and error we have a
- 4:50:10vector a
- 4:50:11which contains elements 6 and zero for
- 4:50:14us to go from A to
- 4:50:18B that has elements from so we need to
- 4:50:23go from 6 to zero in this case and we
- 4:50:26need to go from 0 to 7 now we can
- 4:50:30automatically already see from the
- 4:50:31second element that there is no way that
- 4:50:33we can go from 0 to 7 you cannot find
- 4:50:37any scaler
- 4:50:39C that you can multiply with zero in
- 4:50:43order to
- 4:50:45get seven there is no way that you can
- 4:50:48do that because any number any real
- 4:50:54number that is a real number if you
- 4:50:58multiply it with zero it will never
- 4:51:00become
- 4:51:02seven and of course another thing that
- 4:51:05you can notice here also very quickly is
- 4:51:07the other way around right so here if
- 4:51:10you go from this zero to six there is no
- 4:51:13way you can go from this Z to six
- 4:51:15because there is no such C that you can
- 4:51:19take this zero and multiplying it with
- 4:51:22that so here our
- 4:51:25scaler and you get this equal to six
- 4:51:29this is just not
- 4:51:33possible so what we are seeing here is
- 4:51:36that there is no way that we can somehow
- 4:51:39change this vector so there is no way
- 4:51:42that we can scale them in such
- 4:51:48way so this is minus
- 4:51:51B so all the scales scaled version of
- 4:51:56this or all the um scaled
- 4:51:58multiplications of vector B they will
- 4:52:00always be on this
- 4:52:02line and then the same holds for a as
- 4:52:05well so all the scaled multiplications
- 4:52:08of a will be on this line
- 4:52:11so then one thing we can quickly see
- 4:52:13here is
- 4:52:15that given that those two are
- 4:52:19perpendicular this
- 4:52:22pen of A and B is the entire
- 4:52:28R2 so we can see that by using those two
- 4:52:32lines we can recreate any other line in
- 4:52:35this
- 4:52:38R2 and this is highly related to this
- 4:52:41idea of linear
- 4:52:42Independence and given that we cannot
- 4:52:44come up with a linear combination using
- 4:52:47the a vectors to recreate the other one
- 4:52:50in this case given that we cannot
- 4:52:52recreate a using B and we cannot
- 4:52:55recreate B using a so no linear
- 4:52:58combination that exist that we can use
- 4:53:00to recreate Bay using a and the other
- 4:53:03way around we are saying that Vector a
- 4:53:08and Vector B are are
- 4:53:13linearly
- 4:53:20independent let's now look into another
- 4:53:22example that will uh clarify this linear
- 4:53:25Independence concept so we have three
- 4:53:28different vectors and the first Vector
- 4:53:30is Vector a 1 0 0 Vector B uh 0 1 0 our
- 4:53:34second vector and the third Vector 0 0 1
- 4:53:37you can notice that we are in R Tree
- 4:53:41and then the example goes on and it says
- 4:53:43that those three vectors are linearly
- 4:53:46independent and as an explanation we
- 4:53:48have that there is no way to add these
- 4:53:51vectors together with any scalar
- 4:53:53multiples to equal the zero Vector
- 4:53:56unless all scalers are zero now before
- 4:53:59even going on to next part it's actually
- 4:54:02very quickly um uh provable that those
- 4:54:06three vectors are linearly independent
- 4:54:08and you cannot create a linear
- 4:54:10combination of one using the remaining
- 4:54:12of the two let's look into this example
- 4:54:15in more detail so we have three vectors
- 4:54:24A1
- 4:54:26A2 sorry
- 4:54:29B so we got
- 4:54:33a B and
- 4:54:38C which are
- 4:54:411 0
- 4:54:430 0 1
- 4:54:460 and 0
- 4:54:5001 now you can quickly see that if we
- 4:54:53are in
- 4:54:54R3 and this is actually our unit Vector
- 4:54:57E1 this is our unit Vector E2 and this
- 4:55:00is our unit Vector E3 because in that
- 4:55:03positions we got our ones and the
- 4:55:05remaining they are all zero and this is
- 4:55:09actually very similar to the previous
- 4:55:10example because we can quickly see how
- 4:55:13we are we will not be able to recreate
- 4:55:16one vector using the other ones by even
- 4:55:19looking at the positions of the zeros so
- 4:55:22for us to recreate Vector a which is
- 4:55:27equal to 1 0 0 it means that we should
- 4:55:32be
- 4:55:34able to
- 4:55:36find a linear combination
- 4:55:41C1 C2 and then using these vectors this
- 4:55:45is the vector
- 4:55:48B 0 1
- 4:55:510 plus C2 * Vector C which is 0 0
- 4:55:591
- 4:56:02so in here
- 4:56:04basically we are already seeing a
- 4:56:08problem because we have here here an
- 4:56:12element
- 4:56:14one and we somehow need to be able to
- 4:56:18find
- 4:56:21C1 and
- 4:56:23C2 in such way that 1 is equal
- 4:56:27to C1
- 4:56:30* 0
- 4:56:32+
- 4:56:36C2 time Z but we know that there is no
- 4:56:40C1 and C2 that we can find such this uh
- 4:56:43expression actually is true because C1
- 4:56:47and C2 they should be real numbers and
- 4:56:50there are no real numbers that we can
- 4:56:51find to multiply with zero such that
- 4:56:54this will end up to one because this is
- 4:56:57always equal to zero and we basically
- 4:57:00get 1 is equal to Z which is not
- 4:57:04true and of course the same holds the
- 4:57:07other way around you can prove that B
- 4:57:09can never be um recreated by using the
- 4:57:12linear combination of a and c and also
- 4:57:15the C can never be recreated by using a
- 4:57:17linear combination of A and B therefore
- 4:57:21we are
- 4:57:26saying given that
- 4:57:30a can't be
- 4:57:34written as linear combination
- 4:57:43of B and
- 4:57:48C
- 4:57:51B can be
- 4:57:57written so the same only this time A and
- 4:58:03C and then
- 4:58:05C
- 4:58:07hunt B
- 4:58:11written as linear combination of A and
- 4:58:18B those
- 4:58:22vectors A B and
- 4:58:26C they
- 4:58:28are
- 4:58:30linearly
- 4:58:38independent and if stronger you can
- 4:58:41actually go ahead and prove that this
- 4:58:44Spen of these three vectors is the r Tre
- 4:58:48but that's outside of the scope of this
- 4:58:50example so we will just pass but I will
- 4:58:52leave that um to you to
- 4:58:55prove all right so now when we are done
- 4:58:58with that let's actually move on to the
- 4:59:01last module which is the dot product and
- 4:59:04its
- 4:59:05applications so uh the length of a
- 4:59:08vector and Dot product is a con cep that
- 4:59:10um we um are familiar from the high
- 4:59:13school so the length of a vector is
- 4:59:15deeply related to this do product idea
- 4:59:18the dotproduct of a vector v WID itself
- 4:59:21gives this a square of the length of V
- 4:59:25what basically um it means is that this
- 4:59:29dotproduct of vector v so this thing
- 4:59:33which means take the vector v and
- 4:59:36multiplying it with the with the other
- 4:59:38vector v is simply equal
- 4:59:42to the square of a length of B
- 4:59:47so this is way to express the length of
- 4:59:52the uh of the vector B and once we
- 4:59:55square that that is the dot product so
- 4:59:58that's basically this definition what is
- 5:00:00about so we know what this definition of
- 5:00:03the distance is and we Define it by this
- 5:00:07and then we take the square
- 5:00:10of that distance and there is our DOT
- 5:00:14product and we are going to see this IDE
- 5:00:17of dot product a lot especially when it
- 5:00:19comes to uh matrix multiplication Vector
- 5:00:23multiplications also in many
- 5:00:25applications of linear algebra you will
- 5:00:27see this idea of that product coming
- 5:00:29again uh and coming back to us so uh
- 5:00:32this is a concept that we really need to
- 5:00:35understand so in the two dimensional
- 5:00:37space let's say we have a vector B which
- 5:00:39is um consisting of the two elements X
- 5:00:42and Y then the dot product and the link
- 5:00:45are related by V by V this is the way we
- 5:00:48denote the dot product so we just simply
- 5:00:51use the dot and the name also makes
- 5:00:54sense because we are saying we are using
- 5:00:57the dot to perform dot product so we are
- 5:00:59multiplying to two we are creating the
- 5:01:01product of this Vector with itself and
- 5:01:04this is equal to x² + Y 2 which is equal
- 5:01:08to the uh um squared of the distance of
- 5:01:12this Vector now you might recall from
- 5:01:16the high school that we have learned
- 5:01:18this idea of distance so if we have
- 5:01:20x-axis Y axis then we basically use
- 5:01:24this uh x² + y sare to uh get the uh you
- 5:01:29know the formula for from our Circle and
- 5:01:32then uh we have the x square + y Square
- 5:01:35we take the square root of it and then
- 5:01:37this is our distance so once we take the
- 5:01:40square root of that square of that from
- 5:01:43this uh square root of x square + y
- 5:01:45Square then we are simply getting this
- 5:01:48two cancel out which is equal to x² +
- 5:01:51y^2 So This is highly related to this
- 5:01:54idea because we are again talking about
- 5:01:57distances and we are simply taking the
- 5:02:00distance we are squaring them up and
- 5:02:02then we are getting the dot
- 5:02:05product so this the double uh straight
- 5:02:09line
- 5:02:10this is just a notation that we use and
- 5:02:14we spoke about this also before this
- 5:02:16comes um from the
- 5:02:18pre-algebra and this um this is highly
- 5:02:22important related to this idea of
- 5:02:24pythagore theorem and how we compute the
- 5:02:26distances so for instance when we have
- 5:02:29this uh Square triangular so we have
- 5:02:33this um uh rectangle here and we have
- 5:02:37here the 90 uh
- 5:02:40uh great so here we have the right uh
- 5:02:43right um angle and here we have our C
- 5:02:47which is uh the side right in front of
- 5:02:49this uh 90° angle and here we have the A
- 5:02:53and the B and we say that the c² is
- 5:02:56equal to a sare + b
- 5:03:00sare and if I were to actually write
- 5:03:04this in terms of X and
- 5:03:07Y so if this side is X and this side is
- 5:03:11y and this is my Z let's say then z s
- 5:03:15would be equal to x² +
- 5:03:19y² and this is something that we can see
- 5:03:22here too and the two terms are highly
- 5:03:25related so the Z
- 5:03:27squ is equal to x² + Y 2 and this is
- 5:03:32simply equal to Z * Z right and this is
- 5:03:36something that we know from High School
- 5:03:55welcome to the module one of this new
- 5:03:57unit when we are going to talk about
- 5:04:00about matrices as well as linear systems
- 5:04:02so those are all fundamental concepts
- 5:04:05that you will see time and time again
- 5:04:06when applying linear algebra not only in
- 5:04:09mathematics techs but also in applied
- 5:04:11sciences like data science artificial
- 5:04:13intelligence when training different
- 5:04:15machine learning models and trying to
- 5:04:17see what is this mathematics behind
- 5:04:19machine learning models different
- 5:04:21optimization techniques when you want to
- 5:04:23solve different problems using linear
- 5:04:27algebra so in this first module as part
- 5:04:29of foundations of linear systems and
- 5:04:32matrices we're going to introduce this
- 5:04:34concept of linear systems and then we
- 5:04:37are going to talk about the general
- 5:04:38linear systems we are going to uh see
- 5:04:41this common labeling of the coefficients
- 5:04:43this idea of indices that refer to the
- 5:04:46rows and the columns we are going to see
- 5:04:48what is this differentiation between
- 5:04:50homogeneous and nonhomogeneous systems
- 5:04:54so without further Ado let's get started
- 5:04:57so uh the linear systems form the uh
- 5:05:01bedr of linear algebra modeling this
- 5:05:04array of problems thanks to this
- 5:05:07advancements in these linear systems and
- 5:05:09Sol in it in Computing we can now solve
- 5:05:12a large amount of problems in a very
- 5:05:15efficient and a fast
- 5:05:18way so uh the general linear systems can
- 5:05:21be represented by this uh set of M
- 5:05:24equations with n
- 5:05:26unknown in the previous unit when we
- 5:05:29were looking into this uh linear
- 5:05:32combination of vectors we saw this
- 5:05:35notation which was A1 and then we we
- 5:05:40had C1 multiplied or rather let me keep
- 5:05:44me uh let me keep the same notation so
- 5:05:47we had this linear combination of
- 5:05:48vectors so we had beta 1 and then we had
- 5:05:53A1 Plus beta 2 and then A2 and those are
- 5:05:57all vectors plus A3 so beta 3 * A3 dot
- 5:06:04dot dot and then beta m
- 5:06:09times a m this is the notation that we
- 5:06:13saw before and we said we want to come
- 5:06:16up we wanted to come up with the linear
- 5:06:18combination of these different vectors
- 5:06:20A1 A2 A3 up to a and then we use that in
- 5:06:24order to get a sense of whether we are
- 5:06:26dealing with linearly independent
- 5:06:28variables vectors or linearly dependent
- 5:06:31vectors and then we also commented on
- 5:06:33the span that these vectors
- 5:06:36take now when it comes to um the uh
- 5:06:40vectors and just in general linear
- 5:06:42systems we can represent what we had
- 5:06:45before now in terms of with a bigger
- 5:06:48system so in terms of M equations and
- 5:06:52with n unknowns so here what you can see
- 5:06:55here is that we have M different
- 5:06:59equations so we have beta B1 B2 up to
- 5:07:05BM so you can see it in here and then
- 5:07:09each of these equations it contains n
- 5:07:12unknowns so you can see that the
- 5:07:14unknowns stays the
- 5:07:16same so the unknowns are those X1 X2 up
- 5:07:21to xn so X1 X2 up to xn are the set of
- 5:07:28all n
- 5:07:33unknowns and then M equations that you
- 5:07:36can see in here are all these equations
- 5:07:39so a11 X1 + a12 X2 dot dot dot and then
- 5:07:43a1n and then xn is equal to
- 5:07:46B1 and here one thing that is really
- 5:07:50important to keep in mind is that the
- 5:07:54indexing is what we need to focus on so
- 5:07:58we need to keep this one in mind this a
- 5:08:01i
- 5:08:02j and this
- 5:08:04XI so this is something that we also
- 5:08:08spoke about when uh discussing the
- 5:08:10linear combination of vectors we
- 5:08:13slightly uh touched upon on this topic
- 5:08:17so let's now dive into this this
- 5:08:18indexing and how do we indexes a i j
- 5:08:23what are this A's what are this JS and
- 5:08:27here you can see that we have a11 and
- 5:08:30then a12 and then up to the a1n and this
- 5:08:34is in our equation one and then we have
- 5:08:39in our equation
- 5:08:41two A1
- 5:08:43two let may actually write this with
- 5:08:45different color so in our equation two
- 5:08:48we got a 21 a 23 up to
- 5:08:53a2n
- 5:08:54and this A's that you see here those are
- 5:08:58just real numbers so a11 can be 1 A1 2
- 5:09:02can be three A1 n can be 100 and then
- 5:09:06the same also holds for this B1 for this
- 5:09:09B2 and for this BM and all these values
- 5:09:12A's and B's they are just real numbers
- 5:09:16the only unknowns that we got here are
- 5:09:18those so the X1 X2 up to
- 5:09:31xn all right so what about the indexing
- 5:09:34now so we got a i j
- 5:09:39and as you can see in this
- 5:09:43case the first thing that we can see
- 5:09:45here it stays everywhere the same which
- 5:09:47is the one so we got here one we got
- 5:09:51here one and up to the point we got here
- 5:09:53one whereas the second
- 5:09:55Index this one it does change it grows
- 5:09:59gradually with
- 5:10:02one and it becomes it goes from 1 to two
- 5:10:06and up to n so you can see here that the
- 5:10:11first
- 5:10:15index first
- 5:10:19index or index
- 5:10:23I it
- 5:10:25goes from one it doesn't change it's
- 5:10:29just one so it is one one and one so
- 5:10:32here in all cases for this equation I is
- 5:10:36equal to 1 but another thing that you
- 5:10:39can notice here is that the index 2
- 5:10:43unlike index I so the second index which
- 5:10:46is the J so you see here that the second
- 5:10:49index is referred as J this is a general
- 5:10:52way of defining the indexes so here J is
- 5:10:56equal to 1 2 dot dot dot and then
- 5:11:01n so
- 5:11:05basically the I doesn't change in the
- 5:11:09same row but the G
- 5:11:12changes and then of course we have
- 5:11:15slightly different in terms of I but
- 5:11:17then the same for J for our second
- 5:11:19equation so here I is equal to 2 and
- 5:11:22then J is again equal to one and then
- 5:11:27two dot dot dot and then
- 5:11:29n and then here up
- 5:11:32to for the last equation our I is equal
- 5:11:36to M and then our J is again equal to
- 5:11:42one till two dot dot
- 5:11:45dot so you might notice that I was
- 5:11:48looking at this from the row perspective
- 5:11:51so I was saying pair equation or pair
- 5:11:56Row the I doesn't change but then the J
- 5:12:02stays the same and then it is either one
- 5:12:05two up to n but the set is the same so
- 5:12:08it is it contains all these different
- 5:12:10elements here so one one two and then n
- 5:12:13but it contains all these different real
- 5:12:16numbers going from one till n because we
- 5:12:18are combining and we are creating this
- 5:12:21combination the sum of all these values
- 5:12:24a11 and then X1 a12 X2 A1 n
- 5:12:29xn and another thing that you can also
- 5:12:31notice here is
- 5:12:34that here with the second
- 5:12:39index so with this J J is equal to one
- 5:12:44then here the X's corresponding index is
- 5:12:46also one when the J is equal to two then
- 5:12:50the ex's corresponding index is also two
- 5:12:54and then here the same story and you
- 5:12:56will notice that while the coefficient
- 5:12:58contains two indices 1 one one 2 or 1 n
- 5:13:03which are the two indices for the
- 5:13:06coefficients for the unknowns we got but
- 5:13:09just single index which goes from one
- 5:13:13till n so basically 4 a for the
- 5:13:17coefficients so
- 5:13:20I let me write with the right
- 5:13:23color so I can be one 2 all the way to
- 5:13:30M whereas in case of
- 5:13:36J it can be one to all the way to
- 5:13:41n
- 5:13:43and
- 5:13:46the indices are basically used to help
- 5:13:49us to keep track of in which row we are
- 5:13:53and what is the um
- 5:13:58variable that the coefficient belongs to
- 5:14:01because knowing this second Index this
- 5:14:06helps us to understand that we are
- 5:14:07dealing with a coefficient that
- 5:14:09corresponds to this
- 5:14:10first unknown the first variable X1 and
- 5:14:14then the same holds in here as you can
- 5:14:18see in here and in here we are dealing
- 5:14:20with the same variable X1 therefore the
- 5:14:25second index the index J is then the
- 5:14:28same both in the first equation and in
- 5:14:31the second one in both cases it's equal
- 5:14:33to
- 5:14:35one okay so now when we are clear on
- 5:14:38that let's
- 5:14:41also understand this high level concept
- 5:14:44because you will see this system of
- 5:14:47linear systems this m equations and N
- 5:14:49unknowns appearing a lot not only in
- 5:14:52terms of calculating and finding the
- 5:14:54solution to this linear system but this
- 5:14:57actually has a very common application
- 5:15:00when it comes to um running regression
- 5:15:03linear regression
- 5:15:05specifically and one thing that you can
- 5:15:08notice here is
- 5:15:10that here we got also this B1 B2 up to
- 5:15:14BM and you will notice that here the
- 5:15:17index also uh goes from one but then
- 5:15:20this time to M so when it comes to the
- 5:15:25rows we have M rows or M
- 5:15:30equations therefore we also expect when
- 5:15:33it comes to Counting from the top that
- 5:15:35at the bottom we will see an M whereas
- 5:15:38if we count
- 5:15:39from this side so kind of like imagine
- 5:15:43it like a column then we see that it
- 5:15:45goes from one till
- 5:15:47n so those are common observations and
- 5:15:51reference to um number of observations
- 5:15:55and number of uh features that you will
- 5:15:58see in your data when dealing with data
- 5:16:01analysis or modeling data so just this
- 5:16:04uh just keep those things in mind this
- 5:16:07uh abbrevation of M and then n m
- 5:16:09equations and unknowns because this will
- 5:16:12become very handy and the same also
- 5:16:14holds for this indexing just to keep in
- 5:16:16mind that this I and this J what those
- 5:16:20indices are and how for instance the
- 5:16:23first you know the I the first index
- 5:16:27changes when we go from up to the bottom
- 5:16:30and how the second index J goes and
- 5:16:32changes when we go from left to the
- 5:16:35right when we go through the columns but
- 5:16:38we are going to it is also in the uh
- 5:16:40upcoming slides so uh we can we will
- 5:16:43have time to practice
- 5:16:45it so um this is what we are calling a
- 5:16:48coefficient labeling the coefficient uh
- 5:16:51a i j so this thing in a linear system
- 5:16:56they are labeled where the first index
- 5:16:58represents the row and the second index
- 5:17:01denotes the column so when we see a i j
- 5:17:07we know that this
- 5:17:09refers to the row and the J refers to
- 5:17:14the
- 5:17:15column so this is something that we use
- 5:17:19in order to understand where exactly in
- 5:17:21our metric something that we can we will
- 5:17:24see very soon where exactly our unit or
- 5:17:29our uh member that is part of our Matrix
- 5:17:33where exactly is that located in which
- 5:17:36row and in which column
- 5:17:39the systematic labeling is super
- 5:17:41important because this helps us to keep
- 5:17:43the structure and this helps us to
- 5:17:45understand uh what does this uh
- 5:17:48coefficient represent what what is this
- 5:17:50row that it belongs and what is the
- 5:17:52column it belongs so for which equation
- 5:17:55and for which unknown we have already
- 5:17:57solved the problem such that we can know
- 5:18:00what this uh coefficient
- 5:18:04represents so before moving on onto the
- 5:18:07actual linear systems and the definition
- 5:18:09of metrices let's quickly understand
- 5:18:11this distinction between homogeneous and
- 5:18:13non-homogeneous because this will help
- 5:18:15us to also get an understanding how we
- 5:18:17can solve a system of linear systems so
- 5:18:21a system is homogeneous if all the
- 5:18:23constant terms b i are zero otherwise
- 5:18:28it's non homogeneous so identifying this
- 5:18:31helps us to really understand the nature
- 5:18:34of the solution set that we need to get
- 5:18:37and to understand what kind of strategy
- 5:18:39we need to use in order to solve this
- 5:18:42problem now what do I mean by
- 5:18:44bi we is so that we had this system of M
- 5:18:49equations with n unknowns and we saw
- 5:18:52that that we have in the right hand side
- 5:18:55this B1 B2 up to BM which means that we
- 5:18:58had this m different equations with n
- 5:19:02different unknowns and to find a
- 5:19:05solution to the system it means finding
- 5:19:08this value
- 5:19:11values corresponding
- 5:19:17to X1 X1 here X2 X2 xn so basically
- 5:19:22finding the set of X1 X2 up to xn that
- 5:19:26solves this problem and for us to know
- 5:19:29how to solve this problem we need to
- 5:19:30know whether this B1 is equal to zero or
- 5:19:34not this B2 is equal to zero or not and
- 5:19:39then this BM is equal to zero or
- 5:19:42not this is very similar to this idea of
- 5:19:44solving any sorts of um problems that
- 5:19:48contain unknowns for instance if we have
- 5:19:52three
- 5:19:53x is equal
- 5:19:55to let's say five solving this is
- 5:20:00entirely different than if we know that
- 5:20:01the tree exal to
- 5:20:05Z
- 5:20:07so this is a simplified version of
- 5:20:10course but the IDE is the same knowing
- 5:20:12that this B1 B2 up to BM this R zero
- 5:20:17this gives us an idea how we can solve
- 5:20:20this problem and later on we will see
- 5:20:21this distinction between non-homogeneous
- 5:20:23and homogeneous system and whenever
- 5:20:26these BS so whenever this B1 B2 up to BM
- 5:20:30whenever these BS are zero then we are
- 5:20:33saying that the system is homogeneous
- 5:20:35and we need to solve a homogeneous
- 5:20:37system otherwi wise we are dealing with
- 5:20:39nonhomogeneous system so this means that
- 5:20:42the bis are not all zero let's now move
- 5:20:46on to the second module which is about
- 5:20:48the matrices so we are going to define
- 5:20:50the Matrix we are going to see the
- 5:20:52definition of it as well as the notation
- 5:20:54this idea of rows columns
- 5:20:57Dimensions uh some of which we have
- 5:20:59already touched upon but we are going to
- 5:21:02uh go into the depth of it we are going
- 5:21:04to learn properly as well as we are
- 5:21:06going to see many examples then we are
- 5:21:09going to talk about Matrix types so here
- 5:21:11we will talk about identity Matrix
- 5:21:13diagonal matrices and also special type
- 5:21:16of matrices like matrices containing
- 5:21:18only zeros and only
- 5:21:20ones so by definition add a matrix is a
- 5:21:25rectangular array of real numbers that
- 5:21:28are arranged in rows and in columns for
- 5:21:33example an M byn Matrix a can be
- 5:21:37represented as follows so let's look
- 5:21:41into this definition and this reference
- 5:21:44to Matrix we call this Matrix or
- 5:21:49Matrix
- 5:21:51a and every Matrix it can be described
- 5:21:55by this rows and columns where we always
- 5:22:00have this uh way of describing this
- 5:22:04Matrix always should be
- 5:22:06defined by the
- 5:22:09number of rows and number of
- 5:22:14columns so this is super
- 5:22:16important and let's look into this
- 5:22:19specific Matrix so we have a matrix a
- 5:22:22and all these values they are members of
- 5:22:25this Matrix they form the
- 5:22:28Matrix and we already saw this labeling
- 5:22:31of a i j where we said that I is
- 5:22:36referred to the row so you might recall
- 5:22:39that those were all these equations that
- 5:22:41we got so this horizontal lines where I
- 5:22:47was equal to 1 I I was equal to two I
- 5:22:50was equal to three up to the point of I
- 5:22:52was equal to M and then we had this J so
- 5:22:58this thing and then J was referred to
- 5:23:02the
- 5:23:04columns and we had J
- 5:23:09was here one and then two and then three
- 5:23:12up to the point of n so one 2 3 and
- 5:23:19N this is exactly what you can see here
- 5:23:22so in this Matrix we got all these
- 5:23:24elements a11 is a number a12 is a number
- 5:23:27up to the a1n is a number those are all
- 5:23:30real numbers and one thing that you can
- 5:23:33notice here is that here we got a11 so
- 5:23:37this is our first row and First Column
- 5:23:40here we got A1 two this is our first row
- 5:23:45and second column and then we got up to
- 5:23:49the point of a1n actually let me just
- 5:23:52write this down even at a bigger scale
- 5:23:55such that I can make more
- 5:24:00noes so let's assume we have this Matrix
- 5:24:06a and this Matrix a
- 5:24:13a if I'm
- 5:24:16bigger and we got all these different
- 5:24:19elements so we start with our first row
- 5:24:23and here we have A1 1 so
- 5:24:28here the row that I will write with
- 5:24:33let's say
- 5:24:35with blue the r is equal to 1 and then
- 5:24:41the column is one so this is Row one
- 5:24:47this is Row one row one and this is
- 5:24:51column
- 5:24:53one let me write it with red this is
- 5:24:58column
- 5:24:59one this is column
- 5:25:01two this is column three dot dot dot and
- 5:25:06this is column n
- 5:25:09and this is row two this is Row three
- 5:25:14dot dot dot and this is row M so in
- 5:25:17total I got M rows and N columns I will
- 5:25:24come to this notation that I'm putting
- 5:25:27here later for now let's keep track of
- 5:25:30the rows and the columns to get a good
- 5:25:32understanding what this indices were
- 5:25:34about that we just
- 5:25:36learned so every time I will also
- 5:25:38mention this reference to a i j to keep
- 5:25:42track of this and also let me write it
- 5:25:45with the right colors so a i this is the
- 5:25:51row and
- 5:25:53J which is the
- 5:25:56column so all the elements I'm just
- 5:26:00defining by this a because it just a way
- 5:26:02to reference a part that comes from a
- 5:26:05matrix it's a just common way to write
- 5:26:07the higher matrix by capital letter A
- 5:26:11whereas its members we will write with
- 5:26:13the um with the lower case
- 5:26:18a so this is
- 5:26:21Matrix
- 5:26:23Matrix
- 5:26:25a all right so here in the second row
- 5:26:30But First Column we got
- 5:26:33a two and then one because it is still
- 5:26:38in the First Column and then when it
- 5:26:40comes to this
- 5:26:43element we have here
- 5:26:46a the row is the first one because we
- 5:26:49are in the first
- 5:26:50row but then we are in the second column
- 5:26:53so this one should be
- 5:26:56two then we go on to the next element in
- 5:26:59our first row so a
- 5:27:03one and then
- 5:27:06three and then dot dot
- 5:27:10dot the last element is an a as we are
- 5:27:14still in the first row it will be one
- 5:27:17the I but then given we are in the last
- 5:27:20column the column index or the J will be
- 5:27:23equal to
- 5:27:25n because we got in total n
- 5:27:29columns so we are now ready to go into
- 5:27:32the second row so here given that we
- 5:27:36already have our first element
- 5:27:40a21 this is in our second row and the
- 5:27:43First Column so the I is equal to here
- 5:27:46two and G is equal to 1 let's now write
- 5:27:49down the element in the second draw
- 5:27:52second column as you might have already
- 5:27:54guessed I is equal to here 1 I is equal
- 5:27:56to here two s and then uh the J is equal
- 5:28:00to
- 5:28:022 and then we go on to the next element
- 5:28:05which is in the second row and the third
- 5:28:07column so it's a the
- 5:28:11row index is 2 so I is equal to 2 and
- 5:28:16then the column index is three dot dot
- 5:28:19dot and then we
- 5:28:22got a as we are in the second row it is
- 5:28:27the I is equal to two and as we are in
- 5:28:31the last column the J is equal to n now
- 5:28:34you might have already guessed when I
- 5:28:36was writing this down that whenever you
- 5:28:38are in the row and you move on to all
- 5:28:41the elements in the same
- 5:28:43Row the I so the row index it stays the
- 5:28:47same only you need to uh update the
- 5:28:50column index so here for instance you
- 5:28:52got one one one here also one so all the
- 5:28:56way down in the same row or one which
- 5:28:59logically makes sense because we are in
- 5:29:01the same row so the row index should not
- 5:29:04change but instead you should change the
- 5:29:06column index like here column one column
- 5:29:08two column three all the way to column n
- 5:29:11so those are our
- 5:29:16columns dot dot dot so let me make this
- 5:29:22distinction and
- 5:29:24those are our
- 5:29:28rows as you can
- 5:29:32see so this kind of mentally helps us to
- 5:29:35understand why we are writing all these
- 5:29:37indices
- 5:29:39over time once you practice more with
- 5:29:41this this will become more
- 5:29:48natural very quickly remove
- 5:29:51this so now our ride rest very quickly
- 5:29:55so as you might have already guessed we
- 5:29:57are in the third row so we have a tree
- 5:30:00so everywhere I will just write down
- 5:30:05the ace so first write down the A's and
- 5:30:10then the rows the row index will stay
- 5:30:13the same as I in the same row but then I
- 5:30:16will increase the columns gradually so
- 5:30:18we are in the column one and the column
- 5:30:19two column three up to the column n so
- 5:30:24now the remaining stuff you can actually
- 5:30:26write down yourself to just
- 5:30:29practice let's now move on on to the
- 5:30:32last row and last column so in the last
- 5:30:35row we got a a a up to
- 5:30:40here and in the last show the uh row
- 5:30:44index is M which means that here I need
- 5:30:47to have M M M everywhere I need to have
- 5:30:51M and then the column index is 1 2 3 all
- 5:30:57the way to
- 5:31:00n so this last column is very
- 5:31:03interesting too you can see here that we
- 5:31:06have the opposite of what we have here
- 5:31:10because in the last column we see that
- 5:31:14the uh column index is the same so it is
- 5:31:19everywhere n Only the first index the
- 5:31:21index of the row it changes it goes from
- 5:31:241 2 3 up to M which is of course logical
- 5:31:27because we said that in the last column
- 5:31:29if we are looking it from the
- 5:31:30perspective of column so all these
- 5:31:33values this A's so the all the ends they
- 5:31:36are logical because they we are in the
- 5:31:38last column we are in the same column
- 5:31:41but then the row changes here we are in
- 5:31:42the row one here we are in the row two
- 5:31:44Row three of two row M therefore we have
- 5:31:47also at the end a m
- 5:31:50n now let's talk about this idea of
- 5:31:54MN we said that our Matrix
- 5:31:58a
- 5:32:01has
- 5:32:03M as a number of rows
- 5:32:08and n as a number of
- 5:32:12columns which you can see by the way
- 5:32:14also
- 5:32:16here so we always refer the dimension of
- 5:32:21a
- 5:32:22matrix so the
- 5:32:26dimension dimension of Matrix a by these
- 5:32:31two
- 5:32:34numbers so first we always write down
- 5:32:37the number of rows in this case
- 5:32:42M then as the second element we are
- 5:32:46writing the number of columns in this
- 5:32:49case n we are always putting this small
- 5:32:51X in between two kind of emphasize M by
- 5:32:56n Matrix and we most of the time use the
- 5:33:00square braces to Showcase that we are
- 5:33:02dealing with Dimension and in this case
- 5:33:05we are saying the dimension of Matrix a
- 5:33:08is equal to M byn so we are dealing with
- 5:33:12M byn Matrix this is a common convention
- 5:33:16used in linear algebra in mathematics
- 5:33:18General but also used in data science uh
- 5:33:21in machine learning artificial
- 5:33:23intelligence so whenever you are dealing
- 5:33:25with matrices a it is a common
- 5:33:27convention to talk about this idea of
- 5:33:30dimensions and the idea of Dimensions is
- 5:33:33super important when it comes to the
- 5:33:35idea of multiplication multiplying
- 5:33:38Vector with Matrix Matrix with Matrix so
- 5:33:41this dot product Dimensions play a
- 5:33:44central role in here so keep this one in
- 5:33:47mind once we uh get to the point of that
- 5:33:50products this one will become very handy
- 5:33:52so let's now look into a specific
- 5:33:54example where we see simple Matrix a so
- 5:33:57in this case you can see that we are
- 5:33:59dealing with a matrix that has a 2x3
- 5:34:01Dimensions so like we just learned
- 5:34:062x3 means that we
- 5:34:11got two
- 5:34:15rows and three
- 5:34:19columns that's something that you can
- 5:34:21also see here very quickly so you have a
- 5:34:24small Matrix on the small matrix it's
- 5:34:26really easy to actually count so you can
- 5:34:29see that we got Row one and row two and
- 5:34:32we got column 1 column two and column
- 5:34:35three so this basically confirms this
- 5:34:37Dimensions therefore we are also saying
- 5:34:40that we have a 2
- 5:34:43by three Matrix and like usual we first
- 5:34:48write down the number of rows and then
- 5:34:50the number of columns you can see here
- 5:34:53that here we have this elements for our
- 5:34:56Matrix so a is equal to 1 2 3 for the
- 5:34:58first row and then uh 4 5 6 for the
- 5:35:01second row so from this actually I think
- 5:35:05it's a good exercise to just uh very our
- 5:35:08understanding of indices and from this
- 5:35:11um we can write down that for instance
- 5:35:13all these different elements uh like a 1
- 5:35:171 is equal to 1 A1 2 which means that we
- 5:35:21are in the first row and in the second
- 5:35:24column so we have this element is equal
- 5:35:29to two and then we got a and then one
- 5:35:34Tre so we are in the third column so
- 5:35:37this one 1 is equal
- 5:35:40to 3 and then a 21 is equal to 4 a 22 is
- 5:35:48equal to 5 and then a 23 is equal to 6
- 5:35:53so this is actually a good way to
- 5:35:56practice our understanding of indices
- 5:35:58our understanding of this Matrix
- 5:36:00structure and the understanding of
- 5:36:02dimension of the Matrix which in this
- 5:36:04case is 2x3 so this is yet another
- 5:36:07different definition of a matrix
- 5:36:09structure when it comes to the rows coms
- 5:36:11and dimensions so this is exactly what
- 5:36:14we just spoke about on our example and
- 5:36:17let's just quickly look at the formal
- 5:36:19definition so the rows of a matrix are
- 5:36:22the horizontal lines of the of the
- 5:36:24entries while the comms are the vertical
- 5:36:27lines so basically it's saying those are
- 5:36:32let me remove
- 5:36:34this so the rows are are the horizontal
- 5:36:39line and the columns are those vertical
- 5:36:42lines those are the columns this helps
- 5:36:45us to form these columns so column one
- 5:36:47column two and column three whereas this
- 5:36:49horizontal lines it helps us to create
- 5:36:51the rows so Row one and row
- 5:36:54two so then we have the dimensions of
- 5:36:56Matrix are given by the number of rows
- 5:36:58and columns it has so an M by n Matrix
- 5:37:02has M rows and N columns that's
- 5:37:07something that that we already
- 5:37:08saw so let's look into some special type
- 5:37:12of matrices one Matrix type is the
- 5:37:16identity Matrix so we saw before we had
- 5:37:18this Identity or unit Vector now we have
- 5:37:23identity Matrix so the two are quite
- 5:37:26similar so like before when we had our
- 5:37:29unit vectors we had this for instance E1
- 5:37:34in three dimension we had 1 0 0 then we
- 5:37:37had our E2 which had 0 1 0 and then we
- 5:37:42had our E3 which was 0 01 so you might
- 5:37:46recall this about our identity vectors
- 5:37:49or we were calling it unit factors you
- 5:37:52might notice very quickly that we have
- 5:37:55formed an identity Matrix i n which is a
- 5:37:59square Matrix with one on the diagonal
- 5:38:02and zeros elsewhere is basically a
- 5:38:05matrix that is built using those unit
- 5:38:08vectors so here we have E1 here we have
- 5:38:11E2 and here we have
- 5:38:13E3 so you can also see that this
- 5:38:183x3 Matrix because we got three
- 5:38:22rows and three
- 5:38:27columns so you can see that here we
- 5:38:31have on the diagonal so we call this
- 5:38:35diagonal on this diagonal we have all
- 5:38:38ones and in
- 5:38:40here outside of the diagonal they are
- 5:38:43all zeros and this is the definition of
- 5:38:46identity Matrix it is this i n Matrix
- 5:38:49where n is the dimension of a matrix and
- 5:38:54given that it's a square Matrix it means
- 5:38:56that the dimension of it is n by n so
- 5:38:59all the rows so the number of rows is
- 5:39:01equal to the number of columns on the
- 5:39:04diagonal we have all these ones and
- 5:39:06every where else we got
- 5:39:09zeros and do note that we are forming
- 5:39:12this identity Matrix simply by combining
- 5:39:15these different uh unit vectors so like
- 5:39:18here E1 E2 and
- 5:39:21E3 so let me actually uh give you yet
- 5:39:24another example but of much higher
- 5:39:28Dimension so of this identity Matrix so
- 5:39:31let's say we have I and then this I
- 5:39:38uh let us actually use this notation i
- 5:39:41n so let's say we got i
- 5:39:47n what this means is that we got
- 5:39:50actually this large
- 5:39:52matrix it's a square Matrix which means
- 5:39:56that it is n by n so it has n as the
- 5:40:01number of rows
- 5:40:10and n as number of
- 5:40:13columns so the dimension is n by n you
- 5:40:17got n as number of columns too because
- 5:40:20it's a square and let us actually write
- 5:40:24down that how that Matrix looks like
- 5:40:27it's a large Matrix the N is the size of
- 5:40:30that Matrix so here we got on the
- 5:40:34diagonal we got one here we got one here
- 5:40:37we got one dot dot dot up to the last
- 5:40:39point one and the index of this one here
- 5:40:45so this is the first row this the First
- 5:40:47Column
- 5:40:51basically and everything else is simply
- 5:40:55zero so here we got z0 0 dot dot dot
- 5:41:00zero here we got 0 0 all the way down to
- 5:41:04zero here also zero all the way down to
- 5:41:06Z
- 5:41:08and then here also zero so everywhere
- 5:41:11here and here we all got zeros only on
- 5:41:15this
- 5:41:16diagonal we actually got
- 5:41:19once so basically by using our common
- 5:41:24notation we can say that in the D in the
- 5:41:28identity Matrix we got a 1 1 = to a 22 =
- 5:41:34to a 33 equal to all the way to a NN
- 5:41:40equal to 1 and then when it comes down
- 5:41:45to the rest of
- 5:41:48the cases so all the other
- 5:41:52observations let's
- 5:41:55say a
- 5:41:5921
- 5:42:02a 31 or a 41
- 5:42:08anything so anything that is not um a11
- 5:42:12or a22 anything that is not on the
- 5:42:14diagonal it is simply equal to zero we
- 5:42:17also say in those cases that a i j is
- 5:42:21equal to
- 5:42:241 if I is equal to J because then it
- 5:42:29means that we are talking about item
- 5:42:31that is on diagonal because both the row
- 5:42:33index is equal to the column index
- 5:42:37otherwise
- 5:42:40the a i
- 5:42:43j is equal to Zer if I is not equal to
- 5:42:50J so this is in the nutshell how a large
- 5:42:54identity Matrix in general can be
- 5:42:58defined so let's now move on to another
- 5:43:01type of Matrix which is the diagonal
- 5:43:03matrix so by definition a diagonal
- 5:43:06matrix is a matrix where all of diagonal
- 5:43:09elements are zero so what does this mean
- 5:43:14we is saw um example of a diagonal
- 5:43:18matrix which was our identity Matrix
- 5:43:21because identity Matrix is an example of
- 5:43:25a diagonal matrix and what do I mean by
- 5:43:27that in our just seen example we saw
- 5:43:31that only on the diagonal we had all
- 5:43:33these nonzero elements but the rest were
- 5:43:37all zeros so all the off diagonal
- 5:43:39elements were
- 5:43:41zeros like in here and in here exactly
- 5:43:44the same holdes for the diagonal
- 5:43:46matrices only unlike in the identity
- 5:43:49Matrix we no longer need to have this
- 5:43:52diagonal elements equal to one those can
- 5:43:55be any other numbers so as long as we
- 5:43:58have this um elements D1 D2 D3 that are
- 5:44:03not zeros but then of the diagonal
- 5:44:06numbers so all these elements they are
- 5:44:08zero then we are dealing with the
- 5:44:10diagonal matrix so in this case we got a
- 5:44:143X3 diagonal matrix because we have uh
- 5:44:17three rows and three columns and here we
- 5:44:21can see that the um the first so the a11
- 5:44:25the first element from the first draw
- 5:44:27and First Column is equal to D1 so a 22
- 5:44:32is equal to D2 and then a33 is equal to
- 5:44:37D3 so D1 D2 and D3 those are all so D1
- 5:44:43D2 and D3 those are all real
- 5:44:48numbers now when it comes to the uh this
- 5:44:51numbers for example it can be that D is
- 5:44:55let's say 2 five 6 on diagonal then we
- 5:45:00have those zeros this is a diagonal
- 5:45:04matrix it can also be
- 5:45:08that D is equal to minus 3 and then 0 0
- 5:45:15and then 5 8 and then here we have zeros
- 5:45:20so again we have on the diagonal all
- 5:45:23these elements and the off diagonal
- 5:45:26elements so if all the off diagonal
- 5:45:28elements are zero then we are dealing
- 5:45:30with diagonal matrix and if you
- 5:45:33wondering well what happens if on the
- 5:45:35diagonal we got zero do we still have a
- 5:45:38diagonal matrix it's actually a great
- 5:45:40question but yes indeed we are dealing
- 5:45:43with the diagonal matrix as long as all
- 5:45:46the off diagonal elements are zero so
- 5:45:49for instance if we got D is
- 5:45:53equal here we have zero here we have 0 0
- 5:45:570 and then 7 and then 0o and then 8 and
- 5:46:02then 0 0 so we got this of diagonal
- 5:46:06elements so here are the diagonal
- 5:46:09elements and all the of diagonal
- 5:46:11elements are those given that all the of
- 5:46:15diagonal elements are zero which is the
- 5:46:18definition of the diagonal matrix then
- 5:46:20we can say that our D Matrix in here is
- 5:46:24indeed a diagonal
- 5:46:29matrix let's now look into yet another
- 5:46:31type of Matrix which is a special type
- 5:46:33of Matrix and it's called one's Matrix
- 5:46:37so by definition one's Matrix is denoted
- 5:46:40by 1 M1 so you can see here and here it
- 5:46:44mens the dimension of it so the number
- 5:46:46of rows and number of columns and it's a
- 5:46:49matrix in which all the elements are
- 5:46:52one so this is a very unique Matrix we
- 5:46:56often use it during the programming so
- 5:46:58in data science data analytics but also
- 5:47:01in um uh when creating like data
- 5:47:03structures when designing algorithms
- 5:47:06this becomes very very handy and this
- 5:47:09idea of one's Matrix is that all the
- 5:47:12elements are just one it means that if
- 5:47:15we want to create a placeholder in such
- 5:47:17way that we can then multiply any number
- 5:47:20in here with some other number and get
- 5:47:22that number then it can be done very
- 5:47:24easily because we know that when we
- 5:47:27multiply a number with one then we get
- 5:47:29that number so a * 1 is = to a x * 1 is
- 5:47:34= to X now this is a exactly this
- 5:47:37property exactly is what motivates us to
- 5:47:40create and to have this type of ones
- 5:47:43matrices it means that we are defining
- 5:47:47matrix by its Dimension so it is M by n
- 5:47:51and here the m is equal to two and then
- 5:47:54n is equal to three because we got two
- 5:47:57rows and three columns but you can see
- 5:48:00that all the elements are the same and
- 5:48:02they are equal to one so a11 is equal to
- 5:48:05A1 2 is equal to a13 is equal to a uh 21
- 5:48:11and is equal to a 22 and a 23 and they
- 5:48:15are all equal to one and this is the
- 5:48:18definition of one's Matrix you can have
- 5:48:21um on Matrix of the size 4 by 10 On's
- 5:48:27Matrix of the size
- 5:48:30th let say 10,000
- 5:48:34by 100 Etc so any number any real number
- 5:48:39so M and then n are real numbers you can
- 5:48:42use in order to create this large M by
- 5:48:46n1's
- 5:48:49matrix let's now look into our final
- 5:48:52special type of Matrix before moving on
- 5:48:54onto the next module which is about zero
- 5:48:57matrices so similar to this one Matrix a
- 5:49:01zero Matrix denoted by 0 m by N is a
- 5:49:06matrix in which all the elements are the
- 5:49:08same with the one difference that this
- 5:49:11time all the elements are equal to zero
- 5:49:13so in the on Matrix all the elements
- 5:49:15were ones but in the zero Matrix all the
- 5:49:17elements are zero this type of matrices
- 5:49:21become very handy also during the
- 5:49:23programming creating um different
- 5:49:25algorithms during design encoding um but
- 5:49:29for slightly different purposes usually
- 5:49:32we create the zero matrices as a
- 5:49:34placeholder such that in the beginning
- 5:49:36we can have this uh tups or we can have
- 5:49:38this um uh arrays or nested Loops um
- 5:49:42that we want to perform and then
- 5:49:45gradually add these values to the
- 5:49:47existing Mt array so if we create this
- 5:49:51Zer Matrix and um this is a placeholder
- 5:49:55then next time we can always add on this
- 5:49:58this new data that we get and then we
- 5:50:01know that zero plus a number is always
- 5:50:04equal to number which means that once we
- 5:50:07have this updated information of a we
- 5:50:09can add this to the zero and we will
- 5:50:11then have this new updated information
- 5:50:13in our system therefore the zero Matrix
- 5:50:16is often used as a way to uh have this
- 5:50:20placeholder with the provided Dimension
- 5:50:22where we can always add new information
- 5:50:25and the information can be
- 5:50:27updated so in this specific case we got
- 5:50:30um a zero Matrix that has two rows and
- 5:50:33three columns so you can see two rows
- 5:50:37and three
- 5:50:40columns so m is equal to 2 and then n is
- 5:50:44equal to three three perfect so we are
- 5:50:48done with module 2 and now we are ready
- 5:50:50to go on to our next module which is the
- 5:50:54core Matrix operations so when it comes
- 5:50:57to matrices we often perform Matrix
- 5:51:01additions Matrix subtraction but also
- 5:51:04Matrix um scalar multiplication of this
- 5:51:06Matrix so multiplying Matrix with a
- 5:51:08scaler and then Matrix um multiplication
- 5:51:12just in general so taking two matrices
- 5:51:15and multiplying them we are going to
- 5:51:17look into this concept in detail we are
- 5:51:19going to see many examples like before
- 5:51:22we are going to dive deeper into this
- 5:51:24such that we lay the ground on uh to the
- 5:51:27next module which is solving a system of
- 5:51:30M equations with an unknown so solving
- 5:51:33this General um linear system
- 5:51:37so for the beginning uh we will be
- 5:51:40looking into this Matrix operations
- 5:51:42where we are adding or subtracting
- 5:51:44matrices so by definition the sum of two
- 5:51:47matrices A and B of the same dimensions
- 5:51:50is obtained by adding their
- 5:51:51corresponding elements so by taking the
- 5:51:55element i j from both matrices and
- 5:51:59adding them to each other so in this
- 5:52:01case you can see that Matrix A and B are
- 5:52:04here and uh the uh definition says we
- 5:52:09just simply need to take the
- 5:52:10corresponding elements corresponding
- 5:52:12elements from the row I and the column J
- 5:52:16take them add them and this will become
- 5:52:19an element in our final um Matrix
- 5:52:24because when we are adding two matrices
- 5:52:27of the same size the result is yet
- 5:52:29another Matrix so we will use the Matrix
- 5:52:32a to add to Matrix B and this will give
- 5:52:36us a matrix A + B and this i j simply
- 5:52:42refers to the indices corresponding to
- 5:52:44the row and the
- 5:52:46column we will look into an example in a
- 5:52:48bit and this will make much more sense
- 5:52:51and the same holds also for the
- 5:52:53difference so by definition the
- 5:52:55difference of the two matrices A and B
- 5:52:57of the same dimensions is obtained by
- 5:52:59subtracting their corresponding Elements
- 5:53:02which means that in order to obtain this
- 5:53:05Matrix a minus B this is a new Matrix we
- 5:53:10simply need to look for each element so
- 5:53:13we are going to index them for a row I
- 5:53:16and J we are going to do this pairwise
- 5:53:19element wise subtractions we are going
- 5:53:22to see what is that element
- 5:53:24corresponding to the row I and column G
- 5:53:26in The Matrix a which we say is a i j we
- 5:53:31are going to subtract from this the
- 5:53:33element in the row I
- 5:53:36and column G that comes from Matrix B
- 5:53:39and this will give us our new Matrix
- 5:53:41which is a minus
- 5:53:44B so let's now look into an example in
- 5:53:47this Matrix Matrix um uh a and Matrix B
- 5:53:51are used and Matrix a is of the size 3x3
- 5:53:54Matrix 3 Matrix B is of the
- 5:53:57size 3x 3 in order to obtain a plus b
- 5:54:03what we are doing is that we are
- 5:54:05performing element wise additions now
- 5:54:08let's verify
- 5:54:10this so what we are doing here is that
- 5:54:13we are saying a plus
- 5:54:16b let me actually get a larger area
- 5:54:21here so let's say we have the two
- 5:54:23matrices I want to add the two in such
- 5:54:26way that we do everything one by one
- 5:54:28such that this idea of a plus b and
- 5:54:31addition of the matrices will make
- 5:54:33sense so we want to find out a plus b
- 5:54:37for that what we are going to do is that
- 5:54:40we are going to make use of this
- 5:54:42definition that A + B and then I J is
- 5:54:46equal to a i j+ b i j which is a fancy
- 5:54:53way or mathematical way or describing
- 5:54:55that for each element we need to go and
- 5:54:57look for the row I and column J and take
- 5:55:01that element from the um column from
- 5:55:04that uh Matrix a and from the Matrix
- 5:55:07B so this means
- 5:55:10that for a + b this is going to be a
- 5:55:16matrix that will have the same number of
- 5:55:18rows and the same number of columns as
- 5:55:20two matrices because both A and B are
- 5:55:233x3 which means also their sum is going
- 5:55:26to be 3x3 so this going to be 3x3 and
- 5:55:30here we are going to do so we are going
- 5:55:32to take for the first row in the First
- 5:55:36Column so for
- 5:55:40A+
- 5:55:42b 1 1 so first row and First Column we
- 5:55:46need to go to the first row and First
- 5:55:48Column of Matrix a and the first row and
- 5:55:51First Column of Matrix B and we need to
- 5:55:53add these two elements so we need to do
- 5:55:571 + 1 and then we need to go on to the
- 5:56:01second column so the first row and the
- 5:56:03second column which means that we need
- 5:56:05to be here
- 5:56:08in both
- 5:56:09matrices so here we have 0 + 2 and then
- 5:56:14we got 2 + 3 and then we got 0 + 0 so
- 5:56:18you can see it in
- 5:56:20here and then we have 1 + 0 and then we
- 5:56:23have 3 + 1 0 + 1 and then 0 + 2 and then
- 5:56:291 + three which gives us
- 5:56:37so 1 + 1 is = to 2 0 + 2 is = 2 and then
- 5:56:432 + 3 is = to 5 0 + 0 is equal to 0 0 +
- 5:56:481 is = to 1 1 + 0 is = to 1 0 + 2 is =
- 5:56:52to 2 and then 3 + 1 is = 4 1 + 3 is = to
- 5:56:574 which means that our A + B is equal to
- 5:57:01this Matrix that we got in here so you
- 5:57:05can see that we are getting exactly what
- 5:57:07we uh what we have here only we have
- 5:57:10done it manually one by one so the same
- 5:57:13idea holds exactly when we have a minus
- 5:57:16B only instead of adding you will have
- 5:57:19to do here minuses so minus minus so
- 5:57:23everywhere minus so 1 - 1 0 - 2 2 - 3
- 5:57:30Etc so let's look into another addition
- 5:57:33so in this case by definition it is
- 5:57:36defined as this element wise uh of the
- 5:57:39adding of these two matrices here the
- 5:57:42only difference in this definition is
- 5:57:44that it's saying it's calling this a
- 5:57:46plus b as C so this new Matrix that we
- 5:57:51are getting as a result of adding a to B
- 5:57:54it's calling C so basically it's the
- 5:57:56same as calling this Matrix as C you
- 5:57:59will see also this type of definitions
- 5:58:01so in this case The Matrix C is equal to
- 5:58:04a plus b which basically means that for
- 5:58:06each row with index I and with each
- 5:58:10column with index J go and look for row
- 5:58:14I and index J take the corresponding
- 5:58:16elements from Matrix a and Matrix B add
- 5:58:19them in order to get that corresponding
- 5:58:21element in our new Matrix C and you can
- 5:58:25see that in this example that's exactly
- 5:58:27what we are doing we have a we have B we
- 5:58:29are taking this element and this one so
- 5:58:321 + 1 we are getting here two and then 0
- 5:58:35+ 2 we are getting two here 2 + 3 is 5
- 5:58:39and then 0 + 0 is = 0 1 + 0 is = to 1
- 5:58:43and then 3 + 1 is equal to
- 5:58:464 so now we already go to the next topic
- 5:58:49which is about scalar multiplication of
- 5:58:51a matrix so by definition scalar
- 5:58:54multiplication of a matrix a by scalar
- 5:58:57Alpha results in new Matrix where each
- 5:59:00entry of a is multiplied by Alpha the
- 5:59:04idea of scalar multiplication matrices
- 5:59:06is actually quite similar to this idea
- 5:59:09of scaled multiplication in vectors so
- 5:59:12uh we have already seen in the lecture
- 5:59:15of the vector multiplication that when
- 5:59:17we were having this scaler C and we had
- 5:59:22this Vector
- 5:59:24a then uh when we are multiplying C
- 5:59:28which is a real number with Vector a
- 5:59:30then we simply need to take all the
- 5:59:33elements of vector a so A1 A2 all the
- 5:59:37way down to a n and we need to multiply
- 5:59:40them by this same scaler so
- 5:59:44see this is what we were doing with
- 5:59:47vectors and that's exactly the idea
- 5:59:49behind matrices and when uh doing the
- 5:59:52scalar multiplication of matrices only
- 5:59:55instead of multiplying only just one
- 5:59:58vector with this scaler C now we need to
- 6:00:02apply this to all the rows and all the
- 6:00:04columns so here we got this one column
- 6:00:06and Matrix is simply a combination of
- 6:00:09multiple vectors which means that we
- 6:00:11need to multiply all these elements of
- 6:00:14all the vectors of all the columns in
- 6:00:17this Matrix so let's actually look into
- 6:00:20a specific
- 6:00:22example so in this case we have a matrix
- 6:00:25a and this Matrix a is this thing and we
- 6:00:30have a scaler which is three so in here
- 6:00:32our Alpha is equal to three or you can
- 6:00:34call it C or anything so you can see
- 6:00:39that when we are scaling The Matrix with
- 6:00:43a scaler in this case Tre with this
- 6:00:46Matrix what we are doing is that we are
- 6:00:48simply taking each of these elements and
- 6:00:50multiplying it with this scum so 1 by 3
- 6:00:53is 3 2x 3 is 6 3x 3 is 9 and 4x 3 is
- 6:01:0012 this is the idea behind this entire
- 6:01:04scal multiplication ofation Matrix in
- 6:01:07more general terms if we for instance
- 6:01:10have a matrix a so let's actually look
- 6:01:13into a high level General example where
- 6:01:16we have a DA Matrix M by n so we got M
- 6:01:21rows and N columns and we want to get a
- 6:01:24scal multiplication of this Matrix and
- 6:01:28um scaler that we have here as in our
- 6:01:31definition it is defined by this alpha
- 6:01:34alpha is just a number you can qu C you
- 6:01:36can qu B anything so in this case our
- 6:01:40scaler
- 6:01:42alpha alpha is coming from R so it's a
- 6:01:46real number so Alpha time a is then
- 6:01:52simply equal to to this new
- 6:01:56Matrix where all of these elements are
- 6:02:01simply multiplied by this scal so I will
- 6:02:04just take over all these values H1 up to
- 6:02:09a M1 and then A1 2 a22 all the way down
- 6:02:15to a M2 and then let me also add the
- 6:02:19last column just for fun here a 2 N and
- 6:02:25then here a m
- 6:02:30n so here this new scaled M multiplies
- 6:02:35so so scaled uh Matrix a so Alpha * a is
- 6:02:40simply equal to Alpha time all these
- 6:02:42elements are simply multiplied by the
- 6:02:46scale it is as simple as
- 6:02:55that so that's the simple idea behind um
- 6:02:59Matrix as scaling so when you are doing
- 6:03:02scalar multiplication of this Matrix you
- 6:03:05simp take all the values and you
- 6:03:08multiply them element by element per row
- 6:03:11and per column by that single scalar
- 6:03:14Alpha do note that you are multiplying
- 6:03:17them all without exclusion with exactly
- 6:03:20the same number which is that
- 6:03:24Alpha so let's now look into the
- 6:03:27definition of matrix
- 6:03:29multiplication so here we are no longer
- 6:03:32multiplying a matrix with a scalar but
- 6:03:34we are multiplying Matrix with Matrix so
- 6:03:37the product of an M by n Matrix a and an
- 6:03:40N by P Matrix B results in an M by P
- 6:03:44Matrix C where each entry cig is
- 6:03:47computed as the dotproduct of the e Road
- 6:03:50of a and the J column of B now what does
- 6:03:54this mean firstly let's look and unpack
- 6:03:58this part of the definition so we got
- 6:04:02Matrix
- 6:04:04a that is
- 6:04:06M by n and then we got Matrix B which is
- 6:04:11n by P what this means is that in this
- 6:04:16case Matrix a has M
- 6:04:19rows and N
- 6:04:22columns and Matrix B has n
- 6:04:26rows and P
- 6:04:30cups so this is then simply the
- 6:04:34dimension dimension of the two
- 6:04:39matrices so then it's saying that by
- 6:04:43definition the product of these two
- 6:04:45matrices so the product of A and B the
- 6:04:50product of the
- 6:04:57two
- 6:05:02B is equal to to this Matrix
- 6:05:07C and each entry cig
- 6:05:11J so c i j is computed as the dotproduct
- 6:05:18of the each row of a and the Jade column
- 6:05:23of B now this part might seem bit
- 6:05:27difficult but once we look into the
- 6:05:29actual example and we illustrate this on
- 6:05:32our common high level General
- 6:05:34expressions of Matrix am and their
- 6:05:36multiplication this will make much more
- 6:05:39sense for now before coming to this one
- 6:05:43I just wanted to refresh our memory on
- 6:05:45one thing I said before when discussing
- 6:05:48also this idea of improving uh this uh
- 6:05:51different properties of vectors that
- 6:05:54when we want to
- 6:05:55multiply a vector with a matrix or
- 6:05:58Matrix with Matrix or vector with a
- 6:06:00vector we need to ensure that from the
- 6:06:04first element the number number of comms
- 6:06:06is equal to the number of rows of the
- 6:06:07second element this is also very
- 6:06:10important for this specific case and
- 6:06:12just in general for matrix
- 6:06:14multiplication so you can notice here
- 6:06:17that the number of coms here is equal to
- 6:06:20the number of rows in here and the order
- 6:06:24is very important so in case of matrix
- 6:06:27multiplication the order is really
- 6:06:29important which means that if you have a
- 6:06:32matrix a and you want to multiply with
- 6:06:36the Matrix B then
- 6:06:38the number of
- 6:06:43columns of
- 6:06:46a should be equal to the number of
- 6:06:52rows of
- 6:06:54B otherwise you cannot multiply those
- 6:06:59two matrices with each other so in case
- 6:07:01you got a matrix a that doesn't have the
- 6:07:04same number of columns as the rows of
- 6:07:06number of the Matrix B then there are
- 6:07:09some alternative things that you can do
- 6:07:11including this idea of the transpose
- 6:07:13that we saw also doing when Computing
- 6:07:15the dot product between this Vector a
- 6:07:17and Vector B that's something that we
- 6:07:19also do in programming when we are
- 6:07:21dealing with this Matrix and we want to
- 6:07:23compute this relationship between two
- 6:07:26matrices but the number of columns of
- 6:07:29one of the first one is not equal to the
- 6:07:31number of rows of the second one we are
- 6:07:33simply uh manipul ating this matrices or
- 6:07:36removing some data if that's not hurting
- 6:07:39our problem maybe uh flipping so
- 6:07:42transposing our Matrix or applying any
- 6:07:45other source of operation to it to
- 6:07:48ensure that the two matrices that we are
- 6:07:50multiplying with each other the first
- 6:07:53one's number of columns is equal to the
- 6:07:55second one's number of rows that's just
- 6:07:58the low and that's something that you
- 6:08:00should follow if you want to multiply
- 6:08:02these two
- 6:08:03matrices all right so now let's move on
- 6:08:06onto this idea of multiplying and Dot
- 6:08:08product let's look into a specific
- 6:08:11example and this will uh help us to
- 6:08:14understand this process
- 6:08:16better so before doing that I just want
- 6:08:20to quickly show you this general idea so
- 6:08:23if we have a matrix a that is M by n
- 6:08:28which means that it looks something like
- 6:08:30this like
- 6:08:31A1 1 a 2 one up to the point of a
- 6:08:37M1 and then here we got let's say a 1 2
- 6:08:42a 22 up to the point of a M2 and then at
- 6:08:48the end we got a MN and here we got A1
- 6:08:58n so let me also add this one 2 N and we
- 6:09:03got a matrix B this Matrix B is n by P
- 6:09:08so it has n rows and P columns so we are
- 6:09:13fine in terms of Dimension
- 6:09:15here and we got here
- 6:09:18b11 B21 up to the point of b m sorry b n
- 6:09:25in this case let's not confuse the
- 6:09:28letters so b n 1 B1 2 B 22 up to the
- 6:09:35point of b n 2 because n now is the
- 6:09:40number of rows for Matrix B unlike for
- 6:09:43the Matrix a up to
- 6:09:46B1 p and here b 2 p and here after the
- 6:09:52point of B and then n p this is the last
- 6:09:56element in order to perform um
- 6:09:59multiplication between these two
- 6:10:00matrices so to obtain a matrix C which
- 6:10:05is a equal to a *
- 6:10:08B what we need to do is we simply need
- 6:10:12to take pair case or pair Row for the
- 6:10:15row I for
- 6:10:18instance we need to take this element so
- 6:10:21this row and we need to multiply it with
- 6:10:24this so we need to find the dot product
- 6:10:26between this row and this column then we
- 6:10:30need to move on on to the next one and
- 6:10:33then for the second element we will then
- 6:10:36take this row and we will multiply it
- 6:10:40with this
- 6:10:43one so this is then something that we
- 6:10:46need to do in order to obtain these
- 6:10:49elements and you might have already
- 6:10:50noticed that we got this m by n and n by
- 6:10:54P so you might have already guessed what
- 6:10:57will be the dimension of the C if we got
- 6:11:00that the dimension of a is equal to M by
- 6:11:04n
- 6:11:06and the dimension of B is equal
- 6:11:112 N by P then the
- 6:11:15results Matrix after M multiplying the
- 6:11:18two so Matrix c will be will be having a
- 6:11:22number of rows equal to this and the
- 6:11:25number of columns equal to this so This
- 6:11:27middle part basically disappears and the
- 6:11:30number of rows of the first Matrix will
- 6:11:33be then the number of rows of this
- 6:11:34result Matrix C and the number of
- 6:11:37columns or the second Matrix so Matrix B
- 6:11:40will then be our final number of columns
- 6:11:42so we will then have a matrix C that
- 6:11:44will have a
- 6:11:46dimension so
- 6:11:50Dimension so dimension of C will then be
- 6:11:54equal
- 6:11:57to M
- 6:12:00by P so we will have M rows and P
- 6:12:07columns so how we are going to compute
- 6:12:11this so for c i j which means row
- 6:12:18I and column J let's look into the
- 6:12:23definition of it it's saying c i j is
- 6:12:26computed as a dotproduct of the each row
- 6:12:30and the Jade column so each row from a
- 6:12:32and Jade column of B what where is the
- 6:12:35each Road of a the each Road of a is
- 6:12:39somewhere here so each Road of
- 6:12:42a it is uh the A and then
- 6:12:50I
- 6:12:53one then
- 6:12:56a and then I 2 and then a and then I Tre
- 6:13:01dot dot dot and then
- 6:13:03a i and then then we got in total n
- 6:13:07columns
- 6:13:09n and we always do the transpose right
- 6:13:12when Computing this um dot product so we
- 6:13:15then take the transpose so we take this
- 6:13:19row row I and we multiply it so we do
- 6:13:23the dot product between this one this is
- 6:13:25the a
- 6:13:28i and the
- 6:13:32B J
- 6:13:35this is column J it is somewhere
- 6:13:39here so it is B and then we got the
- 6:13:44first element which is one and then J
- 6:13:48and then b 2 J
- 6:13:51B 3j dot dot dot up to B and then in
- 6:13:56total we got n rows in B so n and then
- 6:14:02the J is the
- 6:14:05column so it stays the
- 6:14:08same so this is then the dot product
- 6:14:13between
- 6:14:14e row that comes from Matrix a and the J
- 6:14:19column that comes from Matrix B so it's
- 6:14:22always like that actually so we always
- 6:14:24take row by row so we
- 6:14:29take this different so every time we
- 6:14:32take just a row
- 6:14:35and we multiply with the corresponding
- 6:14:38column and then we get the dot product
- 6:14:41between this row that comes from the
- 6:14:42first Matrix and then the column that
- 6:14:44comes from the second Matrix in that
- 6:14:46specific order in order to get our DOT
- 6:14:48product and that specific valum and what
- 6:14:51is this amount actually
- 6:14:54so when we calculate this do product you
- 6:14:57can quickly see that we have a
- 6:15:02i1 multiplied by B 1 J plus a I2
- 6:15:09multiplied by b 2 J and then dot dot dot
- 6:15:14a i n multiplied by b n
- 6:15:19g and this new Matrix
- 6:15:23c will then have all these elements so
- 6:15:26C11 C 21 and then c31 dot dot dot and
- 6:15:31then
- 6:15:32C the last
- 6:15:35row as the number of rows of C is m c m
- 6:15:41see here M so C and then here it will be
- 6:15:45one 2 C 22 C3 and then 2 up to the point
- 6:15:51of
- 6:15:53cm and then two and then here the last
- 6:15:56col will be C1 and then p is the number
- 6:16:00of coms in C so C1 p and then C2 p and
- 6:16:04then
- 6:16:05c3p dot dot dot and then
- 6:16:10c m and then
- 6:16:15P
- 6:16:17okay so this is what we get this is our
- 6:16:20final Matrix C when multiplying Matrix a
- 6:16:25and Matrix B so let me clean this
- 6:16:32up C is to now if you want to find out
- 6:16:37what is C11 you can easily fill in this
- 6:16:40general formula that uh that we just
- 6:16:42calculated the I is equal to 1 and then
- 6:16:45J is equal to 1 and this will give you
- 6:16:47C11 by using this formula if you want to
- 6:16:51get the C and P then just fill in the I
- 6:16:53is equal to M and then J is equal to P
- 6:16:56in order to get this value C and P so
- 6:16:59you can already see the amount of
- 6:17:01calculations you need to do in order to
- 6:17:03get all these elements from this l large
- 6:17:05matrices A and B let's actually look
- 6:17:07into a simple example to clarify this so
- 6:17:10we have a matrix a here and Matrix B
- 6:17:13here and we want to do a multiplication
- 6:17:15of the two and we have just learned how
- 6:17:17to do it let's actually do it one by one
- 6:17:19so we got a matrix a which is equal
- 6:17:24to 1 2 3 4 with Dimensions 2 by 2 then
- 6:17:31we got a matrix B which has values two Z
- 6:17:36and then one two so it is 2 by two and I
- 6:17:41want to find what is c that is equal to
- 6:17:44a * B and I know already by looking at
- 6:17:47these Dimensions that c is going to be
- 6:17:50equal to 2 by 2 so you might recall that
- 6:17:54I said that when looking at this final
- 6:17:56result the number of rows or the final
- 6:17:59um Matrix will be this so the number of
- 6:18:03rows of the initial Matrix a and then
- 6:18:06the number of columns of this final
- 6:18:07Vector c will be the number of vectors
- 6:18:10number of columns of this second Matrix
- 6:18:13B so two therefore I know already before
- 6:18:17even doing calculations that the uh
- 6:18:20product Matrix c equal to a * B is going
- 6:18:23to have a dimension 2x two let's
- 6:18:25actually do a calculation to check this
- 6:18:28so C is then equal to a * B and it's
- 6:18:31equal
- 6:18:32to 1 2 3 4 4 multiplied by 2 0 1
- 6:18:392 okay
- 6:18:47so I expect to have four different
- 6:18:49elements here here here and here so to
- 6:18:54obtain the C11 so it is C11 in here what
- 6:18:59I need to do is that I need to look at
- 6:19:02the first row and in the first column in
- 6:19:06here so first row from a and the First
- 6:19:09Column of B and I'm doing the dot
- 6:19:11product which means 1 * 2 + 2 * 1 1 * 2
- 6:19:16is 2 2 * 1 is 1 so here I'm getting 1 *
- 6:19:212 + 2 * 1 which basically gives me 2 + 2
- 6:19:28and that's equal to 4
- 6:19:37so here I'm just writing
- 6:19:39[Music]
- 6:19:43down 1 * 2 + 2 * 1 now when I want to
- 6:19:50get this value which is
- 6:19:52C12 this means that I want to get the
- 6:19:55first row and the second column and
- 6:19:57that's exactly what I'm doing so I'm
- 6:19:59going back and I'm saying let's look at
- 6:20:03the first row but this time will look at
- 6:20:05the second column coming from the uh
- 6:20:07from The Matrix B so 1 *
- 6:20:120 0 + 2 * 2 and then I do the same only
- 6:20:17this time for the second row which means
- 6:20:19I'm picking this row and then this
- 6:20:23column
- 6:20:25so it
- 6:20:27is three * 2 + 4 * 1 and for the final
- 6:20:33element c22
- 6:20:38I'm taking the second row and the second
- 6:20:45column which gives me three * 0 plus 4 *
- 6:20:522 now what does this gives
- 6:20:58me this gives me this 4x4 Matrix where 1
- 6:21:03* 2 + 2 * 1 is 4 1 * 0 + 2 * 2 is 4 3 *
- 6:21:092 + 4 is = to 6 + 4 which is
- 6:21:1410 and then 3 * 0 + 4 * 2 is = to
- 6:21:188 so let's check 4
- 6:21:224108 that's exactly what we have here so
- 6:21:26as you could see here the idea is that
- 6:21:28every time to follow what element I'm
- 6:21:31looking for for the CI J and then I just
- 6:21:34go to the E rows from the first Matrix
- 6:21:38and the J column from the second Matrix
- 6:21:41and I do the dot product of the A and
- 6:21:45then
- 6:21:46I and then K let's say so I'm going to
- 6:21:51the E Row from the first Matrix and I'm
- 6:21:55taking all the elements which means I
- 6:21:57don't even need to mention this index it
- 6:22:00just means the entire each row coming
- 6:22:03from the Matrix a and then I'm doing the
- 6:22:05dot product between this row and the
- 6:22:11column that comes from the Matrix B
- 6:22:14which means B and then
- 6:22:17J which then will give me the cig so I'm
- 6:22:22looking at this and taking this
- 6:22:23multiplying this dot product and this
- 6:22:25gives me the first element then the
- 6:22:27first row and then the second column
- 6:22:29which gives me the uh second element in
- 6:22:32the first row in my Matrix so this one
- 6:22:34and so on so hope this makes sense uh if
- 6:22:38it doesn't make sure to reach out
- 6:22:40because it's a very important concept
- 6:22:43and uh let's also look into another
- 6:22:45example to make sure that we got this
- 6:22:47right so in this case as you can see we
- 6:22:49have another matrices so set of A and B
- 6:22:52matrices again 2 by two a simple
- 6:22:55one and we want to know what is a so
- 6:22:59let's say we call this C we already know
- 6:23:01C should be 2 by 2 and what we are doing
- 6:23:05is basically for
- 6:23:07C11 we are saying let's look at the
- 6:23:11first row so first row and the First
- 6:23:15Column coming from the second Matrix B
- 6:23:19and let's do the dot product so 2 * 1 2
- 6:23:23* 1 2 * 1 4 * 5 4 * 5 we get this and
- 6:23:29then when we want to find what is C oh
- 6:23:34what is C and then one two so in the
- 6:23:37first row but in the second element in
- 6:23:39our final Matrix so I is equal to one
- 6:23:42and J is equal to 2 it means we need to
- 6:23:45look at the first row from The Matrix a
- 6:23:50but this time
- 6:23:52the second column from The Matrix B so
- 6:23:56it is 2 by 3 2 by 3 4 * 7 4 * 7 and this
- 6:24:03gives us a number 13 four even if you
- 6:24:05calculate you can see that 2 * 1 is
- 6:24:07equal to 2 4 * 5 is 5 so 2 4 * 5 is 20
- 6:24:11so 2 + 20 is 22 in here and then you can
- 6:24:15do the rest of calculations and this
- 6:24:17will be a good practice to see how we
- 6:24:20can do a basic matrix multiplication the
- 6:24:23idea is actually quite straightforward
- 6:24:25when it comes to multiplying it it just
- 6:24:27it comes with a practice when we see all
- 6:24:30these uh much bigger matrices
- 6:24:34so um this is another example I will
- 6:24:37leave this one to you to complete it
- 6:24:40just uh to keep in mind we always do uh
- 6:24:44so we always look at the dimension first
- 6:24:46in here 2 * 2 and 2 * 2 which gives me
- 6:24:49an impression already what I can expect
- 6:24:51the result will be 2 by two and when it
- 6:24:55comes to the uh cross elements just
- 6:24:58ensure to always look to the E row and
- 6:25:02the J column
- 6:25:05this comes from Matrix a and this comes
- 6:25:07from Matrix B take them compute the dot
- 6:25:09product and then you will find your C uh
- 6:25:13your final result let's call it
- 6:25:17um kig because in this case we have a
- 6:25:20matrix C already welcome to the module 4
- 6:25:23of this course when we are talking about
- 6:25:26matrices and linear systems so in this
- 6:25:28module we are going to dive deeper into
- 6:25:30this uh idea of linear systems with
- 6:25:33matrices and solve linear systems using
- 6:25:35different techniques and specifically we
- 6:25:37are going to learn the uh concept behind
- 6:25:41solving linear systems using matrices
- 6:25:43named gausian elimination and gaussian
- 6:25:46reduction welcome to the module one in
- 6:25:48this unit so in this uh case we are
- 6:25:51going to talk about algebraic lows for
- 6:25:53matrices we are going to discuss four
- 6:25:55different properties for matrices uh and
- 6:25:59the first one is the communative laow
- 6:26:00for Matrix addition the associative law
- 6:26:03for matrices the distributive laow for
- 6:26:05matrices both the left and the right one
- 6:26:07and then finally we're going to talk
- 6:26:09about the scalar multiplication laow for
- 6:26:12matrices so the algebraic lows or
- 6:26:14matrices they are like in case of real
- 6:26:17numbers like in case of vectors they
- 6:26:19help us to do different operations on
- 6:26:22these entities they are very similar to
- 6:26:24the real numbers and the vector cases
- 6:26:27where we for instance um so that if for
- 6:26:30instance A + B uh is equal to B+ C C or
- 6:26:34a * um b + C is equal to a b + a c those
- 6:26:40are all sorts of lows that we uh learn
- 6:26:43as part of high school prealgebra and we
- 6:26:46have applied it to real numbers we know
- 6:26:48how helpful those can be and similar
- 6:26:51type of lows we have also for the
- 6:26:54matrices and we got in this case four
- 6:26:58different laws that we will be
- 6:27:00discussing the first one is what we are
- 6:27:01referring as associative law the second
- 6:27:04one is the distributive low the SEC the
- 6:27:07third one is the scalar multiplication
- 6:27:09low and the fourth one is the
- 6:27:10communative low for addition so these
- 6:27:12laws help us to do different metrix
- 6:27:14operations they help us to manipulate
- 6:27:17algebraically this metrices and then uh
- 6:27:20this can help us to solve different
- 6:27:22sorts of problems including solving a
- 6:27:24system of linear
- 6:27:26equations so let's start with the
- 6:27:28commutative law for Matrix addition so
- 6:27:31the Matrix addition is cumulative um
- 6:27:34which means that A+ B is equal to B plus
- 6:27:37a so unlike the matrix multiplication
- 6:27:40that we have seen in the previous
- 6:27:43lessons uh where the order did matter
- 6:27:46and we said that we um had to uh ensure
- 6:27:49that the number of columns of the first
- 6:27:51Matrix is equal to the number of rows of
- 6:27:54the second Matrix in case of addition
- 6:27:57that's this is not the case so we should
- 6:27:59not care about the order whenever we
- 6:28:01want to add two matrices the other thing
- 6:28:04that we need to keep in mind though is
- 6:28:06that the two matrices needs to have the
- 6:28:08same size so I mean that both Matrix a
- 6:28:13and Matrix B need to have a dimension so
- 6:28:17dimension of Matrix a should be equal to
- 6:28:19dimension of Matrix B and let's say
- 6:28:21should be equal
- 6:28:23to M
- 6:28:27by n but for the rest we don't really
- 6:28:30need to care uh which one we will put
- 6:28:33first
- 6:28:34will we put first a and then add the b
- 6:28:37or we will do the other way around so we
- 6:28:40will then First Take B and then we will
- 6:28:42add
- 6:28:43a so this is the idea behind communative
- 6:28:46low for Matrix
- 6:28:48addition so first let's look into all
- 6:28:50this uh lows and then we will also look
- 6:28:53into the corresponding
- 6:28:55examples so for this specific case it
- 6:28:58might actually also be helpful to write
- 6:29:00down the general formula which will um
- 6:29:03make sense out of this um low for the uh
- 6:29:08uh which is a communative low for the
- 6:29:10Matrix additions so let's say we got a
- 6:29:14matrix
- 6:29:15a which is M by
- 6:29:18n and this Matrix can be represented as
- 6:29:22a11 dot dot dot a M1 so this is
- 6:29:26something that we saw time and time
- 6:29:28again so I'll just quickly write it down
- 6:29:30the common notation for this and then
- 6:29:34here we have the last column which is a
- 6:29:37MN and this is the Matrix a then we got
- 6:29:42Matrix B which is again M by n and can
- 6:29:47be represented as
- 6:29:48b11 and then dot dot dot and then B M1
- 6:29:53dot dot dot b1n dot dot dot b
- 6:29:59MN
- 6:30:01so the communative lows says that A +
- 6:30:09B should be equal
- 6:30:12to B + a let's check that whether this
- 6:30:16is the case let's first compute this
- 6:30:19part and then we will do this
- 6:30:21one
- 6:30:23well the first
- 6:30:25one means that we get so
- 6:30:31A+ B is and we remember remember how we
- 6:30:34add matrices right so we know that we
- 6:30:37just need to pick their corresponding
- 6:30:39elements and add them to each other so
- 6:30:41we get
- 6:30:44a11 plus
- 6:30:47b11 then dot dot dot and then a
- 6:30:52M1 plus b M1 this is why also D is
- 6:30:57really important that they got um the
- 6:30:59same Dimension which means that they got
- 6:31:01exactly the same amount of elements the
- 6:31:04same uh amount of columns and the same
- 6:31:06amount of rows um in terms of the uh
- 6:31:10Matrix size so then here we have a 1 n
- 6:31:17and then
- 6:31:19plus B1
- 6:31:21n then dot dot dot and then a
- 6:31:27M1 and then plus b m here I need to put
- 6:31:34n we are in the last element of the
- 6:31:36Matrix so
- 6:31:38BMN and that is it this is our Matrix A
- 6:31:42+ B let's now look into the Matrix b + a
- 6:31:48so what that amount
- 6:31:53is so the
- 6:31:56Matrix b + a will then be equal to
- 6:32:07b11 plus
- 6:32:09a11 dot dot dot and then B
- 6:32:15M1 plus a
- 6:32:18M1 then dot dot dot and then b 1
- 6:32:23n plus a 1 n then dot dot dot and then
- 6:32:29the last element will be B
- 6:32:31MN and then Plus
- 6:32:34a m
- 6:32:41n
- 6:32:42so in here if we remember from the real
- 6:32:47numbers we know that a
- 6:32:51+ b is equal to B + a for instance if a
- 6:32:59is equal to 2 and then B is equal to 1
- 6:33:02then a + b is = to 2 + 1 which is equal
- 6:33:06to 3 and then b + 1 is = to 1 + 2 and
- 6:33:10it's equal to 3 so we know that indeed
- 6:33:12for the real numbers a plus b is equal
- 6:33:15to B + a and making use of that property
- 6:33:18we can already state that b11 + a11 is
- 6:33:24equal to A1 1 + B1 1 and then the
- 6:33:29general case is that a
- 6:33:33i
- 6:33:36j plus b i
- 6:33:40j is equal
- 6:33:42to b i
- 6:33:46j plus a i j where I is the index of the
- 6:33:52rows and then J is the index of the
- 6:33:55columns from the coefficient
- 6:33:57labeling so using this property from the
- 6:34:01real numbers given that all these values
- 6:34:03in the m Matrix are real numbers we can
- 6:34:05quickly see that the Matrix B+ a that we
- 6:34:10just got in
- 6:34:11here is equal to this Matrix a plus b
- 6:34:16which means
- 6:34:18that 1 is equal to B and this proves
- 6:34:23that A + B is equal to B + a this is the
- 6:34:27communative property of the Matrix
- 6:34:31additions so the next law is the
- 6:34:34associative law for matrices which says
- 6:34:37that the in case of Matrix addition a +
- 6:34:40B+ C isal to A + B +
- 6:34:45C so
- 6:34:48basically this
- 6:34:50time we go from here to adding one more
- 6:34:54element which is the third Matrix Matrix
- 6:34:57C so we are saying A + B + C is equal to
- 6:35:02a +
- 6:35:04B+ C so it doesn't matter whether we
- 6:35:07will First Take The Matrix a and then B
- 6:35:10and then add them up and then we add
- 6:35:12Matrix C or if we first take the Matrix
- 6:35:16B and C add them up and then we add a to
- 6:35:19this sum it doesn't
- 6:35:21matter we will see an example of this in
- 6:35:24a
- 6:35:25bit and then the uh second part of this
- 6:35:28associative law for matrices says that
- 6:35:30for matrix multiplication a * B * C is
- 6:35:35equal to a * B * C so again in terms of
- 6:35:40the
- 6:35:41um order when it comes to this specific
- 6:35:45multiplication so it doesn't matter
- 6:35:47whether we will first multiply a by B
- 6:35:50and then by C or we will first multiply
- 6:35:52B by C and then we add the a at the end
- 6:35:56we will end up with the same amount so a
- 6:35:59* B and then * C is equal to B * C C and
- 6:36:04then in the left hand side we add the a
- 6:36:06so a * B * C so these properties help us
- 6:36:10to add or multiply matrices without
- 6:36:13really worrying about this idea of
- 6:36:15grouping of the terms so we can always
- 6:36:18group them and perform all sorts of
- 6:36:21operations so this is this first
- 6:36:23property that we see in
- 6:36:25here let's say we have this uh Matrix a
- 6:36:29matrix B and Matrix C so let's prove
- 6:36:33that in
- 6:36:34the order doesn't matter and this
- 6:36:36associative property holdes so let's
- 6:36:39prove
- 6:36:41that so for that the first thing we need
- 6:36:44to do is to
- 6:36:46compute a plus b so this part so A + B +
- 6:36:53C what is that first I need to compute
- 6:36:56this
- 6:36:57part and then I will add C which is the
- 6:37:02second part
- 6:37:04so A + B is equal to my a is equal
- 6:37:10to
- 6:37:121 2 3 4 plus and my B is equal
- 6:37:18to 5
- 6:37:216 7
- 6:37:248 this is then equal to so 1 + 5 is = to
- 6:37:296 2 + 6 is = 8 3 + 7 is = to 10 and then
- 6:37:334 + 8 is equal to 12 this is my A + B
- 6:37:38this is the first part now the second
- 6:37:41part is then to add to this A +
- 6:37:46B this C this I can by the way also call
- 6:37:50some Matrix D so I can say that this is
- 6:37:55equal
- 6:37:56to D+
- 6:37:58C so let's find out what is this amount
- 6:38:03so a plus b or what we're referring as D
- 6:38:07is 6 8 10 12 we just calculated it in
- 6:38:11here I'm also adding now my Matrix C
- 6:38:15which is 91 10 12 so 9 10 11 12 what is
- 6:38:21this amount it is 6 + 9 is 15 8 + 10 is
- 6:38:2618 10 + 11 is 21 12 + 12 is
- 6:38:3124 this is my final Matrix
- 6:38:35so I have checked
- 6:38:38that D A + B + C is equal to 15 18
- 6:38:4821 and
- 6:38:5024 this is the first part let's now go
- 6:38:53ahead and check whether this is equal to
- 6:38:56the second part which is this part so
- 6:38:59this is one this is two so
- 6:39:04this is then A + B + C as you can see it
- 6:39:09in here let's now calculate that amount
- 6:39:12and like previously we will do it in an
- 6:39:14order so first we need to calculate this
- 6:39:17part and then the entire
- 6:39:23thing so B+ C is then equal
- 6:39:29to the B was 5 6 7 8
- 6:39:355 6 7 8 plus and the C
- 6:39:41was 9 10 11
- 6:39:4412 9
- 6:39:4710 11
- 6:39:5012 what is the much 5 + 9 is 14 6 + 10
- 6:39:55is 16 7 + 11 is 18 and 8 + 12 is
- 6:40:0220 this is the first amount let's refer
- 6:40:06refer this as a
- 6:40:08d or we can even call it by some other
- 6:40:11letter let's say k this is Matrix K so B
- 6:40:14plus C is
- 6:40:17k then the second part is to take this
- 6:40:20B+ C so B+
- 6:40:25C which we have referred as
- 6:40:28K say
- 6:40:30K and then we are adding to this
- 6:40:33the A and specifically just to ensure
- 6:40:37that we stay with the same order I'm
- 6:40:38saying I will add from the left side the
- 6:40:42a to this Matrix
- 6:40:45K and this obviously
- 6:40:53means this is equal to so A+ b + C this
- 6:40:59is what I'm referring by just uh in a
- 6:41:02more simpler note a I'm just using K in
- 6:41:05here so this is my B plus C or what I'm
- 6:41:09referring also as a
- 6:41:11k and this amount is equal
- 6:41:15to what is my a my a is 1 2 3
- 6:41:204 1 2 3 4 plus and what is B plus C we
- 6:41:26just calculated that that's the K so 14
- 6:41:3016 18 20
- 6:41:34T So 1 + 14 is 15 2 + 16 is 18 3 + 18 is
- 6:41:4121 4 + 20 is
- 6:41:4524 so we have learned that the A + B + C
- 6:41:51is this
- 6:41:54Vector now is this Vector equal to the a
- 6:41:59plus b and then plus C well here we got
- 6:42:02this 15 18 21
- 6:42:0624 15 18 21 24 so we have just proved
- 6:42:13that the first part is equal to second
- 6:42:16part which means that we have proved
- 6:42:18that
- 6:42:19indeed the order doesn't matter and A +
- 6:42:23B + C is equal to a + B+
- 6:42:27C so this calculation confirms that the
- 6:42:30both sides of this equations they are in
- 6:42:33indeed equal and this confirms the
- 6:42:35associative low for the Matrix
- 6:42:42addition so let's now look into the
- 6:42:45distributive law for matrices which says
- 6:42:48that Matrix addition and multiplication
- 6:42:51they satisfy the distributive property
- 6:42:54which means that if we have a left
- 6:42:56distribution a * b + C is equal to a + a
- 6:43:02c
- 6:43:03and then in the right distribution we
- 6:43:05basically have the Matrix multiplying
- 6:43:07from the right from hence the name right
- 6:43:10distribution A + B * C is equal to a C +
- 6:43:15BC you might very quickly see and
- 6:43:19recognize from here that we have very
- 6:43:22similar actually exactly uh the same
- 6:43:26rule only for real numbers we know that
- 6:43:28a * b + C is equal to and then we open
- 6:43:32the parentheses with say this is equal
- 6:43:33to this times this so AB plus this times
- 6:43:37this a c you can see that we have
- 6:43:41exactly the same here only in the
- 6:43:43capital letters so in the real numbers
- 6:43:45we have exactly the same low so the same
- 6:43:48we have also for our left
- 6:43:51distribution when it comes to Matrix
- 6:43:53additional multiplication and the same
- 6:43:56we have only with a different order here
- 6:43:58you can see the C so this one is
- 6:44:01basically uh with the different order
- 6:44:04instead of having the Matrix multiplied
- 6:44:05in the left here we have from the right
- 6:44:08and this is similar to the property that
- 6:44:11A + B * C is equal to C * a which is a c
- 6:44:17plus c * B which is BC an example uh
- 6:44:22where we will prove that the
- 6:44:23distributive law for matrices um is
- 6:44:25indeed true and I have skipped
- 6:44:30deliberately the uh example for this one
- 6:44:34because uh this a b * C is equal to a *
- 6:44:38b c so the associative law for matrix
- 6:44:41multiplication it's something that you
- 6:44:43can calculate for yourself using the
- 6:44:46same a b and c matrices only this
- 6:44:49includes multiplication of these two
- 6:44:51matrices and it's something that we are
- 6:44:53going to do as part of this example so
- 6:44:56instead of doing and redoing this
- 6:44:59multiplication I thought that it's great
- 6:45:01to leave that for you as a practice and
- 6:45:03instead focus on bit more complex
- 6:45:06problem like this one that one way or
- 6:45:09the other includes the same matrix
- 6:45:12multiplication so I need to calculate
- 6:45:14the a * B in this case which means that
- 6:45:18by providing you this example I'm also
- 6:45:20including what is needed to do the
- 6:45:23previous example only it would be a
- 6:45:24great way to practice the material for
- 6:45:26yourself so let's now move into proving
- 6:45:29the distributive low for matrices so we
- 6:45:32got this mat matrices a b and c and here
- 6:45:36I'm going to apply matrix multiplication
- 6:45:39the same as that is needed for the
- 6:45:40previous uh case and here what we need
- 6:45:44to prove is that a * b + C is equal to a
- 6:45:49* AC so this is the first part this is
- 6:45:52the second part so let's go and
- 6:45:55calculate them
- 6:45:57separately so for the first one we need
- 6:46:00to calculate
- 6:46:05a * b +
- 6:46:08C which is
- 6:46:12then something that we can calculate by
- 6:46:15first doing the addition so we will
- 6:46:18first do the addition of matrices B and
- 6:46:21C and then once we are done with that we
- 6:46:24will then do a * b +
- 6:46:28C so that's the second part
- 6:46:39so let's go ahead and do that
- 6:46:41calculation so first we
- 6:46:43got b + C what is B plus C B is 5 67 8 5
- 6:46:506 7
- 6:46:538 plus and the C is minus one 0 0 minus
- 6:46:57one so on the diagonal we got min-1 and
- 6:47:00minus one and then of diagonal lower and
- 6:47:02upper part we got zero and what is this
- 6:47:05Matrix this is equal to 5 - 1 so 5 + -1
- 6:47:09is equal to 4 6 + 0 is = 6 7 + 0 is = 7
- 6:47:15and then 8 - 1 is = 7 this is our B plus
- 6:47:19C which we can refer also as Matrix D so
- 6:47:23let's call this D which means that now
- 6:47:26we are interested in a
- 6:47:29* B
- 6:47:33so for this second
- 6:47:36part we need to take this Matrix
- 6:47:40a so a
- 6:47:44* D is then equals to we need to take
- 6:47:49the Matrix a which is
- 6:47:521 2 3 4 and we need to multiply it with
- 6:47:57this Matrix that we just got because
- 6:47:59this is the B plus C or the D that we
- 6:48:00were referring 46
- 6:48:0477 okay so let me remove this
- 6:48:09part cuz we are going to need some space
- 6:48:12for
- 6:48:13this and let's do this calculation this
- 6:48:16is 2x two and this is 2x
- 6:48:25two I will do the calculations in here
- 6:48:29so we need to end up with the Matrix
- 6:48:31that is also 2 by 2 because we know 2x 2
- 6:48:36Matrix times 2x two we will pick this
- 6:48:39part so the number of rows and the
- 6:48:41number of columns of the second one this
- 6:48:43will be our resulting Matrix which is 2
- 6:48:45by
- 6:48:47two all right so for the matrix
- 6:48:51multiplication we know that for this
- 6:48:53element in the place of so one a or
- 6:48:58let's call this Matrix we don't even
- 6:49:00actually need to call this anything we
- 6:49:02we can keep it simple so let's say that
- 6:49:04we are in the first draw in the First
- 6:49:06Column so this is the first draw in the
- 6:49:08First Column for this what we need to do
- 6:49:11is we need to take the first row from
- 6:49:14the first Matrix so Matrix a and then
- 6:49:16the First Column of the Matrix D so this
- 6:49:19one and we need to do the dot product
- 6:49:22which means that we do
- 6:49:26basically 1 * 4 1 * 4 plus 2 *
- 6:49:387 so for this element which is in the
- 6:49:42second row and the First Column we need
- 6:49:46to take the second row and First
- 6:49:51Column in here so we end up with three
- 6:49:56times 4 so 3 * 4 and then 4 * 7 so Plus
- 6:50:024 * 7 The Dot product between this one
- 6:50:05and then this
- 6:50:07one so for this element which is in the
- 6:50:10first row and then the second column of
- 6:50:12the final Matrix so first row and second
- 6:50:15column we need to pick the first row and
- 6:50:19second column and do a DOT product which
- 6:50:21means
- 6:50:24one 1 * 6 + 2 * 7 2 *
- 6:50:317 and then in here in this element we
- 6:50:35got the second column and second row so
- 6:50:38second row second
- 6:50:39column which means that we need to pick
- 6:50:42the second
- 6:50:45row and the second column the dot
- 6:50:48product of the second row of Matrix a
- 6:50:51and the second column of Matrix D which
- 6:50:56is 3 *
- 6:51:006 Plus 4 * 7 4 *
- 6:51:077 so let's quickly calculate what this
- 6:51:10amount
- 6:51:13is so this is the a * B+ C basically and
- 6:51:21this Matrix is 1 + 4 is 4 2 * 7 is 14 4
- 6:51:28+ 14 is
- 6:51:3018 1 * 6 X is 6 2 * 7 is 14 and 6 + 14
- 6:51:38is
- 6:51:3920 3 * 4 is 12 4 * 7 is
- 6:51:4728 which means that we got here
- 6:51:5140 3 * 6 is 18 4 * 7 is 28 which means
- 6:51:58we got here 36 and 46
- 6:52:06this is our final a * b +
- 6:52:11C let's now go ahead and calculate the
- 6:52:15second part so the second
- 6:52:18part says that we
- 6:52:22got a * b + a *
- 6:52:26C so a * b + a * C
- 6:52:32which means that first we need to do
- 6:52:34this calculation and then this
- 6:52:37one and then we need to add them to each
- 6:52:41other so let's quickly then calculate
- 6:52:44what is a * B and then a * C and then
- 6:52:48add them to each
- 6:52:51other let me clean up some space in
- 6:52:55here we're going to KN
- 6:53:00that when we write this one in a smaller
- 6:53:03format so this is equal to
- 6:53:0718 20 40 and
- 6:53:1646 and let me take over the second
- 6:53:19element which we still need to calculate
- 6:53:22which is AB plus a
- 6:53:28c first we will do this and then this
- 6:53:32and then we will add them to each
- 6:53:35other so a * B is equal
- 6:53:41to 1 2 3 4 multiplied
- 6:53:46by 5 6 7 8 5 6 7
- 6:53:518 now following the
- 6:53:54same
- 6:53:55approach from the previous example when
- 6:53:58we calculate this Matrix I will then
- 6:54:00quickly calculate what is is a * B so in
- 6:54:04here we got first row and First Column
- 6:54:07so 1 * 5 + 2 * 7 so the dot product
- 6:54:11between the first row and the First
- 6:54:13Column from
- 6:54:14here now for this element here we got
- 6:54:18the second row and the First Column we
- 6:54:21need to take the second row in the First
- 6:54:23Column from here and we do the dot
- 6:54:26product which means 3 * 5 + 4 * 7 in
- 6:54:32here here we got the first draw and
- 6:54:33second column so the first draw and
- 6:54:35second column which
- 6:54:38means that we need to have 1 * 6 + 2 *
- 6:54:468 then here we got the second row and
- 6:54:49then second column which means 3 * 6 + 4
- 6:54:53*
- 6:54:558 and then this is equal
- 6:54:59to 1 * 5 is 5 5 2 * 7 is 14 so this is
- 6:55:0819 1 * 6 is 6 2 * 8 is 16 6 + 16 is
- 6:55:1822 in here 3 * 5 is 15 4 * 7 is 28 so
- 6:55:24this is then 33 and then 43 so
- 6:55:3043 and in here we got 3 * 6 6 is 18 4 *
- 6:55:368 is 32 so we end up with
- 6:55:4650 so hope I haven't made any mistakes
- 6:55:49in the
- 6:55:51calculations so this is the a *
- 6:56:00B so a * B is then equal
- 6:56:06to 19 22 43
- 6:56:1150 let's clean this pce and let's move
- 6:56:14ahead to the second part of the
- 6:56:16calculation which is a *
- 6:56:21C what is a * C well a * C
- 6:56:29is 1 2 3 4 1 2 3 3 4 multiplied by
- 6:56:36-1 0 0 -1 so here we are then
- 6:56:42getting -1 +
- 6:56:450 here we are
- 6:56:47getting -3 + 0 here we
- 6:56:53have -1 +
- 6:56:560
- 6:56:58so no so the first row and second column
- 6:57:04which is 0us
- 6:57:062 and then in here we got the second row
- 6:57:10and the second column which is 0 -
- 6:57:144 which means that we end up with this
- 6:57:17Matrix and it's equal to
- 6:57:20-1
- 6:57:22-3 then -2 and then
- 6:57:29-4 which means that we are getting
- 6:57:33as a final step AB plus a which
- 6:57:37means 19 202 43 and then 50 then
- 6:57:44plus -1 - 2 - 3 - 4 and what is this 19
- 6:57:51- 1 is 18 43 - 3 is 40 22 - 2 is 20 50 -
- 6:58:004 is 46
- 6:58:04okay so we got
- 6:58:08that this amount ab+ a c is equal to 18
- 6:58:1420 40
- 6:58:1646 and as you can see already
- 6:58:20here this Matrix that we got in the
- 6:58:23previous calculation from one is equal
- 6:58:25to this Matrix that we got as part of
- 6:58:27second calculation which means that now
- 6:58:30we have proved that for this specific
- 6:58:32example indeed 1 is equal to 2 which
- 6:58:35means that a * b + C is equal
- 6:58:40to AB
- 6:58:43plus
- 6:58:46AC there we go so let's now look into
- 6:58:50another law which is the scalar
- 6:58:53multiplication law for
- 6:58:55matrices so the scalar multiplication
- 6:58:58law for matrices says
- 6:59:01that if we got a scalar R and a matrix A
- 6:59:05and
- 6:59:06B then R * a * B is equal to R * a * B
- 6:59:13and is equal to a * R *
- 6:59:16B so here the r is just a
- 6:59:21scalar so it's a real
- 6:59:23number and then A and B are
- 6:59:28matrices and what this low basically
- 6:59:31says is is that it doesn't matter what
- 6:59:34in which stage you will do your matrix
- 6:59:37multiplication with the scaler if you
- 6:59:39have this external scaler you can first
- 6:59:42take the two matrices multiply them with
- 6:59:45each other so the A and then B and then
- 6:59:49multiply it with
- 6:59:51r
- 6:59:53or you can
- 6:59:55take the scalar R multiply with your
- 6:59:58first Matrix and then multiply with B
- 7:00:02or you can take your second Matrix
- 7:00:06multiply with the scaler and then
- 7:00:08multiply with a it doesn't matter they
- 7:00:11will all result in the same Matrix so
- 7:00:15let us actually prove this by making use
- 7:00:18of our skills from matrix multiplication
- 7:00:20and scalar multiplication here I've
- 7:00:23picked up bit more uh Advanced example
- 7:00:26where uh a is
- 7:00:292x3 and B is 3x3 in this way we will
- 7:00:32train our multiplication skills for
- 7:00:35matrices and at the same time we will
- 7:00:37also prove that the scalar
- 7:00:39multiplication law of matrices holds so
- 7:00:42let's go ahead and do the
- 7:00:46multiplications so first we have a
- 7:00:48matrix
- 7:00:49a what is that Matrix Matrix a
- 7:00:56is 1 - one 2 so 1 - one and then
- 7:01:03two then we got 0
- 7:01:082 and then
- 7:01:121 which is 2 by 3 and then we got B
- 7:01:19which is equal 2 it is 3x
- 7:01:253 with elements 1
- 7:01:28Z 1 1
- 7:01:332
- 7:01:35Z one one and then 3
- 7:01:411 0 2 so it
- 7:01:46is
- 7:01:483x 4 so it's 3x 4 not 3x 3 but 3x 4
- 7:01:55Matrix now the final part that I need
- 7:02:00here is this which is R is equal to 2
- 7:02:03the scalar value so R is equal to
- 7:02:072 so the first thing that I'm going to
- 7:02:09do is to calculate this amount which is
- 7:02:12R * a * B for that what I need to do is
- 7:02:16to First calculate this a * B so let me
- 7:02:20quickly go and calculate this for us
- 7:02:55so given that the a has Dimension 2x3
- 7:02:57and then B has a dimension 3x4 I can see
- 7:03:00that quickly that my Dimension criteria
- 7:03:03is satisfied the number of columns of a
- 7:03:06is equal to number of rows of B so
- 7:03:08that's fine and then I know also know
- 7:03:11that the final dimension of a * B is
- 7:03:13going to be 2x4 so it's going to be a
- 7:03:182x4 Matrix and how do I know that well
- 7:03:21because I know that from our um all the
- 7:03:26problems that we have solved we have
- 7:03:28already seen that we always need to pick
- 7:03:30the number of rows of the First Column
- 7:03:33and the number of columns of the second
- 7:03:36uh Matrix in order to get the final
- 7:03:38Dimension which is
- 7:03:402x4
- 7:03:42so let me then go ahead and do the
- 7:03:45calculation so we are going to have a
- 7:03:482x4 Matrix let me write it even
- 7:03:52bigger so it's going to be a
- 7:03:572x4 Matrix
- 7:04:12so for the first
- 7:04:15row and First
- 7:04:18Column I need to look in here the first
- 7:04:22row and the First Column which means I
- 7:04:25need to
- 7:04:27take
- 7:04:30one so it's equal to
- 7:04:331 * 1 so + 1 * 1 is 1 - 1 * 2 is -
- 7:04:412 2 * 3 is 6 + 6 this is my first value
- 7:04:48and what is this amount it is equal to 1
- 7:04:50- 2 is - 1 and 6 - 1 is equal to 5 so
- 7:04:56this amount is five
- 7:05:03five so what is this
- 7:05:08amount well this is my second row in the
- 7:05:11First Column so I need to make
- 7:05:15use
- 7:05:18of second row and First Column which is
- 7:05:22equal to 0 * 1 is 0 2 * 2 is 4 and 1 * 3
- 7:05:28is 3 4 + 3 is 7 so this value is 7 seven
- 7:05:33we are ready to go on to the next column
- 7:05:36so column number two so then this
- 7:05:43time I need to look at the first row and
- 7:05:48second column so we are going to use
- 7:05:50this one so first we will use this first
- 7:05:53Row 1 * 0 is 0 - 1 * 0 is 0 0 + 0 is 0
- 7:05:58and then 2 * 1 is the only nonzero
- 7:06:00element 2 * one is two so I already know
- 7:06:03that for my second column I got here
- 7:06:10two and what is this element well for
- 7:06:13this I need to look at the second row
- 7:06:18and second column so this thing so 0 * 0
- 7:06:21is 0 2 * 0 is 0 1 * 1 is one which means
- 7:06:27that here I get a
- 7:06:30one let's not move on to on uh towards
- 7:06:33the third column so in here first I need
- 7:06:37to look at the first row so 1 - one and
- 7:06:39two and then this
- 7:06:43time remove
- 7:06:48this I need to look at the third
- 7:06:52column because I'm here in the third
- 7:06:55column
- 7:06:58so 1 * 1 is 1 -1 * 1 is 1 so here I got
- 7:07:051 - 1 and then 2 * 0 is 0+ 0 1 - 1 + 0
- 7:07:13is 0 because those two cancel
- 7:07:16out this means that here in this element
- 7:07:19I got a zero and what about this element
- 7:07:22where I need to look here in the second
- 7:07:24row and here I need to look at the third
- 7:07:26column 0 * 1 is 0 2 * 1 is 2 1 * 0 is 0
- 7:07:32so 0 + 2 + 0 is equal to 2 so this is
- 7:07:372 and now we are left with the fourth
- 7:07:41column so for that I need to
- 7:07:44look in
- 7:07:46here so for the first row which means
- 7:07:50first row in here and then the fourth
- 7:07:51column in here so first row in here and
- 7:07:53fourth column here 1 * 1 is 1 - 1 * 1 is
- 7:07:581 and then 2 * 2 is 4 which means that I
- 7:08:01end up with 1 - one and then + 4 and
- 7:08:05what is this this two cancel out I end
- 7:08:08up with four which means that here I
- 7:08:10need to fill
- 7:08:11in
- 7:08:13four and what is this final element it
- 7:08:16is the second row in the fourth column
- 7:08:17so the second row in the fourth column 0
- 7:08:20* 1 is 0 2 * 1 is 2 1 * 2 is 2 0 + 2 + 2
- 7:08:26is =
- 7:08:284 so now we obtained that a * B is this
- 7:08:342 * 4 Matrix as we have
- 7:08:39expected so this is then equal to 5 2 04
- 7:08:45and then 7 1 2 4
- 7:09:03so then the next step would be to take
- 7:09:05the scaler R and multiply it with a *
- 7:09:11B let me actually keep the colors
- 7:09:14consistent so a * B this is a * B so the
- 7:09:20only thing that I need to do is to take
- 7:09:24that in here and multiply this two with
- 7:09:29each of those elements so I will end up
- 7:09:32with the same size Matrix so 2x 4 only
- 7:09:37all these elements need to be multiplied
- 7:09:39with the scaler which means that I will
- 7:09:41get 5 * 2 is 10 2 * 2 is 4 0 * 2 is 0 4
- 7:09:47* 2 is 8 and then 7 * 2 is 14 1 * 2 is 2
- 7:09:532 * 2 is 4 and then 4 * 2 is 8 so this
- 7:09:58is the result of the multiplication
- 7:10:04so this is the first part this is what
- 7:10:06we are referring as
- 7:10:08one so we have then
- 7:10:11checked in
- 7:10:14here that the
- 7:10:18r times actually we have already in here
- 7:10:22so I won't be writing again so as part
- 7:10:24of the first
- 7:10:26section we have already seen that R * a
- 7:10:29* B is this Matrix
- 7:10:31let's now move on to the next one which
- 7:10:34is
- 7:10:36calculating the second part so this is
- 7:10:39the first part this is the second and
- 7:10:41this is the third we have this already
- 7:10:44let's now move on and calculate this one
- 7:10:47so for this second case so the second
- 7:10:50case what we want to calculate is R * a
- 7:10:54* B so it is R * a and then * B this is
- 7:11:01what we need to calculate so the first
- 7:11:03thing that we will do is to calculate
- 7:11:05this
- 7:11:06part and then to calculate the entire
- 7:11:09thing the second
- 7:11:11point so let's go ahead and do
- 7:11:14that first we will take the A and then
- 7:11:18we will multiply all its elements by
- 7:11:20scaler two to get the r and then a this
- 7:11:24amount is equal
- 7:11:272 1 * 2 is = 2 - 1 1 * 2 is - 2 2 * 2 is
- 7:11:33= 4 0 * 2 is = 0 2 * 2 is = 4 2 * 1 is
- 7:11:39equal to 2 this is R * a now in The Next
- 7:11:44Step so this was one the next step we
- 7:11:47need to take this amount this
- 7:11:53Matrix to minus 2 4
- 7:11:58042 and multiply it with
- 7:12:041 2 3 0 0 1 and then 1 1 Zer and then 1
- 7:12:13one 2 so basically the Matrix
- 7:12:16B let's now move and work our way out
- 7:12:21with that one actually let me remove
- 7:12:23this from here and keep the space bit
- 7:12:26more clean R time a and I will
- 7:12:31multiplying this with the Matrix 1 2 3
- 7:12:35and then 0 0 1 and then 1 1 1 1 and then
- 7:12:410
- 7:12:422 well I know that this one is 2x3 and
- 7:12:46this one is 3x 4 which means that the
- 7:12:48result will be 2x 4 let's now go ahead
- 7:12:52and calculate that Matrix which is equal
- 7:12:56with a dimension of 2x 4
- 7:13:04well for the first row and First Column
- 7:13:07let me actually go and quickly do those
- 7:13:11calculations let's now go ahead and do
- 7:13:13those calculations so we are going to
- 7:13:16have four columns as previously the
- 7:13:19dimension is going to be
- 7:13:212x4 so let's do it column by column in
- 7:13:24here it means that we are in the row one
- 7:13:27and then column 1 so 2 * 1 is equal to 2
- 7:13:31- 2 * 2 is - 4 and then here we got 4 so
- 7:13:354 * 3 is 12 so we got 2 - 4 and then +
- 7:13:4212 and what is this amount 2 - 4 is - 2
- 7:13:47+ 12 is
- 7:13:5010 so here we got 10 let me remove
- 7:13:57this
- 7:13:5910 this is the second row and the First
- 7:14:02Column which means we got 0 * 1 is 0 4 *
- 7:14:062 is 8 and 2 * 3 is 6 so 8 + 6 is equal
- 7:14:14to 14 so here we got
- 7:14:2014 this is the first row and second
- 7:14:23column which means that we are looking
- 7:14:24at this row and second column this
- 7:14:29time so 2 * 0 is 0 - 2 * 0 is 0 the only
- 7:14:33thing that we care about is this one and
- 7:14:36this element which is 4 * 1 so this
- 7:14:38should be four let's now do the same for
- 7:14:40the second row 0 * 0 is 0 4 * 0 is 0 0 +
- 7:14:440 is 0 which means we are left with 2 *
- 7:14:461 so here it comes
- 7:14:49two let's now do the third column so for
- 7:14:54the third column we got First Row 2 * 2
- 7:14:582 * 1 is 2 - 2 * 1 is - 2 and then 4 * 0
- 7:15:02is 0 which means that here we get 0
- 7:15:06because 2 - 2 + 0 is 0 then we got the
- 7:15:12second row and third column which is
- 7:15:15this row and then third Comm so 0 * 1 is
- 7:15:200 4 * 1 is 4 2 * 0 is 0 0 + 4 + 0 is
- 7:15:25four so this is four and then for the
- 7:15:28first row and then fourth coln so it
- 7:15:31means that we need to look at this
- 7:15:32specific column the first row is 2 * 1
- 7:15:38it is 2 - 2 * 1 is - 2 and then 4 * 2 is
- 7:15:438 so 2 - 2 + 8 is
- 7:15:488 and then finally for the second row
- 7:15:51and the fourth column 0 * 1 is 0 4 * 1
- 7:15:55is 4 2 * 2 is 4 4 + 4 is 8
- 7:16:01this is the final Matrix which means
- 7:16:04that this entire amount that we just
- 7:16:06calculated step by step this is equal to
- 7:16:10this Matrix in
- 7:16:13here okay so this is the second element
- 7:16:16let's check whether the first element is
- 7:16:18equal to the first one so we see here 10
- 7:16:2148 142
- 7:16:23248 as you can see we are dealing with
- 7:16:26exactly the same Matrix which proves
- 7:16:30that indeed
- 7:16:32R * a * B is equal to R * a * B so this
- 7:16:36part we have already proven because we
- 7:16:38have seen that 1 is equal to
- 7:16:412 perfect so the only thing that is
- 7:16:43remaining is to calculate this third
- 7:16:45part and to see whether this is equal to
- 7:16:49this matrices because we have seen that
- 7:16:52the two of those are equal so the
- 7:16:55remaining thing that is left to prove
- 7:16:57this theorem is to calculate this third
- 7:16:58part let's go ahead and do that
- 7:17:06that so the third element says let's
- 7:17:09first calculate the r * B and then
- 7:17:11multiply it by a so we need to
- 7:17:14calculate
- 7:17:16b r *
- 7:17:19B * a this is what we need to calculate
- 7:17:22which means first we need to calculate
- 7:17:24this and then we need to can calculate
- 7:17:26the entire thing all right so let's go
- 7:17:29ahead and do that
- 7:17:33so R * B is equal
- 7:17:43to so we need to multiply each of the
- 7:17:47elements of B by two so we end up with
- 7:17:50this Matrix
- 7:17:532 0 2 2 and then 2 * 2 is 4 2 * 0 is 0
- 7:18:01and then 2 2 and then 2 * 3 is 6 2 * 1
- 7:18:06is 2 2 * 0 is 0 2 * 2 is four this is
- 7:18:11that first Matrix let's now go ahead and
- 7:18:15calculate the second part which is a *
- 7:18:19Matrix a so it
- 7:18:22is 1 - 1 2 and then 0 2 and then 1
- 7:18:32multiplied by this Matrix which is 2 4 6
- 7:18:370 0 2 and then 2 two 0 and then 2 2
- 7:18:444 okay
- 7:18:46perfect so this is then what we need to
- 7:18:50calculate well this is 3 * 4 this is 2 *
- 7:18:543 which means the result should be 2 * 4
- 7:18:58let's go ahead and do those calcul
- 7:19:09ations this first amount will be the
- 7:19:13first row and the First Column
- 7:19:15dotproduct of those which means 1 * 2 is
- 7:19:182 -1 * 4 is - 4 and then 2 * 6 is 12 so
- 7:19:25here we got 2 - 4 + 12 and what is this
- 7:19:31amount well 2 - 4 is - 2 12 - 2 is = to
- 7:19:4010 so this one this element is
- 7:19:4410 then for the second show we need to
- 7:19:46look in here so 0 2 one and the
- 7:19:49dotproduct of the one with the First
- 7:19:51Column so this
- 7:19:54thing and that is 0 * 2 is 0 2 * 4 is 8
- 7:19:59and then 1 * 6 is 6 so what is 8 + 6
- 7:20:06that is
- 7:20:0814 and then for the first row and then
- 7:20:11the second column we need to look to
- 7:20:16the first row in here and then the
- 7:20:19second column in here and the dotproduct
- 7:20:21of the two well 1 * 0 is 0 Min - 1 * 0
- 7:20:25is 0 and then 2 * 2 is four so that's
- 7:20:28what we are left with four
- 7:20:31and then for the second row and then the
- 7:20:35second column so this element we
- 7:20:38got 0 * 0 is 0 2 * 0 is 0 1 * 2 is
- 7:20:462 for the first row and the third column
- 7:20:51so we need to look in
- 7:20:55here 1 * 2 is 2 - 1 * 2 is - 2 and then
- 7:21:012 * 0 is 0 so we are left with
- 7:21:06zero 0 and then once we do the
- 7:21:10calculation for the second row we will
- 7:21:11see that we end up with 0 * 2 is 0 2 * 2
- 7:21:15is 4 and then 1 * 0 is 0 so we end up
- 7:21:20with four and then here for the final
- 7:21:26column 1 * 2 is 2 - 1 * 2 is - 2 and
- 7:21:32then 2 * 4 is 8 the first two cancel out
- 7:21:36and we end up with 8 and then for the
- 7:21:39second row and the fourth column we look
- 7:21:41into here again this time the second row
- 7:21:440 * 2 is 0 2 * 2 is 4 and 1 * 4 is 4 and
- 7:21:50then 4 + 4 is
- 7:21:518 so if we look in here this is our
- 7:21:55third amount we will quickly see that
- 7:21:59again we have the same Matrix with
- 7:22:02exactly the same elements so now we have
- 7:22:05also proved this third part and we have
- 7:22:08seen that in all cases the r * a * B is
- 7:22:12equal to R * a * B is equal to a * R * B
- 7:22:17now we are ready to move on towards the
- 7:22:19second module in this unit which is
- 7:22:21about the determinants and their
- 7:22:23properties we are going to look into the
- 7:22:26uh determinants at high level we are
- 7:22:28going to Define them and going to
- 7:22:30understand what why they matter and why
- 7:22:31they are important then we are going to
- 7:22:34see how we can calculate the
- 7:22:35determinants we are going to see the
- 7:22:38calculation for 2x two Matrix then 3x3
- 7:22:41Matrix and then just in general how we
- 7:22:43can do it and then we are going to see
- 7:22:46the properties of determinants one by
- 7:22:48one and then finally we are going to see
- 7:22:50the determinants interpretation from the
- 7:22:52geometric perspective so when we
- 7:22:54visualize it using
- 7:22:57python so by definition the determinant
- 7:23:00is a scalar value that can be computed
- 7:23:03from the elements of a square
- 7:23:06Matrix so this important Square Matrix
- 7:23:09and encodes certain properties of the
- 7:23:12Matrix so the determinant provides a
- 7:23:15critical information about The Matrix
- 7:23:17such as whether it's
- 7:23:19invertible and the volume scaling factor
- 7:23:24for the linear transformation it
- 7:23:26represents so we see that the uh concept
- 7:23:29of theer detent is highly related to
- 7:23:33many other concept that we have seen
- 7:23:34before so first here it's talking about
- 7:23:36the square Matrix then it's talking
- 7:23:38about encoding certain properties so
- 7:23:41having the determinant it contains
- 7:23:43certain information that um is related
- 7:23:46to the properties of the system that
- 7:23:50that Matrix is representing and then it
- 7:23:53provides critical information about the
- 7:23:55underlying metrix because the
- 7:23:57determinant is calculated from Matrix we
- 7:24:01say the determinant of a matrix so it
- 7:24:03contains a critical information about
- 7:24:05that Matrix such as whether it's
- 7:24:07invertible or not and this goes back to
- 7:24:09the concept of inverse we will see this
- 7:24:12once we learn the concept of determinant
- 7:24:14because the inverse calculation is
- 7:24:16dependent on the
- 7:24:18determinant but keep this thing in mind
- 7:24:21that the determinant contains
- 7:24:23information whether we can get um
- 7:24:26inverse from a matrix or not we will see
- 7:24:29this concept over also in detail in the
- 7:24:32next section but for now we can remember
- 7:24:35that the determinant contains important
- 7:24:37information related to the invertibility
- 7:24:40of the Matrix so having an inverse or
- 7:24:42not and then it also contains
- 7:24:44information about the volume scaling
- 7:24:46factor for the linear transformation it
- 7:24:50represents so here we then go back to
- 7:24:52this concept of a x is equal to B and
- 7:24:55then knowing the determinant we can then
- 7:24:58comment on this volume scaling factor
- 7:25:02for this linear transformation that it
- 7:25:04represents so let's go uh on to the next
- 7:25:08slide to find out bit more about the
- 7:25:11determinants and specifically how we can
- 7:25:13calculate the determinant in the
- 7:25:15mathematical terms when it comes to the
- 7:25:172x two Matrix because the uh determinant
- 7:25:22of a 2X two Matrix is quite
- 7:25:24straightforward so for 2x2 matrix a with
- 7:25:28this elements where a b c and d they are
- 7:25:32all real
- 7:25:35numbers the
- 7:25:37determinant which we Define by this de a
- 7:25:41so that is a short way of saying
- 7:25:43determinant and then in here we always
- 7:25:45write the Matrix of which we are
- 7:25:47Computing the determinant is then equal
- 7:25:50to and then we are taking this a * D so
- 7:25:54we are taking this diagonal elements a *
- 7:25:59d so they are on the diagonal and then
- 7:26:02we are subtracting from this this other
- 7:26:05two the remaining two
- 7:26:08elements of the diagonal so B * C and
- 7:26:14this gives us the determinant of 2x2
- 7:26:17matrix this is just a formula that you
- 7:26:20need to uh remember whenever you want to
- 7:26:22calculate the determinant of a matric by
- 7:26:25hand
- 7:26:26manually so the calculation for larger
- 7:26:29matrices it involves bit more uh
- 7:26:32difficult uh calculation we will see
- 7:26:35also in a bit the uh determinant of a
- 7:26:383X3 Matrix It relies on the determinant
- 7:26:40of a 2X two Matrix and the idea is that
- 7:26:44every time we uh increase the dimension
- 7:26:46of our problem so let's say we are in R4
- 7:26:49then we will go back to the R3 and then
- 7:26:51given that R3 relies on the determinant
- 7:26:54of the underlying 2x two matrices
- 7:26:56anytime we increase the dimension we
- 7:26:58again go back to this IDE of using 2 by
- 7:27:01two matrices that form the entire Matrix
- 7:27:03in order to compute the determinant only
- 7:27:06when it is R4 R5 Etc so it becomes much
- 7:27:10more difficult to describe and to do it
- 7:27:12manually therefore there are other
- 7:27:14algorithms which we will see at the end
- 7:27:16of this course like uh the composition
- 7:27:19algorithms and factorization algorithms
- 7:27:21that can be used in order to calculate
- 7:27:23the determent of a matrix that has
- 7:27:25higher Dimension higher than the tree
- 7:27:27for instance but in this specific unit
- 7:27:30we are going to discuss both the
- 7:27:32calculation of the 2x two matrices
- 7:27:33determinant and the determinant of a 3X3
- 7:27:36matrices and we will also see detailed
- 7:27:38examples of
- 7:27:40them so without further Ado let's then
- 7:27:42go ahead and calculate the determinant
- 7:27:45of this 2x2 matrix so let's now look
- 7:27:47into this specific example where we are
- 7:27:49calculating the determinant of this 2x2
- 7:27:51matrix so this is the A and let's keep
- 7:27:55in mind that this is the um uh a this is
- 7:27:59the
- 7:28:00uh B in this not in this uh way of
- 7:28:05writing the Matrix a so the uh letters
- 7:28:08corresponding of the uh elements of this
- 7:28:11Matrix a so this is the a this is the
- 7:28:13B and then this is the C this is the D
- 7:28:17and we said that the
- 7:28:19determinant
- 7:28:21that of a is equal to the diagonal
- 7:28:26elements so 1 * 4
- 7:28:31minus the of diagonal Elements which is
- 7:28:362x3 because we said that the definition
- 7:28:41of
- 7:28:43this determinant is that is equal to a *
- 7:28:47D and then minus B * C which is exactly
- 7:28:51what we are doing in here so if we
- 7:28:54calculate 1 * 4 is = to 4 and then 2 * 3
- 7:28:57is = 6 4 - 6 is = to - 2 therefore we
- 7:29:01say that the
- 7:29:03determinant of Matrix a is equal to Min
- 7:29:07- 2 let's now go ahead and uh practice
- 7:29:11with calculation of determinants on two
- 7:29:14other matrices so in this case we are
- 7:29:16still in the two dimensional space so we
- 7:29:19have 2 by two matrices we'll first
- 7:29:22calculate the the determinant for Matrix
- 7:29:24a so we see that we got this element
- 7:29:285061 and we know that by definition the
- 7:29:32determinant of the 2x two Matrix so that
- 7:29:36of
- 7:29:38Matrix is equal
- 7:29:41to a * d - B * C where the
- 7:29:50Matrix has the following form so we got
- 7:29:53a and then D in here and then B and the
- 7:29:56C in here so we see that this is basic
- 7:29:59Bally our a this is our D this is our B
- 7:30:04and this our C the way you can also said
- 7:30:08is that those are the diagonal elements
- 7:30:12and those are the of diagonal
- 7:30:16elements so therefore it means that we
- 7:30:19can calculate the
- 7:30:23determinant of Matrix
- 7:30:26a by taking the five multiplying with
- 7:30:31one so it is 5 * 1 minus the off
- 7:30:37diagonal element which is 6 *
- 7:30:400 and this amount is equal to 5 - 0 and
- 7:30:45is equal to 5 let's go ahead and also
- 7:30:48calculate the determinant of Matrix B we
- 7:30:52see here that on the diagonal we have
- 7:30:54this two elements one one and of the
- 7:30:57diagonal elements are both zero
- 7:31:00those two therefore we can calculate the
- 7:31:04determinant of this 2x2 matrix which is
- 7:31:07also sometimes referred as I2 so it is
- 7:31:10the identity Matrix because we got here
- 7:31:13the E1 and then E2 in the two
- 7:31:16dimensional
- 7:31:18space and the determinant of the Matrix
- 7:31:21B using this definition is then equal to
- 7:31:241 * 1 - 0 * 0 so 1 * 1 - 0 *
- 7:31:350 and this is equal to 1 and this is
- 7:31:39actually a special case of determinant
- 7:31:43and later on we will see why it is so
- 7:31:46important to uh have this relationship
- 7:31:49of identity Matrix having a determinant
- 7:31:52and having it equal to one um and this
- 7:31:56relationship between determinant
- 7:31:57identity Matrix is something that we see
- 7:31:59so uh in the upcoming lesson so keep
- 7:32:02this one in mind so now when we are
- 7:32:04clear on how we can calculate the
- 7:32:06determinant for 2 by2 Matrix so this is
- 7:32:09quite simple and straightforward
- 7:32:10calculation by taking the diagonal
- 7:32:13elements a and then D and then
- 7:32:16subtracting from that from that product
- 7:32:18a * C we are subtracting the off
- 7:32:20diagonal elements products B * C we can
- 7:32:23then get our determinant and now when we
- 7:32:26are clear on that we are ready to go on
- 7:32:28to bit more Advanced calculations which
- 7:32:31is calculating the determinant this time
- 7:32:34for the 3X3 Matrix so now we increase
- 7:32:38the um the dimension size and we go from
- 7:32:42R2 to
- 7:32:45R3 because now we have a 3X3 Matrix and
- 7:32:49by definition given a 3X3 Matrix a which
- 7:32:53has the following elements so a11 a21
- 7:32:57a31 and then a12 a32 a 32 so we have
- 7:33:01already seen this coefficient labeling
- 7:33:03this should look very familiar this is
- 7:33:053x3 Matrix 2 and the determinant of a
- 7:33:09matrix a denoted as that a is calculated
- 7:33:13using the formula and here we see the
- 7:33:17formula we are basically using the 2x
- 7:33:22two matrices that form this Matrix a in
- 7:33:27order to calculate the determinant of
- 7:33:29the 3X3 Matrix and how we are doing that
- 7:33:33well we are using this element and then
- 7:33:37this element and this element and every
- 7:33:40time we are
- 7:33:44hiding part of the Matrix so when we
- 7:33:48have for instance this a11 so for this
- 7:33:51first part we are saying well let's hide
- 7:33:57the row and the column
- 7:34:00corresponding to this
- 7:34:02element which means that we need to hide
- 7:34:06this this row and this column and what
- 7:34:11is left is this 2x two
- 7:34:13Matrix we will calculate the determinant
- 7:34:16of this 2x2 matrix and we will multiply
- 7:34:19this with this element that we use in
- 7:34:21order to remove the corresponding row
- 7:34:24and
- 7:34:26column this will form the first element
- 7:34:29in here
- 7:34:30so you can see a11 which is a simple
- 7:34:34value so this is the um uh entry volume
- 7:34:39which is in the first draw and First
- 7:34:41Column a11 multiplied by the determinant
- 7:34:45of this Matrix so this
- 7:34:50Matrix so once we have that and we
- 7:34:53already know how we can calculate a
- 7:34:56determinant of a 2X two Matrix because
- 7:34:59this 2X two so taking the diagonal
- 7:35:01elements and then multiplying them
- 7:35:03together subtracting from that the of
- 7:35:05diagonal elements product now we are
- 7:35:07ready to go on to the next part of the
- 7:35:11calculation which is this time adding a
- 7:35:13minus here so you can see here this here
- 7:35:16is plus and then here is
- 7:35:19minus so we do here
- 7:35:23minus and for this second step what we
- 7:35:27need to do is kind of similar only this
- 7:35:29time
- 7:35:30the element that we will be using to
- 7:35:33understand how we can remove the row and
- 7:35:35the column so we will then dark it out
- 7:35:37it is this
- 7:35:39one
- 7:35:41a12 so then we will need to remove this
- 7:35:44column and this row and then the
- 7:35:47remaining Matrix which
- 7:35:50is this one this 2x two and here I mean
- 7:35:54a
- 7:35:5621 a 31 and then a a
- 7:36:0023 and then
- 7:36:03a33 this is the Matrix that you can see
- 7:36:06in here remaining which means remove
- 7:36:08this
- 7:36:09one and then this one and then the
- 7:36:12remaining 2 by two Matrix is what you
- 7:36:15need to use in order to do your
- 7:36:18calculations so you can see that I got
- 7:36:21exactly the same in here and once again
- 7:36:24we are Computing the determinant of this
- 7:36:27Matrix we are multiplying this with this
- 7:36:29a want to element so this
- 7:36:31element and now we have also the second
- 7:36:34element in our
- 7:36:36calculation and then we go on to the
- 7:36:39next step which is a plus sign here let
- 7:36:42me use the same colors plus sign here
- 7:36:45and then we are using this time our
- 7:36:47final third
- 7:36:50element to understand which row and
- 7:36:53which car we need to dark out which
- 7:36:56is this
- 7:36:57element so we then remove the first row
- 7:37:01and the last column and this is then the
- 7:37:04Matrix the 2x two Matrix that we use in
- 7:37:07order to do our calculation so deter the
- 7:37:09determinant of this Matrix multiplied by
- 7:37:11the
- 7:37:13a13 so we could also use in the same
- 7:37:17manner this row or this row it really
- 7:37:20depends on the kind of values the the
- 7:37:23tip that um I will provide to you or the
- 7:37:25trick is that to always look for these z
- 7:37:28z values wherever I see Z zos or I see
- 7:37:31one one I'm thinking that hey those s u
- 7:37:35values that um give me the more
- 7:37:38straightforward and easy calculations
- 7:37:41because if I have zeros in my Cal in my
- 7:37:46entry so if I got a zero here for
- 7:37:48instance 0 times any determinant is zero
- 7:37:52I don't even then need to calculate the
- 7:37:54determinant right because then I know
- 7:37:56that I'm multiplying that determinant
- 7:37:58with zero therefore if I know that that
- 7:38:01entry for instance this row contains the
- 7:38:03majority uh of zero so it is 0 01 then
- 7:38:07of course it's a great uh row to pick to
- 7:38:10use these Target
- 7:38:12elements so in that way I will then know
- 7:38:15that this is the row that I need to
- 7:38:16Target but if it is like that that for
- 7:38:19instance I got a matrix 10 3 4 and here
- 7:38:23I got 0 1 Zer and here I have 100 three
- 7:38:27and four of of course the easiest thing
- 7:38:30would be to not use this row but instead
- 7:38:34use this one so in that case I will then
- 7:38:37have this zero and zero as my target
- 7:38:40values which means that I will only need
- 7:38:42to calculate the determinant of a 2x2
- 7:38:45matrix this uh for this one for the two
- 7:38:49cases I don't need to do it because I
- 7:38:50know that the corresponding Target
- 7:38:53values the target elements from my
- 7:38:55Matrix will be zero so let me show you
- 7:38:58what I mean by that so if for instance I
- 7:39:02go for this second row and not the first
- 7:39:06one what I need to do is that I can
- 7:39:09calculate the determinant of a by taking
- 7:39:13the
- 7:39:15a21 this then will be my target I will
- 7:39:18then need to remove this uh column and
- 7:39:22this row then I will need to do the
- 7:39:25determinant of A1 2 A1 3 a 3 2
- 7:39:33a33 this is what then I need to do then
- 7:39:37the next thing I need to do is of course
- 7:39:40here I have a plus here I need to do
- 7:39:42minus because we always need to
- 7:39:44Interchange the values so here is a plus
- 7:39:46here is a minus here is a plus so I do
- 7:39:49PL a minus in here then I
- 7:39:52do the next element in my row which is
- 7:39:55this
- 7:39:56one let me use red color so a22 so I'm
- 7:40:01then doing a 22 multiply the determinant
- 7:40:07of so I'm re removing this row and this
- 7:40:10column A1 1
- 7:40:14a13 and then
- 7:40:16a31
- 7:40:20a33 and then the final part is of course
- 7:40:23as you might have already guessed is to
- 7:40:24look into this element so it is
- 7:40:31plus
- 7:40:33a23
- 7:40:35multiplied the determinant of let me
- 7:40:38actually write it down in here the
- 7:40:41determinant of
- 7:40:43a11 a12 and then a31 and then
- 7:40:50a32 so in this way basically independent
- 7:40:54of what row I
- 7:40:57will take as my leading row that I will
- 7:41:01do my calculations and I will just need
- 7:41:03to pick one row I can always get the
- 7:41:06same value for determinant of a but
- 7:41:09choosing intelligently which row to
- 7:41:12pick it will save you a lot of time and
- 7:41:15headache in terms of calculations
- 7:41:17because if you are dealing with a row
- 7:41:20that contains many zeros for instance
- 7:41:22you have 0 0 one or one 0 0 or even
- 7:41:27better 00 0 then you know know
- 7:41:29automatically that you will need to
- 7:41:31calculate your DET the determinant once
- 7:41:34here also once and here you don't even
- 7:41:36need to calculate it you know that you
- 7:41:38got zero here Z here zero here so it's
- 7:41:40automatically equal to zero so I hope
- 7:41:43this makes sense because this is a trick
- 7:41:45that usually you will not come across
- 7:41:47but this just helps you to save a lot of
- 7:41:49time uh when it comes to calculation of
- 7:41:51your determinants in a tree by3
- 7:41:54settings so in this case uh we have this
- 7:41:58um we now we have this definition and we
- 7:42:01know the tricks that we can use but I
- 7:42:03think it's really uh helpful to go ahead
- 7:42:06and to solve a problem so basically this
- 7:42:10is the higher level summary of the steps
- 7:42:12that we just discussed um so the
- 7:42:14determinant of a 3X3 Matrix it simply
- 7:42:16involves multiplying the a11 by the
- 7:42:21determinant of the 2x2 matrix that that
- 7:42:24remains after excluding the row and
- 7:42:26column of a11 so what we did in here by
- 7:42:30doing this and subtracting the product
- 7:42:33of A1 2 and the determinant of its
- 7:42:36respective 2 two Matrix so this
- 7:42:40part and then adding the product of a13
- 7:42:43and the determinant of its respective 2x
- 7:42:46two Matrix so this part and the signs
- 7:42:50alternate so it means first you always
- 7:42:53got the
- 7:42:57plus then you always is get the minus
- 7:43:00and then the
- 7:43:04plus so they interchange you start with
- 7:43:07plus then you do the minus and then the
- 7:43:17plus so let's go ahead and calculate the
- 7:43:20determinant of this
- 7:43:22Matrix so before even looking at the
- 7:43:25answer let's actually go ahead and do
- 7:43:28that on this page paper so we got a
- 7:43:32matrix a which is equal to 1 2 3 4 so
- 7:43:37basically from 1 till 9 1 2 3 4 6
- 7:43:434 5 6 and then 7 8 9 and for this 3x3
- 7:43:51Matrix we need to calculate the
- 7:43:53determinant so the determinant of a the
- 7:43:57first thing that I'm seeing is that
- 7:43:58there are no no rows with zeros or
- 7:44:00columns which means that I cannot use my
- 7:44:02uh trick and instead I will just need to
- 7:44:05go with let's say the first dra and it's
- 7:44:08also convenient given that I got as
- 7:44:10scaler this values this much smaller
- 7:44:12values relatively to the other
- 7:44:15ones all right so first things first
- 7:44:20let's go ahead and write down that
- 7:44:21formula so the determinant of a is equal
- 7:44:24to first we are going to take this one
- 7:44:28so our one
- 7:44:29one times and then we
- 7:44:32got determinant of and then we
- 7:44:37have this Matrix which is 5 6 8 and
- 7:44:449 this is our remaining Matrix then the
- 7:44:49next thing we need to do is to
- 7:44:51Interchange the size uh the the sign
- 7:44:54which is minus and then we got
- 7:45:06so the remaining Matrix is
- 7:45:14then determinant
- 7:45:19of 4 6
- 7:45:2579 and then
- 7:45:27finally Plus plus three
- 7:45:31times and then determinant
- 7:45:36of what do we
- 7:45:40have well this is the
- 7:45:42target so it is
- 7:45:454 5 7
- 7:45:508 right so let's go and do those
- 7:45:53calculations
- 7:45:54quickly this is equal to 1 * the
- 7:45:57determinant of this is the diagonal
- 7:45:59element so 5
- 7:46:03* it is 5 * 9 - 8 * 6 - 2 * 4 * 6 - 7 *
- 7:46:146 Sorry 4 *
- 7:46:189 so the diagonal elements 4 * 9 - 7 * 6
- 7:46:24and plus three * and then 4 *
- 7:46:318 - 5 *
- 7:46:347 this is equal
- 7:46:36to so 9 * 5 is = 45 8 * 6 is =
- 7:46:4548 then - 2 * 4 * 9 is
- 7:46:4936 7 * 6 is =
- 7:46:5449 7 * 6 is = to
- 7:46:5742 + 3 * 4 * 8 is = 32 - 5 * 7 is = 35
- 7:47:05so this is equal to 1 * - 3 - 2 * and
- 7:47:10then here we got 36 - 42 so that's - 6 +
- 7:47:173 * -
- 7:47:213 which is that = to - 3 + 12 - 9 which
- 7:47:28which is equal to
- 7:47:31zero so let's check it indeed we got the
- 7:47:36right answer perfect so now when we are
- 7:47:39clear on how we can do this calculation
- 7:47:41let's now go ahead and calculate yet
- 7:47:43another determinant of a 3X3 Matrix and
- 7:47:46this time I want to show you this uh
- 7:47:48simplified version by you making use of
- 7:47:51this trick that I uh specified so
- 7:47:54instead of using this first dra as an
- 7:47:56indicator I will be using the uh second
- 7:47:59row as my indicator one thing to keep in
- 7:48:03mind when making use of this trick is
- 7:48:05that when you start from the second row
- 7:48:10so from the even
- 7:48:13rows even
- 7:48:15rows second fourth or sixth then in
- 7:48:19those cases you need to flip the signs
- 7:48:22that you will be using so while in here
- 7:48:26you had Des Sign Plus
- 7:48:29in the beginning then you got a minus
- 7:48:31and then a plus when doing all these
- 7:48:33calculations so you remember here we got
- 7:48:36plus minus plus when you start from the
- 7:48:40second row instead of first one you need
- 7:48:42to flip the order of this so you need to
- 7:48:45start with minus you have minus you got
- 7:48:47plus and then
- 7:48:49minus so knowing this trick it also
- 7:48:52means that you go One Step Beyond and
- 7:48:55you know how you need to intelligent
- 7:48:58ently uh reduce the time that you are
- 7:49:01spending on calculation calculation of
- 7:49:04the determinant but it also means that
- 7:49:06you need to be careful on knowing what
- 7:49:09kind of signs you need to use because if
- 7:49:11you start from the first row you start
- 7:49:14with plus and then you do minus plus
- 7:49:16minus plus so knowing how to start you
- 7:49:19already know how you can go on but when
- 7:49:21it comes to the second row so the even
- 7:49:24rows you need to start with a minus so
- 7:49:26you need to do minus plus minus plus dot
- 7:49:29dot
- 7:49:30dot all right so let's now go ahead and
- 7:49:33use that technique in
- 7:49:36here so here I see that my first row
- 7:49:39doesn't contain zeros but my second row
- 7:49:41does so this gives me indication that I
- 7:49:44can reduce the time that I spent on
- 7:49:46calculating the determinant at least one
- 7:49:48time because I didn't no longer need to
- 7:49:51calculate that
- 7:49:52determinant so the determinant of B is
- 7:49:56then equals you I will then start with
- 7:49:59minus given that I'm going to use this
- 7:50:01rope and then I have zero times
- 7:50:05so because this is my element the
- 7:50:10determinant the determinant of
- 7:50:152306 and then
- 7:50:20plus then this time the second element
- 7:50:24Target element is this one so it's four
- 7:50:31times and then we
- 7:50:33got determinant of 1 3 1 6 and then
- 7:50:42minus the five
- 7:50:48times so this
- 7:50:52five determinant of 1 2 1 0
- 7:50:59and what is this amount it is equal to
- 7:51:02this I don't need to calculate because I
- 7:51:05got a zero in here this this trick is
- 7:51:07all about this to not calculate the
- 7:51:09determinant too often and
- 7:51:13then this equals you four
- 7:51:18times four times determinant of this is
- 7:51:226 - 3 so 1 * 6 - 1 * 3 which is equal to
- 7:51:283
- 7:51:32and then
- 7:51:37minus 5
- 7:51:39* determinant of 1 2 1 0 which is 0 - 2
- 7:51:49so this equal to 4 * 32 - 5 * - 2 which
- 7:51:55is equal to 12 + 10 and this is equal to
- 7:51:5922 let's go ahead and check this and
- 7:52:02this is the more detailed and formal
- 7:52:05derivation so one uh interesting thing
- 7:52:08is that I calculated with my second row
- 7:52:11and in here in this slides you can see
- 7:52:13calculation with the first dra this is
- 7:52:15just a nice way of seeing the difference
- 7:52:17that you can do and here uh in this
- 7:52:20solution what we have is that we have
- 7:52:22manually calculated this first
- 7:52:24determinant too so in total three
- 7:52:26determinants but we again in end up with
- 7:52:29the same determinant so independ what
- 7:52:31kind of row you will use in order to
- 7:52:33calculate your uh determinant of Matrix
- 7:52:36B you will all always end up with the um
- 7:52:39with the same similar volume unless you
- 7:52:42have made a mistake in your calculations
- 7:52:45so you just need to keep track of the uh
- 7:52:47rows that contain many zeros and you
- 7:52:50need to um be careful in terms of the
- 7:52:53signs that you need to use and the sign
- 7:52:56that you will need to start if you start
- 7:52:58with the first row then start with plus
- 7:53:00if you start with the second row then it
- 7:53:02is minus and then plus Etc so as you can
- 7:53:05see here it's a plus and then minus and
- 7:53:08then Plus in my case I did with my
- 7:53:10second row therefore I started with
- 7:53:14minus all right so let's now move on to
- 7:53:17the properties of determinants so the
- 7:53:20determinant of an identity Matrix is one
- 7:53:23that's something that we have also seen
- 7:53:25when doing our calculations because we
- 7:53:28are so that in one specific case when we
- 7:53:30had this example so this Matrix B and
- 7:53:34the Matrix B was the identity 2 in the
- 7:53:36two dimensional space we have calculated
- 7:53:39its determinant and we saw that it's
- 7:53:41equal to one and this was not a
- 7:53:42coincidence because the determinant of
- 7:53:45identity matrices is always equal to
- 7:53:49one then the second property is that
- 7:53:52swapping two rows or Columns of a matrix
- 7:53:55changes the sign of its
- 7:53:57determinant so if you swap rows or
- 7:54:00columns in your Matrix so if you end up
- 7:54:04with Matrix A and B they are exactly the
- 7:54:06same only one swaps the two columns or
- 7:54:10two rows then you are changing the
- 7:54:12determinant of that Matrix uh the sign
- 7:54:16of that determinant but not devalue
- 7:54:18itself it means that if you got a and
- 7:54:20you got B and your a is equal to let's
- 7:54:25say uh A1 and then uh A2 and then A3 so
- 7:54:31it contains these
- 7:54:33columns and then Matrix
- 7:54:37B is equal to um let's say
- 7:54:43A2 and then
- 7:54:45A1
- 7:54:47A3 then the
- 7:54:51determinant determinant of a will be
- 7:54:55equal to minus of the determinant of B
- 7:55:00you can also say determinant of B will
- 7:55:03then be equal to the minus determinant
- 7:55:07of a this is basically the idea of this
- 7:55:11property let's now move on to the third
- 7:55:14property which says that if a matrix has
- 7:55:17a row or a column of zeros its
- 7:55:19determinant is zero
- 7:55:23so if you got a matrix a that contains
- 7:55:27this different values a11 H1 dot dot dot
- 7:55:31a and uh M1 and then here you got
- 7:55:35suddenly um column that contains all
- 7:55:38zeros and then the rest are nonzero even
- 7:55:41so in that
- 7:55:44case you know that your
- 7:55:47determinant is equal to
- 7:55:50zero so for a specific
- 7:55:54example if you got for instance Matrix 1
- 7:55:592 0 0 0 3 13
- 7:56:04then the determinant of this Matrix is
- 7:56:08equal to
- 7:56:09zero and
- 7:56:12otherwise if you got a matrix B that has
- 7:56:17a column of zeros so column that is
- 7:56:20entirely of
- 7:56:22zeros so let's say here we have 1 one
- 7:56:25one and we have a zero Vector here so we
- 7:56:29got in here 0 0 0 and then 3 4 five then
- 7:56:34given that we have here this zero Vector
- 7:56:38then the determinant of Matrix
- 7:56:43B is equal to zero and this actually
- 7:56:47straightforward to be seen from this
- 7:56:50calculations that we saw because if you
- 7:56:52do the uh if you pick this specific row
- 7:56:56and then you do zero times the ter DET
- 7:56:58minant of the remaining Matrix 0 times
- 7:57:00determinant of the other Matrix and then
- 7:57:03plus so PL and then so minus and then
- 7:57:06plus and then minus 0 * determinant of
- 7:57:09the third
- 7:57:10Matrix it is obvious that 0 * a
- 7:57:13determinant is 0 0 * determinant is z 0
- 7:57:15* determinant is zero which means that
- 7:57:17you got a whole bunch of zeros to be
- 7:57:20added to each other or subtracted from
- 7:57:23each other this means that if you have a
- 7:57:25row or a Col with zeros this already
- 7:57:28gives you an idea that your determinant
- 7:57:30is equal to zero you don't even need to
- 7:57:32do
- 7:57:34calculations so the final property of
- 7:57:38determinants is that if a determinant of
- 7:57:40a product of matrices equals the product
- 7:57:43of their determinants so the
- 7:57:47determinant determinant of a b is equal
- 7:57:51to determinant of a multip by
- 7:57:55determinant of B this is basically what
- 7:57:57this property is
- 7:58:00about so let's quickly go through
- 7:58:02examples to ensure that we are at the
- 7:58:03same page with all these properties and
- 7:58:05we can prove them so let's say we have
- 7:58:09an identity
- 7:58:12Matrix n by n which is we are dealing
- 7:58:15with I in now according to this first
- 7:58:21property when we
- 7:58:24calculate the determinant of this Matrix
- 7:58:27so determinant of i n is equal to
- 7:58:361 Let's actually look at a specific
- 7:58:38example so here we got um identity um
- 7:58:42Matrix in the two dimensional space in
- 7:58:45the
- 7:58:46R2 and we can quickly calculate the
- 7:58:50determinant of this I2 and we can see
- 7:58:54that it is equal to this diagonal
- 7:58:56element so 1 by one - 0 * U it's
- 7:58:59actually something that we did as part
- 7:59:01of my previous examples so this equal to
- 7:59:051 - Z and is equal to 1 one thing that I
- 7:59:10wanted to show you before moving on to
- 7:59:12the next example about the swapping rows
- 7:59:15is that when we are swapping some of the
- 7:59:18rows or some of the comms or two rows or
- 7:59:20two cars of Matrix a we are referring to
- 7:59:23this matrix by this notation so we add
- 7:59:26this nod in here and we say that that
- 7:59:28this is basically the manipulated
- 7:59:31version of Matrix a so if we have for
- 7:59:33instance Matrix a equals u a b
- 7:59:39and and c and those are
- 7:59:43vectors and then we are
- 7:59:46swapping two of The Columns let's say we
- 7:59:50are swapping this two we get B and then
- 7:59:53a and then
- 7:59:55C then this Matrix will are referring as
- 7:59:58a not this is just an a matter of
- 8:00:01notation and we just learned that as
- 8:00:04part of the properties that the
- 8:00:06determinant of this new
- 8:00:10Matrix is equal to minus the determinant
- 8:00:14of
- 8:00:18a so if a matrix a has a row or column
- 8:00:22of zeros then the determinant of it is
- 8:00:24zero so let's actually quickly look at
- 8:00:27this specific example example in here we
- 8:00:29got a which is uh having a column of
- 8:00:32zeros and another column of B and D
- 8:00:35where B and D are real
- 8:00:39numbers so let's prove that this
- 8:00:41determinant is actually equal to zero so
- 8:00:44the determinant of a 2X two Matrix we
- 8:00:46have already seen is equal to the
- 8:00:48diagonal elements so 0 * D minus the of
- 8:00:54diagonal Elements which is 0 * B 0 * B
- 8:01:01and what is number * 0 is equal to 0 0 -
- 8:01:050 * B is also Z it's equal to Z
- 8:01:08therefore the determinant of a is equal
- 8:01:11to
- 8:01:13Z so when it comes to the uh determinant
- 8:01:16of a product of a matrices let's prove
- 8:01:19that the determinant of a * B is equal
- 8:01:22to the determinant of a times the
- 8:01:25determinant of B so therefore the first
- 8:01:28thing we need to do is to calculate this
- 8:01:30a * B let's quickly go ahead and do that
- 8:01:35so let me add here this um blank
- 8:01:42file so a is equal
- 8:01:46to 1 2 3 and 4 B is equal
- 8:01:51to 5
- 8:01:546
- 8:01:5678 and I I want to prove that the
- 8:01:59determinant of a b is equal to
- 8:02:02determinant of a Time determinant of B
- 8:02:07first I will be calculating this and
- 8:02:09then I will be calculating
- 8:02:11this so for the first one what I need to
- 8:02:17do is that first I need to
- 8:02:19calculate d a * B which is equal to 1 2
- 8:02:253 4
- 8:02:28times 5 6 7
- 8:02:328 and then this is equal 2 should be 2
- 8:02:38by two so first I take this 1 * 5 is 5 2
- 8:02:43* 7 is 14 14 + 5 is
- 8:02:4719 then for this one I need to pick this
- 8:02:51row so 3 * 5 is
- 8:02:5415 and then 4 * 7 is 28
- 8:02:59so 15 + 28 is so there we have 33
- 8:03:0543 so I got here
- 8:03:1643 then I'm going on to the next column
- 8:03:19which is in this
- 8:03:23case 1 * 6 is 6 6 + 6 16 is
- 8:03:2922 and now the second column 3 * 6 is
- 8:03:3418 4 * 8 is 32 and this gives me
- 8:03:4550 all right so now I have the a * B
- 8:03:49then as the next step what I need to do
- 8:03:52is to
- 8:03:53calculate the
- 8:03:55determinant of this a * B which is equal
- 8:04:00to the determinant of this Matrix 19 22
- 8:04:054350 that I just
- 8:04:08calculated and what is this amount the
- 8:04:11diagonal elements 19 * 50 - 43 * 22 19 *
- 8:04:1950 is then equal to
- 8:04:2195 and 43 * 22 is 94 6 which means that
- 8:04:29we end up with four this means that the
- 8:04:32determinant of the a * B is equal to 4
- 8:04:36let's quickly check what are the parts
- 8:04:39of the second amount so for that I need
- 8:04:44to calculate determinant of a which is
- 8:04:46equal to 1 * 4 - 2 * 3 1 * 4 is 4 3 * 2
- 8:04:53is 6 so 4 - 6 is = - 2 determinant of B
- 8:05:00is equal
- 8:05:01to 5 * 8 which is equal to 4T and then 7
- 8:05:06* 6 is equal to 42 and this is equal
- 8:05:11to - 2 and determinant of a *
- 8:05:17determinant of B is equal to - 2 * -2
- 8:05:21which is equal to 4 so we can see that
- 8:05:25now we just provve that the determinant
- 8:05:27of a * B is equal to 4 so we have seen
- 8:05:32that determinant of a is equal to 4 and
- 8:05:37we see that that's exactly the same as
- 8:05:40determinant a * determinant of B which
- 8:05:42is equal to 4 so we have just proven
- 8:05:45that the this equation indeed
- 8:05:51holds so the determinants they are not
- 8:05:54just um some calculations or some
- 8:05:58amounts but they are actually uh
- 8:06:00important concept and their
- 8:06:02interpretation um is highly relevant
- 8:06:05from geometric perspective so the
- 8:06:08terminant have a geometric
- 8:06:10interpretation and the for example the
- 8:06:13terent of a 2X two uh Matrix or 3x3
- 8:06:16Matrix they represent the area in case
- 8:06:20of 2x two or the volume in case of 3x3
- 8:06:24Matrix uh of the parallelogram
- 8:06:28that they are
- 8:06:29forming so uh this is often referred as
- 8:06:33a parallel uh piped um I hope I'm
- 8:06:37pronouncing this correctly and it's
- 8:06:39formed by the con vectors of the Matrix
- 8:06:43so if we have for instance this uh
- 8:06:46Matrix a and then we have a b and then C
- 8:06:48and D we have this A and C which is the
- 8:06:52first vector and then B and D which is
- 8:06:54the second vector and the uh the shoe
- 8:06:58vectors they actually form a
- 8:07:01parallelogram um when it comes to the uh
- 8:07:06two dimensional
- 8:07:07space and the area that this uh
- 8:07:11parallelogram um is
- 8:07:13forming that is equal to the determinant
- 8:07:17of this
- 8:07:18Matrix so the determinant ofer this
- 8:07:21scalar value that summarizes this linear
- 8:07:25transformation that we describe by this
- 8:07:28Matrix because we saw that we had this a
- 8:07:31x is equal to
- 8:07:32B linear system that we were describing
- 8:07:35using this coefficient Matrix and this
- 8:07:37was our unknowns this was our variable
- 8:07:42and then this B was the um amount that
- 8:07:46we were uh putting this as equal to if B
- 8:07:48was equal to zero then we were solving
- 8:07:50the homogeneous system otherwise we had
- 8:07:52this non-homogeneous system and in the
- 8:07:54geometric terms the determinant of this
- 8:07:57Matrix
- 8:07:57a so the determinant of a um in case of
- 8:08:022x two space so in
- 8:08:06R2 um when we got two vectors
- 8:08:09basically in our Matrix a this is equal
- 8:08:13to the area that is spent by these
- 8:08:16vectors in the two dimensional space in
- 8:08:18a bit I will also show you specific
- 8:08:20example such that um we will be on the
- 8:08:23same page when it comes to this concept
- 8:08:25of parallelogram the deter determinant
- 8:08:28and those vectors that form the column
- 8:08:31um uh space of the uh Matrix a uh when
- 8:08:36it comes to the three dimensional space
- 8:08:37when we have R3 so we got 3x3 Matrix of
- 8:08:43a then the determinant of this Matrix a
- 8:08:48is the volume that is um formed by these
- 8:08:52uh threedimensional vectors because
- 8:08:55unlike the 2D
- 8:09:00in R3 we got the three vectors that form
- 8:09:03the a let's say this one this one and
- 8:09:07then this one and then here we can
- 8:09:09create this
- 8:09:11area covered by this Tre vectors and the
- 8:09:14area that is formed by the tree vectors
- 8:09:17from a it is equal to the determinant of
- 8:09:21that Matrix a so in terms of the 3D it's
- 8:09:25bit harder to uh visualize it but in uh
- 8:09:29case of the two-dimensional space I
- 8:09:31think this will help uh to improve our
- 8:09:34understanding of the determinants and
- 8:09:35make this interpretation uh from
- 8:09:38geometry uh from geometrical perspective
- 8:09:41so given the two vectors A and B in the
- 8:09:44two dimensional space the determinant of
- 8:09:46this Matrix uh is then equal to the um
- 8:09:50diagonal elements we already know minus
- 8:09:53the of diagonal elements right so we are
- 8:09:56also saying
- 8:09:59we have seen this notation already very
- 8:10:01often you will see this volume this is
- 8:10:04the absolute we already know this from
- 8:10:06high school this is the absolute volume
- 8:10:09because the determinant can also be a
- 8:10:11negative number we have seen minus 20 or
- 8:10:13minus 2 and we know that the area cannot
- 8:10:17be a negative number therefore we are
- 8:10:19adding this absolute term here so
- 8:10:24knowing for example that we have this m
- 8:10:27matx a which consists of the elements 3
- 8:10:312 and then 1 14 we know that the
- 8:10:34determinant of this a is equal to 3 * 4
- 8:10:4012 - 1 * 2 it is 10 and the absolute
- 8:10:44value of it so absolute value of 10 is
- 8:10:47equal to 10 given that is positive and
- 8:10:49this is exactly what we have here and
- 8:10:52this is referred as the area of the
- 8:10:56parallelogram that the two vectors are
- 8:10:58forming and how does that look like in
- 8:11:02uh the uh coordinate space so this is
- 8:11:04the parallelogram that we were referring
- 8:11:07by and
- 8:11:09this area that is formed by this
- 8:11:13parallelogram is equal to the
- 8:11:16determinant of the
- 8:11:19a The Matrix
- 8:11:25a so so one thing that we need to keep
- 8:11:28in mind is the definition of
- 8:11:30parallelogram which means that those two
- 8:11:31are parallel and they are the same so
- 8:11:34this and this lines those two are the
- 8:11:37same and then of course the same holes
- 8:11:39for those two they are parallel and they
- 8:11:41have the same um length therefore this
- 8:11:46figure in here this is what we are
- 8:11:49referring as
- 8:11:51parallelogram and those two
- 8:11:54vectors that we can see in here
- 8:11:58this one and this one they form this
- 8:12:01parallelogram and they are the two
- 8:12:04vectors that are part of the Matrix
- 8:12:08a hence if we got two vectors that the
- 8:12:12uh that come from The Matrix a so Matrix
- 8:12:15a and we got here this two vectors in a
- 8:12:192X
- 8:12:21two Matrix then the determinant of this
- 8:12:26Matrix is then describing the area that
- 8:12:30these
- 8:12:30two vectors are using or are spanning
- 8:12:35when creating this
- 8:12:39parallelogram so the determinants they
- 8:12:41play an important Ro in understanding
- 8:12:44the geometric properties of the spaces
- 8:12:47that uh spent uh by these vectors they
- 8:12:51provide valuable insights when it comes
- 8:12:53to the scaling effect effect of linear
- 8:12:55transformation the or orientation and
- 8:12:58the um the locations of them in the
- 8:13:02cordan system as well as the Practical
- 8:13:04applications in calculating areas in
- 8:13:06calculating volumes welcome to another
- 8:13:09unit in our fundamentals to linear
- 8:13:11algebra course where we are going to
- 8:13:13talk about Advanced linear algebra
- 8:13:15Concepts so uh in the first module we
- 8:13:18are going to talk about Vector spaces
- 8:13:20and the projections we are going to
- 8:13:23define the bases in a couple of examples
- 8:13:26of them we have already touched upon
- 8:13:28this concept briefly when we are
- 8:13:30calculating the basis of a no space and
- 8:13:33the basis of a comp space we are going
- 8:13:35to do a similar example in this case and
- 8:13:38then we are going to uh look into this
- 8:13:40concept of the uh standard bases for uh
- 8:13:44different spaces including the R2 we're
- 8:13:47going to introduce the concept of
- 8:13:49projections what is the definition of
- 8:13:51projections what is a Formula how we can
- 8:13:54calculate it we are going to look into
- 8:13:55detailed examples of that
- 8:13:58then we are going to talk about the
- 8:13:59concept of uton normal basis in this
- 8:14:01module we are going to introduce this
- 8:14:03concept and we are going to understand
- 8:14:04the orog gonality normalization we are
- 8:14:07going to then discuss a very important
- 8:14:10topic in linear algebra which is a
- 8:14:12gramme process we're going to Define it
- 8:14:15we are going to see the overview the
- 8:14:17step-by-step process of applying grme uh
- 8:14:21algorithm then we are going to see an
- 8:14:23example of it and the calculations step
- 8:14:26by step
- 8:14:27and then we are going to talk about
- 8:14:29applications of auton normal bases the
- 8:14:32application of gram Smiths process and
- 8:14:34the importance of this auton normal
- 8:14:37basis this is the module one of this
- 8:14:41part so let's first Define the basis a
- 8:14:45basis of a vector space is a set of of
- 8:14:48linearly independent vectors that spend
- 8:14:50the entire Vector space every Vector in
- 8:14:54the space can be expressed as a unique
- 8:14:56linear combination of the basis
- 8:15:00vectors so there are a couple of parts
- 8:15:02in this definition they are really
- 8:15:05important and first thing that we need
- 8:15:08to uh mention here is this Vector space
- 8:15:13that says it is a set of linearly
- 8:15:16independent vectors that spend the
- 8:15:18entire Vector space this is very
- 8:15:20important because um here we are with
- 8:15:25the basis is simply this Vector space
- 8:15:30that is a set of linearly independent
- 8:15:33vectors which means that one of these
- 8:15:36vectors cannot be Rewritten as a linear
- 8:15:39combination of the other one so we have
- 8:15:42a linearly independent vectors and they
- 8:15:45span the entire Vector
- 8:15:48space so for instance if we are in
- 8:15:52R2 then the basis of a vector space is
- 8:15:56then a set of linearly independent
- 8:15:58vectors that span this entire
- 8:16:01R2 so we do we then need to
- 8:16:05have for vectors forming a basis so
- 8:16:09let's say we have a basis of vector
- 8:16:15space for us to say that this is the
- 8:16:17basis of this Vector space let's say in
- 8:16:22R2 we need to First
- 8:16:25say we need to First prove that these
- 8:16:30vectors this
- 8:16:34vectors are linearly
- 8:16:39independent and
- 8:16:42two they
- 8:16:45span the entire R2 which means that span
- 8:16:49of this
- 8:16:51vectors is equal to
- 8:16:54R2 we can actually be even more spefic
- 8:16:59specific in a
- 8:17:01example of let's say having a vectors A
- 8:17:06and
- 8:17:07B we can say that this set that we have
- 8:17:11here consisting of vectors A and B in
- 8:17:17R2 form the
- 8:17:20bases of a vector space
- 8:17:28if the first criteria
- 8:17:33is that
- 8:17:35a and b are
- 8:17:41linearly
- 8:17:44independent and the second criteria is
- 8:17:48that those two vectors together they
- 8:17:52spend the entire Vector space of R2
- 8:17:56which means that
- 8:18:00span of a and b Vector space is equal to
- 8:18:07R2 on more specific
- 8:18:11example and then the second part of this
- 8:18:13definition says that every Vector in the
- 8:18:18space can be expressed as a unique
- 8:18:20linear combination of the basis factors
- 8:18:23which means in our specific example when
- 8:18:26we had this A and B forming the bases of
- 8:18:28a vector space this means that if we
- 8:18:31prove that this is indeed the
- 8:18:34basis of this Vector
- 8:18:40space then any
- 8:18:42combination every
- 8:18:45Vector let's say a vector
- 8:18:49C that consists of this C1 and C2
- 8:18:55elements that this Vector this random
- 8:18:58Vector from
- 8:19:01R2
- 8:19:03C can be represented as a linear
- 8:19:07combination of these vectors A and B so
- 8:19:12let's say we have a coefficient
- 8:19:15K1 * a plus K2
- 8:19:20*
- 8:19:22B then here we are representing this
- 8:19:26random Vector c as a linear combination
- 8:19:30of these vectors A and B which form the
- 8:19:33bases of a vector space of this Vector
- 8:19:38space so we have previously spoken about
- 8:19:41the no space and Comm space so let's now
- 8:19:46go ahead and do one more example when we
- 8:19:49are calculating the new space and the
- 8:19:51Comm space and then we are again
- 8:19:54calculating this concept of basis of
- 8:19:56Vector space and a b basis of the com
- 8:19:59space and then we will be uh finding the
- 8:20:02basis of a vector space uh with um R2
- 8:20:06example so given that we have already
- 8:20:10looked into this concept the basis of
- 8:20:12Comm space and based of no space I will
- 8:20:14try to uh go through this example bit
- 8:20:16more quickly to save time on more
- 8:20:18complex
- 8:20:22Concepts so let's say we have an example
- 8:20:26Le of a matrix and that Matrix is a is
- 8:20:31equal to 1 2
- 8:20:3536 this is our 2x two Matrix
- 8:20:39a and the first thing that I want to do
- 8:20:43is to understand look into my Matrix and
- 8:20:46understand whether I'm dealing with
- 8:20:48unique vectors or not and by unique I
- 8:20:51mean whether I'm dealing with two
- 8:20:53vectors that are linearly dependent or
- 8:20:55linearly independent this kind of
- 8:20:58inspection always helps us to save time
- 8:21:01when we are doing our calculation for
- 8:21:03the no space and for the Comm space and
- 8:21:05for the basis of no space and base of
- 8:21:07Comm space now here we can see that this
- 8:21:10is our A1 the first Vector the first com
- 8:21:14Vector forming the Matrix a and this
- 8:21:18Vector is the
- 8:21:20A2 another thing that uh we can notice
- 8:21:23here is that we can easily take the
- 8:21:27First Column A1 multiply it by two and
- 8:21:31get the A2 because 1 * 2 is 2 3 * 2 is 6
- 8:21:37that is that 2
- 8:21:42*
- 8:21:44A1 is equal to
- 8:21:50A2 which means that we can say that A1
- 8:21:57and
- 8:21:57H2
- 8:21:59are
- 8:22:02linearly
- 8:22:06dependent okay so seeing this and
- 8:22:09knowing this this can help us to quickly
- 8:22:11go through our calculations of the bases
- 8:22:14of the co space and the bases of a no
- 8:22:16space so let's go ahead and first
- 8:22:19calculate what is the
- 8:22:22basis of no space
- 8:22:28of
- 8:22:30a so we have already learned that the um
- 8:22:34basis of a no space can be calculated
- 8:22:38when looking into the first no space so
- 8:22:41we C we need to calculate the no space
- 8:22:44and then we need to calculate the basis
- 8:22:46of that no
- 8:22:47space
- 8:22:49so this means that we need to get the
- 8:22:53na and we have learned that in order to
- 8:22:56get
- 8:22:58DNA we for that need to solve the a x is
- 8:23:02equal to zero
- 8:23:04problem and this
- 8:23:10x will give
- 8:23:13us the no space of a we have also
- 8:23:17learned that the no space of a is equal
- 8:23:20to the no space of r r EF of a which
- 8:23:25means that using gausian reduction or
- 8:23:28gausian elimination we can quickly find
- 8:23:31the solution to this problem of a x is
- 8:23:35equal to Z and find this x this is
- 8:23:39simply solving a similar problem only in
- 8:23:41this case the B so this is equal to zero
- 8:23:46because we are dealing with the
- 8:23:49homogeneous
- 8:23:53case I want do the calculation for this
- 8:23:56we have done a ton of examples when we
- 8:23:58were doing this step by-step calculation
- 8:24:01getting the uh argumented Matrix of a
- 8:24:04and then uh doing all these different
- 8:24:06draw operations normalizations and then
- 8:24:09eliminations in order to uh get this uh
- 8:24:13complex Matrix a to the point of uh
- 8:24:16basic representation from which either
- 8:24:18we can visibly see the solution to the
- 8:24:21problem or we can at least simplify it
- 8:24:23and describe it as a linear combination
- 8:24:25of vectors
- 8:24:27in this case if you go ahead and solve
- 8:24:29this problem you will find that the
- 8:24:33x that
- 8:24:35solves the a x is equal to Z
- 8:24:39problem is unique and this x is equal to
- 8:24:44minus
- 8:24:460.894 as the first element and then
- 8:24:500.447 as a second element this can be a
- 8:24:53good practice also to refresh um the
- 8:24:55memory when it comes to the gaion
- 8:24:57elimination and reduction the example
- 8:24:59itself is quite simple the a is just a
- 8:25:022x2 matrix um and um by performing
- 8:25:06couple of operations uh in terms of
- 8:25:08normalization and elimination you can
- 8:25:10find this
- 8:25:12X for your a is equal to
- 8:25:18zero given that now we know what is the
- 8:25:22solution to a is equal to Z problem now
- 8:25:25we know what no space is because in this
- 8:25:28case
- 8:25:29the all this help us to understand that
- 8:25:34the no space of a is then equal to the
- 8:25:38set the vector set where as part of this
- 8:25:42we got just single column which is -
- 8:25:470.894 and
- 8:25:510.447 this is the no space
- 8:25:56this is the first part I will say it
- 8:26:011.1 and then 1.2 will
- 8:26:06be to get the
- 8:26:11basis
- 8:26:13basis of this
- 8:26:16Na and we have just seen what is the
- 8:26:19definition of the bases so the basis of
- 8:26:22vector space is a set of linearly
- 8:26:24independent vectors that spend the
- 8:26:25entire Vector
- 8:26:29space therefore given that we got just
- 8:26:32this single Vector as a solution to our
- 8:26:36problem we can see then very quickly
- 8:26:40that the new space of a is based on this
- 8:26:43and then the basis of the no space is
- 8:26:46simply this entire
- 8:26:48set so knowing what the solution is to
- 8:26:51our homogeneous problem a is equal to
- 8:26:55zero so let me also write down in here
- 8:26:58then we know that the no space the N A
- 8:27:03is then equal
- 8:27:072D
- 8:27:09Vector minus
- 8:27:120.894 and
- 8:27:140.447 this is my Vector X that solve
- 8:27:16this ax isal to zero
- 8:27:20problem and this is simply the no space
- 8:27:23of a and given that we
- 8:27:27have calculated and we have got this
- 8:27:30unique solution to our problem we can
- 8:27:34say that any Vector in R2 can be
- 8:27:37represented as a linear combination of
- 8:27:40this
- 8:27:42Vector so
- 8:27:451.2 any
- 8:27:49Vector in
- 8:27:51R2 can be represented
- 8:27:58as linear
- 8:28:00combination
- 8:28:07combination
- 8:28:09of this
- 8:28:13Vector
- 8:28:20X therefore we are saying that the
- 8:28:24bases of of no
- 8:28:29space of
- 8:28:33a is this entire set consisting of the
- 8:28:37single
- 8:28:45Vector so this is about the basis of a
- 8:28:49no space
- 8:28:56let's Now quickly look into the concept
- 8:28:58of the basis of a calm
- 8:29:01space so the first thing we need to then
- 8:29:04uh get is the column
- 8:29:07space
- 8:29:09so to get the
- 8:29:13basis of Comm
- 8:29:19space we need to get the ca first which
- 8:29:22is the Comm space of a and what is the
- 8:29:25Comm c space of a the Comm space of a is
- 8:29:29the uh setle and the space of the
- 8:29:32vectors that we can see in
- 8:29:35here in this A1 and A2 is it's quite
- 8:29:40straightforward so this two vectors they
- 8:29:43form the Comm space of this Matrix
- 8:29:47a so then the ca is
- 8:29:52simply the set of one three
- 8:29:56and then two six vectors this is
- 8:30:00A1 this is
- 8:30:03A2 now we have just seen in the
- 8:30:06beginning before even starting our
- 8:30:08calculations that A1 and A2 are linearly
- 8:30:11dependent because A2 can be right
- 8:30:14written as 2 * A1 so one of these
- 8:30:17vectors can be written as a linear
- 8:30:19combination of the other one this means
- 8:30:21that we got just a single linearly
- 8:30:24independent vectors and why is this
- 8:30:26important because we have seen in the
- 8:30:29definition of the basis that for us to
- 8:30:32have a basis we need to have a linearly
- 8:30:36independent vectors so the basis of
- 8:30:40vector space in this case the Comm space
- 8:30:42is a set of linearly independent vectors
- 8:30:44that need to spend the entire Vector
- 8:30:46space in this case
- 8:30:49R2 so
- 8:30:51therefore we need to look into the ca
- 8:30:54that we got in here and select one of
- 8:30:58these two
- 8:31:00vectors that can be considered as
- 8:31:02linearly independent let's say we pick
- 8:31:05one
- 8:31:07three now we know that we can then write
- 8:31:12any Vector in R2 as a linear combination
- 8:31:16of this Vector 1 3 so we can scale this
- 8:31:20Vector one Tre and get a new Vector in
- 8:31:24R2 therefore or we are saying that the
- 8:31:28basis of Comm space
- 8:31:31basis of Comm
- 8:31:35space
- 8:31:37space of a is then the set of one
- 8:31:44Tre because one Tre so
- 8:31:48A1 is then
- 8:31:50linearly
- 8:31:52independent and the span of
- 8:31:56A1 is
- 8:31:59R2 now when it comes to the uh basis of
- 8:32:03the entire R2 one thing that we can
- 8:32:06notice is that
- 8:32:08this A1 so one
- 8:32:12three it's not forming it's not spanning
- 8:32:14the entire
- 8:32:15R2 because because we cannot uh write
- 8:32:20any random Vector in r two as a linear
- 8:32:23combination of this two therefore we are
- 8:32:25saying that this is the basis of Comm
- 8:32:27space but we are not saying that this is
- 8:32:29the basis of R2 and the final element in
- 8:32:32this definition that I want you to uh
- 8:32:34focus on is that every Vector in the
- 8:32:37space can be expressed as a unique
- 8:32:38linear combination of the basis
- 8:32:41vectors so in here we have looked into
- 8:32:45this idea of bases of a new space and
- 8:32:47the base of Comm space and we saw that
- 8:32:51we are talking about specifically the
- 8:32:53new space and comp space but when it
- 8:32:55comes to the entire space for instance
- 8:32:58the basis for R2 then the basis of Comm
- 8:33:04space for instance is no longer um
- 8:33:07helping us because the basis of Comm
- 8:33:10space it consists of this Vector one
- 8:33:12tree and this one tree alone is not
- 8:33:15satisfying the second criteria that says
- 8:33:18that this Vector needs to spend the
- 8:33:20entire Vector space because this one Tre
- 8:33:25vector it's a single vector and this
- 8:33:29Vector it is not forming the entire R2
- 8:33:34it's not um the basis for R2 it's not
- 8:33:38spinning the entire uh R2 so
- 8:33:43given that the one tree is not
- 8:33:50spinning the entire
- 8:33:54R2 because of that we know that the one
- 8:34:00tree is not the set of one Tre is not
- 8:34:05the
- 8:34:08basis of
- 8:34:10R2 so this distinguishing of the basis
- 8:34:15of R2 basis of Comm space basis of no
- 8:34:18space is really important because basis
- 8:34:21for R2 it means that we need to find set
- 8:34:24of linearly independent vectors that
- 8:34:27they together form the entire R2 they
- 8:34:30span the R2 which means any random
- 8:34:33Vector that we can see in R2 we can
- 8:34:35represent as a linear combination of the
- 8:34:38vectors in this space so in here let me
- 8:34:43also prove that this one tree alone is
- 8:34:46actually not forming the R2 it's not
- 8:34:49spinning the R2 which then uh concludes
- 8:34:52that they are not the it is not the
- 8:34:54basis of R2 CU and after this I will
- 8:34:58then provide you an example where we
- 8:35:01have a set of vectors that span R2 and
- 8:35:05are linearly independent which means
- 8:35:06that they are the bases of the entire R2
- 8:35:10so first I want to show you why this
- 8:35:12single Vector one Tre is not the basis
- 8:35:17of
- 8:35:18R2 so being the base of R2 we have the
- 8:35:22criteria that the vectors need to be
- 8:35:25linearly
- 8:35:31dependent so let me actually clear up
- 8:35:34some space
- 8:35:38here so I want to see and find the basis
- 8:35:41of
- 8:35:45R2 first I want to
- 8:35:47prove that this
- 8:35:50set which is the base of Comm
- 8:35:54space I want to
- 8:35:56prove that this is not the
- 8:36:01basis of
- 8:36:04R2 then I will also as part of the
- 8:36:08second part of this proof look in look
- 8:36:10into the case when we do have vectors
- 8:36:13and the set of vectors it forms the base
- 8:36:16of
- 8:36:17R2 so the first thing the first criteria
- 8:36:21of the basis of R2
- 8:36:23says that quote 1.1 the first criteria
- 8:36:28says that this Vector in this Vector
- 8:36:31space it need to be they need to be
- 8:36:34linearly independent well that criteria
- 8:36:37is valid given that one3 is
- 8:36:43linearly
- 8:36:47independent this means that criteria one
- 8:36:50is satisfied
- 8:36:59so whenever you got just one vector this
- 8:37:01criteria is automatically
- 8:37:03satisfied so then you have the
- 8:37:061.2 which says that we need to have this
- 8:37:10spin of these vectors equal to
- 8:37:14R2
- 8:37:15so is the
- 8:37:17span of
- 8:37:21one3 the R2
- 8:37:29well no and how we can prove that
- 8:37:32because the idea is that any Vector
- 8:37:35including an example where I have for
- 8:37:38instance uh let's say four and five this
- 8:37:42Vector that I need to be able to find a
- 8:37:47scalar that will help me to create a
- 8:37:50linear combination let's say
- 8:37:53C linear combination using this Vector
- 8:37:5713 which will then set this amount this
- 8:38:01to be equal to this which means that I
- 8:38:03need to be able to write my random
- 8:38:07Vector 45 as a linear combination of
- 8:38:09this Vector that forms my uh Vector
- 8:38:14space so let's see whether that is even
- 8:38:17possible well here I got four and
- 8:38:21five if I do this multiplication in the
- 8:38:24right hand side I
- 8:38:26get C and here I got 3
- 8:38:31C because C * 1 is C and 3 * C is
- 8:38:37C and this means that I have an
- 8:38:41equation 4 is equal
- 8:38:44to
- 8:38:46C and 5 is equal
- 8:38:51to 3 * C
- 8:38:57from this I get that the C is equal to 4
- 8:39:01and C is equal to 5 / to
- 8:39:053 but that is impossible because 4 is
- 8:39:09not equal to 5 / to 3 which means that
- 8:39:12I'm proving in here and I got to prove
- 8:39:15that the uh any random chosen Vector 45
- 8:39:20cannot be written as a linear
- 8:39:23combination of this Vector that 4 forms
- 8:39:25this uh space
- 8:39:28therefore as
- 8:39:32random
- 8:39:35Vector from
- 8:39:39R2
- 8:39:41can't be
- 8:39:45written as
- 8:39:48linear
- 8:39:50combination
- 8:39:52of one three
- 8:40:02criteria two is not
- 8:40:11satisfied because for that we had to say
- 8:40:15that this pen of One Tree is equal to R2
- 8:40:19which we saw that it's not the case
- 8:40:21because then we would have been able to
- 8:40:22represent this four five as a linear
- 8:40:24combination of the one Tre Vector okay
- 8:40:27so now we have proven that the one Tre
- 8:40:30is not forming the bases of R2 let's now
- 8:40:33look into what then does form the basis
- 8:40:36of R2 an example of
- 8:40:38it so we are familiar with the unit
- 8:40:42vectors E1 and E2 into
- 8:40:46R2 which form the identity Matrix
- 8:40:51I and this is 1 0 and this is 0 1
- 8:40:55also 1 0 0 1 in the form of a
- 8:41:04matrix so in this example we have a set
- 8:41:10consisting of E1 and
- 8:41:14E2 where this is this E1 this is the
- 8:41:20E2 and the set corresponding to this
- 8:41:23Vector space is then
- 8:41:261 Z and then
- 8:41:3001 and now I will be proving that this
- 8:41:34space this Vector space does
- 8:41:38indeed equal to the bases of
- 8:41:42R2 so this
- 8:41:45is the
- 8:41:47basis of
- 8:41:50R2 so the first
- 8:41:52criteria of the bases is that these two
- 8:41:56vectors should be linearly
- 8:42:00independent now we can quickly uh
- 8:42:02remember from our previous theory that
- 8:42:06the two unit vectors one z01 are
- 8:42:12actually linearly independent that's
- 8:42:13something that we have proven and you
- 8:42:15can easily see it also from here there
- 8:42:18is no way that you can find um scalar
- 8:42:21C that you can multiply this Vector we
- 8:42:25and get a vector 0 one because for that
- 8:42:29for this one to become a zero you need
- 8:42:31to multiply this with zero but then 0 *
- 8:42:340 is not equal to 1 which means that
- 8:42:37there is no way that you can find a
- 8:42:39scaler C to multiply this E1 to get the
- 8:42:44E2 so let me write this down
- 8:42:55E1 and E2 are
- 8:43:00linearly
- 8:43:06independent
- 8:43:09because
- 8:43:11there is
- 8:43:14no scaler
- 8:43:17C which is a real
- 8:43:20number such that
- 8:43:25such
- 8:43:26that c
- 8:43:29*
- 8:43:31E1 is equal to
- 8:43:34Ich
- 8:43:35so this
- 8:43:40means you
- 8:43:43can't
- 8:43:46write hu as linear
- 8:43:51combination of A1
- 8:43:57or vice
- 8:44:01versa this means that E1 and E2 are
- 8:44:06linearly
- 8:44:08independent and this
- 8:44:11satisfies our first
- 8:44:13criteria so
- 8:44:15criteria one is satisfied
- 8:44:27what we have also learned is that any
- 8:44:30Vector in R2 can be actually written as
- 8:44:33a linear combination of a unit vectors
- 8:44:37that form that um
- 8:44:39R2 in this case 1 0 and
- 8:44:4201 so let's assume that this random
- 8:44:47Vector is C1 C2 so this is C vector
- 8:44:55and what we want to prove is that we can
- 8:44:58always write this C in terms of linear
- 8:45:00combination of these two vectors and how
- 8:45:03can we do that
- 8:45:06well let's say here we got a
- 8:45:13K1 K1 which is a real
- 8:45:17number and we multiply this by one
- 8:45:21Z and then we add
- 8:45:29K2
- 8:45:31K2 and then here
- 8:45:3401 so this is our E1 this is our E2 can
- 8:45:38we do this well what is this this is
- 8:45:41equal to K1 0
- 8:45:48plus 0
- 8:45:53K2 and and what does this give
- 8:45:57us
- 8:45:59well this means this
- 8:46:03amount let me write it
- 8:46:06over K1 * 1 which is the E1 plus K2 * 01
- 8:46:14which are which is our second Vector E2
- 8:46:17this is equal to K1
- 8:46:200+ 0 K2 and this is equal to K1
- 8:46:27K2 so I got on one hand this Vector C1
- 8:46:34C2 which I want to write as a linear
- 8:46:39combination of K1 E1 plus K2
- 8:46:46E2 if I take
- 8:46:50D
- 8:46:51K1 equal to C K1 and
- 8:46:57K2 K2 equal
- 8:47:03to
- 8:47:05C2 well then in that case I can prove so
- 8:47:10this is basically equal to C1 and C2
- 8:47:14which means if I take this K1 and K2
- 8:47:16equal to C1 and C2 respectively and
- 8:47:19those numbers are given then I can
- 8:47:22represent this vector
- 8:47:26c as a linear
- 8:47:29combination of
- 8:47:30E1 and
- 8:47:33E2 which is what I had to prove in order
- 8:47:36to say that
- 8:47:39the
- 8:47:41Spen
- 8:47:44of one Z which is the
- 8:47:47E1 and 01 which is
- 8:47:51E2 is equal to R2
- 8:47:55because any random Vector that will be
- 8:47:58provided to me with an element C1 and C2
- 8:48:01and those are just real numbers can be
- 8:48:03written as a linear combination of these
- 8:48:06two vectors this means that the spend of
- 8:48:09these two vectors is equal to
- 8:48:11R2 and this is basically the second
- 8:48:15criteria so
- 8:48:18criteria
- 8:48:20to
- 8:48:21satisfied and if the criteria one and
- 8:48:24criteria 2 are both satisfied it means
- 8:48:29that this Vector
- 8:48:33space of 1 Z and
- 8:48:3901 this is the
- 8:48:42basis of the entire
- 8:48:45R2 so let's now talk about the concept
- 8:48:48of projections by definition a
- 8:48:51projection of a vector a onto another
- 8:48:53Vector B is the orthogonal projection of
- 8:48:57a along B it's denoted by approach and
- 8:49:01then B underneath here we see the index
- 8:49:03and then a so projection of a onto B so
- 8:49:07here is the A and here is the B and
- 8:49:10represents the component of a in the
- 8:49:12direction of
- 8:49:14B so component of a in the direction of
- 8:49:21B all right so in order to properly
- 8:49:24understand this concept the intuition of
- 8:49:26it let's actually make use of the R2
- 8:49:30space so let's first start by picturing
- 8:49:34in our flat world the R2 coordinate so
- 8:49:37the Cartesian coordinate system so let's
- 8:49:40say here we got our y AIS here we got
- 8:49:44our
- 8:49:45x-axis so this is the X this is the
- 8:49:49Y and uh here we of course we need to
- 8:49:54keep in mind this is just an example
- 8:49:56when it comes to projections we can
- 8:49:58always go beyond R2 but for keep it
- 8:50:00simple and truly understand this
- 8:50:02Concepts and this intuition behind the
- 8:50:05projection I want to simplify this and
- 8:50:07do the example in
- 8:50:09R2 so here uh imagine that we got this
- 8:50:15line
- 8:50:17and this is
- 8:50:20our a line that goes through the
- 8:50:23center that let's call this
- 8:50:29line
- 8:50:31B so B is
- 8:50:35line in
- 8:50:37R2 let's say this is that
- 8:50:43line and now that imagine that we have
- 8:50:47this
- 8:50:48Vector which is part of this
- 8:50:52line let's say this is this line
- 8:50:58and this line is the representing by uh
- 8:51:02on this line we got this Vector B and
- 8:51:06this Vector is basically part of that
- 8:51:09line as you can
- 8:51:14see this is the vector B on this line B
- 8:51:20so we know from this concept of the line
- 8:51:24spanning the R2 and then vectors we know
- 8:51:27that in this case independent what is
- 8:51:30the magnitude of this Vector what is the
- 8:51:32direction of this Vector we can
- 8:51:34represent this line
- 8:51:37B by this linear
- 8:51:40combination based on this Vector so
- 8:51:42linear combination of this Vector which
- 8:51:44is in this
- 8:51:46case
- 8:51:49D
- 8:51:52set set then here we got some
- 8:51:58C where C is a real
- 8:52:05number multiplied by this
- 8:52:08Vector
- 8:52:13B knowing that this C is just a real
- 8:52:21number so let's make it actually green
- 8:52:28so we can basically say that this entire
- 8:52:31line B can be represented as this set of
- 8:52:35this linear combinations of these
- 8:52:37vectors so for instance if this
- 8:52:41is one and we do the C is equal to two
- 8:52:46then we can get this
- 8:52:48part of so we can get this Vector
- 8:52:51otherwise this is equal to three we can
- 8:52:53get this vector or C is equal to for
- 8:52:55this vector and then and so on which
- 8:52:58means that we can always come up with a
- 8:53:00linear combination forming a part of
- 8:53:03this line therefore we are seeing that
- 8:53:05this line can be represented as all
- 8:53:07these linear
- 8:53:08combinations uh of this Vector B which
- 8:53:11is part of this
- 8:53:12line and here the C is just a scaler so
- 8:53:17a number which is a real number so this
- 8:53:20C * Vector B represents this uh entire
- 8:53:24line
- 8:53:26so we will knit this in a bit but for
- 8:53:28now imagine this line and part of this
- 8:53:30line which is this Vector
- 8:53:33B so imagine then that we got yet
- 8:53:37another
- 8:53:39Vector which is let's say in
- 8:53:44here again going from the center but
- 8:53:47this time in this different
- 8:53:50direction
- 8:53:52so in here
- 8:53:55this
- 8:54:00is
- 8:54:02Vector
- 8:54:04a we call this Vector an
- 8:54:08A so you can see that this Vector a is
- 8:54:11actually much longer than the vector B
- 8:54:14and we see that Vector a is not lying on
- 8:54:17the same line as B so B is lying on the
- 8:54:19line b and a is not lying on the line B
- 8:54:25now let's say we want to
- 8:54:29project this Vector a onto this Vector B
- 8:54:34which means that we want
- 8:54:36to project this a in this
- 8:54:41direction so we want
- 8:54:44to bring this Vector a onto this
- 8:54:50line let me actually use a different
- 8:54:55color and the word of the projection
- 8:54:58actually does make sense in here as you
- 8:55:00might notice because we're trying
- 8:55:03to cast the shadow of a onto this line
- 8:55:07of B and how can we do that we can only
- 8:55:12do that if we connect
- 8:55:16this Vector
- 8:55:18a like this with this orthogonal line
- 8:55:23let's Say by using a different color
- 8:55:28of
- 8:55:30this so with this perpendicular
- 8:55:34line we then will be connecting the
- 8:55:37vector a to the line B because we want
- 8:55:39to project our Vector a onto this
- 8:55:48direction so this perpendicular line
- 8:55:51that you see in
- 8:55:52here that
- 8:55:54goes from Vector a to the line B where
- 8:55:59on line B we have the vector B so here
- 8:56:03is the line a line B and this
- 8:56:07perpendicular line it goes from
- 8:56:11a to line B and on line V we have the
- 8:56:15vector
- 8:56:17B that is represented like this then the
- 8:56:21projection of a onto Line B
- 8:56:24is this Shadow Vector that you see in
- 8:56:28here and the word projection or the name
- 8:56:32projection actually does make sense
- 8:56:35because we are projecting this Vector a
- 8:56:38onto this line and it creates this
- 8:56:40Shadow so we are casting this Shadow on
- 8:56:43here and this Vector is what we are
- 8:56:47referring as
- 8:56:49projection of vector a onto l line B
- 8:56:55notice that we don't say projection of B
- 8:56:58on Vector B but instead we are saying
- 8:57:00projection of a on the line B then
- 8:57:03another thing we can notice is that we
- 8:57:05are getting this
- 8:57:07projection of a on B so this
- 8:57:11vector by taking the vector
- 8:57:17a so Vector a and subtracting from that
- 8:57:26projection of a on
- 8:57:31B that is the
- 8:57:33formula for this
- 8:57:36Vector that we refer as a
- 8:57:40perpendicular that
- 8:57:42goes from a to line B so when drawing
- 8:57:47this perpendicular line from a to line B
- 8:57:50we are referring this as a minus
- 8:57:52projection of a b because you can see
- 8:57:55that this Vector is simply this Vector
- 8:57:57minus this Vector that is the um
- 8:58:00mathematical expression for this
- 8:58:02perpendicular
- 8:58:05line so how we can then find out what is
- 8:58:10this C that we got in here because we
- 8:58:14understand that to get this exact
- 8:58:17formula for
- 8:58:19the
- 8:58:21projection of a
- 8:58:24on the line B we need to understand what
- 8:58:28is the scaler specifically what value
- 8:58:31are we using to multiply this Vector B
- 8:58:33to get to this
- 8:58:36point so what is that
- 8:58:42c what is C what is
- 8:58:47C such
- 8:58:50that c times
- 8:58:54a is then equal
- 8:58:58to
- 8:59:01projection of
- 8:59:04a on the line B because we can have
- 8:59:08different sorts of a linear combination
- 8:59:11of vector
- 8:59:12B on this line uh B and in fact B this
- 8:59:17line B is the set of all linear
- 8:59:20combinations of this Vector B and I want
- 8:59:23to know
- 8:59:25specifically what is the vector that we
- 8:59:29see in here what is the shadow Vector
- 8:59:32because this is the projection of a on
- 8:59:34the line
- 8:59:35B what we see in
- 8:59:37here now how can we do
- 8:59:41that well let's first formally Define on
- 8:59:45this specific case what is the
- 8:59:47projection of a on this line
- 8:59:51B so projection
- 8:59:54of
- 8:59:55a on line
- 8:59:58B is some
- 9:00:02Vector that is
- 9:00:05also
- 9:00:07on line
- 9:00:09B
- 9:00:17where
- 9:00:18a
- 9:00:22minus projection
- 9:00:25of
- 9:00:26a on
- 9:00:30B
- 9:00:32is per
- 9:00:38pendicular or
- 9:00:43ortogonal to this is basically the
- 9:00:46definition of the projection of a on
- 9:00:49line B under this specific example
- 9:00:54so in this case the way we can find this
- 9:01:00projection is by looking into this C so
- 9:01:04this is what we are interested this
- 9:01:07specific
- 9:01:09specific C
- 9:01:13* B
- 9:01:17vector and knowing C and knowing B we
- 9:01:20already know what is B what B is knowing
- 9:01:23C
- 9:01:24we can then describe this specific
- 9:01:29projection so one thing that we can know
- 9:01:32is the condition under which we say two
- 9:01:35vectors are autal that's something that
- 9:01:37we already have learned as part of the
- 9:01:39previous lessons so let's go ahead and
- 9:01:42find that amount so now what we need to
- 9:01:44do is to calculate this value of C
- 9:01:46because value of C calculation will then
- 9:01:48lead us to the exact uh Vector that we
- 9:01:52are interested in which is this
- 9:01:54projection so our end goal is to find
- 9:01:57out what is this projection of a on B
- 9:02:02this is what we want and for that we
- 9:02:04need to calculate this C because we
- 9:02:05already know the vector B so let me
- 9:02:09quickly remove this
- 9:02:16part cuz here we will then do our
- 9:02:21calculation so one thing that we need to
- 9:02:24make use of is this part when it says
- 9:02:26orthogonal because we know that if two
- 9:02:29vectors are orthogonal then they dot
- 9:02:32product is equal to zero so we know that
- 9:02:36this Vector is orthogonal to this target
- 9:02:39Vector which means that we can say that
- 9:02:43the
- 9:02:45vector
- 9:02:46a and
- 9:02:48then minus
- 9:02:55projection of
- 9:02:57a on
- 9:03:02B
- 9:03:06multiplied with Vector
- 9:03:10B that this is equal to
- 9:03:14zero this is something that we know by
- 9:03:17definition of orthogonality two vectors
- 9:03:19are orthogonal it means that their
- 9:03:20dotproduct is then equal to zero
- 9:03:24now let's make use of that part
- 9:03:27so this means that we need to describe
- 9:03:32this projection of A and B we need to
- 9:03:35make use of the fact that we know that
- 9:03:37this projection of a onto B is actually
- 9:03:43some linear combination of vector
- 9:03:47B so let me actually go ahead and remove
- 9:03:51this part we already know the definition
- 9:03:55so let us go ahead and calculate that c
- 9:03:58that we need in order to find out what
- 9:04:00is this entire projection so few things
- 9:04:03that we need to clear out is those
- 9:04:05formulas because then we can make use of
- 9:04:07them to find the C so we know that by
- 9:04:09definition the projection of a on the
- 9:04:11line B it is this
- 9:04:15Vector that we get where we draw this
- 9:04:18perpendicular line from Vector a onto
- 9:04:21Line B and we said that this line is
- 9:04:23equal to this amount this is simply the
- 9:04:26vector a minus this Vector the shadow
- 9:04:29Vector which we said it's defined by
- 9:04:31projection of A and B this thing so we
- 9:04:34can make use of that because we also see
- 9:04:36in here that this we are saying isogonal
- 9:04:40to this
- 9:04:43Vector so given that this uh Vector a
- 9:04:48minus projection a b is orthogonal to
- 9:04:51line B that is also orthogonal
- 9:04:54on this specific Vector which is the
- 9:04:56projection itself so from this we can
- 9:05:01make use of the fact that two vectors
- 9:05:03when they are autal their dotproduct is
- 9:05:06equal to zero in order to find this uh
- 9:05:09value of C so firstly we just set that
- 9:05:14the a minus projection of a on the line
- 9:05:21B that this
- 9:05:25multiplied by this Vector B is equal to
- 9:05:29zero because those two lines they should
- 9:05:31be
- 9:05:36perpendicular but at the same time we
- 9:05:39know that this is simply the linear
- 9:05:42combination of this Vector because this
- 9:05:47line is perpendicular to this one and
- 9:05:50this line is some linear combin a of
- 9:05:55this Vector B because if I have here a
- 9:05:59vector and then I have the longer
- 9:06:03version of that Vector on the same line
- 9:06:05which is then a linear combination of
- 9:06:08this original Vector let's say this is
- 9:06:09my Vector B then this second Vector that
- 9:06:14I have in here is then equal to some C *
- 9:06:19Vector
- 9:06:20B this is also exactly what we said in
- 9:06:23here here we said any Vector on line B
- 9:06:26can be represented as a linear
- 9:06:28combination of vector B and this is
- 9:06:31exactly what we are seeing in here so
- 9:06:34this
- 9:06:35projection is simply that c
- 9:06:41times Vector
- 9:06:44B this is something that we have already
- 9:06:47said so we are just making use of that
- 9:06:49to fill in that volum so this then
- 9:06:52results
- 9:06:54in a
- 9:06:56minus this C
- 9:06:59*
- 9:07:01B multiplied by this Vector B is equal
- 9:07:04to zero
- 9:07:07formula so here we are simply making use
- 9:07:10of the fact that the
- 9:07:14projection of a onto B is the shadow
- 9:07:17Vector which is then equal to some
- 9:07:20linear combination of this original
- 9:07:23Vector B which is on this
- 9:07:27line
- 9:07:32B then I can easily find the scaler C
- 9:07:36from here because we know how we can
- 9:07:38easily calculate this dot product so let
- 9:07:42us actually go ahead and do that let's
- 9:07:44first multiply
- 9:07:47this a
- 9:07:50by
- 9:07:51B and then my minus so I'm simply
- 9:07:55opening the parenthesis C * then I got B
- 9:08:00by B and this equal to
- 9:08:04zero so C
- 9:08:07* B time B is then equal
- 9:08:12to a and b which means that
- 9:08:18c is equal to a * B / to B *
- 9:08:35B now when we have the C we can easily
- 9:08:39derive the formula for the projection of
- 9:08:43a on the line
- 9:08:48B so this is the first part this is the
- 9:08:53second
- 9:08:54part so then the
- 9:08:57projection of a on
- 9:09:04B so
- 9:09:06projection of a on B is equal
- 9:09:10to this
- 9:09:13c
- 9:09:17c times the B and we just found out that
- 9:09:23this is equal to the C was equal
- 9:09:26to a * B / to B *
- 9:09:33B and now we need to take this C and
- 9:09:37then
- 9:09:39multiply by Vector
- 9:09:41B this is then the projection of a on
- 9:09:49B this Vector so projection
- 9:09:53of
- 9:09:55a on line
- 9:10:02B so you will notice that this is the
- 9:10:05same that we just got so whether you
- 9:10:09compute the projection of a on the
- 9:10:11entire line b or projection of a on the
- 9:10:13specific Vector b as we are using the
- 9:10:16vector b as a source for drawing our
- 9:10:20line this is the same as the project
- 9:10:23rection of vector
- 9:10:27a on Vector
- 9:10:32B and this is the same formula as we SE
- 9:10:35in here so this is the projection
- 9:10:37formula that we have just uh found out
- 9:10:40so projection of a onto B is given by
- 9:10:43this
- 9:10:44formula a * B so the dot product of the
- 9:10:48vector A and B divided to the dot
- 9:10:50product of the bay withd itself and
- 9:10:52multiply with the vector
- 9:10:54B and this is the in here this is
- 9:10:57something that we have calculated time
- 9:10:59and time again in our examples so if we
- 9:11:02go back to our
- 9:11:04example then here we can see that this
- 9:11:09is our Vector B this is our Vector a and
- 9:11:15we are saying if we take the vector a
- 9:11:18and we project it onto this Vector B
- 9:11:21then we can calculate this Pro
- 9:11:23projection which is in here the formula
- 9:11:26for this entire
- 9:11:29Vector which we are calling projection
- 9:11:31of a on b or projection of
- 9:11:35a on
- 9:11:38B this can be find out so the the length
- 9:11:41of that Vector we can find by using this
- 9:11:44formula so the dot product of vector A
- 9:11:47and B divided to the dotproduct of B
- 9:11:49with itself and then multiplied with
- 9:11:51Vector B so again a DOT product
- 9:11:54produ and this is of course something
- 9:11:57that we get as a vector so this is a
- 9:12:00vector something that is equal to this
- 9:12:03entire Vector in
- 9:12:06here this
- 9:12:08Vector so uh I know that this uh might
- 9:12:12look bit messy because it contains many
- 9:12:14moving Parts but I wanted to provide
- 9:12:17this detailed explanation and the step
- 9:12:19by-step process even if it is bit
- 9:12:21confusing and bit messy um in the
- 9:12:25beginning because this help us to
- 9:12:27understand what this uh formula is about
- 9:12:30and what is the intuition behind it
- 9:12:32because what we are doing is that we are
- 9:12:34making use of the fact that the line can
- 9:12:38be represented as a linear combination
- 9:12:41of all the
- 9:12:44um vectors that we use in here so this
- 9:12:47is Vector B and this entire line B is a
- 9:12:51linear combination of this vector B and
- 9:12:54we can make use of that in order to find
- 9:12:56that scalar that we are multiplying to
- 9:12:58create this single linear combination
- 9:13:01that will end up giving us this Vector
- 9:13:04that we see in here which is the
- 9:13:06projection the projection that we are
- 9:13:09interested which is this line This is
- 9:13:11the projection that we are defining by
- 9:13:14this projection a on to
- 9:13:16B and we can get that by making use of
- 9:13:20the fact that this this perpendicular
- 9:13:23line that we are creating in here which
- 9:13:25is simply the vector a minus this
- 9:13:29projection this is this Vector this
- 9:13:31projection Vector that this is
- 9:13:34perpendicular to this line
- 9:13:38B and if the vector B is part of this
- 9:13:42line B this means also that this line a
- 9:13:45minus projection a is also perpendicular
- 9:13:47to that vector vector B making use of
- 9:13:50that formula we can then uh make use use
- 9:13:53of the product of the two we know that
- 9:13:55the dot product of two perpendicular
- 9:13:57vectors is equal to zero making use of
- 9:13:59that we can then obtain this specific
- 9:14:01scaler C that we
- 9:14:03need in order to get the final formula
- 9:14:08for our projection we are interested in
- 9:14:11this C because knowing C we can then
- 9:14:14multiply with this Vector B to get our
- 9:14:16final projection and we have found that
- 9:14:19that projection a on B is is defined as
- 9:14:24the dotproduct of the A and B divided to
- 9:14:27the dotproduct of the B with the B and
- 9:14:28multiply with the vector B and this is
- 9:14:31again a
- 9:14:34vector now let's look into a couple of
- 9:14:36numeric examples to clarify this topic
- 9:14:39and practice with it so given vectors A
- 9:14:42and vectors B find the projection of a
- 9:14:44on to B so without looking into answer I
- 9:14:49will quickly go onto that example itself
- 9:14:52so Vector a
- 9:14:53is this Vector 3 4 can also represent
- 9:14:59this by our more common notation which
- 9:15:02is three and four and then Vector
- 9:15:07B
- 9:15:10is one and zero so let's quickly draw
- 9:15:15our coordinate
- 9:15:17system this our xaxis this our y axis
- 9:15:21and then what is the a
- 9:15:25the a is three and
- 9:15:30four three and
- 9:15:39four so this is our
- 9:15:43a and what is the B the B is one and
- 9:15:51zero which which means that our line
- 9:15:56B is
- 9:16:00then C times the vector B given that the
- 9:16:05C is a real number and one thing that
- 9:16:08you can notice is that the line B is
- 9:16:12actually our x-axis it is this line this
- 9:16:15is our line
- 9:16:20B this is our line l
- 9:16:24b
- 9:16:26so the projection is then this line this
- 9:16:30is our projection because we can know
- 9:16:32that by drawing a perpendicular
- 9:16:35line in here from a to the line B we can
- 9:16:41get then the connection between
- 9:16:44our Vector a and Vector B and create our
- 9:16:48projection so this is then the A minus
- 9:16:54projection of a on line
- 9:16:59B and this part is
- 9:17:04then this is then this
- 9:17:08projection
- 9:17:10a on
- 9:17:13B and how we can get this projection
- 9:17:17well we just learned that the projection
- 9:17:24of
- 9:17:28a on
- 9:17:31B is equal
- 9:17:34to dotproduct
- 9:17:36of
- 9:17:38a with B divide it to dotproduct of B
- 9:17:43with B
- 9:17:44itself and multiply it by
- 9:17:48B this is the formula that we can use
- 9:17:50and even if you don't remember the
- 9:17:52formula by heart you can make use of
- 9:17:54this visualization to figure out what
- 9:17:55that formula is because we know that if
- 9:17:58this line is perpendicular to this one
- 9:18:00then a minus projection of a on B
- 9:18:03multiplied by this projection a on B
- 9:18:06should be equal to zero and this
- 9:18:09projection of a on B is equal to some
- 9:18:12scalar C multiplied by Vector B that's
- 9:18:16something that we see in
- 9:18:20here the first thing we need to do to
- 9:18:23compute the dot product between a and
- 9:18:26b a * B is equal
- 9:18:33to
- 9:18:3634 multiplied by 1 0 this is the dot
- 9:18:43product which is then equal to 3 * 1 + 0
- 9:18:47* 4 and this is equal to
- 9:18:503 the next thing we need to to do is to
- 9:18:53compute the dotproduct between B itself
- 9:18:56so B * B and what's that that is 1 0
- 9:19:02with 1 Z multiplied this is equal to 1 1
- 9:19:07* 1 + 0 plus 0 * 0 is equal to
- 9:19:111 then the third thing that we can do
- 9:19:15then is to obtain the final value which
- 9:19:20is
- 9:19:25projection of
- 9:19:28a on
- 9:19:32B is then equal
- 9:19:36to three / 2 1 multiplied by the vector
- 9:19:43B which is 1 0 which is equal to 3
- 9:19:500 and this actually makes sense visually
- 9:19:53too as you can see in here this is the
- 9:19:57tree for the xaxis and here we have the
- 9:20:00center Z so this projection is then the
- 9:20:03vector 3 0 so even without calculation
- 9:20:06we could see just from plotting the uh
- 9:20:09on the coordinate system the vectors A
- 9:20:11and B that the projection of a on B will
- 9:20:13be this Vector 3 but we have followed
- 9:20:15the formula in order to do calculation
- 9:20:17step by
- 9:20:18step which is something that you can see
- 9:20:21in this answer too
- 9:20:23so the projection of this Vector a onto
- 9:20:25B is then this Vector of a length tree
- 9:20:28in the direction of B so you can see
- 9:20:31that it is of the length of
- 9:20:36three so this is the tree on the
- 9:20:39direction of B so on the line
- 9:20:43B let's now move ahead and look into a
- 9:20:46different example but this time we will
- 9:20:47do the calculation in a quicker way so
- 9:20:50we got two vectors 4 three and B is
- 9:20:52equal to
- 9:20:5320 and we need to find this projection
- 9:20:56of a on to B so the first thing we need
- 9:21:00to do is to calculate the a * B which is
- 9:21:05equal to 43 multili 2 0 and that's equal
- 9:21:12to 4 * 2 + 3 * 0 and it's equal to 8 the
- 9:21:16second thing we need to calculate is the
- 9:21:18B do product with B which is equal to 2
- 9:21:220
- 9:21:232 0 this is then equal to four and the
- 9:21:27final part is to take and uh from this
- 9:21:31one and two this values and then bring
- 9:21:33them all together so then
- 9:21:36the
- 9:21:38projection
- 9:21:40of a on B is equal
- 9:21:51to H
- 9:21:53ided to
- 9:21:544 multiplied by the vector
- 9:21:58to0 and this is equal 2 8 / 2 4 is 2 2 *
- 9:22:042 is 2 2 * 0 is 0 so we are getting this
- 9:22:10two Vector so projection of a on B is
- 9:22:14then this Vector 20 which is actually on
- 9:22:16this xaxis similar to what we had before
- 9:22:19only with the length of t uh towards the
- 9:22:21direction of
- 9:22:23which is then equal to 4
- 9:22:26and0 and this is again similar to what
- 9:22:28we had before uh where we got the
- 9:22:31projection of a on B on that end up on
- 9:22:34the x axis but now with the length of
- 9:22:36four so now our
- 9:22:42projection has the following Vector so
- 9:22:45the uh following magnitude and
- 9:22:48Direction so this is the step by-step
- 9:22:50process that I just followed if if you
- 9:22:52want to do it bit slowly and this is the
- 9:22:55final
- 9:22:56result so uh the interpretation of this
- 9:23:00projection is that this projection a
- 9:23:02onto B is simply this 4 zero this means
- 9:23:06that the A's component in the direction
- 9:23:09of B it spends uh four units along this
- 9:23:12x-axis that we saw in
- 9:23:18here because this is the value X this is
- 9:23:21the value of y
- 9:23:25so this projection shows us that A's
- 9:23:28influence in the direction of B is
- 9:23:30completely horizontal with this
- 9:23:32magnitude of four because we saw that we
- 9:23:35end up with the projection on the x-axis
- 9:23:39again so this was four this was our
- 9:23:42projection vector and if you plot this
- 9:23:45entire Vector a and Vector B on this
- 9:23:49x-axis and y axis then you can clearly
- 9:23:51see that the uh horizontal line that we
- 9:23:55end up with the uh
- 9:23:58projection of a n b is very similar to
- 9:24:03what we had
- 9:24:05before in
- 9:24:08here let's now talk about a concept of
- 9:24:10auton normal bases so let's now Define
- 9:24:14what the auton normal bases are so by
- 9:24:16definition auton normal basis for a
- 9:24:19vector space is a basis where all vector
- 9:24:22vors are orthogonal or perpendicular to
- 9:24:25each other and each Vector is of unit
- 9:24:28length so as you can notice here here we
- 9:24:32have a special type of basis it's called
- 9:24:35auton normal basis because in the
- 9:24:38beginning of this section of this module
- 9:24:40we defined formally this concept of
- 9:24:42bases we talked about the concept of
- 9:24:45colal uh space and then the uh basis of
- 9:24:49a comp space the no space the basis of a
- 9:24:52n space and then we talked about the
- 9:24:55concept of the bases of the entire space
- 9:24:59for instance the R2 and now we are
- 9:25:02defining a special type of bases which
- 9:25:05we are referring as auton normal bases
- 9:25:08and this auton normal basis as you can
- 9:25:10see from this definition it contains two
- 9:25:12criteria for it to be auton normal so an
- 9:25:16auton basis for a vectory space is a
- 9:25:18basis where a all vector are orthogonal
- 9:25:23or perpendicular to each other and B
- 9:25:27each Vector is of unit length we already
- 9:25:30have learned that when we have vectors
- 9:25:34let's say Vector A and B
- 9:25:36perpendicular it means that A and B
- 9:25:40their dot product is equal to zero
- 9:25:42that's the first criteria that we need
- 9:25:44for calling our basis an auton normal
- 9:25:48basis then the second criteria is that
- 9:25:53each of these vectors they need to have
- 9:25:56a
- 9:25:57length of
- 9:26:03one if we have this condition satisfied
- 9:26:06then we are saying that our vectors they
- 9:26:09help us to form this auton normal basis
- 9:26:13if we got three vectors forming this
- 9:26:15Vector space it means that we need to
- 9:26:18have the a * B = to
- 9:26:220 a * C = 0 and then B * C = 0 this is
- 9:26:30if we are in in case we are using three
- 9:26:34different vectors that Define our Vector
- 9:26:39space in this
- 9:26:41case let me make this part smaller so
- 9:26:46let's put the length of B in here in
- 9:26:51this case
- 9:26:53the second
- 9:26:54criteria becomes that the length of a is
- 9:26:59equal to the length of B and then is
- 9:27:02equal to the length of c and is equal to
- 9:27:06one so depending on the number of
- 9:27:09vectors that you use to form your vector
- 9:27:11space the proof that you are dealing
- 9:27:14with auton normal bases will be
- 9:27:15different here we got just two vectors
- 9:27:18here we got three vectors but in both
- 9:27:20case we first need to prove that we are
- 9:27:22dealing with uh vectors Each of which
- 9:27:25are set of orthogonal perpendicular
- 9:27:28vectors and all of them pairwise they
- 9:27:32need to be perpendicular and at the same
- 9:27:34time the second criteria says that they
- 9:27:36all need to have a unit length so their
- 9:27:40length should be equal to
- 9:27:42one we need this auton normal bases in
- 9:27:45order to simplify our calculations
- 9:27:47including the calculations of
- 9:27:49projections and Transformations that we
- 9:27:51just so before when we were discussing
- 9:27:54this concept of projecting a vector onto
- 9:27:57a line or projecting a vector onto not a
- 9:27:59vector because we were in this basic
- 9:28:01case when we had just two vectors in
- 9:28:05R2 and calculating projection in R2 is
- 9:28:09very easy because we can make use of
- 9:28:10this formula um a and then B uh the dot
- 9:28:15product of them and then divided two
- 9:28:17product of the B and then times the B
- 9:28:19this was quite straightforward right but
- 9:28:22when it
- 9:28:23came so this is the projection of a on B
- 9:28:30but when it comes to projection in
- 9:28:32higher dimensional space let's say you
- 9:28:34have R5 or you have R 100 or R th000
- 9:28:37then it becomes much more difficult to
- 9:28:40do those projections and to calculate
- 9:28:42the projections and for those cases we
- 9:28:45can make use of this concept of auton
- 9:28:47normal basis to simplify our
- 9:28:49calculations and we will see that in a
- 9:28:51bit
- 9:28:53so let's first understand this
- 9:28:55orthogonality and the normalization part
- 9:28:57so orthogonality refers then to the part
- 9:28:59of uh when we are saying that the
- 9:29:01vectors should be orthogonal to each
- 9:29:03other and the normalization refers to
- 9:29:06the fact uh to the fact that the length
- 9:29:09should be one this is basically the set
- 9:29:11of two criteria that I just discussed
- 9:29:14this is uh the summary slide that will
- 9:29:17give you an indication what is meant by
- 9:29:19that so if we have two vectors V and W
- 9:29:23then we say that the first criteria is
- 9:29:25that those two vectors are orthogonal
- 9:29:27which means their dot product is equal
- 9:29:29to zero and we are saying that their
- 9:29:31length is equal to one which we are
- 9:29:33referring as a normalized vector so if
- 9:29:36the
- 9:29:37vector has a length of one then we are
- 9:29:41calling a vector
- 9:29:42v
- 9:29:49normalized so if both of this criteria
- 9:29:52of normalization and
- 9:29:53orthogonality is satisfied that we are
- 9:29:56saying that we are dealing with an uton
- 9:29:58normal basis so now where we have
- 9:30:00learned this idea of projections also
- 9:30:02this idea of autog colonization and the
- 9:30:06uh concept of auton normal basis we are
- 9:30:08ready to discuss the concept of the
- 9:30:10grade process so the grade process is
- 9:30:14this method for orthogonalizing a set of
- 9:30:16vectors in an inner product space and
- 9:30:19turning them into an auton normal
- 9:30:24set so let's say we have a set of
- 9:30:27vectors we want to uh bring and
- 9:30:30transform all these vectors onto this
- 9:30:33auton normal set of vectors which means
- 9:30:36that we want them to be aized so we want
- 9:30:40them to be perpendicular and we want
- 9:30:43them to be normalized because we know
- 9:30:45that the two criteria were specified
- 9:30:47right so the first criteria was that we
- 9:30:49need to have vectors
- 9:30:55ortogonal hence we are doing
- 9:31:02orthogonalization and the second
- 9:31:04criteria was that they need to be
- 9:31:07normalized because we want the
- 9:31:12vectors to
- 9:31:15have
- 9:31:17length one so we are doing normalization
- 9:31:24this process of turning this set of
- 9:31:29vectors onto this uton normal
- 9:31:32set by using this method of
- 9:31:35orthogonalization which is something
- 9:31:37that we are referring as a grme
- 9:31:39process this is something that we can
- 9:31:42use in order to simplify later this
- 9:31:45different sorts of Transformations which
- 9:31:47we need in order to perform bit more
- 9:31:49advanced uh Transformations like Matrix
- 9:31:52uh factorization different decomposition
- 9:31:55techniques so given this set of linearly
- 9:31:58independent vectors this process which
- 9:32:01we are referring as grme process
- 9:32:03produces this auton normal set that is
- 9:32:06spinning the same
- 9:32:08Subspace so we have the same
- 9:32:11Subspace it's just that we are turning
- 9:32:13the set of vectors into an auton normal
- 9:32:16set of vectors that is spanning the same
- 9:32:20Subspace so the gr Street process step
- 9:32:23by step looks like something like this
- 9:32:26so given the vectors A1 A2 up to a n the
- 9:32:30first thing we need to do is to start
- 9:32:33with the vector V1 which is equal to our
- 9:32:36first Vector A1 and first we need to
- 9:32:39normalize this vector and how we can
- 9:32:42normalize this Vector well we need to
- 9:32:45take this vector and we need to divide
- 9:32:47it to its length so the grme process
- 9:32:50step by step will look like like
- 9:32:52something like this so in the first step
- 9:32:54what we need to do when starting with
- 9:32:56these vectors of A1 A2 up to a n so in
- 9:32:59RN we need to First Take the first
- 9:33:02vector and we need to normalize it and
- 9:33:04how we can normalize the vector and
- 9:33:06ensure that its length is equal to this
- 9:33:09length of P1 well we need to take that
- 9:33:13vector and we need to divide it to this
- 9:33:15length because
- 9:33:18when we take the
- 9:33:20vector the 1 and we divide it to its
- 9:33:24length of V1 then we will ensure that
- 9:33:27the length of that Vector is equal to
- 9:33:32one we can actually prove that very
- 9:33:34easily but I won't do it in here uh feel
- 9:33:37free to go through the process assuming
- 9:33:40that
- 9:33:41the
- 9:33:43length of the vector what what you want
- 9:33:46to achieve at the end is that the length
- 9:33:48of a vector v is equal to one
- 9:33:51this is something that we want to
- 9:33:53achieve and this normalization process
- 9:33:56can be
- 9:33:57done if we find a way to ensure that we
- 9:34:02uh get this E1 because E1 means that we
- 9:34:06end up with this Vector y 000000 0 this
- 9:34:10will be for first Vector so
- 9:34:13V1 this is E1 so the one is really
- 9:34:17important here so we want to normalize
- 9:34:20this Vector View 1 by uh ensuring that
- 9:34:25we get the E1 so we go from V1 to E1 and
- 9:34:30the way we do that is that we take the
- 9:34:32V1 and we divide it to the length of
- 9:34:35V1 and in this way we get the E1 so the
- 9:34:40normalized version of P1 is
- 9:34:45E1 so then for each subsequent Vector a
- 9:34:49k which means A2 A3 A4 up to a n we need
- 9:34:54to subtract its projection on all the
- 9:34:57previously computed orthogonal
- 9:35:04vectors in this way by using this tab
- 9:35:07two we are ensuring that all these
- 9:35:11different each pair wise set of A1 A2
- 9:35:15and then A2 A3 Etc they are all
- 9:35:17orthogonal to each
- 9:35:19other and we know that this projection
- 9:35:24is something that we got when we had
- 9:35:26this two perpendicular lines so we had
- 9:35:29this Vector we're projecting onto this
- 9:35:31Vector we got that by finding this
- 9:35:36perpendicular line and making use of
- 9:35:38that using this property we are then
- 9:35:41making use of that in order to see how
- 9:35:43we can ensure that the subsequent Vector
- 9:35:46that we have is always perpendicular to
- 9:35:49this
- 9:35:50one so let me actually write down what
- 9:35:54is in this
- 9:35:55formula so here VK is equal to a minus
- 9:36:01the sum of all the projections so then
- 9:36:04we need to normalize the VK to get the
- 9:36:07EK and then we need to repeat this step
- 9:36:10two and three for all vectors which
- 9:36:13means that first here we apply this
- 9:36:16normalization on the vector A1 so V1 is
- 9:36:21to A1 and then we get the normalization
- 9:36:25by getting this E1 so E1 is normalized
- 9:36:29version and then we need to apply a bit
- 9:36:33different tactique for our V2 V3 up to
- 9:36:38VN and then let me actually write down
- 9:36:41this for this General
- 9:36:44case so what this processed this the GR
- 9:36:52let me ensure that I'm not making a typo
- 9:36:58Schmid
- 9:37:01process step by step means step number
- 9:37:08one for
- 9:37:12vectors A1
- 9:37:15A2 A3 dot dot dot a n so we are in the
- 9:37:19RN
- 9:37:25then step number one basically says take
- 9:37:30the
- 9:37:32V1 and set it equal to this first
- 9:37:35element
- 9:37:38V1 this is
- 9:37:46A1 then what we need to do is to
- 9:37:51normalize it to get the
- 9:37:55E1 so normalize
- 9:37:59normalized
- 9:38:01V1 to get E1 which is equal to 1 0 0 0
- 9:38:09and then dot dot dot zero and the size
- 9:38:11of this n by one and how we can do
- 9:38:16that by taking this Vector V1 and
- 9:38:21divided it to the length of V1 which
- 9:38:25basically means in this specific case A1
- 9:38:29divided to the length of A1 this will
- 9:38:33then give us our
- 9:38:35A1 this Vector this is basically what
- 9:38:39the step one entails then in the step
- 9:38:42number
- 9:38:44two we have for each
- 9:38:48subsequent a where K is just an index
- 9:38:52referring to whether we are dealing with
- 9:38:55K is equal to 2 so uh A2 A3 and then dot
- 9:39:00dot dot a
- 9:39:02n this is what basically the K is used
- 9:39:05for to refer to which Vector we are
- 9:39:07dealing
- 9:39:09with we need to subtract its projection
- 9:39:13on all previously computed orthogonal
- 9:39:18vectors by using this formula so let's
- 9:39:22actually do a couple of those case to
- 9:39:24see what is going on for instance for K
- 9:39:27is equal to
- 9:39:322 so K is equal to 2 and here is the
- 9:39:37formula by the way
- 9:39:40so
- 9:39:42VK VK is equal to
- 9:39:47AK
- 9:39:50minus some
- 9:39:51K is equal to K starts with
- 9:39:54one and
- 9:39:56then let me use a different
- 9:40:00index so I is = to 1 till K minus
- 9:40:08one and then
- 9:40:11projection
- 9:40:13of a
- 9:40:15k a k
- 9:40:24on E1 or
- 9:40:29eii so the EI that we have just computed
- 9:40:32because every time you are then
- 9:40:34normalizing and normalizing every time
- 9:40:37your vectors and then you are uh finding
- 9:40:40out what is the projection of your
- 9:40:42vector a onto that
- 9:40:49EI and then you are substract in that
- 9:40:51from your vector so what this means in
- 9:40:54Practical terms when for instance your K
- 9:40:56is equal to 2 it means that V 2 is equal
- 9:41:04to a 2 minus sum of I is = 1 and then K
- 9:41:12is = 2 K - 1 this means this is
- 9:41:16one
- 9:41:18projection of a a and then
- 9:41:242 on
- 9:41:27A1 given that this is one this is simply
- 9:41:30equal to
- 9:41:32A2
- 9:41:33minus
- 9:41:36projection of
- 9:41:38A1 that's normalized version of E1 and
- 9:41:43then A2 so projection of A2 on E1
- 9:41:53and then in the step number three we
- 9:41:56need to do we need to go from VK to get
- 9:41:58EK so basically we are ensuring with the
- 9:42:01step number two the orthogonally uh
- 9:42:03orthogonality condition and with step
- 9:42:06number
- 9:42:07three I
- 9:42:10me add some space in here so in the step
- 9:42:14number three step number three we then
- 9:42:16saying let's
- 9:42:19normalize normalized
- 9:42:22this VK that we have just
- 9:42:26computed in
- 9:42:29here because we remember that the second
- 9:42:32criteria after tonality is normalization
- 9:42:34that the unit or the length of the
- 9:42:37vector should be equal to
- 9:42:39one so then VK in this case for K is
- 9:42:44equal to 2 for K is equal to 2 means
- 9:42:47that we need to go from V2 to E2
- 9:42:52and the way we can do that is by taking
- 9:42:55the
- 9:42:57V2 by V2 and then divide it to the
- 9:43:02length of
- 9:43:04V2 this will then give us the E2 this is
- 9:43:08the normalization
- 9:43:10part and the step number four basically
- 9:43:14means
- 9:43:16repeat
- 9:43:18repat step two
- 9:43:22entry for all
- 9:43:25case which means that if we go back so
- 9:43:29we are done with V2 so we have obtained
- 9:43:32V2 and then we have obtained normaliz
- 9:43:34normalized version of V2 by getting this
- 9:43:38E2 we are ready to come back and do the
- 9:43:41same for
- 9:43:44K is equal to three and for K is equal
- 9:43:47to three in Step number two we got
- 9:43:51V3 is equal to
- 9:43:55A3 minus making use of this
- 9:43:59formula sum overall I is = to 1 K - 1 is
- 9:44:04= to 2 and then
- 9:44:07projection of this time a Tre see three
- 9:44:12k is equal to three and then on E2
- 9:44:21actually it says EI let me remove this
- 9:44:25this otherwise we would have made a
- 9:44:30mistake this should be I because an I
- 9:44:34will change per K this is the entire
- 9:44:37idea we need to re um subtract all the
- 9:44:40um
- 9:44:41projections what this basically means is
- 9:44:44that we need to take A3 and this time
- 9:44:47given that here we have two instead of
- 9:44:49one in here we need you have an extra
- 9:44:52step which means A3
- 9:44:56minus and then what this formula
- 9:44:58basically says this is the sum of the
- 9:45:01projections of A3 on e i where I goes
- 9:45:04from one till two so
- 9:45:07projection of a Tre on
- 9:45:14a one when K so when I this is the I is
- 9:45:19equal to one case plus
- 9:45:23projection of a Tre on a 2 this is the I
- 9:45:30equal to 2 case this is
- 9:45:32basically what this
- 9:45:35summation says this is this element and
- 9:45:38we have seen this as part of the high
- 9:45:40school but also the pre-algebra
- 9:45:43course okay so now when we are clear on
- 9:45:49how we can calculate the V3 in the step
- 9:45:52number two for K is equal to 3 we are
- 9:45:55ready to go onto the step number three
- 9:45:57and what was step number
- 9:46:00three the step number three
- 9:46:05for K is equal to 3 was saying let's
- 9:46:09take the V3 and normalize it to go from
- 9:46:13V3 to E3 and how we can do that by
- 9:46:17taking the V3 and dividing it to the
- 9:46:21length of V
- 9:46:23tree to get on to E
- 9:46:28tree and this cycle goes on and on until
- 9:46:32we cover all the case so all the vectors
- 9:46:37so the idea is that we first for our
- 9:46:41initial step we set the V1 equal to
- 9:46:44A1 we normalize it then starting from
- 9:46:49the K is equal to two we don't go first
- 9:46:53on and on WE autog it by formula in here
- 9:46:58by using this we can ensure that each of
- 9:47:02these vectors is then orthogonal to all
- 9:47:06the other vectors so for K is equal to 2
- 9:47:08we ensure that this uh Vector that we
- 9:47:12get is orthogonal to all the other ones
- 9:47:16and the case equal to treat that the
- 9:47:18third Vector isogonal to all the other
- 9:47:20ones and we are doing that in Step
- 9:47:21number
- 9:47:23two so for each case for each K we
- 9:47:26basically are ensuring that in this case
- 9:47:30we have an a vector that is orthogonal
- 9:47:33to all the other vectors in this
- 9:47:35set and for each Vector we are also
- 9:47:38normalizing it to satisfy the second
- 9:47:40criteria because we had these two
- 9:47:42criterias to create this auton normal
- 9:47:45set so we are doing this in subsequent
- 9:47:49uh way so first for K isal to 1 so
- 9:47:53basically for A1 and then we are doing
- 9:47:55this for K is equal to 2 so A2 and then
- 9:48:01until K is equal to n so a n what we are
- 9:48:05doing every time is that we are
- 9:48:06obtaining this V1 and then we go from V1
- 9:48:10to E1 to normalize it and then here we
- 9:48:13are getting the V2 here to go to E2 by
- 9:48:18normalizing it so this basically
- 9:48:21the step two and step three and then we
- 9:48:24do this every time up until to the point
- 9:48:28of obtaining VN and then from VN we go
- 9:48:32to en n to normalize
- 9:48:35it so this is the idea of this entire
- 9:48:40process step by step to start with V1 as
- 9:48:43part of the step number one and then as
- 9:48:45part of Step number two for each
- 9:48:47subsequent Vector a k so K is equal to
- 9:48:50two obtain the VK and then normalize it
- 9:48:54for K is equal to 3 obtain the V3 and
- 9:48:56then normalize it to get E3 up to the
- 9:48:58point of the last Vector which is a n
- 9:49:01the vector a n we compute the
- 9:49:05VN and then we normalize it to get
- 9:49:09the and this is what this part is which
- 9:49:13is the St number two that says repeat
- 9:49:15steps 2 and three for all vectors it
- 9:49:17means that every time when you increase
- 9:49:19your K when you go to the next Vector we
- 9:49:22first compute the V so VK and then you
- 9:49:25normalize it you get the EK and then you
- 9:49:27go back to the step number two at three
- 9:49:29because you then again need to calculate
- 9:49:31the VK and then EK and then for the next
- 9:49:34case so this is something that you will
- 9:49:37see also a lot when you are writing the
- 9:49:40code for
- 9:49:42your uh algorithms because in many cases
- 9:49:45you need to do this reputation of the
- 9:49:48steps so uh you for one Vector you do
- 9:49:51something or for one iteration you do
- 9:49:53process and then you uh go back and do
- 9:49:56for the next one and for the next one
- 9:49:58this process is what we are referring by
- 9:50:00repeat step number two and three for all
- 9:50:06vectors so let's now look into an
- 9:50:08example let's apply this grumme process
- 9:50:11to vectors A1 and A2 where A1 is 1 1 0
- 9:50:16and A2 is 101
- 9:50:22so let's go ahead and do that so A1 is
- 9:50:25equal
- 9:50:28to 1 1
- 9:50:320
- 9:50:34A2 is equal
- 9:50:37to 1 0
- 9:50:401 we want to apply this gret process to
- 9:50:43create this Aon normal basis for the
- 9:50:46Subspace that is Pinn by A1 and A2 so
- 9:50:49now we have this
- 9:50:51set 1 1
- 9:50:540 and one
- 9:50:561 and what we want is to create an auton
- 9:51:00noral
- 9:51:02basis so
- 9:51:05creating
- 9:51:06creating or to normal normal
- 9:51:13basis
- 9:51:16which
- 9:51:18CR meet
- 9:51:27process so here we got only two vectors
- 9:51:31so obviously it's this and it's a very
- 9:51:33simplified version of it what was the
- 9:51:36first step in our case uh in our
- 9:51:38algorithm it was to set the V1 equal to
- 9:51:44A1 what we need to do step number one we
- 9:51:49need to set the V1 equal to
- 9:51:54A1 and we need to
- 9:51:56normalize
- 9:51:59normalize the
- 9:52:02V1 to get E1 that's what our goal is so
- 9:52:07let's go ahead and do
- 9:52:09that V1 is equal to A1 and is equal
- 9:52:15to 1 1 0er that's our A1 so 1 1
- 9:52:22Z and in order to normalize
- 9:52:28V1 and get the
- 9:52:30E1 we know that this is equal to V1 / to
- 9:52:34the length of
- 9:52:37V1 which is then equal to take the V1 so
- 9:52:42that is 1 1 0 and then divide it to the
- 9:52:47length of V1
- 9:52:51and you can very quickly see
- 9:52:55that
- 9:52:57given
- 9:53:00V1 is equal to V1 * V1 that's something
- 9:53:04that we learned in the very beginning of
- 9:53:06our fundamentals to linear algebra
- 9:53:07course that the length of V1 is simply
- 9:53:10the dotproduct between uh V1 and V1 and
- 9:53:13it's equal
- 9:53:14to 1 1 0 * 1 1 0
- 9:53:21which is equal to 1 + 1 so two so this
- 9:53:27is then equal to 1 1 0 / 2 which is
- 9:53:32equal to 1 / 2 1 / to 2 and then
- 9:53:360 this is our E1 so we are done with our
- 9:53:40step number one because now we have
- 9:53:42V1 and we got
- 9:53:46E1 so what was the step number two in
- 9:53:49the step number
- 9:53:51two we need to set the k equal to
- 9:53:562 this is the next K so for
- 9:54:03A2 what we need to do is we want to
- 9:54:07get
- 9:54:09V2
- 9:54:11and
- 9:54:14normalize V2 by getting E2 and how can
- 9:54:19we get that
- 9:54:21well first let's find what is the V2
- 9:54:25well V2 was and using that formula that
- 9:54:27we saw before which was this formula so
- 9:54:31it's equal to a k minus and the sum I is
- 9:54:35equal to 1 K minus one and then
- 9:54:37projection of a onto EI
- 9:54:40I so let's take this formula
- 9:54:43over this is equal to a 2 because K is
- 9:54:49equal to 2 a a k minus Su and then I is
- 9:54:53equal to one till K -1 and then K -1
- 9:54:58which is equal to basically 1 given that
- 9:55:02K is equal to
- 9:55:032 and then projection of A2 onto e
- 9:55:13i and this is equal to
- 9:55:16A2 minus given that we got k - Y is
- 9:55:20equal to 1 so the limit for our
- 9:55:22summation is equal to
- 9:55:241 so this one this means that like
- 9:55:29before we got just one part as part of
- 9:55:31our summation so minus and then
- 9:55:37projection of let me actually keep the
- 9:55:40same color I want it to be consistent so
- 9:55:44projection of
- 9:55:47A2 on d e
- 9:55:521 so you see here the i i is equal to 1
- 9:55:57and the limit of the I is K minus one
- 9:56:00which is equal to 1 so we got here just
- 9:56:06E1 so we got the V2 formula we can then
- 9:56:10now calculate it because we know
- 9:56:14A2 and the A2 is this so one one
- 9:56:211 0 1 but now we got a problem we don't
- 9:56:26know what this is so let's
- 9:56:29quickly go and calculate this
- 9:56:34part so
- 9:56:36projection of
- 9:56:39A2 on
- 9:56:42a
- 9:56:431 and we learned from the projection
- 9:56:47formula that this is equal to H 2 * E1 /
- 9:56:532 E1 * E1 so the dot product multip by
- 9:56:58E1 and what is this this is equal
- 9:57:01to 1 1 multiplied by and what is the E1
- 9:57:07E1 we just calculate in here so it is 1
- 9:57:11/ to 2 1 / to 2 and then zero here / two
- 9:57:16and then 1 / 2 1 / 2 and then 0 0
- 9:57:21multiplied by 1 / 2 1 / to 2 and then Z
- 9:57:25here multiplied by the same Vector so
- 9:57:33E1 so this two cancel out this two also
- 9:57:37cancel out and as you can see we are
- 9:57:40getting that
- 9:57:42the projection of A2 on E1 is equal to
- 9:57:46this vector
- 9:57:52we can also manually check that actually
- 9:57:55so let's let's do that so let's see we
- 9:57:57are not canceling out these
- 9:58:01vectors and instead we are manually
- 9:58:04calculating
- 9:58:10this so here we got 101 ultip by 0.5 and
- 9:58:170.50 this is equal to 1 *
- 9:58:201 / 2 is 1 / 2 0 * 1 / 2 is 0 1 * 0 is 1
- 9:58:27so + 1 /
- 9:58:312 this amount is
- 9:58:351/4 +
- 9:58:371/4 this multiplied by the vector 1 / 2
- 9:58:421 / 2 and then 0 in here this is equal
- 9:58:46to 1 / 2 1 + 1 / 2 is = to 3 / to 2 and
- 9:58:54then 1 1/4 + 1/4 is equal to 1 / 2 2
- 9:59:01multiplied by 1 2 and then 1 2 and then
- 9:59:07zero what is this amount well those two
- 9:59:10cancel out so we end up with three * and
- 9:59:15then 1 / 2 2 and then
- 9:59:201 / 2 and then
- 9:59:22zero this is then the projection 3 / 2 3
- 9:59:26/ to two and then
- 9:59:32zero so let me remove all these
- 9:59:35calculations
- 9:59:53and then we can take over the projection
- 9:59:56value which
- 9:59:57is 3 / to 2 3 / to 2 and then zero to
- 10:00:04get our Vector
- 10:00:07V2 which is equal to 1 - 3 / to 2 0 - 3
- 10:00:15/ to 2 and then 1 - 0 and this is equal
- 10:00:20to here it is 1 here it is - 3 / 2 and
- 10:00:24here is minus and then 1 / 2
- 10:00:292 because 3 / 2 is minus uh it is 1.5
- 10:00:34and then 1 - 1.5 is simply minus
- 10:00:370.5 so this is then the vector
- 10:00:40V2 then what we need to do is to
- 10:00:43normalize this Vector to get D
- 10:00:46E2 which is then equal to V2 ided to V2
- 10:00:53length which is simply equal to
- 10:00:57V2 / to V2 * V2 so the dot product and
- 10:01:03this is equal to let's take the V2 which
- 10:01:06is -1 / 2 and then - 3 / 2 and then 1
- 10:01:11and then divided 2 and this amount let's
- 10:01:14quickly calculate that it is equal to so
- 10:01:19the length of V2 is equal
- 10:01:23to - 1 / 2^
- 10:01:272 + - 3 / 2^ 2 + 1 this is equal to 1/4
- 10:01:34+ 9/ to 4 + 1 which is 4 / to 4 and then
- 10:01:41this is equal to 1 + 9 is 10 10 + 4 is
- 10:01:4514 so 14 / 2 4 this is the length of it
- 10:01:57so 14 / 2
- 10:02:044 so then this is equal to this Vector
- 10:02:08to this threedimensional
- 10:02:11Vector min-1 * 14 - 1 / 2 * 14 / 4 is
- 10:02:18equal to this is 7 so
- 10:02:23minus 7 / 2
- 10:02:294 and then - 3 /
- 10:02:342 think I just made a mistake here
- 10:02:38actually so Min - 1 / to 2 so the first
- 10:02:43element and then ided 24 / 4 is actually
- 10:02:47actually equal to this multipli by four
- 10:02:50ided to 14 so you take this element then
- 10:02:55divide it to this one and we know that a
- 10:02:58/ to B * C / 2 D is equal to a *
- 10:03:05D and then B * C so we are basically
- 10:03:10flipping this
- 10:03:12side this is
- 10:03:14from
- 10:03:15pre-algebra and then here
- 10:03:19this is equal
- 10:03:25to 2 and then is equal to -1 /
- 10:03:3827 then let's do the second one
- 10:03:41twoo so we got minus 3 / to 2 / to 14 /
- 10:03:47to 4 is actually equal to - 3 / to 2 * 4
- 10:03:51/ to
- 10:03:5314 and then if we remove this this is
- 10:03:58then 2 this is 7 this cancel out this
- 10:04:02equal to - 3 / to 7 - 3 / to 7 and then
- 10:04:08finally we got 1 /
- 10:04:122
- 10:04:1514 / 2 4 which is equal to 4 / 2 14 this
- 10:04:19equal to 2 / to 7 so 2 / to 7 and this
- 10:04:23is our A2 and given that we got just two
- 10:04:27vectors so we have already reached the
- 10:04:29end of our solution so now when we have
- 10:04:34already the V1 and the V2 the E1 and the
- 10:04:37E2 We have basically completed the
- 10:04:40process of this grummet uh procedure
- 10:04:43because we have already uh only two
- 10:04:47vectors that means that we need to have
- 10:04:49V1 and V2 and then uh E1 and E2 and this
- 10:04:53is all that you need in case you got two
- 10:04:55vectors if you have three vectors of
- 10:04:57course the process will include um the
- 10:05:00same process of Step number two and
- 10:05:02three so the V2 and the normalization of
- 10:05:05it two times for your K is equal to 2
- 10:05:08and K is equal to 3 and then if you have
- 10:05:12more vectors than every time you will
- 10:05:14have more of the steps but at the end
- 10:05:17what we want to have is the set of
- 10:05:19vectors that are orthogonal and at the
- 10:05:21same time they are normalized in this
- 10:05:23case we say that this vectors form this
- 10:05:26oron normal bases now why is this
- 10:05:29important the applications of
- 10:05:31orthonormal bases well firstly it
- 10:05:34simplifies a complex Vector
- 10:05:37operations and uh this is the basis of
- 10:05:40many uh more difficult mathematical
- 10:05:43Concepts uh like foror series or quantum
- 10:05:46mechanics it's used also um when when it
- 10:05:50comes to this auton normal basis uh also
- 10:05:53signal processing and it's a critical uh
- 10:05:56process in numerical methods especially
- 10:05:59in machine learning algorithms and in
- 10:06:01data compression so we will see this
- 10:06:03process to be used also as part of uh
- 10:06:05decomposition techniques which is really
- 10:06:08important when it comes to different
- 10:06:10algorithms uh whether it's optimization
- 10:06:12algorithms but also um algorithms that
- 10:06:16are used for recommender systems for
- 10:06:18example and those uh Concepts they all
- 10:06:22come together and we will see later on
- 10:06:24when we will be discussing the concepts
- 10:06:26of the compositions and metrics
- 10:06:29factorization so this Aon normal basis
- 10:06:31and this grum process they are really
- 10:06:33foundationally in linear algebra they
- 10:06:36provide tools for simplifying and also
- 10:06:39solving these higher dimensional
- 10:06:40problems efficiently their application
- 10:06:43include different fields of science
- 10:06:45engineering demonstrating their
- 10:06:47versatility and utility
- 10:06:52let's now talk about the special
- 10:06:54matrices and their properties so we are
- 10:06:56going to talk about special matrices
- 10:06:59like symmetric matrices and their
- 10:07:01example diagonal matrices and their
- 10:07:03corresponding example but also the
- 10:07:05ortogonal matrices with the
- 10:07:06corresponding
- 10:07:08example so when it comes to the special
- 10:07:11matrices special matrices have unique
- 10:07:14properties such as being symmetric or
- 10:07:16all nonzero elements on the diagonal
- 10:07:19like diagonal matrices or
- 10:07:21orthogonality uh in matrices which means
- 10:07:24that we have orthogonal
- 10:07:26matrices so when it comes to the
- 10:07:28symmetric Matrix it means that uh the a
- 10:07:33The Matrix a is equal to its transpose
- 10:07:36the a so a is equal to a in this case we
- 10:07:40can confirm and say that the Matrix a is
- 10:07:43symmetric so in this case we have Matrix
- 10:07:46a and we know that the way we need to to
- 10:07:50transpose this Matrix is to taking this
- 10:07:53rows and making them The Columns of our
- 10:07:56transpose Matrix so a is then equal
- 10:08:01to 2 - 1 and then zero then the second
- 10:08:05row which is min -1 and then 2 and then
- 10:08:09Min -1 and then the third row which is 0
- 10:08:13- one and two so the third row then
- 10:08:15becomes my third column so as you can
- 10:08:17see those two are the same so I'm using
- 10:08:20then the definition of the transpose of
- 10:08:23the um Matrix and then here then we end
- 10:08:28up with two matrices they are actually
- 10:08:31the same so we can see that the A and
- 10:08:34the a in both the First Column they got
- 10:08:372 minus one and then zero the second
- 10:08:40column minus one 2 and minus one the
- 10:08:42third column 0 - 1 and two so their
- 10:08:45columns and their rows they are the same
- 10:08:48which means that we are dealing with a
- 10:08:50symmetric Matrix so whenever we want to
- 10:08:52check whether the Matrix is symmetric we
- 10:08:54just need to take the transpose of it
- 10:08:56and see where the the Matrix is equal to
- 10:08:59its transpose in that case we are
- 10:09:00dealing with symmetric
- 10:09:02Matrix do also note therefore for uh
- 10:09:05Matrix to be symmetric it needs to be a
- 10:09:08square Matrix so it needs to be 2x two
- 10:09:11into two dimensional space or 3 by3 in
- 10:09:14the three dimensional space or n by N in
- 10:09:16N dimensional space which means that the
- 10:09:19number of rows should be equal to number
- 10:09:23of
- 10:09:27columns because otherwise when you flip
- 10:09:30your number of rows with number of
- 10:09:32columns on in case there is no um uh
- 10:09:37Square version of that Matrix so m is
- 10:09:40not equal to n in that case a will have
- 10:09:45a dimension of M by n and then then a t
- 10:09:51so a
- 10:09:56t will have a dimension of n
- 10:10:00by m which means that there is no way
- 10:10:03that a can be equal to a this is not
- 10:10:07then possible therefore we need to have
- 10:10:10a square Matrix for them to be
- 10:10:15symmetric let's now talk about diagonal
- 10:10:17matrix so a diagonal Matrix has a
- 10:10:20nonzero element only on its diagonal
- 10:10:24which means that in this case we have
- 10:10:27this nonzero elements on the diagonal so
- 10:10:30let's call it
- 10:10:31d11 d22 and then d33 this equal to three
- 10:10:36this equal to 5 this equal to 7 and all
- 10:10:39the other elements as you can see in
- 10:10:41here they are
- 10:10:44zeros so the concept of diagonal
- 10:10:47matrices is very uh simple therefore we
- 10:10:50will then go through the next example
- 10:10:52which is about orthogonal Matrix now
- 10:10:55this is a concept that we haven't yet
- 10:10:57seen and we spoken about so let's Cod
- 10:11:00read through this bit slowly so an
- 10:11:02orthogonal Matrix is a square Matrix
- 10:11:05whose columns and rows are orthogonal
- 10:11:09unit vectors so oron normal vectors and
- 10:11:13its transpose equals its
- 10:11:17inverse so there are two two part of
- 10:11:19this elements so firstly it
- 10:11:22says that for the Matrix to be octogonal
- 10:11:24Matrix it should be a square Matrix so
- 10:11:29Square
- 10:11:33Matrix and then its
- 10:11:36columns and rows are orthogonal unit
- 10:11:41vectors so
- 10:11:44columns and
- 10:11:46rows
- 10:11:48are
- 10:11:52orthogonal unit
- 10:11:55vectors which means they need to be
- 10:11:57normalized so
- 10:12:01normalized so um we have seen when
- 10:12:05forming this orthonormal basis that we
- 10:12:07had this process of uh this condition of
- 10:12:11orthogonality the vectors had to be AAL
- 10:12:14and they had to have a length of one
- 10:12:16which means that they they had to be
- 10:12:18normal I we can see exactly the same in
- 10:12:21here so hence the name oron normal
- 10:12:25vectors so they are utal and they are
- 10:12:28unit vectors which means they are
- 10:12:31normalized so then the final condition
- 10:12:35is added in here which actually is not
- 10:12:38so much a condition but rather than a
- 10:12:40property something that we can prove
- 10:12:42that once we have all this we can also
- 10:12:46say that if we are dealing with toal
- 10:12:49Matrix then
- 10:12:51Q T * Q so the dotproduct of the
- 10:12:58transpose with that Matrix Q is equal to
- 10:13:04the Q * QT is equal to I why because the
- 10:13:11QT is equal to the Q minus one because
- 10:13:16the transpose of that Matrix Q is
- 10:13:19actually equal to its
- 10:13:21inverse and given that we learned that
- 10:13:23the Q minus one so the inverse time Q is
- 10:13:27= to Q inverse * Q is equal to
- 10:13:31I and given that here we are learning
- 10:13:34that Q T is = to Q minus one we are then
- 10:13:40making use of this to claim
- 10:13:44this so instead of minus On's that we
- 10:13:48are used to when we are dealing with
- 10:13:51inverses here we have t the
- 10:14:02transpose so in this case this
- 10:14:04orthogonal Matrix that we have just
- 10:14:07learned about this is the square Matrix
- 10:14:09whose columns and rows are orthogonal
- 10:14:11and they are also normalized meaning
- 10:14:14that we are dealing with
- 10:14:16QT QT sh Q minus one it will look like
- 10:14:21this so this q1 you can see that here we
- 10:14:24got the first row here we got the second
- 10:14:27row and if we
- 10:14:29calculate
- 10:14:31the dot product between this row and
- 10:14:34this row we can quickly see that we are
- 10:14:36getting a value of zero so we can prove
- 10:14:39that they are actually autogo those two
- 10:14:42rows let's go ahead and actually prove
- 10:14:44that so let's call this R1 let's call
- 10:14:47this R2 this is Row one and row two and
- 10:14:50I will leave the uh column version so q1
- 10:14:54* Q2 that's do product on you to prove
- 10:14:57that the columns are perpendicular I
- 10:15:00will work with the rows so R1 * R2 for
- 10:15:06me to prove that they are orthogonal I
- 10:15:08need to prove that this equal to
- 10:15:10zero can we do that well let's try so 1
- 10:15:15/ 2 < of 2 1 / 2 of 2 ultied by 1 / 2 <
- 10:15:24of
- 10:15:252 needs some bigger space in
- 10:15:29here so 1 / 2 of 2 and then
- 10:15:34minus 1 / 2 of 2 that's how I can
- 10:15:38calculate the dot product between R1 and
- 10:15:43R2 R2 and
- 10:15:46R1 you can see that the elements in here
- 10:15:49are the same and here the elements are
- 10:15:51also the
- 10:15:54same so then this is equal
- 10:15:58to 1 / 2 < of 2 * 1 / 2 of 2 - 1 / to of
- 10:16:072
- 10:16:11* 1 / 2 of 2 I'm simply taking this
- 10:16:15minus and given that the dotproduct is
- 10:16:18basically Plus
- 10:16:19and then this amount I'm just taking
- 10:16:21this and bringing up in here to a avoid
- 10:16:24one more step uh given the space is
- 10:16:27quite limited now what do we see in
- 10:16:31here this value is the same as this
- 10:16:34value which means that this is equal to
- 10:16:38zero and we know that the two vectors to
- 10:16:42be or token they need to have a DOT
- 10:16:45product equal to zero so here we have
- 10:16:47proven that dotproduct
- 10:16:52of R1 and R2 is equal to
- 10:16:59zero so this proves that R1 and R2 so
- 10:17:04the two
- 10:17:08rows of this Matrix so R1 and
- 10:17:12R2 are orogo
- 10:17:19we can also prove that the second
- 10:17:21criteria of auton normal vectors is also
- 10:17:24satisfied in here we can prove that when
- 10:17:27we look at the
- 10:17:30length of this vector and of this one
- 10:17:35then they are of the unit one so let's
- 10:17:38actually go ahead and do for one of them
- 10:17:41so let's prove that
- 10:17:45for 1 / 2 of 2 and then 1 / 2 Ro of 2
- 10:17:52this is a
- 10:17:56vector that the length of
- 10:17:59it this is let's say
- 10:18:01our first row so this is
- 10:18:05R1 then the R1 length is equal
- 10:18:10to 1 / 2 of 2 2 + 1 / 2 of 2 2 this is
- 10:18:21equal to 1 / 2 + 1 / 2 and what is 1 / 2
- 10:18:28+ 1 / 2 it's equal to 1 so we have
- 10:18:32proven that the length of R1 is equal to
- 10:18:371 you can quickly and easily also
- 10:18:40compute that for the second row and you
- 10:18:42will then also prove that the R2 the
- 10:18:45length of it is also one which is then
- 10:18:47the second criter area which said that
- 10:18:51for the vectors to form this auton
- 10:18:53normal bases so to be auton normal
- 10:18:55vectors they uh also had to have a
- 10:18:58length of one so they had to be a unit
- 10:19:01vectors in this case then we can make
- 10:19:04use of the property that the
- 10:19:07Q
- 10:19:102 transpose is equal to Q
- 10:19:15inverse and this then result in Q2
- 10:19:20transpose * Q2 Q2 which is equal to Q2 *
- 10:19:24Q2 transpose which is equal to the
- 10:19:26identity Matrix and specifically I2
- 10:19:30because we are in the
- 10:19:34R2 so both this Q2 and the previous
- 10:19:37example those are orthogonal
- 10:19:40matrices and in here we have proven that
- 10:19:44the rows are indeed oroginal and we have
- 10:19:47also seen that the length of them are
- 10:19:49unit vectors meaning that we have
- 10:19:52automatically got
- 10:19:54this I will leave this one to you to do
- 10:19:58those proofs so to uh ensure that the
- 10:20:01row one and row two are orthogonal so
- 10:20:04they are perpendicular which means that
- 10:20:06the product of their uh the dot product
- 10:20:09of these two vectors is equal to zero
- 10:20:11and also that they are normalized which
- 10:20:13means the length of them is equal to one
- 10:20:16and this means that then this holds you
- 10:20:20can actually even go ahead and uh
- 10:20:24practice the material that we are uh
- 10:20:26learned as part of the previous units by
- 10:20:28calculating the inverse of this Matrix
- 10:20:32and checking that the inverse of this
- 10:20:34Matrix is indeed equal to the transpose
- 10:20:36of the Matrix so that QT is equal to Q
- 10:20:40minus 1 because we learned how we can
- 10:20:42compute the inverse of a matrix because
- 10:20:45the inverse of a matrix was equal to 1 /
- 10:20:48the determinant of this Matrix
- 10:20:52times and then the manipulated version
- 10:20:54of it which was in this case 0 0 and
- 10:20:58then we need to have here 1 so -1 *
- 10:21:021 and then 1 * - one so we have to
- 10:21:06multiply this and this by minus so one
- 10:21:09and then here minus
- 10:21:11one so in this way you can also prove
- 10:21:15that this inverse is actually equal to
- 10:21:18the Q to
- 10:21:20transpose because then you can prove
- 10:21:24that indeed and you can see for yourself
- 10:21:26that this formula is in equal to the Q2
- 10:21:30transpose because then you can prove
- 10:21:34that indeed and you can see for yourself
- 10:21:37that this formula is indeed true in this
- 10:21:40module we are going to talk about Matrix
- 10:21:42factorization we are going to discuss
- 10:21:44the significance of Matrix factorization
- 10:21:47we are going to Define Matrix
- 10:21:49factorization we are going also to
- 10:21:51discuss the common applications of
- 10:21:52Matrix factorization across different
- 10:21:54fields and then we are going to see
- 10:21:56detailed examples of metrix
- 10:21:59factorization so let's talk about why
- 10:22:02Matrix factorization matters so metrix
- 10:22:05factorization techniques they are
- 10:22:07essential for various reasons they are
- 10:22:09used for simplifying metrix operations
- 10:22:11like solving linear systems or when we
- 10:22:14have this um many uh matrices but we
- 10:22:18want to to um simplify these operations
- 10:22:21that we apply to these matrices and we
- 10:22:22want to solve the problem then we can
- 10:22:25make this uh complex Matrix operations
- 10:22:28more manageable and make these uh
- 10:22:31calculations more manageable by using
- 10:22:33Matrix factorization techniques we can
- 10:22:36also use Matrix factorization directly
- 10:22:38to solve system all linear equations
- 10:22:41efficiently we can also use Matrix
- 10:22:43factorization to perform igon value de
- 10:22:45composition singular value de de
- 10:22:47composition or called SVD and other
- 10:22:51operations which are crucial in machine
- 10:22:53learning and data analysis so ion values
- 10:22:57and igon vectors you might have heard
- 10:22:59already they are part of also PCA which
- 10:23:02is the principal component analysis and
- 10:23:04this comes from uh fundamentals of
- 10:23:06statistics and the uh PCA is used as a
- 10:23:10dimensionality technique and in fact
- 10:23:12it's one of the most popular damage s
- 10:23:14techniques that you will find in the
- 10:23:16industry used in the data science using
- 10:23:19data analytics machine learning even in
- 10:23:22the Deep learning so Matrix
- 10:23:25factorization can also be used to reduce
- 10:23:28the computational complexity by making
- 10:23:30use of this factorization we can then
- 10:23:33simplify the process and also make it
- 10:23:35more efficient for computation and it's
- 10:23:38especially important when we are dealing
- 10:23:40with this High dimensional data when we
- 10:23:42have many features or we have a very
- 10:23:45large model and complex model then this
- 10:23:48uh meing factorization technique can
- 10:23:51make a huge difference in our data
- 10:23:53processing process so this techniques
- 10:23:56underpin many algorithms in numeric
- 10:23:59analysis in optimizations and Beyond so
- 10:24:03whenever it comes to machine learning or
- 10:24:06data science or many other fields you
- 10:24:08will see this uh process and this term
- 10:24:11metrix authorization appearing a lot
- 10:24:14even um in the example of a streaming
- 10:24:16company Netflix which I'm sure that you
- 10:24:18are aware of netrix is using uh metrix
- 10:24:22uh factorization to build a recommender
- 10:24:24system and uh metrix authorization usage
- 10:24:28in building recommender algorithm for
- 10:24:30personalized recommendations is actually
- 10:24:32one of the most popular applications of
- 10:24:34metric factorization therefore I wanted
- 10:24:37to specifically discuss this topic as
- 10:24:39part of our Advanced linear algebra
- 10:24:41course and some of the concepts might
- 10:24:44seem bit more complex than the ones that
- 10:24:46we have discussed as part of the
- 10:24:47previous units but once we go through
- 10:24:50them step by step and I will give you
- 10:24:53all the details in all these examples
- 10:24:55this entire process of this different
- 10:24:58metrix factorization techniques should
- 10:25:00become much more clear and
- 10:25:02straightforward so we will be discussing
- 10:25:04not just one but multiple fundamental
- 10:25:07metrix factorization techniques beside
- 10:25:10of talking the high level where they are
- 10:25:12used and how you can choose for what
- 10:25:15type of applications so we are going to
- 10:25:17demes this entire concept of metrix
- 10:25:20factorization and we are going to uh
- 10:25:23start from high level then we are going
- 10:25:25to go into the deepest details let's now
- 10:25:28formally Define the metrix factorization
- 10:25:31so metrix factorization refers to
- 10:25:34decomposing a matrix into product of two
- 10:25:37or more matrices revealing its structure
- 10:25:41and simplifying further
- 10:25:43analysis so what is this idea behind
- 10:25:46metric factorization the idea is that if
- 10:25:48we have a matrix
- 10:25:50a and we want to simplify our process of
- 10:25:54calculation or multiplication anything
- 10:25:57that's related to this a but this a in
- 10:26:00itself it contains this weird numbers or
- 10:26:03it is just too complex you know it
- 10:26:04contains this ton of different numbers
- 10:26:07you don't recognize whether the columns
- 10:26:09are linearly independent it's not very
- 10:26:11readable from the first View and you
- 10:26:13just want to make your life easier when
- 10:26:15performing this calculations well for
- 10:26:17that you you can make use of this Matrix
- 10:26:19factorization to write this a in terms
- 10:26:23of some other matrices let's say um and
- 10:26:26I'm calling here randomly Q or t so it's
- 10:26:30equal to for instance the dotproduct of
- 10:26:31these two matrices Q * T where Q is much
- 10:26:35simpler and the t is also much simpler
- 10:26:38so those may contain vectors that are um
- 10:26:42for instance this can be a diagonal
- 10:26:44matrix or it can be a matrix uh with
- 10:26:47specific properties when using those you
- 10:26:50will feel much more comfortable so it
- 10:26:52will be easier for you to use them in
- 10:26:54order to multiply uh with other matri
- 10:26:57matrices it can be easier for you to
- 10:27:00solve this problem but of course if you
- 10:27:02are in the two-dimensional space let's
- 10:27:04say you are in R2 or in R3 then most
- 10:27:07likely it will be quite straightforward
- 10:27:09for you to use the a itself but if you
- 10:27:12are in the r 100 or R 1,000 then of
- 10:27:17course this uh entire computations they
- 10:27:20become super complex it will be
- 10:27:23difficult to understand and compute this
- 10:27:26linear combinations find out whether you
- 10:27:28are dealing with a linearly independent
- 10:27:30columns find out um the um new space the
- 10:27:35calm space the basis of the new space
- 10:27:38and calm space and all these they might
- 10:27:41seem uh much more difficult when you are
- 10:27:43in high dimensional space for in those
- 10:27:45cases we can then make use of metric
- 10:27:47factorization
- 10:27:48to make the entire process much more
- 10:27:52simplified and also more efficient this
- 10:27:55entire calculation process so common
- 10:27:58types of Matrix factorization include
- 10:28:00lower upper uh Matrix factorization or
- 10:28:03in short
- 10:28:04L QR factorization an Infamous type of
- 10:28:08factorization which is called orthogonal
- 10:28:11triangular
- 10:28:13factorization and then we have SVD
- 10:28:16singular value de compos ition yet
- 10:28:19another in famous metrix
- 10:28:21factorization and then finally the igon
- 10:28:24de composition also another Super
- 10:28:26popular metrix factorization
- 10:28:28technique so uh the QR SVD and igod
- 10:28:33composition are in fact highly popular
- 10:28:37the composition and Metric factorization
- 10:28:40techniques that you will see appearing
- 10:28:43in the 90% of all the statistics related
- 10:28:46and machine learning related ated books
- 10:28:49so this just comes to prove how
- 10:28:51important these concepts are when it
- 10:28:54comes to properly learning and mastering
- 10:28:57these more applied uh science related
- 10:29:00fields like machine learn so if you want
- 10:29:03to go beyond the level of knowing
- 10:29:05algorithms but rather than to also be
- 10:29:08able to edit the algorithms tweak them
- 10:29:11adjust them be able to understand
- 10:29:14machine learning algorithms deep
- 10:29:15learning algorithms data science and at
- 10:29:18its core and in order to become a
- 10:29:20professional well-rounded professional
- 10:29:23then this I composition the singular
- 10:29:25valid composition and the QR metrix
- 10:29:28authorization techniques are techniques
- 10:29:30that you want to know and you want to
- 10:29:33understand at least higher level such
- 10:29:35that you can easier grasp more advanced
- 10:29:39concepts that come from the applied
- 10:29:41sciences like machine learning and
- 10:29:44AI so let's first discuss at high level
- 10:29:47what this C q r DEC composition is so
- 10:29:50what the QR DEC composition does is that
- 10:29:52it decomposes a matrix into an
- 10:29:55orthogonal Matrix which we are referring
- 10:29:58by q and then an upper triangular Matrix
- 10:30:03R so in here you can see that we have
- 10:30:07this two different matrices so we are
- 10:30:10basically saying a is equal to this
- 10:30:12product of this Matrix q and r R where
- 10:30:19the first one this Matrix
- 10:30:22Q this one should be orthogonal Matrix
- 10:30:26so this part is really important and we
- 10:30:29have learned as part of the previous
- 10:30:31module the definition of orthogonal
- 10:30:34Matrix we learned that the rows or
- 10:30:37columns they had to be orthogonal to
- 10:30:39each other and we also learned that they
- 10:30:42need to have a length of one they need
- 10:30:44to um be normalized
- 10:30:48and we learned that this means that the
- 10:30:51transpose of those matrices is equal to
- 10:30:53the inverse of the matrices so this was
- 10:30:56just the last part of the previous
- 10:30:58module and this is exactly what this
- 10:31:01Matrix Q is about so we are saying that
- 10:31:04we will decompose I into this two
- 10:31:06matrices as a product of these two
- 10:31:08matrices Q andr one of which this Matrix
- 10:31:11Q should uh be uh an autal Matrix which
- 10:31:14means the rows and the columns they
- 10:31:16should be or toal to each other so their
- 10:31:20uh dot product each of them should be
- 10:31:22equal to zero and they need to be
- 10:31:25normalized so the length of them should
- 10:31:27be one for each of those rows and
- 10:31:29vectors and then the second part of this
- 10:31:33U the composition is this Matrix R which
- 10:31:36says that the Matrix R should be an
- 10:31:39upper triangular Matrix and what is the
- 10:31:42definition of upper
- 10:31:43triangular well in this case you can
- 10:31:47think of this r as this
- 10:31:49Matrix where we have here all
- 10:31:54zeros and then here on the diagonal you
- 10:31:57have numbers nonzero numbers and then
- 10:32:00here let's say 1 2 3 4 5 and then here
- 10:32:04in the upper part you will also have
- 10:32:06numbers so unlike in the lower part of
- 10:32:08this Matrix R where you will have zeros
- 10:32:12in
- 10:32:13here you will have also noner numbers
- 10:32:16numbers let's say seven
- 10:32:18uh 10 uh
- 10:32:208 and I'm just writing these numbers
- 10:32:22randomly so of course in a real case
- 10:32:25when we have this Matrix a and we go
- 10:32:27through this process of QR de
- 10:32:28composition of course we will have an
- 10:32:30appropriate q and appropriate R where
- 10:32:33these numbers will be different and they
- 10:32:35will be specific numbers that we will be
- 10:32:39calculating but the idea is that we need
- 10:32:41to get this upper triangular Matrix R
- 10:32:45for this calculation to make sense
- 10:32:48so we will then be using this qard
- 10:32:50composition for solving linear um linear
- 10:32:54Le squares problems for instance which
- 10:32:56is part of the linear regression too
- 10:33:00because linear regression from machine
- 10:33:03learning and from statistics uh it is
- 10:33:06based on the least Square technique the
- 10:33:10estimation technique that we are using
- 10:33:12for linear regression in machine
- 10:33:14learning um to solve this linear
- 10:33:17regression problem is called Ordinary
- 10:33:19leas squares so the algorithm is based
- 10:33:21on this idea of Le squares which is
- 10:33:23trying to minimize a squared uh
- 10:33:26residuales of the morel and that can be
- 10:33:29done by using this idea of QR
- 10:33:34decomposition so it helps us to provide
- 10:33:37numerically stable solutions for this
- 10:33:39type of problems too and C de
- 10:33:41composition is used extensively in
- 10:33:44Signal processing and statistical
- 10:33:46analysis
- 10:33:49let's now briefly talk about the L
- 10:33:51decomposition so L decomposition
- 10:33:53decomposes a matrix into lower
- 10:33:56triangular Matrix so this is the
- 10:33:58opposite of what we had before we can
- 10:34:00have an upper
- 10:34:03triangular
- 10:34:05triangular
- 10:34:07Matrix like we had in the QR the
- 10:34:11composition we can also have a lower
- 10:34:13triangular Matrix so you might have
- 10:34:15already guessed how it will look like I
- 10:34:17want go into that very soon in the QR
- 10:34:20composition example you will see the
- 10:34:22idea of the upper triangular I will also
- 10:34:25show the idea of a lower
- 10:34:27triang so the composition in case of Lu
- 10:34:32uh is done by decomposing a matrix into
- 10:34:36lower triangular Matrix l and an upper
- 10:34:39triangular Matrix U so basically the
- 10:34:43difference between the QR de composition
- 10:34:46and L de composition is that in the QR
- 10:34:49DEC composition we are decomposing a
- 10:34:51matrix into orthogonal Matrix and an
- 10:34:53upper triangular Matrix while in case of
- 10:34:56L DEC composition we are decomposing a
- 10:34:59matrix into lower triangular Matrix and
- 10:35:02an upper triangular Matrix so here you
- 10:35:05can see that we no longer have this idea
- 10:35:06of orthogonal matrix but instead of that
- 10:35:09we are talking about lower triangle
- 10:35:13Matrix so in that aspect uh L U the
- 10:35:17composition is different from QR DEC
- 10:35:19composition so what the L de composition
- 10:35:22does is that it facilitates the solving
- 10:35:25of linear equations and Matrix
- 10:35:27inversions it is common in engineering
- 10:35:30and in physical sciences for systems of
- 10:35:33this linear equation to be solved by
- 10:35:35using lud de composition and in fact if
- 10:35:38you are learning Quantum uh mechanics
- 10:35:41that this L decomposition can definitely
- 10:35:45help you to better understand many
- 10:35:46Concepts but if your target fields are
- 10:35:49machine learning deep learning or
- 10:35:51artificial intelligence then for those
- 10:35:54using QR composition will be uh much
- 10:35:57more often a case than using this lud de
- 10:36:03composition let's now talk about the
- 10:36:05singular value decomposition so what the
- 10:36:08SVD does is that it decomposes a matrix
- 10:36:11into three matrices so first one is the
- 10:36:16orthogonal Matrix C
- 10:36:19the second one is a diagonal
- 10:36:22matrix and then the third one is this V
- 10:36:26which is the conjugate transpose of an
- 10:36:28orthogonal
- 10:36:30Matrix so for now this might s bit
- 10:36:34complex and you can see that unlike the
- 10:36:36QR or Lu de composition where we got
- 10:36:39just uh two uh matrices as a result of
- 10:36:42our decomposition in case of SD we got
- 10:36:45three matrices like the name suggests
- 10:36:47two by the way so three
- 10:36:54parts and this might seem bit complex
- 10:36:57but we are going to go through this
- 10:37:00process step by step and I'm going to
- 10:37:02provide you detailed example such that
- 10:37:04this will all make sense but for now
- 10:37:07let's focus at the high level usage of
- 10:37:09SVD so singular value decomposition is
- 10:37:13one of the most popular decomposition
- 10:37:15techniques and it is also Direct Al used
- 10:37:18as part of machine learning algorithms
- 10:37:20to form uh those machine learning
- 10:37:22algorithms it is also used in the data
- 10:37:25compression in the noise reduction so
- 10:37:27when we are trying to clean our data and
- 10:37:30remove the Noise by using SVD because
- 10:37:32SVD can help us to identify those
- 10:37:34outliers and then remove them from the
- 10:37:37data by performing noise
- 10:37:40reduction and it is also used in the
- 10:37:42principal component analysis the
- 10:37:45PCA the uh same dimensionality reduction
- 10:37:48technique that I just uh mentioned
- 10:37:51related to the ion de composition
- 10:37:53because SVD and the igon de composition
- 10:37:55are highly related to each other so this
- 10:37:58SVD is used as part of this PCA
- 10:38:00algorithm and PCA is the most popular
- 10:38:04the infamous dimensionality reduction
- 10:38:07technique that is used both in the
- 10:38:09advanced statistical studies in the
- 10:38:11statistics in general also in finance
- 10:38:14and is also used as part of many machine
- 10:38:16learning and deep learning applications
- 10:38:19so knowing PCA is a must if you want to
- 10:38:22get into uh data analytics or data
- 10:38:24science machine learning and AI but
- 10:38:29also uh it helped you it will help you
- 10:38:31also to uh understand uh many other
- 10:38:35Concepts when it comes to this Fields so
- 10:38:38the SVD provides insight into the
- 10:38:40structure but also the rank of the
- 10:38:42Matrix so we are going to see this as
- 10:38:44part of our example too
- 10:38:47let's now also briefly talk about the
- 10:38:49igen dec composition so igen DEC
- 10:38:52composition which is highly related to
- 10:38:54this concept of igen values and ion
- 10:38:56vectors it decomposes a matrix into this
- 10:38:59ion values and ion vectors which then
- 10:39:02shows the matrix's fundamental
- 10:39:05properties which are related to this
- 10:39:06idea of correlation what kind of
- 10:39:08information does this uh Matrix contain
- 10:39:11what is the variation in what direction
- 10:39:13is the variation the largest and this
- 10:39:16icon that composite which is then
- 10:39:18related to also this idea of SVD and in
- 10:39:21general this dimensions and correlations
- 10:39:24is critical for understanding linear
- 10:39:26Transformations the stability analysis
- 10:39:29and systems of differential
- 10:39:32equations but beside this uh
- 10:39:35mathematical side of uh Concepts and
- 10:39:38understanding these mathematical topics
- 10:39:41the ion de composition is also the basis
- 10:39:43for many algorithms in numerical deor
- 10:39:46algebra
- 10:39:48uh but also many applied linear algebra
- 10:39:50topics like in the data science in
- 10:39:53machine learning and it's used heavily
- 10:39:55in artificial intelligence for feature
- 10:39:58extraction for dimensionality reduction
- 10:40:01related again to the concept of PCA
- 10:40:03because PCA is based entirely on this
- 10:40:06concept of IG de composition PCA is the
- 10:40:10direct result of computing the igon
- 10:40:14values and igon vectors
- 10:40:21so without knowing what are Dion values
- 10:40:24and ion vectors you cannot perform PCA
- 10:40:26because the first step of the PCA is the
- 10:40:30computation of the icon values and icon
- 10:40:32vectors and then using different rules
- 10:40:34which we are referring uh as the elbow
- 10:40:37rule or Kaiser rule we can then use this
- 10:40:40icon values and icon vectors to
- 10:40:43understand what are the features in our
- 10:40:45data that contain the most
- 10:40:48variation so the most information and
- 10:40:52then we can use that in order to
- 10:40:54understand what are the most important
- 10:40:56features in our data and reduce the
- 10:40:59dimension of our model by selecting this
- 10:41:02most important features because what PCA
- 10:41:05basically does is that it it uses these
- 10:41:08icon values and icon vectors to
- 10:41:10understand how we can uh create a linear
- 10:41:13combination out of our features and
- 10:41:16understand the the amount of those
- 10:41:19linear combinations that contain the
- 10:41:21most variation and then select those and
- 10:41:24uh select the largest amount of
- 10:41:27information in the data and then Skip
- 10:41:30and drop those uninformative being your
- 10:41:33combinations while still keeping the
- 10:41:35most information and this definition of
- 10:41:38the most will then be decided by this
- 10:41:40differentials this is just higher level
- 10:41:42Insight background information on what
- 10:41:44you can expect when you are talking
- 10:41:46about applying this highly technical
- 10:41:50linear algebra concept of Icon de
- 10:41:52composition into an applied science
- 10:41:55Fields like data science or machine
- 10:41:57learning or AI but we will see this
- 10:41:59later and I'll also make comments
- 10:42:01regarding this and though PCA won't be
- 10:42:05discussed as part of this course because
- 10:42:07here we are talking about linear algebra
- 10:42:09but PCA is part of the fundamentals
- 10:42:12statistics course and in there we are no
- 10:42:15longer providing all these different
- 10:42:17details on how you can uh perform this I
- 10:42:20composition therefore knowing how to
- 10:42:23perform I composition will then set you
- 10:42:27for success to actually understand the
- 10:42:30mathematics behind the statistical
- 10:42:32Concepts like PCA and also later on
- 10:42:37understand how you can use that PCA in a
- 10:42:39machine learning Concepts and in AI
- 10:42:42Concepts like outo encoders and how you
- 10:42:44can relate your um out to encoders to
- 10:42:48this concept of PCA how they are related
- 10:42:50what are their commonalities and what
- 10:42:52are their
- 10:42:55differences so everything is about the
- 10:42:58choice and choosing the right tool for
- 10:43:01your problem when it comes to the
- 10:43:03decomposition tools metrix authorization
- 10:43:05tools we have seen that there are many
- 10:43:07options and the question is which one
- 10:43:09should we pick in what cases so choosing
- 10:43:11the right tool is really important when
- 10:43:13it comes to this different metrix
- 10:43:15factorization techniques because they
- 10:43:16are many choices and each of them they
- 10:43:19can be used for different sorts of
- 10:43:21problems so therefore in order to
- 10:43:24understand which one you need to pick in
- 10:43:27what kind of cases what kind of
- 10:43:28requirements you have and what kind of
- 10:43:30solve uh problem you are trying to solve
- 10:43:33that in those cases you will need to
- 10:43:36have this knowledge that you will learn
- 10:43:38as part of this course in order to make
- 10:43:40that right choice of the
- 10:43:43twool so the choice among Q are the
- 10:43:46composition
- 10:43:47the L de composition the SVD and IG de
- 10:43:50composition it really depends on your
- 10:43:53specific problems requirements and the
- 10:43:55data characteristics so are you dealing
- 10:43:57with a complex data are you dealing with
- 10:44:00a simple data with low Dimensions what
- 10:44:03is the goal that you uh want to uh
- 10:44:06achieve what is the problem that you are
- 10:44:07trying to solve is it to uh reduce the
- 10:44:11dimension of your feature space is it to
- 10:44:15solve a problem with linear
- 10:44:17equations is it to solve a quantum
- 10:44:20mechanics problem or is it to um
- 10:44:24incorporate this as part of your machine
- 10:44:27learning algorithm so QR and LU DEC
- 10:44:30compositions are usually preferred for
- 10:44:32solving linear systems while SVD and I
- 10:44:35Anda compositions they help us for
- 10:44:37deeper insights when it comes to the
- 10:44:39data and what kind of information it
- 10:44:41contains how we can reduce the dimension
- 10:44:44of the data or how we can use it as part
- 10:44:47of machine learning algorithm for uh
- 10:44:49noise reduction identifying outliers Etc
- 10:44:53so um this type of algorithms like SVD
- 10:44:57and ion de composition it helps us to
- 10:44:59also uh intuitively using geometry and
- 10:45:03our knowledge of geometry to um
- 10:45:06visualize the data for instance the PCA
- 10:45:08helps us to visualize this High
- 10:45:10dimensional data using just couple of
- 10:45:13principal components let's say we have
- 10:45:1510 features in our
- 10:45:17model so we have a dimension of 10 we
- 10:45:21are in r10 but we want to visualize our
- 10:45:24data by using PCA we can then reduce the
- 10:45:26dimension and come up with uh three
- 10:45:29principal components which are a linear
- 10:45:31combination of our original 10 vectors
- 10:45:34and then we can use the three principal
- 10:45:36components to visualize our data in
- 10:45:393D and this basically helps us to
- 10:45:42geometrically visualize our data and
- 10:45:45then make presentation s make much more
- 10:45:48sense of our story so to do uh
- 10:45:50storytelling for our data and uh much
- 10:45:53more and these two uh models and tools
- 10:45:58they are invaluable when it comes to uh
- 10:46:01applications in machine learning in deep
- 10:46:03learning in data science and artificial
- 10:46:06intelligence
- 10:46:08so meing factorization techniques they
- 10:46:10are super important when it comes to
- 10:46:12computational mathematics they are also
- 10:46:15directly affecting the data science Ai
- 10:46:17and many other algorithms so they are
- 10:46:19not only important in terms of the
- 10:46:21problem that they are trying to solve
- 10:46:23but also in order to make the
- 10:46:24computation process so when coding in
- 10:46:27python or in other programming languages
- 10:46:30to make that process much more efficient
- 10:46:33they also help us to uh make these
- 10:46:35computations efficient and provide
- 10:46:37insights into different properties that
- 10:46:40we have in our
- 10:46:42data as part of this course we are not
- 10:46:45only going to discuss one but actually
- 10:46:48three of these four the composition
- 10:46:51techniques and this metrix factorization
- 10:46:53techniques in detail we are going to
- 10:46:55talk about the qard de composition we
- 10:46:58are going to not just discuss it but uh
- 10:47:01also to learn it step by step and we are
- 10:47:04going to do a detail example with all
- 10:47:07the steps involved such that you will
- 10:47:09feel confident doing a QR decomposition
- 10:47:12all by yourself then we are also going
- 10:47:15to do an SVD de comp position as well as
- 10:47:18ion the composition and then we are
- 10:47:21again going to discuss them in terms of
- 10:47:23their mathematical formulation the
- 10:47:25definition but also the application
- 10:47:27step-by-step process and a detailed
- 10:47:30example such that you can conduct each
- 10:47:32of those metric factorization techniques
- 10:47:34and these decomposition techniques by
- 10:47:36yourself manually doing all these
- 10:47:39calculations this understanding and this
- 10:47:42examples and this Concepts will help you
- 10:47:44to not just be able to formulate what
- 10:47:47these techniques are about but really
- 10:47:49and truly understand and then use them
- 10:47:53later on whether when doing your own
- 10:47:55research writing scientific papers or
- 10:47:58tweaking the algorithm all by yourself
- 10:48:00when inventing new
- 10:48:03algorithms I won't be discussing this L
- 10:48:06de composition technique because we
- 10:48:08already know uh that the QR and LU they
- 10:48:11are both used for similar type of
- 10:48:13problems therefore to save us time I
- 10:48:16have selected carefully the uh most
- 10:48:20important the composition techniques and
- 10:48:22Metric factorization techniques that you
- 10:48:25will most likely be dealing with will be
- 10:48:27dealing with in your future career in
- 10:48:29applied sciences
About this transcript
This page contains the full transcript of Linear Algebra for Machine Learning by freeCodeCamp.org, generated from the public captions YouTube serves with the video. The transcript has 86,865 words across 12,181 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.