 Jeremy, on the topic of learning new things, you mentioned today that your colleagues were peeved when you spent half of the time learning new things. How did you stand your ground? I don't know. Just bloody minded, I don't know. Was it because you were so productive that it didn't matter? No, no. I mean, it matters. Most of that time, I was either the manager of a management consulting team or I was CEO of a company or whatever. My first two startups, I wasn't exactly CEO. Nobody had titles. I had co-founders. In the end, it's like, this is how I do things. But I'm not going to say it didn't create friction. I don't know. What do you think, Hamel? You work with me and you see how I jump onto totally different things when we're meant to be focused on something. I actually don't see you getting distracted that much, at least for me. We're talking about APL right now when we're meant to actually be focused on releasing NB Dev and I'm meant to be doing the course. In hindsight, it looks like it was all part of a genius plan. While you're doing it, it's like, why are we doing this? That's how I feel sometimes. But then it's kind of like that thing we did with Rich. I don't know if you remember that. Oh, with GH Top, with your old CEO, we researched it. His thing is in Rich. We spent so much time doing that. And while we were doing it, I was like, why are we, at some point, I was like, I don't know if this is worth it. But then Will mentioned that he started his company based upon that project. And I thought, wow, that's a really big impact. Textualize. Yeah. So then I just kind of learned over time that it actually, you can pivot these things into something productive, usually. Yeah. So this company, Textualize.io, Will who created it, said came out of Amal and I refactoring, there we go. It's still the most recent one. So nobody's touched it since. This rather mega PR Rich yet basically took Rich and made it do things that Will hadn't exactly expected it to do. This is quite funny because I think yesterday or two days ago, I went to this website, Textualize.io and I was thinking, hmm, what does this do? Like, how are they planning on sending it? Or what's the plan? I mean, the website is beautifully designed. So I thought that there must be some business entity behind it. And I just thought, yeah. Yeah. So it's basically, you know, one guy, although I think he's got some funding. So I think he's hired somebody to help now who loves building CLIs. And so what Hamal and I showed with our GH top thing was that actually you can like use another tool he's created called Rich to kind of get a long way towards building terminal user interfaces. And yeah, this is something. It's a full circle now now that somebody's using Textualize to build a notebook in the terminal. That's true, which is great. All right. So since I'm on the Mac today, let me just check something. If I switch to a different virtual screen, you guys can now see my terminal. Is that correct? Okay, great. Yeah. So since I'm on the Mac, I just downloaded that Jupyter kernel and I unzipped it in the ran.install.sh. And it looks like I now have a dialogue APL thing here. So one thing that's happened since yesterday is we now have a GitHub repo, which let's have a look. APL study. Here we go. So I don't have that over here. So let's grab it. So I'll go copy. Yeah. So we've got a fast.ai slash apl-study and really all this in it at the moment is my notebook. And so I should be able to now get clone that. There we go. And so I should now be able to open that. Good. And there you should be able to run it. Okay. Oh, and then the other thing we did was we installed that toolbar widget thingy, which I've actually already got here. So that's good. So I guess I have to go bookmarks, shift apple B, APL. Great. So let's see if I can type that tick too. Yep, that works. Okay. So I'm back up to where we were on the different computer. So let's do times and divides, shall we? And I guess I should also run dialogue. And we should also get up our help, which was called dialogue language comments. It's two times. So at first it feels a bit weird that times and divide are actually on hyphen and equals. But then you realize that like plus minus times and divide are all kind of next to each other on the keyboard. So it's not quite that weird. I seem to have got used to it pretty quickly. So we can do two times three. So that makes sense. How did you get the APL keyboard on top of Jupyter notebook? If you go to the forum. Oh, it's in the forum. I think, did we discuss it yesterday? I don't quite remember. Maybe we do it. I saw it. But I just didn't know where to take it from. Yeah. Okay. So specifically, the steps are you, there we are. Here's the bookmarklet. So you click here. And then you, as it says, you drag this to your bookmarks bar, this, this link. And then you go to the Jupyter web page and you click that link in your bookmarks bar and it'll appear. Okay. And this thing is called, not surprisingly, time sign. And the two forms of it, are, okay, direction and multiply. Oh, it's actually called times. Times. Okay. So obviously, we can multiply a scalar by a scalar. We can multiply a scalar by a list. And we can multiply a list by a list. And remember, just because there's no space here doesn't mean this is one times two. This is this list times this list. So space binds more tightly. Does that make sense so far? Okay. Now, monadic times is taking us into a complex world again, which is fun. Let's see what it says. Direction. So again, we look over to the top right. And it says, R is the result of doing times on Y. Y is any numeric array. Okay, when an element of Y is real, the corresponding element of the result is an integer whose value indicates whether the value is negative, zero or positive. So this is what we'd normally call the sign function. And most languages, and often in math, it's called that as well. And so just to check here, 3.1 is positive. So that returns one. Negative two is negative. So that returns negative one. And zero is neither. So that returns zero. Okay. So those ones okay? So this is showing us the sign, which they call direction. Complex numbers. The corresponding element is a number with the same phase, but with magnitude of one. It's equivalent to this. So let's find out what this does. I think that'll give you the absolute value. Yeah. Magnitude, they call it the absolute value. So direction is, what does that mean for a complex? Is that going to give either i or negative i? I guess we should try it. Is that just a regular bar? It is. Okay. So it's actually something a bit more interesting. I think this is going to, I mean, if you visualize it as a vector, it's just going to normalize the vector to magnitude one. Yes. That's going to require some drawing, I think. I just want to get up the documentation to see how they describe it. Magnitude or a complex number. Okay, great. So we're going to do some more complex number stuff, which is called. That was a good question. Yeah. So I think so far, the glyphs for monadic and dietic are the same for all the glyphs that we've looked at, except for nix and minus sign, which uses a different one. Do you know why that is? No, they're always the same. Always the same. Yeah. I think what you might be getting confused about is the difference between the thing that lets you specify a negative number, which is that, versus the function, which takes the negative of an array, which is that. Oh, I see. That's not a function. This binds more tightly than a function. This is actually, this is more like, the dot here is not a function, right? It's part of the literal number 2.3. Okay. Is it the same as? The negative is not part of, it's not a function, it's part of the number negative 2.3. Okay. Thanks. No worries. So if I do this, this is not saying, apply the negative function to these four things. It's saying, this is a list containing this negative number and this, and this positive number. So if I wanted to negate those four things, I would have to do this. Yeah. So hyphen is a function and this upper bar thing is just part of a number, not a function, just like dot is part of a number, just like j is part of a number. Jeremy, so this JavaScript keyboard, it gives, when you hover over a symbol, it gives these key bindings that work with a regular keyboard, not the APL keyboard, but it would be preferred to use the APL keyboard, right? No, not at all. They're the same. The difference is an APL keyboard has pictures of those letters on them, but they produce the same things. You still have to have the same software, whatever. So the only reason to have an APL physical keyboard is so that you can look at the keyboard and see the difference. No, I got it. I was thinking about the APL keyboard in Windows. Oh, in Windows? Okay. Because these things, the JavaScript applet thing here, it gives you other key bindings that work with the regular keyboard, like x, x tab is for multiplication. Yeah. Oh, okay. So I suggest not using those. Instead, use at the very bottom, it says back tick dash, use that one, because those are identical to the Windows keyboard. So you just use back tick followed by the same letter you would use in the Windows keyboard. And so here this one is back tick equals. Yeah, I would ignore those tab ones. Okay. But this also works with just a regular Windows keyboard. Should I be using the APL keyboard? Yeah, you can use the Windows APL keyboard if you want. So I'm not using that right now because I am not on Windows. But B, even on Windows, I actually prefer not to use it because it takes away my control key. And I like my control key. Yes. So the back tick notation, the one on the bottom here, will be the preferred one. It's what I'm liking so far, but obviously I'm very new to this. So I don't take my word for it. But yeah, I like the back tick approach because it I tend to use that as well. Let's use copy and paste and everything in the usual way. Yeah. Okay, let's talk about complex numbers some more, shall we? So yeah, this is one of those things I didn't really get into much at university. I mean, I wish somebody told me how cool they are. Okay. So the thing I guess we talked about yesterday is how we can create this like complex number plane, right? And so along this axis, you've got the real number line. And then along this axis, you've got the imaginary number line. Okay. So you can put numbers there. For example, here's the number two and here's the number minus three i. But you could also create the number here, two plus two i. So that's the complex number two plus two i would go there. And you can think of that as a vector, right? It goes from the origin and it goes up to there. There's another way of thinking of two plus two i. And that vector has a length and we can calculate its length because it is we have here a right angle triangle. So we have a right angle triangle and its height is two and its base is two. So it's length here. We can get from the Pythagorean theorem. That makes sense so far? So that is the magnitude of this complex number. So the magnitude of real numbers is easy, right? Because like what's the magnitude of this number here? Well, it's how far away is it from the origin? And the answer is three. You know, what's the magnitude of this number here? Well, that's easy. It's one, right? This one's also easy. Three i, what's its magnitude? What's the distance from the origin is also three, right? But yeah, the ones where you've got a mixture of imaginary and real, you have to use the Pythagorean theorem to find out the magnitude, a single number, which is like how big is it? And if we take a number, so the number we were dealing with here was 2 plus 2i, which APL writes like this. It's the same thing. And they have this thing called direction, which is basically saying take a number, for example, like three, and three, the direction of three is plus one, and the direction of negative three is negative one. And basically what we're doing is we're taking the number three and dividing it by its magnitude. And that's another way of thinking about this sine function. So what do you do for a complex number? Well, you take the number and divide it by its magnitude to do the same thing. And so that's going to give you something that is going to be around about here. So it's going to be pointing in the same direction. No, excuse me. It's going to be pointing in the same direction, but it's going to be shorter. And specifically, we can draw this really important thing, which is called the unit circle. And the unit circle is something that has a radius of one, right? And it's centered on the origin. And so the direction, any time we get the direction of a real, we're going to get something that points in the same direction as the original number, but it actually sits on the unit circle. Its length will be one. Does that make sense? So we could try it, right? So what's the square root of eight? So we could do eight to the power of negative two. That's not right. Sorry, to be one half, rather. Okay. And so we thought if we took two J2 and divide that by eight, the power of half, we get that. And if we get the direction, times of two J2, three, it's the same. So, and rather than writing eight times five, what I could have written here is magnitude of two J2, because that's what magnitude means. Okay. So does that make sense? What it's doing? You'll notice that like, although complex numbers are about this, either square root of minus one, we don't think about that at all, right? When we're doing this complex number stuff, we just treat it as a pair of numbers, which therefore can represent a point in Cartesian space, and therefore that can represent a vector. Is that 0.7 radians? Like what is that value? No, this is a complex number. It's 0.7 J, 0.7. So it's 0.7 plus 0.7 I, because remember, two plus two I is written as two J2 in, in APL. So this is 0.7 plus 0.7 I. So it's a complex number. And so it's this, it's this point here. It's the complex number that has the same direction as two J2, but has a magnitude of one. And therefore it sits on the unit circle. And like, we really like to do things on the unit circle, because on the unit circle, so if we kind of draw that out a little bit more, if we stick to things that are on the unit circle, so here's one, one, one, one, minus one, minus one. So these points are nice, because you can pick any one of those points, like here, right? And if you create that triangle, then this hypotenuse here, the length of it, is one, which is really convenient, right? Because if you're doing like trigonometry or something, right, you've got like sine theta, Sokotoa equals opposite over hypotenuse. Well, that's always one on the unit circle. So we can, we can delete that part entirely. And instead we get sine theta equals opposite. You know, so it's, it's, it's nice to deal with stuff that's on the unit circle, things become more convenient, we can ignore the whole magnitude slash hypotenuse piece entirely. Trigonometry coming back, huh? Probably a lot of us haven't seen it since high school. All right, so what do we say about monadic times? We haven't introduced magnitude yet. So let's put that away down here for later. And for now, I guess we'll just say that the magnitude of 3j4 is equal to, I guess we don't have a way of even doing a square root. So we'll just have to kind of do it with pros. So the magnitude of 3j4 is equal to the square root of 3 squared plus 4 squared. So that's 9 plus 16. Oh, yeah, of course, 3, 4, 5s of Pythagorean triple. So it's basically going to be, we're going to be dividing by 5. Yeah, so, so basically 3j4 means 3 plus 4i, which has a magnitude of 25 because, just a magnitude of 5, because 3 times, I guess we should use this 3 times 3 plus 4 times 4 equals 5 times 5. So 0.6j0.8 represents a vector in the same direction as 3j4, 3j4. But with a magnitude of 5, it's 3j4 divided by 5. Okay, how's that? So that's dyadic times. Now, that does mean that we just use divide and I don't want to use anything until we've introduced it. So we should probably do divide first. And divide, I think, is actually a bit of an easier one. Okay, so divide, which is on the equals sign on the APL keyboard, divide, here we are. Okay, so that's called divide sign, divide sign, the magnetic version called reciprocal, reciprocal, reciprocal, reciprocal, did I spell that right? No, reciprocal, reciprocal. And the dyadic version is called divided by, or divided by, okay. And I guess what we could do is grab all of those and paste them in here. And I wonder if this works. Can we go find times and replace with divide? Oh, lovely. There we go. Okay, so divided by is easy. Does anybody here not know what reciprocal does? Maybe we don't. Oh, we can't do zero. Okay, let's change this to three. As a side note, I found the reciprocal to be kind of handy when I'm doing square roots or cube roots or anything like that, because then you can do rather than doing to 0.5 power, you can do 16 to the reciprocal to the power of reciprocal. For example, yeah, so cube root, you could do the cube root of eight like so. And I guess you need those parentheses. Yeah, exactly. I don't think we need the parentheses because first it does it one at a time, right? So it's going to do divide. So this is going to be the first thing it does is divide three, which is reciprocal of three. And then it's going to be power of, on the left will be eight, and on the right will be reciprocal three, which is called. So it's like function composition? Yes, it is, which is actually a great time to talk about that because we've now got our four basic operators from math. And so we should now talk about precedence. And I think I want to change my headings a little bit and create a section called basic math operators. Wait, what do I got here? I've got plus sign twice. So do something weird. Diatic minus monetic minus plus sign monetic plus this dietic plus monetic dietic times monetic dietic. Okay, precedence. So here is the formula three times two plus one. Okay, so in regular math, we would go three times two first, get six, and then we'd add one and get seven. And there's a couple of reasons we do that. The first is that times is a higher precedence than plus. And even if it wasn't, we go left to right. So is this seven? No, it's not. And that's because APL makes things much simpler for us by having no concept of precedence of different functions. They all have the same precedence. And the rule is we always go right to left, not left to right. So this is the same as this. And that's good because you wouldn't want to remember precedence rules for all what are these like 50 or 60 or whatever glyphs, right? So they all have the same precedence. That doesn't mean all symbols have the same precedence. We've learned of a few symbols that have different precedence. So for example, space, right, three plus four, space two, space between numbers binds more tightly. I guess this would be better to explain like this. This binds more tightly. So this is the list three, five added to four, or the array three, five added to four, which is the same as that. So when I say we're doing things right to left, I'm only talking about functions, right? And remember that upper bar thing is not a function, right? That's part of the number. And this space here is not a function. That's part of this array. So functions specifically, you can tell something's a function because you look it up in the help. And I'm going to tell you it's a function. Ah, okay, we can see here it's listed under the section called primitive functions. Okay, so we can tell that this is a function because in the functions part of the help. Most of the things up here are going to be functions. As we'll learn shortly, some of them are operators and the rules are different for operators. But most of these, everything we've seen so far in terms of times divide, plus and minus are all functions. So that's the rule. We go right to left. So in this version here, right, we go right to left. So okay, we've got the number three. Now we've got three divide. Okay, well that means the reciprocal of three. And then we keep going left. We come across this time, this power of, and it has a right-hand side and it has a left-hand side. And that's why this is eight to the power of a third. Does that make sense? So we could do that with a list. And so remember the symbol space finds the most tight leaves. This is the list one, two, three, multiplied by two plus one, because we go right to left. So we go one plus two times this list. That'll be three times that list. And we could also do this. So this will be this list to this array, two, four, six, plus two. So all that in brackets. And then multiplied by the array one, two, three. So two plus two is four. Two plus four is six. Two plus six is eight. Eight times three is 24. Six times two is 12. Four times one is four. That makes sense. Yes. So I'm not sure if that's related, but that function for giving us the magnitude direction of this, I think, that would for an array, it still works on each component. It doesn't normalize the whole array. Right, right. Basically, pretty much all the functions in their normal forms work element-wise, like NumPy does, including power and reciprocal and magnitude and so forth. That's a good point. Did you go over the power of symbol? I don't know. I don't remember. Okay. I thought we might do that now. I think that counts as a basic math operator. So let's do, okay. So this is confusing. This is shift eight. The normal multiply sign from Python doesn't mean multiply. It means exponential or power. So and it's called star. Okay. And dyadic power. So exponential means e to the power of. So this is e to the power of zero is one. e to the power of one is 2.718. And e to the power of two apparently is 7.389. Does anybody not know what e is or want a refresher of what e is? A refresher would be great. Sure. Refresher are always great. Sure. The only reason I can do all these refreshers off the top of my head is because I've done all this stuff with my daughter and her friend recently. So I can do math refreshers like this. I'm ready. About a month ago, I couldn't because I'd forgotten everything. So e, the basic idea is if you put $100 in the bank at 100% interest, then after one year you'll get $200. And specifically that's your original 100 plus, sorry, I should say times one plus the interest. And 100% is 100 over 100. So it's one. But the bank might not give you the whole, you know, and might not calculate the whole thing at the end of the year. If they want to be a bit more generous, they could calculate it twice. They could calculate it once at six months. And again, after another six months, so you take your $100. And after six months, they would give you half of your interest. So that's 50%. So after six months, you would have 150. And then another six months, they would give you the other 50%. But the other 50% is now going to be calculated on this. So this is times 1.5. And then again, times 1.5, 225, which is 100 times 1 plus 0.5. If they're really generous, they could pay it quarterly. And if they paid it quarterly, then the amount of money you're going to get is 100 times 1 plus, actually let's do this as a fraction rather than as a decimal, a quarter, or four. Or they could pay it daily. 100 times 1 plus 1 over 365 to the 365. Okay, so we should be able to calculate these things in APL, right? No promises. We could give it a go. So let's do this one 100 plus 100 times 1 plus a quarter to the four 100 times 1 plus a quarter. Now a quarter is that it's a reciprocal of four, one plus a quarter. Okay, to the pair of is this. And so this is going to happen first because we go right to left. I should say you don't have $100 in the bank. Let's say you've got $1 in the bank. Okay, so in that case, your $1 would become $2 if it was paid just at the end of the year, or it become $2.25 if it was played every six months, or it become $2.44 if it was paid every quarter, or we could do 365. If it was paid every day, it would be this number. And you can see the more often it's paid, the more money you're going to get. But like initially, it went up pretty quickly, but now it's going up pretty slowly. So let's say it was paid hourly. It's paid 100 times per day and it's not really making much difference at this point. E is the limit of this as this number gets really, really, really high. So we could write that in math and we can say E is the limit as X goes to infinity. So as X gets really big, that never hits infinity of, okay, and the one times we can just ignore. Okay, so it's a limit of 1 plus 1 divided by X to the power of X. Does that make sense? That's E. How's that, Radek? I just remembered the definition of limit. Wow, that's something I have not seen in ages. Yeah, I got to say the kids loved seeing limit. And of course, they're immediately like, well, just get rid of it and put infinity there. Okay, let's put infinity there. 1 plus 1 divided by infinity. Okay, kids, what's 1 divided by infinity? 0. Okay, what's 1 plus 0? 1. What's 1 to the power of infinity? 1. Okay, so does it equal 1? No. So, okay, well, what do we do? They're like, well, what about infinity minus 1? Oh, that's still infinity. So this was our first introduction to limits and they were just like, they were partly like, wow, that's so cool. And they were partly like, never show me anything like this again. This is wrong. It shouldn't happen. Get it out of my life. But this is beautiful because they're trying to make it concrete and somehow relate to these ideas. That's amazing. And they will understand that they're much deeper level than people, you know, just going through this reading theorems in a classroom. And yeah, that there's something deeply disturbing about limit. And I guess, like the takeaway is that this is just something that people agree to, right? This is what I mean, I think it's more than just something people agree to. Like it's some kind of reality, you know? Like it's a true thing that exists independently about discovery of it. Right. But how do you make the jump from something getting closer to something being the value that it gets closer to? This is a definition. This is like, yeah, I don't know. Anyway, I mean, I think it's really cool. Yeah. All right. So that is, that is monadic, monadic star. And E is named after Euler. I think Euler is more specifically Euler named it after himself. Famous blind Swiss mathematician. But Euler did not discover E. I don't know who did, but it wasn't him, even though he got to name it somehow. For those of you that remember calculus, you know, you can take the derivative of various functions. For example, we saw in the fast AI class that the derivative of x squared is 2x. One of the things that's interesting about E is that the derivative of E to the x is E to the x. It has a lot of crazy things going on with E and comes up a lot. Maybe the most cool, beautiful formula in the world is Euler's identity, which brings together a lot of the things we've seen so far. And it's E to the i pi plus one equals zero. What do I put it another way? E to the i pi equals negative one, which is like total madness that this thing which is about circles, and this thing which is about imaginary numbers, and this thing which is about compound interest somehow combined to create negative one. But that's mind blowing. That's why monadic star is E to the power of. E to the power of is a pretty important thing. We don't need a special symbol for E because any time you want E, you just write this. All right. And then, okay, dyadic star is power of, so 49 to the power of a half is square root of 49. Five to the power of two is five squared. Minus four square root is two i because it's equal to minus one times four. So you get the square root of minus one, which is i, times the square root of four, which is two i. All right. Is that pretty close to stop? I think this is the first time E to the i pi has actually made sense to me because I did make the connection that pi is essentially like a half circle in radians or something. And so i is just that other, I guess like the y on the plane. So all you're doing is you're just curving that around to the other side to turn it to a negative one, add one on to that, and now you got zero. Yes, exactly. And maybe, Wayne, you can try to find like a really good video or something that explains that for people that have never seen that before, because I think that'd be a great thing to put in there. Oh, yeah. I think there's a channel three blue one brown may have some stuff. If I see anything, I'll put it up. Yeah. Ideally, something that doesn't use any concepts that we haven't come across yet, you know. I keep my eye open for that. Yeah. I mean, the key thing around complex numbers to me, I think is this idea that if you multiply by negative one, you flip something from one side of the you flip something from one side of the number line to the other on the real plane. Ditto, if you multiply by negative one for a complex for an imaginary number, it flips it to the other side of the number line. But if you multiply something by I, it rotates it by 90 degrees. You go from two to two I to negative two to negative two I back to two. And so, yeah. And I think a lot of these ideas end up basically being these kind of rotations around this number plane. Yeah, you see stuff like that all over in engineering. I think for me, when I made the connection that if you look at the eye as kind of a shorthand for having an array of two numbers, like basically just coordinates on a plane. And that's just a way to kind of have that mapping to your number line. All of a sudden, everything else starts to fall into place. And then when you're talking about magnitudes and stuff, I'm like, oh, wait, I've seen this before as like, you know, magnitudes in, I mean, when you're, is it like the L2 norm or something like that? It's like even if we're just having like the magnitude of like, absolutely. In fact, there's the exact same thing. It's the likely it is. Wasim put this in the chat. What's this about, Wasim? Can you tell us? Oh, so it looks like the Jupiter kernel has a way of ending, I don't know what to call it, like function composition. So if I type this into Jupiter, yeah, like that. Mm hmm. And what am I missing? Around the cell. Do you mean the the parenthesis? Like execute just that. Oh, okay. It gives us the expression tree. That's beautiful. Okay. We will come back to learning about that. About that later. But yeah, you can basically put a bunch of functions in a row and it does interesting things. If you get rid of the parentheses, hey, fever, goodness me. All right. Thanks, gang. Enjoy the rest of your day. Thank you very much everybody. Thank you. Thank you. Bye. Yeah, have a good one. Yeah.