back to index

fast.ai APL study session 12


Chapters

0:0
11:10 Calculus Book
16:53 Basic Math Operators
30:48 Complex Numbers

Whisper Transcript | Transcript Only Page

00:00:00.000 | All right, so, yes, Sarada, you're going to talk about the APO competition.
00:00:19.880 | I will share my screen because you've put lots of cool stuff there.
00:00:25.040 | I think that is a really fast way to learn and try to find a problem while learning it.
00:00:36.640 | Okay, so there's a whole thread here.
00:00:43.440 | Aitan Leis had some very nice solutions, I thought.
00:00:48.800 | Yeah.
00:00:49.800 | Yeah, tell us about your experience. Look at you, all Gold Cups.
00:00:56.520 | I love the way we've gone from, like, let's set up a study session to try and learn all
00:01:01.080 | the glyphs.
00:01:02.080 | And Sarada's like, no, let's get 10 trophies in the Crop and Solving competition.
00:01:06.720 | Good on you.
00:01:07.720 | Yeah, I think I really stretch myself, but I think I learn a lot during the process as
00:01:13.640 | well.
00:01:14.640 | I ask a lot of questions, try to read a lot of documentation, but I still find the documentation
00:01:20.680 | quite technical.
00:01:21.680 | I really learned from the example, and again, really helpful, point me to some direction,
00:01:27.200 | but some of them I still can't get past my head, because his video actually really good
00:01:33.460 | in the past competition example.
00:01:38.280 | He really-
00:01:39.280 | Oh, Adam's videos?
00:01:42.280 | Yeah, and now someone starts sharing, why it's not the fastest one, definitely I want
00:01:49.320 | to learn from other people, but it's really good to force me to think different, to using
00:01:57.960 | APL to solve the problem, even this is very short and small problem, but it's really good
00:02:02.640 | exercise.
00:02:03.640 | Yeah, I learned a lot.
00:02:04.640 | Thank you.
00:02:05.640 | This is a great thread, because it kind of, this particular post here actually goes through
00:02:10.600 | each of his solutions, and we seem to have quite, especially this one, really elegant
00:02:15.240 | solution.
00:02:17.240 | Yeah, I actually put, we put together, so people can go into the logbook and breaking
00:02:24.280 | down the solution as well, and other person, our AK1537 here.
00:02:31.920 | I'll tell you what, let me make this a wiki.
00:02:38.280 | There we go, so maybe you can put a link to it there.
00:03:06.600 | Yeah.
00:03:07.600 | So I, at the moment, I put all people's solution in one place, and then I profile them to see
00:03:13.440 | who is the fastest solution, so people can learn from the best.
00:03:17.800 | Awesome.
00:03:18.800 | I love it.
00:03:19.800 | Did anybody else try more of the competition questions?
00:03:26.840 | No, me neither.
00:03:31.200 | I did give it a try, but I got stuck on the second or third question, and it was just
00:03:39.640 | about comparing arrays, and then I looked at the solutions, and people are using the
00:03:46.560 | built-in glyphs, not equals, where I tried to go via each entry, so I think that this
00:03:55.120 | is super helpful that people are sharing so freely their solutions.
00:04:01.080 | I looked at the website, and it seems that the competition for this year is not available
00:04:06.840 | right now.
00:04:07.840 | Like, you cannot go onto the website and submit your results yet, but there are competitions
00:04:14.240 | for the previous years that are available, so hopefully this year's will be available
00:04:19.040 | soon as well.
00:04:20.040 | Okay.
00:04:21.040 | So, if you look where you can try to solve a problem yourself first, and then you can
00:04:25.680 | look for help on the forums, I think that's…
00:04:27.960 | And my recommendation for these would be, like, spend at least a couple of hours on
00:04:34.320 | a problem yourself before looking up the solution, and also try doing all the solutions, you
00:04:43.040 | know, like all the questions, so if you get stuck on one, kind of like if you're doing
00:04:47.200 | a math test at school, you're just like, okay, let's move onto the next one, and then, yeah,
00:04:52.320 | you'll learn more by seeing the dumb things it turns out you did, or vice versa, than
00:05:00.440 | just reading about it.
00:05:01.840 | Jeremy, I have a suggestion or question, maybe.
00:05:06.000 | I'm curious to know how you are planning to use APL in your workflow.
00:05:10.080 | I asked a question on the forum, and somebody suggested Pineapple, which I find very useful
00:05:16.120 | for APL to be used in Python and vice versa.
00:05:19.400 | And just to clarify, you're talking about P, Y, and APL, right?
00:05:24.440 | I got stuck installing it on Mac, but that's another separate issue.
00:05:31.840 | If this is the way that you envision using it in your workflow, meaning that, oh, a little
00:05:37.360 | bit of a clever code to clean up data and do pre- and post-processing in the entire
00:05:44.280 | workflow inside Python, I thought it might be useful to experience that with you as a
00:05:51.120 | part of the walkthrough.
00:05:53.040 | Sure.
00:05:54.040 | Before I do, let me just say hello, because I think you're a new face.
00:05:56.760 | How do I pronounce your name?
00:05:57.760 | Is it Rameen?
00:05:58.760 | Rameen.
00:05:59.760 | Yes, yeah.
00:06:00.760 | How about you joining us from today?
00:06:03.440 | San Diego.
00:06:04.440 | San Diego.
00:06:05.440 | Oh, that's a lovely town.
00:06:06.440 | That's great.
00:06:07.440 | I've been watching your videos carefully and pausing them and doing stuff in the background.
00:06:11.720 | Well, thanks for joining.
00:06:15.080 | So I think of this in a similar way.
00:06:19.160 | I don't know if any of you have read Richard Feynman's autobiography.
00:06:23.760 | He described how he got- he liked following problems that he found interesting.
00:06:31.680 | And so he got interested in watching people spitting plates on their fingers at the university
00:06:38.520 | cafeteria, and he decided to take some time to study the motion of those plates, because
00:06:45.400 | that was the thing that seemed most interesting to him at the time.
00:06:48.960 | Later on, it turned out that the math and physics he developed in thinking about that
00:06:54.080 | problem turned out to be exactly what was needed to solve some critical foundational
00:06:59.560 | problems in quantum mechanics.
00:07:01.440 | That's, you know, I have a similar thing about IPLs, things interesting and fun.
00:07:11.240 | It's my interest is in it mainly as a notation.
00:07:16.760 | I have always been kind of interested in mathematics, but the notation has always gotten my way.
00:07:27.880 | I think I'm like, I must be like particularly anal or something because I just find it so
00:07:35.640 | imprecise and like or like the meaning of it varies from paper to paper or area to area.
00:07:42.120 | And like, I don't know how to like look things up and find out exactly what it means.
00:07:45.280 | And then when I try to find out exactly what this thing means, it's hard to pin down.
00:07:49.880 | And so I ended up at university studying metamathematics and formal logic and that like helped me
00:07:56.160 | a little bit because I kind of went back to like, well, what is mathematics and building
00:07:59.600 | it up from scratch?
00:08:00.600 | But I keep getting stuck on notation, you know, and also I'm somebody who's highly intuitive.
00:08:09.800 | So I really like to experiment with things.
00:08:11.720 | I like to know if my experiments are right.
00:08:15.040 | So like I'm really envious of how I don't know if you've seen Adam on the forum is able
00:08:20.000 | to like take an APL expression and treat it like an algebra, you know, he'll go through
00:08:25.800 | symbol replacement exercises and at each point, he'll say, here's the symbol replacement rule
00:08:30.200 | I'm doing and manipulate an APL expression into a new APL expression that clarifies some
00:08:38.080 | situation.
00:08:39.080 | I want to.
00:08:40.080 | Yeah.
00:08:41.080 | So he's he's my hero.
00:08:42.080 | I want to be like that.
00:08:43.080 | I want to be able to treat it as as an algebra, you know, and use it to deepen my understanding
00:08:50.040 | of things.
00:08:51.040 | I mean, I use it a lot right now to teach my daughter math.
00:09:01.880 | And so she's six and her friend is eight.
00:09:06.420 | And so I tutor them in math and we we have been doing a series of books called Beast Academy,
00:09:15.000 | which were kind of great cartoons, super fun, very, you know, compelling for kids.
00:09:23.200 | And they kind of as they math developed, we ran out of those and we, you know, needed
00:09:28.360 | new things to cover, you know, so like they're most of the math stuff they're doing is around
00:09:33.080 | like grade 11 and grade 12 now.
00:09:35.960 | And the problem is that materials are boring, dry presentation.
00:09:41.040 | And even the like the Beast Academy books, it's by a group put out of problem solving.
00:09:46.400 | And they have fantastic materials, but the highest, the high school level stuff is called
00:09:52.040 | out of problem solving and it removes all the comics and all the cool characters.
00:09:56.080 | And so it's not fun anymore.
00:09:58.000 | So, you know, a couple, you know, a few days ago, we were trying to cover a topic.
00:10:05.360 | And after 40 minutes, my daughter's just like, I'm so bored.
00:10:09.120 | You know, can't we do some APL?
00:10:11.720 | And I was like, oh, of course we can.
00:10:13.480 | We can do this exact topic with APL.
00:10:16.080 | So we just we stopped the video, opened up APL and I said, OK, solve this math problem
00:10:21.840 | with APL.
00:10:23.360 | And then they're engaged again and it's fun and they're trying things out and they're
00:10:27.400 | both sharing their screens so I can see them trying things.
00:10:30.520 | And then, you know, why why did that work?
00:10:34.240 | So, yeah, for me, it's kind of intellectual interest.
00:10:41.440 | And I feel like there's a.
00:10:44.720 | I can see it starting the revolution in education.
00:10:48.160 | Well, that's what Iverson thought, you know, and he, you know, he wrote this these books
00:10:57.320 | with with high school teachers and somewhere here, you know, here's OK.
00:11:03.800 | So here's a calculus book.
00:11:05.200 | Let me turn my virtual background off.
00:11:08.680 | OK, so here's a calculus book and it's a calculus book in APL.
00:11:16.360 | So, you know, it has exercises and derivations and whatnot, but rather than using normal
00:11:24.840 | math notation, it's all in APL, you know.
00:11:27.960 | And so it covers, let's see.
00:11:37.400 | You know, it's got all kinds of interesting.
00:11:41.360 | Math problems and Taylor's series and why is that students make it more compelling APL
00:11:51.320 | is intimidating can be well, not when you're six.
00:11:57.160 | Because, you know, when you're six, you're everything's new and everything looks weird.
00:12:04.040 | You know, so the biggest problem in our math is when we hit sigma notation and I just couldn't
00:12:12.280 | get anywhere with it.
00:12:14.720 | Yeah, because there's a lot of assumptions going on.
00:12:20.720 | Like I just sort of thought that was such an easy thing, I thought, how could anybody
00:12:23.800 | ever find it difficult?
00:12:24.800 | But then when we got there with the kids, it's like, OK, well, there's this like implied
00:12:29.160 | loop where this index is like looping through the thing.
00:12:31.760 | And then the thing inside the index is like getting each value of that.
00:12:35.560 | And then there's this kind of like inserted sum.
00:12:38.640 | And it's just that that's just a lot of abstractions going on.
00:12:42.400 | So when we did it in NumPy, that helped a lot, you know.
00:12:47.640 | But then when we did it in APL, we actually learned plus slash means insert plus between
00:12:53.040 | each pair of things in a sequence, you know, OK, so sigma's last step is it does plus slash.
00:13:00.640 | And like you can try it and you can see it and then we're like, OK, and then the thing
00:13:04.720 | that happens inside is there's an expression that gets evaluated.
00:13:09.000 | So yeah, it was much less intimidating to people who haven't yet learned normal math
00:13:18.480 | notation because this is a math notation that they could execute experiment with, has extremely
00:13:24.080 | well defined rules.
00:13:25.080 | If they're not sure what something is, they can look it up and they help, you know, OK,
00:13:30.040 | that was interesting.
00:13:32.040 | Thanks for explaining.
00:13:33.040 | Yeah, no worries.
00:13:36.760 | OK, I am on.
00:13:40.040 | I just wanted to second like Adam, the nation, their awesome hit his rank operator.
00:13:44.960 | I use that all the time now that we showed it on that one, that one video.
00:13:55.960 | Yes, I'm listening to the arraycast podcast.
00:14:03.600 | Yes, yeah, I have two.
00:14:09.240 | It's great.
00:14:10.240 | Got to it yet, but there's two somewhat recent episodes called leading axis theory and transpose.
00:14:21.560 | And they spent about three hours covering what Adam did, you know, in 45 minutes when
00:14:30.000 | he was here, so much better when you've got it visually and I kind of listen to the episode
00:14:34.600 | and I was like, yeah, yeah, yeah, I know all that now.
00:14:39.000 | But it was interesting hearing him talk about transpose as well as being as important as
00:14:49.280 | the rank stuff.
00:14:50.280 | So it might be a valuable thing to check out if you haven't seen it.
00:15:00.240 | OK, so I'll share my screen.
00:15:10.400 | This time we didn't forget.
00:15:12.960 | That's right.
00:15:32.920 | Oh, also the concept of trains, I found them useful and non intuitive.
00:15:38.800 | Yeah, we haven't got to that yet.
00:15:42.520 | Because we're trying to do all the glyphs first, yes.
00:16:07.120 | Does anybody kind of remember, I guess, do we leave off in the middle of something?
00:16:19.060 | Last one was mostly Adam, so yeah, OK, I guess we're kind of up to here.
00:16:29.920 | Actually, I wouldn't mind moving these from stuff we haven't done yet to stuff we are
00:16:46.960 | doing because it really belongs right at the top, basic math operators.
00:17:05.520 | So what I might do is add this pipe operator or vertical bar operator.
00:17:35.320 | That's actually a pretty straightforward one, OK, so we're going to do vertical bar, and
00:17:59.080 | we type help, oh, smoking, never quite sure what's going to work on a new machine.
00:18:07.680 | So they call it style or vertical bar.
00:18:28.360 | I believe it's called magnitude, yes, it is, all right, so unfortunately, because I'm using
00:18:45.840 | a Mac today, I do not have a screen I can draw on, which is a bummer, so hopefully we
00:18:51.280 | can find a picture of what magnitude is, OK.
00:19:02.200 | So the magnitude of a complex number is how far away that complex number is from the origin
00:19:13.400 | if you represent it as Cartesian coordinates.
00:19:16.780 | So if you've got a number a plus bi, so to remind you, i means the square root of minus
00:19:23.040 | 1, and you can represent any of these complex numbers using a single real a and a single
00:19:37.960 | real b, even if you've got squares or square roots or multipliers or whatever, because
00:19:45.640 | you can always simplify it down to a real number part plus a real number times the square
00:19:51.720 | root of minus 1.
00:19:52.960 | So this is basically any complex number you can represent in this form.
00:19:59.220 | And then you could draw it, and you can draw it by putting it on a Cartesian coordinate
00:20:04.080 | plane by going right by a units and then up by b units to the coordinate a, b.
00:20:10.260 | Does that make sense so far? Anybody who's not, I think, Radek, you're not, said you're
00:20:17.200 | not so comfortable with complex stuff, does this make sense to you so far?
00:20:22.600 | OK, so this is a triangle, it's a right angle triangle, and so how far away is this dot
00:20:31.000 | from the origin? Well, the answer is it's going to be the square root of a squared plus
00:20:35.240 | b squared, because it's a right angle triangle, and Pythagoras told us so.
00:20:41.000 | And so if you think about it then, what about this number here? This number here is 1 plus
00:20:46.160 | 0i, also known as 1. So how far away is that from the origin? 1, which is equal to the
00:20:52.960 | square root of 1 squared plus 0 squared. What about this number here, i? OK, how far away
00:20:59.760 | is this? Well, square root of 0 squared plus 1 squared, also 1. OK, so the magnitude of
00:21:05.960 | a real number is the number itself, the magnitude of a complex number is the size of an only
00:21:13.720 | imaginary part, is the size of the imaginary component, it's a real number, and the complex
00:21:18.520 | number more generally is root a squared plus b squared.
00:21:22.600 | So that's what this means. And to remind you, 3j4 is how you write 3 plus 4i. So we could
00:21:36.600 | also do-- oh, and in fact, let's do them all together now that we're getting fancy. What
00:21:55.640 | happened to my APL part? So negatives, the distance that negative 3 is from the origin
00:22:10.440 | is 3. And again, negative 3 squared is 9, plus 0 squared is 9, square root of that is
00:22:17.320 | 3. OK, so dyadic, I think they call residual-- yeah, residual or modulus. Let me move that
00:22:39.880 | one down to later. OK, so modulus, so if we did-- oh, they've probably got some examples,
00:22:54.600 | we could still-- they do. So this tells you the residual you're left
00:23:06.920 | over with if you do 2 divided into 7. So in other words, 7 divided by 2 is 3, remainder
00:23:17.000 | 1. 13 divided by 10 is 1. But it's negative. So if you've got a negative right-hand side,
00:23:29.800 | then what they actually do is they go further. They treat that as being they say that's 2
00:23:34.440 | remained as 7. Or else if you have a positive right-hand side, 8 divided by 2 and a half
00:23:47.080 | is-- how do we get negative 2 here-- is 4 remainder minus 2. So I haven't really seen
00:24:09.000 | this idea before, but normally in school, remainders are done always positive. And they have a
00:24:22.120 | very clear answer, which is 10 goes into 13 one time with 3 remainder. 2 goes into 8 four
00:24:29.760 | times with 0 remainder. But for negatives, you can overshoot it on the positive side
00:24:36.400 | or the negative side. And so in APL, if you have a negative left-hand side, you'll get
00:24:51.600 | a negative remainder. And if you have a positive left-hand side, you'll get a positive remainder.
00:24:58.560 | The reason this is also called modulus is because if you're measuring the number of
00:25:08.200 | minutes past the hour, for example, then after-- let's go back a little bit so it doesn't go
00:25:34.040 | up. Then after 1 second, the minute hand will be at 1. After 4 seconds, the minute hand
00:25:40.800 | will be at 4, et cetera. After 59 minutes, the minute hand will be at 59. After 60 minutes,
00:25:47.800 | the minute hand will be at 0. So clocks count modulo 60. So modulo is the same as what's
00:26:00.240 | the remainder if you divide by this. And modulo arithmetic is used in cryptography a lot. And
00:26:10.440 | it kind of comes up all over the place. If you're measuring the angle that's made as
00:26:17.960 | you turn around a circle, if you go more than 360 degrees, you come back where you come
00:26:22.080 | from. So those measurements will be modulo 360. Does that make sense?
00:26:43.120 | So then times-- Monadic times tells you the direction.
00:27:12.360 | And if you look here, the number 1-- there's a real number-- is to the right. And so you
00:27:19.840 | could say its direction is 1. The number negative 5 is to the left. You could say its direction
00:27:26.880 | is minus 1. The number 5i, its direction is straight up. You could say its direction is
00:27:34.200 | i. So the direction of a number is if you draw a vector from the origin out to that
00:27:43.000 | number on this plane, where abouts would it cross the unit circle? And so in most languages
00:27:53.480 | that don't deal particularly with complex numbers, we have a function called sine, S-I-G-N,
00:28:04.040 | that returns the sine of a number. And it normally returns 1 if it's positive and minus
00:28:10.240 | 1 if it's negative. For real numbers, monadic times is exactly that. Look at this. Monadic
00:28:22.360 | times 3.1. In other words, sine 3.1 is 1. Monadic times of negative 2. In other words,
00:28:30.840 | sine of negative 2 is negative 1. And then normally, in most languages, sine of 0 is
00:28:36.000 | called 0. So, so far, this is all exactly the same as sine. It's called that in Python,
00:28:45.160 | Python. Oh, I guess it doesn't. NumPy has sine. So why doesn't Python have a sine function?
00:29:03.800 | Yeah, I don't remember using sine in just Python. Huh? Was that? Yeah, I don't remember using
00:29:13.480 | sine without NumPy in Python. Yeah, that says there was a patch, but it wasn't accepted
00:29:18.200 | because they couldn't agree on what it should return. So they didn't do it at all. That's
00:29:23.560 | funny. So in NumPy, I wonder if NumPy's sine handles complex numbers.
00:29:50.440 | That sounds to be something slightly different. That's interesting. All right. So I kind of
00:30:20.320 | like this about APL is I find really consistently it tends to extend basic ideas from other
00:30:32.400 | languages and from math to cover, like, more things in a more general way, which I think
00:30:42.400 | is really cool. Okay, I guess I should mention complex numbers here.
00:31:00.760 | Okay, so here we can see, so what is the magnitude of 3 plus 4i? So the magnitude of 3 plus 4i,
00:31:26.360 | well, we would start with the number 3 plus 4i, and then we would divide it by its length,
00:31:38.760 | which we know is magnitude of 3 plus 4i, and that gives us 0.6 plus 0.8i. So that's going
00:31:50.200 | to be the, you know, so 0.6 comma 0.8 would be its coordinates on the unit circle down,
00:31:59.560 | you know, somewhere around here in this case. I'm not going to include it here, but I think,
00:32:14.440 | you know, as Adam said, I was trying to think about a way to do this as a train. I think
00:32:24.160 | this should already work, right? So when you have two of these next to each other, it first
00:32:28.840 | of all applies this. Is that right? I can't remember which border it's in. Yeah, the first
00:32:35.400 | one applies that. So you can just delete the left hand side maybe. You can't just delete
00:32:47.400 | the left. Oh, well, you could delete the left hand side if you're in J, but APL doesn't work
00:32:51.880 | that way. APL would treat this as being the reciprocal of the magnitude. If you put parenthesis
00:33:00.920 | on it. Still no, that's the way J works. It's not the way APL works. Okay. You're thinking
00:33:11.040 | of a type of train called a hook. But in APL, you would need to do, you would need to use
00:33:21.320 | the self operator. So you would do that with the self operator, which I can't remember
00:33:31.040 | how to write it. So I don't have to find it. It's the tilde diuresis. Capital P, capital
00:33:55.400 | P. Oh, did I get it wrong? Yeah, no, I got it right. F tilde diuresis. You can do that
00:34:24.880 | again. Tilde diuresis y equals y f tilde f y. I could answer you last week. All right.
00:34:50.080 | Well, that's an interesting puzzle for somebody to figure out. Is the binding for the complex
00:35:00.000 | number less high than? No, this binds as tightly as upper bar or full stop would as a decimal
00:35:13.520 | or yeah, or whatever. I'm 99.99% sure. Yep.
00:35:35.480 | H a four, F three, two, four. Oh, that's interesting.
00:35:59.560 | So, oh, oh, I see the issue. The issue is that there's an implied parentheses here. Because
00:36:20.040 | we go right to left. So actually, if I did this, that would break. And so I have a feeling
00:36:32.040 | what I actually need and I what I should do really is look it up properly. Yeah, but what
00:36:40.640 | you actually need is beside because beside. Yes, beside is the thing which behaves exactly
00:36:57.200 | the way we want. And it's the same as putting two things next to each other, as long as
00:37:06.160 | you don't mess with the kind of execution order. So here's beside it applies the monadic
00:37:11.120 | g first, and then applies the dyadic to the result, which is what we want here. So I think
00:37:25.640 | that means. Alright, now, what do we expect this to work? So it's going to go. I don't
00:37:49.760 | know if it's. Okay, that does work. That's very interesting, isn't it? So I guess the
00:37:56.200 | thing is here, it starts looking left, right? I still want to get better at these parsing
00:38:01.520 | rules. It starts looking left and it says, okay, that's an operator. So we're not done
00:38:05.000 | yet. Okay. And so then given it's found an operator, it then needs to find a function.
00:38:13.640 | And it's found a function here, but I guess it's not a complete function because it's
00:38:18.960 | got an operator to its left. And so it keeps looking until it's got a complete function.
00:38:24.800 | Something like that. I'd love to see like a really clear documentation of this parsing
00:38:32.000 | rule. Like how is this passed? Yeah, I think you're right. And then there's a way to do
00:38:39.200 | it with train and without the last symbol for the what's called without the symbol.
00:38:47.400 | Right. Without the tilde. I'm pretty sure you're thinking of J. It's got a hook in J. I'm pretty
00:38:53.760 | sure APL does not have such a thing. See the response from the Adam gave to my computing
00:39:02.700 | the mean of a vector. One of them was equivalent to this and one of them, the last. No, no,
00:39:07.600 | that was different. He had a fork. A fork is a list of three verbs in a row. So you're
00:39:13.720 | thinking of something else, which is the definition of mean, which is very interesting, but we
00:39:19.760 | are kind of skipping ahead, which is equal to the sum divided by the count, which is
00:39:30.360 | tally, which I can't remember how to type. Double quote. OK, that's the main. OK, and
00:39:51.720 | this is different because we here we've got one, two, three verbs. And the definition
00:39:59.040 | of these three verbs in a row, it's called a fork. And what it does is it applies this
00:40:06.640 | to Omega and this to Omega and this to the two results. So sum of Omega divided by count
00:40:16.400 | of Omega. But as we're skipping ahead, Jeremy, there's an option you can turn on with the
00:40:24.480 | box option to show trains and functions is like parse trees. I posted it in the chat.
00:40:33.080 | OK, great. And presumably that would just be if we remove this. Oh, why wouldn't you
00:40:49.160 | always want that? It's beautiful, isn't it? Yeah. I'm still a little bit of a pain kind
00:40:58.400 | of deciphering where all of the arguments are supposed to end up, but. Yeah. Well, not
00:41:08.040 | too bad, right? Because you've got to. This this is obviously going to apply to the right
00:41:12.500 | hand side. So I guess that's OK. So. And yeah, but I mean, you can always end you have I
00:41:21.240 | think that those pictures they have is nice of like what the side does. Right. Well, let's
00:41:28.200 | put that at the top, maybe.
00:41:46.360 | [BLANK_AUDIO]
00:41:56.360 | [BLANK_AUDIO]
00:42:06.360 | I've actually got a complex section there.
00:42:24.680 | So I should move the complex description.
00:42:27.680 | [BLANK_AUDIO]
00:42:35.680 | Or just maybe I'll copy it.
00:42:36.680 | [BLANK_AUDIO]
00:42:46.680 | [BLANK_AUDIO]
00:42:56.680 | Okay, maybe it would even be useful to see.
00:43:09.680 | [BLANK_AUDIO]
00:43:14.680 | Or J zero.
00:43:16.680 | See, that's how you just do.
00:43:18.680 | [BLANK_AUDIO]
00:43:24.680 | All right.
00:43:25.680 | [BLANK_AUDIO]
00:43:35.680 | Okay, so I think we can now get back to our stuff for 2022 APL competition.
00:43:43.680 | [BLANK_AUDIO]
00:43:50.680 | So that was our kind of group by thing.
00:43:52.680 | [BLANK_AUDIO]
00:43:59.680 | And okay, so that, and did we have mod addict and dyadic?
00:44:09.680 | [BLANK_AUDIO]
00:44:17.680 | This is dyadic.
00:44:19.680 | [BLANK_AUDIO]
00:44:22.680 | And this is.
00:44:23.680 | [BLANK_AUDIO]
00:44:26.680 | Right, right, right.
00:44:27.680 | We've got the monadic and dyadic versions of the function created by the operator.
00:44:33.680 | Cool.
00:44:34.680 | [BLANK_AUDIO]
00:44:36.680 | All right, so the next in our list of these two.
00:44:40.680 | [BLANK_AUDIO]
00:44:41.680 | Let's do this one then, shall we?
00:44:43.680 | [BLANK_AUDIO]
00:45:05.680 | Oops, something went funny happen there.
00:45:08.680 | So this is called key.
00:45:10.680 | [BLANK_AUDIO]
00:45:17.680 | And that's not better.
00:45:18.680 | [BLANK_AUDIO]
00:45:22.680 | Okay.
00:45:23.680 | [BLANK_AUDIO]
00:45:40.680 | Okay, this is called left shoe.
00:45:42.680 | I like it.
00:45:43.680 | Cool name.
00:45:44.680 | [BLANK_AUDIO]
00:45:58.680 | Oops, I changed the wrong name.
00:46:00.680 | [BLANK_AUDIO]
00:46:09.680 | Left shoe.
00:46:10.680 | [BLANK_AUDIO]
00:46:12.680 | Okay.
00:46:13.680 | [BLANK_AUDIO]
00:46:14.680 | Monadic is in closed and dyadic has a couple of meetings.
00:46:17.680 | [BLANK_AUDIO]
00:46:26.680 | And close.
00:46:27.680 | [BLANK_AUDIO]
00:46:36.680 | So this enclosed thing happens, it gets used all the time.
00:46:40.680 | [BLANK_AUDIO]
00:46:51.680 | And it seems to be something like what Jay calls boxing or
00:46:57.680 | [BLANK_AUDIO]
00:47:02.680 | Kind of creating like references or something.
00:47:06.680 | [BLANK_AUDIO]
00:47:10.680 | Okay, so we're basically
00:47:13.680 | [BLANK_AUDIO]
00:47:18.680 | That's a list.
00:47:20.680 | [BLANK_AUDIO]
00:47:26.680 | And this is row of that list.
00:47:29.680 | [BLANK_AUDIO]
00:47:32.680 | Row of the list.
00:47:33.680 | [BLANK_AUDIO]
00:47:35.680 | Okay, and then.
00:47:37.680 | [BLANK_AUDIO]
00:47:43.680 | So this is a list with three things in it.
00:47:45.680 | [BLANK_AUDIO]
00:47:46.680 | This is a list with two things in it.
00:47:48.680 | [BLANK_AUDIO]
00:47:49.680 | And the second of the things in the list is the list two, three.
00:47:55.680 | [BLANK_AUDIO]
00:47:56.680 | Does that make sense?
00:47:58.680 | [BLANK_AUDIO]
00:47:59.680 | And then this is gonna be a list with one thing in it.
00:48:01.680 | [BLANK_AUDIO]
00:48:04.680 | Because it's a.
00:48:05.680 | [BLANK_AUDIO]
00:48:10.680 | This is a scaler.
00:48:11.680 | [BLANK_AUDIO]
00:48:12.680 | That's interesting, yes.
00:48:13.680 | Okay, of course, this is a scaler.
00:48:15.680 | [BLANK_AUDIO]
00:48:16.680 | So it's empty, it's got an empty rank, an empty shape, sorry.
00:48:22.680 | [BLANK_AUDIO]
00:48:24.680 | So this is a, okay, so.
00:48:27.680 | [BLANK_AUDIO]
00:48:33.680 | I think that's interesting.
00:48:34.680 | [BLANK_AUDIO]
00:48:37.680 | Right, and close, how do I type in close?
00:48:39.680 | [BLANK_AUDIO]
00:48:44.680 | [BLANK_AUDIO]
00:48:46.680 | Right, right, right, okay, so that's what it does.
00:48:49.680 | [BLANK_AUDIO]
00:48:50.680 | So it creates a scaler or an atom containing a list.
00:48:56.680 | [BLANK_AUDIO]
00:49:04.680 | And you've got to do that because.
00:49:06.680 | [BLANK_AUDIO]
00:49:10.680 | Arrays kind of like conceptually only contain atoms.
00:49:14.680 | So when you strand it like this, it's actually creating,
00:49:20.680 | I guess it's enclosing this list.
00:49:22.680 | [BLANK_AUDIO]
00:49:26.680 | Which I think is the same as concatenating.
00:49:32.680 | [BLANK_AUDIO]
00:49:40.680 | It is, see, okay, so if I concatenate the scaler one with the atom,
00:49:47.680 | enclose two, three, that's what this is.
00:49:51.680 | [BLANK_AUDIO]
00:50:01.680 | Does that make sense?
00:50:02.680 | [BLANK_AUDIO]
00:50:05.680 | It's like a void pointer or turning it into a single object that you can store
00:50:13.680 | and move around.
00:50:14.680 | [BLANK_AUDIO]
00:50:18.680 | Has anybody used this?
00:50:19.680 | It seems to come up quite a bit.
00:50:21.680 | Serato, did you use it in any of your solutions or anybody else used it?
00:50:25.680 | >> Yeah, especially for good thing, partition thingy.
00:50:31.680 | >> Yeah, tell us more.
00:50:33.680 | [BLANK_AUDIO]
00:50:37.680 | >> I think that is your example, sorry, or I think quite expendable already.
00:50:42.680 | [BLANK_AUDIO]
00:50:44.680 | It's just a simple idea, but once you put the element,
00:50:47.680 | it's one chunk and then you can operate individually.
00:50:51.680 | >> I just got somebody at the door, just a moment.
00:50:54.680 | Sorry about that.
00:50:55.680 | [BLANK_AUDIO]
00:51:02.680 | I guess we see it in the docs quite a bit, so yeah.
00:51:08.680 | [BLANK_AUDIO]
00:51:10.680 | All right, let's see if we've got time to do dyadic.
00:51:13.680 | Sorry.
00:51:14.680 | >> I was going to say like using it on a single, what is it?
00:51:21.680 | A single scaler, isn't it, does not enclose anything?
00:51:27.680 | So that might be a case to look at.
00:51:29.680 | >> Yeah, great, okay.
00:51:32.680 | [BLANK_AUDIO]
00:51:36.680 | Yeah, so that does nothing.
00:51:39.680 | [BLANK_AUDIO]
00:51:41.680 | Yeah, okay, if y is a scaler, it's a scaler.
00:51:43.680 | Otherwise, it has a depth whose magnitude is one greater than the magnitude of the depth of y.
00:51:50.680 | [BLANK_AUDIO]
00:51:58.680 | And you can add axes.
00:51:59.680 | And I guess we're not meant to be worrying too much about axes, because it says they're a bit old fashioned.
00:52:05.680 | And we're definitely not old fashioned, so that's fine.
00:52:10.680 | [BLANK_AUDIO]
00:52:14.680 | So dyadic, God, I don't know.
00:52:18.680 | What's our quad ml equal to?
00:52:21.680 | Let's just focus on the default, shall we?
00:52:23.680 | [BLANK_AUDIO]
00:52:28.680 | One, okay, partitioned enclose.
00:52:32.680 | [BLANK_AUDIO]
00:52:38.680 | >> APO Wiki has better examples for this.
00:52:41.680 | >> All the partitioned enclose?
00:52:42.680 | [BLANK_AUDIO]
00:52:44.680 | >> For dyadic, yes.
00:52:45.680 | [BLANK_AUDIO]
00:53:12.680 | >> Just click on enclose, I think.
00:53:15.680 | [BLANK_AUDIO]
00:53:25.680 | >> Okay, where's the good examples?
00:53:28.680 | >> Is the first one dyadic?
00:53:30.680 | Do you consider that dyadic?
00:53:31.680 | >> Well, it's got a plus before it, which is, or is that what it is?
00:53:34.680 | Is it an operator?
00:53:36.680 | [BLANK_AUDIO]
00:53:39.680 | >> There's an optional K, that's the axis.
00:53:43.680 | I'm confused about this, they're doing plus.
00:53:50.680 | No, this is monadic, because when you have two functions in a row,
00:53:56.680 | it applies this monadically and then dyadically to the result with the left-hand side.
00:54:02.680 | >> And this is a good example for monadic, because it's not intuitive,
00:54:07.680 | but I didn't think it's gonna do that.
00:54:10.680 | Did you?
00:54:11.680 | [BLANK_AUDIO]
00:54:17.680 | >> Let's think about that.
00:54:19.680 | Okay, so all right, so that's gonna turn the right into a scalar.
00:54:26.680 | And so then it's gonna be one, two, three, plus four, five, one.
00:54:32.680 | Yeah, okay, so if you did one, two, three, plus one,
00:54:35.680 | it would add one to each of these three things.
00:54:37.680 | So if you do one, two, three, plus an enclosed array,
00:54:40.680 | it adds this to each of these three things, which is actually very, yes,
00:54:45.680 | that's very instructive and helpful.
00:54:48.680 | [BLANK_AUDIO]
00:54:58.680 | [BLANK_AUDIO]
00:55:08.680 | [BLANK_AUDIO]
00:55:19.680 | [BLANK_AUDIO]
00:55:29.680 | [BLANK_AUDIO]
00:55:38.680 | [BLANK_AUDIO]
00:55:48.680 | [BLANK_AUDIO]
00:55:58.680 | [BLANK_AUDIO]
00:56:03.680 | >> Oh, we could have used this with a tally operator for that DNA
00:56:08.680 | competition question.
00:56:10.680 | [BLANK_AUDIO]
00:56:12.680 | 456 would be a CGT and the left hand side would have been the DNA sequence.
00:56:19.680 | >> Sounds interesting.
00:56:20.680 | [BLANK_AUDIO]
00:56:23.680 | Great.
00:56:24.680 | [BLANK_AUDIO]
00:56:27.680 | Okay, well, we're kind of out of time.
00:56:30.680 | So we'll do the dyadic version next time.
00:56:34.680 | Thanks, everybody.
00:56:37.680 | >> Thank you.
00:56:39.680 | >> Bye.
00:56:40.680 | >> Adios, everybody.
00:56:41.680 | [BLANK_AUDIO]