 So another video in the first video we looked at vectors as far as linear algebra concerned really the Fundamental object in linear algebra. Now we're gonna move on to matrices. So I'm going to introduce you to the concepts In this video now, it's not gonna be a single video because there's just too much to say So I'm gonna chop this up into a couple of videos. I think in the end they might be as many as nine we'll see how We'll see how it goes and the matrices just as important and you know, whether you do cryptography whether you do Data analysis data science where they do physics or engineering Matrices are just everywhere and that makes linear algebra probably one of the most fundamental and important subjects in mathematics today And that's why I'm showing you how to do this So we're just gonna we building up this intuitive understanding So we're not following a specific a specific way that the textbook usually present this because I want you to understand it And then it just becomes easier to do all of these We're gonna start off with By looking at linear systems, I think in video number two for this second set on on matrices and That still requires you to sit with pen and paper and practice a lot of you have to do tests or exams or whatever but it's just so easy then to check your work in Julia and Using a language such as Julia just makes it easier I think also to understand what is going on because we can draw some plots and you can really we really build up this Intuitive understanding of what is going on. So matrices really really important subject And we're gonna start with just by defining what a matrix says So introduction to matrices part one So we're just gonna look at what matrices are and just how we can represent them in Julia So a series of many notebooks Let's get started. So the first thing we've got to do obviously is just to to activate this environment that we're in So remember these files on github In our project to to ML file and manifest to ML file is a list of all the Packages that we do use everything will be on github So for me this project I generated this project in a folder called linear algebra with Julia And there you see the project to ML file So I've got the whole address there on my internal drive to where this project or to ML file is And I'm saving that as a computer variable file just as we did in the previous video I'm using the PKG package manager, and I'm using the activate function in the package manager So PKG activate in the file and if all of that is run, of course We will have availability of the packages in this environment and one of the base Julia Packages that I'm going to use is linear algebra And you can read up about all the capabilities of which doing this course. We will use most of the functions in the linear algebra, but if you want to check it out check the the Julia Documentation and you can learn all about the linear algebra the linear algebra package so what is a matrix where we've looked at a vector and At least for me and the work that I do everything revolves around a vector But we're gonna work with matrices, but we'll see that inside of a matrix. This is basically a bunch of vectors so vector and Euclidean space that was lecture number one and Everything revolves around that so check out that lecture again If you're not familiar with the work so that you just understand that get a good impression of What a vector is and what it does and that is more than this physical object with the Magnitude and direction as we use in physics. It's just so much more than that So what is a matrix? Well, if you've used the spreadsheet software before, you know matrix is columns and rows of data We usually say rows and then columns and that's how we'll deal with it So there'll be so many rows of of data across so many columns and every little cell has its own address So usually we use this uppercase letter a or m or whatever and then the subscript as you can see in equation 1 Yeah, M n so the M is the number of rows and Say three rows and the N for November that would be the number of columns. It's always rows and then columns and of course those will be natural numbers M and N and So these elements then go inside these cells every cell in your spreadsheet that has an address and The say so the same goes with the matrix and so this is the notation that we use in the equation 2 Yeah, we see a 34 so there'll be three rows and four columns and you can clearly see there And I've put both notations there some textbooks and some lectures would use square bracket notation others use these large parentheses You can use either and of course remember always when we open this up You can see the LaTeX there how to how to do this the begin matrix and then the end matrix LaTeX code there that's for the square matrix the B matrix and then the parentheses one is this P matrix as you can see there Anyway, these notebooks are available on GitHub you can have a look at how to generate this LaTeX code and More importantly what we after here is this is three rows and four columns and then each of these little elements and For the most sake we're going to stick to real numbers, but they can also be complex numbers But let's take with the real numbers for now They each represent a number and you can see a 1 1 that's row 1 column 1 the next one here a 1 2 row 1 column 2 row 1 column 3 row 1 column 4 and then we jump down to row 1 row 2 column 1 So it's always row comma column as you can see there and that's how we index all these values So we can really represent all of them and The way that we're going to represent them if you're trying to check the work that you're doing using code in Julia we're going to save these these matrices as rays ray is the data object That we're going to use to represent an array I mean, it's a it's a normal English word It just means this list of values basically and that's exactly what we're going to do So here in equation 4 we can see this matrix 1 2 3 rows 4 columns and we see the all integer values and We can see there how to represent them Once again, but let's represent that in code and I'm going to use matrix underscore a that's my computer variable and inside of that I'm going to store an instance of an array object and the ray object has an opening closing square brackets and The way that we're going to enter this this is one way of doing it is we're going to list the values by row So you see this in equation for your 3 3 2 1 So there they are 3 3 2 1 and you see there's only spaces between Those values so no commas nothing else is spaces So Julia will recognize those spaces as being jumping to the next column So 3 3 2 1 and then to tell Julia that this array has to jump to a second row There's a semicolon so you can see the little semicolon there then the next row 3 0 1 2 Semicolon 4 1 2 2 I think you get the picture and when this is printed to the screen Remember this is a Pluto notebook So it's going to print above our code cell and you can see it's a 3 by 4 array of 64 bit integers all of these values are integers and it goes along two axes So the first axis will just be this values 3 3 4 if I just had this one single vector But we have a second axis of values here. So we go across the columns as well. So it's comma 2 there Now if you really wanted to enter these by column 3 3 4 and then 301 and then 2 1 1 and 1 2 2 You can also use this nested array So we've created matrix underscore b is my computer variable. I'm assigning to that Remember equals as the assignment operator in Julia I'm assigning to that to whatever's on the right hand side on the right hand side We see an array, but it's actually an array of arrays. There's little arrays inside of a bigger array So now I put commas between these 3 3 4 And but they go inside of a set of square brackets and then a space not a semicolon, but a space Then my second little Array my third array my fourth array representing the four columns we have there So that's a another way to do it And then we just can't use a logical operator, which is this double equals sign It just says is the value on the left hand side equal to the value on the right hand side And if it is it returns to and if it's not it turns false and you can see it returns to there So both of these are the same thing. They have the same values and In fact, we can use the type of function always to check what the type of remember Julia is all about data types And so we can ask what type this is and it got returned way up there when we actually created the instances of these objects We see type of matrix a some passing matrix underscore a as an argument to the type of function And what do we get back? It is an array and it contains values that are all 64 bit integers and Along two axes and the same goes for matrix B I also just want to show you very quickly at the end of this first first tutorial on matrices With the with a little bit of help from Julia is the fact that there are these convenience functions That'll create values or matrices that are can be quite useful Depending on what kind of work you do the first one is the zeroes function Z. E. R. O. S. Or Z E. R. O. S. Depending where you're from 3 comma 4 passed there as two arguments and that's always row comma column So it's just going to give me three rows and four columns of all zeros You can still see it's a three comma three by four an array of 64 bit floats So this time around the zeros function returns floating point values or decimal values So you see zero dot zero indicating that these are decimal values real numbers and In in Julia those are called 64 bit floats 64 bit It's all about how big and on the positive side how small and the negative side is the maximum values you can store and Then again along these two axes then there's the ones function. That's going to return for us 64 bit float represent representations of the number one and again It's rows comma column and then there's twos so to Is a bit array because there's any true and false True carries a bit value of one and false of zero So you're just going to get this array of ones for twos and zeros for falses And again, we're just passing how many rows and commas we want of those as I say depending on the kind of work You do these convenience functions might just be useful Maybe as placeholders you can create an instance of of these arrays as placeholders, etc So that's just the brief introduction. So, you know what a what a matrix is now We're just going to have these rows and columns. We know how to how to represent them they they they As as an array inside of Julia at least and even if you have to do this on paper You understand we just put them in the square brackets or parentheses and we write it by row and by column That's it for this first first introduction there should be I think about nine of these as far as matrices are concerned And we're really going to do a deep dive You know, we can end up doing things that are usually towards the back end of an introductory linear algebra textbook because I think For most textbooks, there's a better way to represent the data the information and For you to get used to the information the thing about linear algebra though is You need knowledge of one part of it to understand the other part But to send the other part you need knowledge of the first part It's always a bit of a chicken and egg when you try and teach Linear algebra and but I think Presenting it in this way sort of makes intuitive sense and it builds from the ground up this understanding even though We are probably in these next or this set of nine exercises about the matrices gonna delve into things as I say that are more towards the back end of the textbook but Gives you a good grounding as to understand the way this is going and how useful these things are How useful linear algebra is before we get to You know to to More deeper things by delving slightly into the deeper things right in the front No, I hope you understand what I'm trying to say there So I hope you enjoyed this one Please leave a comment because I'm quite willing to make more and follow up videos of this and have a good discussion About this and what I what I'm really hoping for here is to understand that you can use a beautiful computer language And you can use something else Python Wolfram language Which can use free of charge online and a browser these days It's useful to be able to use a computer language to do these things because many other things that you can use linear algebra for You're gonna do in a computer anyway, so yeah, you've got a chart You've got a partial tests and your exams and all of that you've got to do some of it with pen and paper Pencil and paper as I like to do But it's nice to just check your work here and as far as I'm concerned and I really say this again and again It helps you develop a different attack on understanding what's going on Purely than just the the textbook and in a piece of paper in your teachers as teacher goes So leave a comment. Let's have a discussion and like this video and as always you have to subscribe See you in the next video