 All right. So, yes, you're going to talk about the APL competition. I will share my screen because you've put lots of cool stuff there. Share. I think that is a really fast way to learn and try to find the problem while learning it. Okay, so there's a whole thread here. I turn lays had some very nice solutions, I thought. Yeah, tell us about your experience of look at you or go cups. I love the way we've gone from like, that's dead up a study session to try and learn all the glyphs and Sirata's like, no, let's get 10 trophies in the problem solving competition. Good on you. Yeah, I think really stretch myself, but I think I learned a lot during the process as well. So, ask a lot of question, try to read a lot of documentation, but I still find the documentation quite technical. I really learned from the example. Again, really helpful point me to some direction but some of them I still can't get past my head. His radio actually really good in the past competition example he read. Yes. Yeah, and now someone starts sharing why is not the fastest one definitely I want to learn from other people, but it's really good to force me to think. Different to to to using APL to solve the problem, even this is very short and small problem but it's really good exercise and yeah I learned a lot. This is a great thread because it kind of this I mean this particular post here actually goes through each of his solutions and he said to have quite especially this one really elegant solution. Yeah, I actually put we put together so people can go into the lookbook and breaking down the solution as well and other person, our AK 157. I'll tell you what, let me make this a wiki. Yeah. So maybe you can put a link to it there. So I, at the moment I put all people solution in one place and then I profile them to see who is the fastest solution so people can learn from the best. Awesome. I love it. Did anybody else try more of the competition questions. I did give it a try but I got stuck on the second or third question, and it was just about comparing arrays. And then I looked at the solutions and people are using the built in glyphs, not equals where I tried to go via each entry. I think that this is super helpful that we'll are sharing so freely their solutions. I looked at the website and it seems that the competition for this year is not available right now, like you cannot go on to the website and submit your results yet but there are competitions for the previous years that are available. And hopefully this year's will be available soon as well. Okay, that feedback loop where you can try to solve a problem yourself first and then, you know, you can look for help on the forums I think that's. And my recommendation for these would be like spend at least a couple of hours on a problem yourself before looking up the solution and also try doing all the solutions, you know like all the questions. You know one kind of like if you're doing a math test at school you're just like, Okay, let's move on to the next one. And then, yeah, you'll learn more by seeing the dumb things it turns out you did or vice versa, then just reading about it. I have a suggestion or question maybe. I'm curious to know how you are planning to use a PL in your workflow. I asked a question on on the forum and somebody suggested pineapple which I find very useful for a PL to be used in Python and vice versa. So just to clarify, you're talking about PYN APL. Right. Yeah. I got stuck installing it on on Mac but that's another separate issue. If you, if this is the way that you envision using it in your workflow, meaning that a little bit of a clever code to clean up data and do pre post processing. I think in the entire workflow inside Python. I thought it might be useful to experience that with you as a part of the walkthrough. Sure. Before I do let me just say hello because I think you're a new face. How do we pronounce your name is it Ramin. I mean, yes. Joining us from today. San Diego. And Diego. Oh, that's a lovely town. I've been watching your videos carefully and pausing them and doing stuff in the background. Well, thanks for joining. So, I think of this in a similar way I don't know if any of you have read Richard Feynman's autobiography. He described how he got it, you know, got he liked following problems that he found interesting and so he got interested in watching spinning plates on their fingers at the university cafeteria. And he decided to take some time to study the motion of those plates. Because that was the thing that seemed most interesting to him at the time. Later on, it turned out that the that the bath and physics he developed and thinking about that problem turned out to be exactly what was needed to solve some critical critical foundational problems in quantum mechanics. You know, I have a similar thing about appeal things interesting and fun. It's my interest is in it mainly as a notation. I have always been kind of interested in mathematics but the notation has always gotten my way. I think I'm like, I must be like particularly anal or something because I just find it's so imprecise and like or like the meaning of it varies from paper to paper or area to area and like I don't know how to like look things up and find that exactly what it means and then it's hard to pin down and so I ended up at university studying metamathematics and formal logic and that like helped me a little bit because I kind of went back to like well what is mathematics and building it up and scratch but I keep getting stuck on notation, you know. And also I'm somebody who's highly intuitive so I really like to experiment with things. I like to know if my experiments are right. I'm really envious of how, I don't know if you've seen Adam on the forum is able to like take an APL expression and treat it like an algebra, you know he'll go through symbol replacement exercises and at each point she'll say here's the symbol replacement rule I'm doing and manipulate an APL expression into a new APL expression that verifies some situation. I want to yeah so he's he's my hero I want to be like that I want to be able to treat it as as an algebra, you know, and use it to deepen my understanding of things. I, I mean I use it a lot right now to teach my daughter math. And so she's six and her friend is eight. And so I tutor them in math and we, we have been doing a series of books called Beast Academy which were kind of great cartoon super fun, very, you know, compelling for kids. And as their math developed we ran out of those and we, you know needed new things to cover you know so like their most of the math stuff they're doing is around like grade 11 grade 12 now and the problem is that materials or boring dry presentation. So they're like the Beast Academy books, it's by a group put out of problem solving. And they have fantastic materials but their highest, their high school level stuff is called out of problem solving and it removes all the comics and all the cool characters and so it's not fun anymore. So, you know, a couple, you know a few days ago, we were trying to cover a topic. And after 40 minutes my daughter's just like, I'm so bored, you know, come can't we do some APL. And I was like, Oh, of course we can we can do this exact topic with APL. So we just, we stopped the video, opened up APL and I said okay, solve this math problem with APL. And then they're engaged again and it's fun and they're trying things out. They're both sharing their screens so I can see them trying things and then, you know, then we can go back well why, why did that work and. So yeah, kind of intellectual interest and I feel like there's a. I can see it starting the revolution in education. Yeah, well that's what I was in thought, you know, and he, you know, he wrote this, these books with with high school teachers and somewhere here, you know, here's a okay. So here's a calculus book. Let me turn my virtual background off. Okay, so here's a calculus book. And it's a calculus book in APL. So, you know, it has exercises and derivations and whatnot, but rather than using normal math notation it's all an APL, you know, and so it covers. Let's see. You know, it's got all kinds of interesting math problems and tailored series and why is that students make it more compelling. APL is intimidating can be. Well, not when you're six, because, you know, when you're six, you're everything's new, and everything looks weird. You know, so the biggest problem in our math is when we hit Sigma notation. And I just couldn't get anywhere with it. Yeah, because there's a lot of assumptions going on, like I just sort of thought that was such an easy thing I thought how could anybody ever find it difficult but then when we got there with the kids it's like okay well there's this like implied loop where this index is like looping through the thing and then the thing inside the index is like getting each value of that and then there's this kind of like concerted some. And it's just that that's just a lot of abstractions going on so when we did it in NumPy that helped a lot. You know, but then when we did it in an APL we actually learned plus slash means insert plus between each pair of things in a sequence. You know, okay so Sigma's last step is it insert does plus slash and like you can try it and you can see it and then we're like okay and then the thing that happens inside is an expression that gets evaluated so. Yeah, it was much less intimidating to people who haven't yet learned normal math notation because this is a math notation that they could execute experiment with has extremely well defined rules if they're not sure what something is they can look it up in the help, you know. Okay that was interesting. Thanks for explaining. Yeah, no worries. Okay, I am on. I just wanted to second like Adam donations are awesome. His rank operator I use that all the time now that he showed it on that one, that one video. Yes. Yes. Listening to the array cast. Yes. Yeah, I have to. It's great. I haven't got to it yet, but there's two somewhat recent episodes called leading access theory and transpose. And they spend about three hours covering what Adam did, you know, in 45 minutes when he was here. It's much better when you've got it visually and I kind of listen to the episode and I was like yeah yeah yeah I know all that. But it was interesting hearing him talk about transpose as well as being as important as the ranks stuff. So it might be a valuable thing to check out. If you haven't seen it. So, I'll share my screen. This time we didn't forget. That's right. Can you believe that. Oh also concept of trains I found them useful and not intuitive. Yeah, we haven't got to that yet. Because we're trying to do all the glyphs first that yes. Does anybody kind of remember, I guess. The last one was in the middle of something last one was mostly Adam so yeah. Okay I guess we're kind of up to here. Actually, I wouldn't mind. Moving these from stuff we haven't done yet to stuff we are doing because it really belongs right at the top. Basic math operators. So what I might do is add this pipe operator. And it's actually pretty straightforward one. Okay, so we're going to do vertical bar. It's working. Never quite sure what's going to work on a new machine. So they call it style or vertical bar monadic. I believe it's called magnitude. Yes it is. All right so unfortunately because I'm using a Mac today I do not have a screen I can draw on. Which is a bummer. So hopefully we can find a picture of what magnitude is. Great. So the magnitude of a complex number is how far away that complex number is from the origin if you represent it as Cartesian coordinates. So, if you've got a number a plus bi. So to remind you I mean square root of minus one. You can represent any. Any of these complex numbers using a single real a and a single real be. Even if you've got squares or square roots or model plies or whatever, because you can send you can always simplify it down to a real number part plus a real number times the square root of minus one. So this is basically any complex number you can represent in the in this form. And then you could draw it, and you can draw it by putting it on a Cartesian coordinate plane by going right by a units and then up by b units to the coordinate a comma b. Does that make sense so far. Anybody who's not. I think radical you're not said you're not so comfortable with complex stuff is this is this makes sense to you so far. Okay, so this is a triangle to right angle triangle. And so how far away is this dot from the origin. Well the answer is it's going to be the square root of a square b square because it's a right angle triangle and Pythagoras told us so. Let's put out it then let's what about this number here. This number here is one plus zero I also known as one. So how far away is that from the origin. One, which is equal to the square root of one squared plus zero squared. What about this number here I. Okay how far away is this will square root of zero squared plus one squared also one. The magnitude of a real number is the number itself the magnitude of a complex number is the size of the complex of the only imaginary part is the size of the imaginary components real number and a complex number more generally is through a square plus b square. So that's what. This means and remind you three J for is how you write three plus four. I also do. Oh, and, you know, in fact, let's do them all together now that we're getting fancy. Have to my. So negatives, the distance that negative three is from the origin is three. And again, negative three squared is nine plus zero squared is nine square root of that is three. Okay. Diatic I think they call residual. Yeah, residue or modules. That one down later. Okay, so much less so we did. Other examples we could steal. So this tells you the residual you're left over with if you do to divided into seven. So in other words, seven divided by two is three remained or one 13 divided by 10 is one. But it's negative. So if you've got a negative right hand side, then what they actually do is they go further they treat that as being they say that's to remain to seven. So if you have a positive right hand side, eight divided by two and a half is how do we get negative two here is two is for remainder minus two. So like it with I haven't really seen this idea before, but normally in in school. Remainders are done always positive. And they have a very clear answer right which is 10 goes into 13 one time with three remainder two goes into eight four times with zero remainder. So the negatives you can kind of like overshoot it on the positive side or the negative side. And so an APL. If you have a negative right hand side. Sorry if you have a negative left hand side, you'll get a negative remainder and if you have a positive left hand side to get a positive remainder. The reason this is also called modulus is because if you're like, if you're, if you're measuring the number of minutes past the hour. For example, then after back a little bit so it doesn't go off the screen. Yeah, it messy huh. Then after one second the minute handle we at one after four seconds minute handle be a four, etc. After 59, so 59, sorry minutes, the minute handle be at 59 after 60 minutes the minute handle be at zero. So clocks count modulo 60. So modular is the same as what's the remainder if you divide by this. And modular modular arithmetic is used in cryptography a lot. And it kind of comes up all over the place. So measuring the angle, you know, that's made as you turn around a circle, if you go more than 360 degrees you come back where you come from so it's kind of that's those measurements will be modular 360. So that makes sense. Okay, so then times. Times tells you the direction. And if you look here, the number one is a real number is to the right. And so you could say its direction is one. The number negative five is to the left you could say its direction is minus one. So five I its direction is straight up you can say its direction is I so the direction of a number is, if you draw a vector from the origin out to that number on this plane. Whereabouts but across the unit circle. And so in most languages that don't deal particularly with complex numbers. We have a function called sign s IGN that returns the sign of a number and it normally returns one if it's positive and minus one of its negative. So for real numbers. Monadic times is exactly that look at this one at eight times 3.1. In other words sign 3.1 is one. Monadic times of negative two. Another word sign of negative two was negative one. And then normally in most languages sign of zero is is called zero. And this is all exactly the same as sign. It's called that in Python isn't it. I guess it doesn't. NumPy has sign. So why doesn't Python have a sign function. Just Python. Yeah, I don't remember using sign without NumPy and Python. Yeah, that says there was a patch but it wasn't accepted because they couldn't agree on what it should return. They couldn't do it at all. That's funny. So in NumPy. I wonder if NumPy sign handles complex numbers. That would be something slightly different. That's interesting. All right. So I kind of like this about APL is I find really consistently it tends to extend basic ideas from other languages and from math like more things in a more general way. Which I think is really cool. Okay, I guess I should mention complex numbers. Okay, so, so here we can see. So what is the magnitude of three plus four I. So the magnitude of three plus four I. Well, we would start with the number three plus four I. And then we would divide it by its length, which we know is magnitude of three plus four I. And that gives us point six plus point eight. So that's going to be the, you know, so point six comma point eight would be its coordinates on the unit circle down, you know, somewhere around here in this case. I'm not going to include it here but I think, you know, as Adam said, I was trying to think of a way to do this as a train. I think this should already work right so when you have two of these next to each other at first of all applies this. Is that right. I can't remember which borders in. Yeah, the first of all plays that right. So you can just, you can just delete the left hand side maybe you can't just delete the left. Well, you could delete the left hand side if you're in J, but APL doesn't work that way. APL would treat this as being the reciprocal of the magnitude. If you put parenthesis on it. Still no, that's the way J works. It's not the way APL works. Okay, you're thinking of a type of train called hook. In APL, you would need to do, you would need to use the self operator. So you would do that with the self operator, which I can't remember how to write it so I don't have to find it. It's the tilde diresis. Yeah, capital P. Capital P capital T. Does anybody know how to make that work working on it. Oh, did I get it wrong. Yeah, I got it right to order diresis y equals y f tilted f y. I could answer you last week. Divide by zero. Alright, so that's an interesting puzzle for somebody to figure out. Is the binding for the complex number less high than. No, that this, this, this is this binds as tightly as upper bar or full stop board as a decimal or. Yeah, or whatever. Yeah, 99.99% sure. Yep. For F three to four. Oh, that's interesting. So, oh, I see the issue the issue is that there's an implied parentheses here, because we go right to left. So actually if I did this, that would break. I'm telling what I actually need to know what I should do really is look it up properly. Yeah, but what we actually need is beside, because beside. Yes, beside is the thing which behaves exactly the way we want. And it's the same as putting two things next to each other, as long as you don't mess with the kind of execution order. So here's beside it applies the monadic G first, and then applies the dyadic to the result, which is what we want here. So, I think that means. All right now. What do we expect this to work so it's going to go. I don't know if it's. Okay that does work that's very interesting isn't it. So I guess the thing is here. It starts looking left. Right, I still want to get better at these parsing rules it starts looking left and it says okay that's an operator. So we're not done yet. Okay. And so then given it's found an operator it then needs to find a function. And it's found a function here but I guess it's not a complete function because it's got an operator to its left and so it keeps looking until it's got a complete function. Something like that. I'd love to see like a really clear documentation of this parsing rule like how is this past. Yeah, I think you're right. And then there's a way to do it with train and without the last symbol for the what's called without the symbol. Right without the tilde. I'm pretty sure you're thinking of Jay. It's got a hook in Jay. I'm pretty sure APL does not have such a thing. See the response from the Adam gave to my computing the mean of a vector. One of them was equivalent to this and one of them the last no that was different he had a fork. A fork is a list of three verbs in a row. So you're thinking of something else, which is the definition of mean, which is very interesting that we are kind of skipping ahead. So the sum divided by the count, which is tally, which I can't remember how to type double quote. Okay, that's the mean. Okay, and this is different because we here we've got one, two, three verbs. The definition of this of three verbs in a row. It's called a fork. And what it does is it applies this to omega, and this to omega, and this to the two results. So, some of omega divided by counter omega. So we're skipping ahead. Jeremy, there's an option you can turn on with the box option to show trains and functions is like parse trees. I posted it in the chat. Okay, great. And presumably that would just be if we remove this. Why wouldn't you always want that it's beautiful isn't it. Yeah. It's still a little bit of a pain kind of deciphering where all of the arguments are supposed to end up but yeah. Well, not too bad right because you've got a. This, this is obviously going to apply to the right hand side. So I guess that's okay. So. And yeah, but I mean you can always and you have, I think that there's pictures they have as nice of like what the side does. Well, let's put that at the top maybe. I've actually got a complex section there so I should move the complex description or just maybe I'll copy it. Maybe it would even be useful to see for J zero. See that's how you just do. Okay, okay. So I think we can now get back to our stuff for 2022 APL competition. So that was our kind of group by thing. Okay, so that. And did we have my attic and dietic. Oops. This is dietic. Oh, right, right, right. We've got the monadic and dietic versions of the function created by the operator call. All right, so the next in our list of these two. Let's do this one then shall we. Oops, something funny happen there. So this is called key. Okay, this is called left shoe. I like it. Oops, I changed the wrong name left shoe. Okay. My attic is enclosed and dietic has a couple of meanings and close. So this enclosed thing happens. It gets used all the time. And it seems to be something like what J calls boxing. Like creating like references or something. Okay, so we're basically, that's a list. And this is row of that list. Row of the list. Okay. And then, so this is a list with three things in it. This is a list with two things in it. And the second of the things in the list. The list to three. So makes sense. And then this is going to be a list with one thing in it. Because it's a, it's a, oh, this is a scalar. That's interesting. Yes. Okay, of course, this is a scalar. So it's empty. It's got an empty rank. An empty shape. Sorry. So this is a, okay. So I think that's interesting. Right. And close. How do I type in close? Right. Right. Right. Okay. So that's what it does. Is it creates a scalar or an atom containing a list. And you've got to do that because a raise kind of like conceptually only contain atoms. So when you strand it like this, it's actually creating, I guess it's enclosing this list, which I think is the same as concatenating. It is. See? Okay. So if I concatenate the scalar one with the atom and close two, three, that's what this is. Does it make sense? It's like a void pointer or, you know, it's turning it into a single object that you can store and move around. Has anybody used this? It seems to come up quite a bit. Sirata, did you use it in any of your solutions or anybody else used it? Yeah. Especially for grouping partition things. Yeah. Tell us more. I think that is your example. Sorry. I think quite expandable already. It's just a simple idea, but once you put the element, it's one chunk and then you can operate individually. I just got somebody at the door just a moment. Sorry about that. I guess we see it in the docs quite a bit. So, all right, let's see if we've got time to do dietic. Sorry. I just want to say, like, using it on a single, what is it, a single scalar. Isn't it, does not enclose anything. So that might be a case to look at. Yeah, great. Okay. Yeah. So that does nothing. Yeah. Okay. Why is a scalar? It's a scalar. Otherwise, it has a depth. The magnitude is one greater than the magnitude of the depth of why and you can add axes. And I guess we're not meant to be worrying too much about axes because Adam says they're a bit old fashioned. And we're definitely not old fashioned. So that's fine. So dietic. Oh God, I don't know what's our quad ML equal to just focus on the default. Shall we one. Okay. Partitioning close. We have better examples for this. The petitioning close. For dietic. Yes. Great. Just click on enclose. I think you're okay. Okay. Where's the good examples. Is the first one. Do you consider that there? Well, it's got a plus before it, which is, oh, or is that what it is? Is it a operator? Oh, there's an optional K. Oh, that's the access. I'm confused about this there. They're doing plus. No, this is, this is, this is a monadic. Because when you have two functions in a row, it applies this monetically and then dietically to the result with the left hand side. And this is a good example for monadic because it's not intuitive. I don't think it's going to do that. Oh, maybe. Okay, so. All right, so that's going to turn the right into a scalar. And so then it's going to be 123 plus four posts. One. Yeah, okay. So if you did 123 plus one, it would add one to each of these things. So if you do 123 plus an enclosed array, it adds this to each of these three things, which is actually very, yes, that's very instructive and helpful. Oh, we could have used this with a tally operator. So for that DNA competition question. 456 would be a CGT and left hand side would have been the DNA sequence. Sounds interesting. Great. Okay. Well, we're kind of out of time. So we'll do the dietic version next time. Thanks everybody. Bye. Bye. Thanks everybody.