back to index

Fast.ai APL study session 14


Whisper Transcript | Transcript Only Page

00:00:00.000 | >> Hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello,
00:00:29.840 | hello, hello, how are you? I'm good, very good, glad I made it, how about you Jeremy,
00:00:36.720 | how are you doing? Oh, can you hear me? It's the same thing again. I know, it's all good,
00:00:44.200 | it's fine. Oh, it's all good. How are you Jeremy? Good. Sweet, sweet, sweet, it's beautiful
00:00:51.800 | and sunny. Yes, beautiful and sunny. Like nearly every other day. Apparently it's going
00:01:00.240 | to be 27, which is pretty good for winter, I've got to say. Yeah. Definitely not the
00:01:08.920 | experience of my first 37 years of my life. Yeah, not 37. This is sometimes closer to
00:01:19.760 | the distance from the zero on the number line from the other side, you know. I mean, yeah.
00:01:29.400 | >> Oh, I'm having trouble getting, I'm just going to get my screen organized and I'm not
00:01:41.200 | quite used to being on a Mac. There we go. I've also tried buying a, one of the magic
00:01:57.280 | track pad things, so that takes some, that's an advising amount of getting used to as well.
00:02:02.840 | >> Oh, those are great. >> Things just take a little bit more adjusting
00:02:06.580 | than I'm used to. >> What is it? It's a track pad, right?
00:02:11.720 | >> Yeah, it's just the, you know, the magic track pads that they use on Apple devices.
00:02:16.840 | I mean, it's just not like that, but I guess I'm so used to using a thumb track pole that
00:02:24.480 | I, my brain's like, what is this strange thing? >> Track pad is the most hated piece of equipment
00:02:32.800 | for me of computer technology. Like, you know, I remember the ThinkPods, they had this tiny
00:02:39.800 | little like gizmo that you could use instead of the track pad. I'm not sure if you --
00:02:45.860 | >> At some point, I think they called it, yes. >> Yeah, that was wonderful.
00:02:49.280 | >> I like those, yeah, they were great. >> And like, I even hate using the mouse, so
00:02:54.960 | track pad is like one level below, but yeah, I'm also in the, in this club.
00:02:58.640 | >> Yes, that's good. >> After reading Rachel's poster, I made the
00:03:04.900 | jump and like, I don't even think about it anymore. It's --
00:03:08.900 | >> Yeah, I had to change because my RSI was terrible. That made a big difference. So I'm
00:03:19.560 | planning, this might be crazy, but I'm planning to like, power through a lot of myths today.
00:03:30.080 | So that's my hope. And I'll just also mention, I guess I'll share my screen. See, I'm already
00:03:52.360 | pressing the wrong button on this track pad. >> I kind of got stuck on the end code, which
00:03:55.760 | is the t-shaped clip. >> Okay. I guess we'll hopefully get to that
00:04:01.760 | today then. Hopefully we'll get to as many as possible. All right, I'm sharing my screen.
00:04:07.960 | You can see it okay? >> Yep.
00:04:11.880 | >> Just wanted to briefly mention, oh, that's not good. I broke everything. How about that?
00:04:25.360 | Your mic is not as good as the other day, Jeremy. >> That's why on the other side of my computer.
00:04:40.760 | Thanks for letting me know. Okay. Is that better?
00:04:44.080 | >> Yes, everybody else is too polite to say anything.
00:04:47.360 | >> Yes, people being polite is the bane of my existence. Nothing worse than being polite.
00:04:55.120 | >> I didn't even notice. It sounded fine to me.
00:04:59.800 | >> All right. Okay. >> That's amazing that we get along, Jeremy,
00:05:03.840 | then, because I'm like chronically polite. >> I know, you're disastrously polite, Ratatoum.
00:05:09.360 | >> It's the bane of my existence as well, since I remember.
00:05:16.360 | That is complicated. Why on earth do we not have a website anymore? So, GH pages. So,
00:05:28.000 | if you're ever trying to debug broken GitHub pages, if you actually go to the GH pages
00:05:33.240 | branch -- oh, there you go. It's empty. So, that's why it says we don't have a website.
00:05:39.600 | So presumably something broke. Build website. Oh, there you go. I don't know. That's not
00:05:58.360 | good. All right. No worries. I will fix that later.
00:06:08.280 | You don't have to watch me do that. What I was trying to tell you is that I've broken
00:06:12.880 | up the notebook into four sections. A bit about arrays and numbers and strings, a bit
00:06:20.280 | about some basic functions, some basic operators and then the APL competition stuff, because
00:06:26.520 | I thought it was getting a little bit unwieldy. Now, there is some helpful stuff about glyphs
00:06:38.440 | to cover on the forums, which I think -- yeah, this is probably a good place. So, thank you,
00:06:45.520 | RogerS49, for this list, and I think some of you else, maybe Serato had one too. And
00:06:54.280 | so some of these are pretty easy to get going with. So, what I might do is just move this
00:07:05.920 | one out of the way so I don't get distracted. So, some of these are pretty basic functions.
00:07:13.680 | I might just add them over here. Maybe this factorial count is a basic math operation
00:07:26.640 | or I wonder what we have as basic math operators. >> I guess it's factorial as well as binomial.
00:07:41.120 | >> Exactly. I'm going to call it basic. Okay. Presumably, they call this something like
00:07:50.840 | exclamation mark or exclamation point. Oh, and let's run this line. Okay. Help. Exclamation
00:08:16.160 | mark. Okay. I guess it doesn't really matter if it's exactly perfect, but exclamation mark.
00:08:26.520 | Okay. So, the mathematic version is factorial, which probably -- does anybody not know what
00:08:34.720 | factorial is? One thing to be aware of is that these are always prefix operators. So,
00:08:50.640 | that's going to be confusing. And I guess in operators, we could then mention that factorial
00:09:00.720 | is probably going to be the same as times slash iota, right? So, maybe we could use that
00:09:09.900 | here. So, times -- oh, I'm going to do apl thingy. Okay. Times slash iota five. And factorial
00:09:38.500 | -- there we go. Look at me. I'm not doing apl. All right. I guess we should probably look
00:09:52.160 | it up in case they do weird things with negative numbers or something. Oh, here we go. Negative
00:09:55.840 | numbers. So, I guess like a factorial of a non-integer is a gamma function. Is that -- yes.
00:10:09.100 | Great. Look at me remembering math from university. I've never used that since, but I'm sure it
00:10:16.620 | comes up for some reason. What's the keyboard shortcut to insert the lamp, the comment character?
00:10:33.820 | It's back to comma. Comma. It's not working, I guess. Yeah, I thought it would be an a-board
00:10:48.260 | or an e-board. Sometimes when I put a couple of spaces, it seems to be a dot. All right.
00:11:17.020 | Someone asked me to explain gamma because I damned if I remember what it is. Maybe if
00:11:23.760 | there's interest, at some point we should come back to that. And I guess they're probably
00:11:29.020 | going to call this binomial or something. Yeah, yes.
00:11:38.460 | Double space on Mac is period. Oh, it's a Mac thing. Is there a way to turn
00:11:44.580 | that off? I suppose so. Not sure. That's right. I'll look at that later. Thanks for letting
00:11:58.940 | me know who to blame. Okay. Probably worth mentioning how to define binomial.
00:12:12.180 | One more. I'm going to use the factorial.
00:12:36.500 | The results are derived from the beta function. I don't remember that at all. That sounds
00:12:48.460 | like an interesting thing to relook up one day as well. Okay. So R is the number of selections
00:12:55.500 | of X things from Y things. That's basically the definition of binomial that we learn in
00:13:02.300 | university. Actually, high school. At least in Australia we did it in high school.
00:13:25.240 | Over-enthusiastic with the use of non-integer versions. I'd be inclined to do something
00:13:34.100 | like say iota 5. Oh, we haven't done iota yet.
00:13:46.620 | No, we haven't done iota. Not at this point. There we go. So there are five ways of selecting
00:14:06.780 | one thing from five things, 10 ways of selecting two things from five things, and so forth.
00:14:17.500 | And I guess one way of selecting zero things. Does that make sense?
00:14:24.260 | All right. Next. How about we do these other Boolean ones? They're probably going to be
00:14:38.060 | nice and easy to zip through as well.
00:14:55.660 | Okay. So, Boolean ones, here we are. Let's start here, shall we? Greatest common divisor
00:15:19.260 | slash or is nine.
00:15:42.620 | So this is going to be quite fun. Because I love the way they don't just do or. Classic
00:15:57.220 | generalization trick, which is to say, well, or is just a special case of GCD, which is
00:16:07.260 | a very nifty insight. Now, something I don't know is, or haven't really thought about it
00:16:26.820 | is that there's some fundamental reason why that is, or it's just a coincidence. The greatest
00:16:37.340 | common divisor is the same as or.
00:16:44.860 | Greatest common divisor.
00:16:45.860 | Yeah. So the greatest common divisor, Radek, is zero and zero. It's zero. The greatest
00:16:53.620 | common divisor of one and zero is one.
00:16:57.900 | I thought those were binary numbers.
00:16:59.860 | These are also binary numbers. This is also a binary truth table. So this is true. This
00:17:08.020 | is true both for GCD and for the or truth table.
00:17:12.540 | No, no, no, but so the way I'm reading this, and maybe this is wrong, the result is the
00:17:19.620 | number that's greater than any of the two numbers above. Right. So how can it be the
00:17:25.740 | greatest common divisor?
00:17:27.620 | No, no, no. This is not a number. Space means create a list in APL.
00:17:32.140 | Yes, yes, yes. But all right. So it still operates on a single item. And it's just that
00:17:38.060 | I saw zeros and ones. I thought, oh, wow, maybe there's a binary number. Does that happen?
00:17:44.340 | Got it. Got it. One or zero.
00:17:49.740 | Okay. That's interesting that this is, I mean, that or can be, yeah, that's cool. That's cool.
00:17:59.860 | They also have a similar interesting point about not having XOR, exclusive or, because
00:18:07.380 | that's, yeah, but maybe that will be in a second. Oh, and then you can also operate on numbers
00:18:18.140 | that are not binary numbers that are, okay, got it. Sorry. Yeah, it makes a lot of sense.
00:18:30.060 | Great. So I think the header, you have equal underbar slash there. Oh, thank you. And what
00:18:44.220 | is this thing actually called?
00:18:49.020 | I think it's just, let me look it up. And I accidentally started with dyadic. Is there
00:19:03.940 | a monadic version of it?
00:19:06.340 | I think so.
00:19:08.420 | There isn't, no, not defined. Wow, they've actually got a spare character they can play
00:19:14.500 | with. Looks like it's just called logical OR, I guess. That's easy. Logical OR.
00:19:28.940 | Yep. And logical AND is same thing, no dyadic.
00:19:38.780 | Lowest common multiple OR AND. Okay.
00:19:49.140 | And all right. So this is lowest common multiple OR.
00:20:13.880 | Oh, website is up again.
00:20:16.880 | Our website is up again.
00:20:19.500 | That's what the chat says.
00:20:23.020 | That's weird.
00:20:24.020 | Well, it looks like maybe he fixed it.
00:20:28.380 | Oh, got a champion. Okay. So yeah, so we've got multiple things here now, as you see.
00:20:41.700 | Thanks, Vassim. He's meant to be on vacation in Melbourne. Why is he fixing our website?
00:20:58.120 | Another kind of person.
00:21:01.400 | You know, like.
00:21:03.920 | Well, maybe he's getting in trouble with his girlfriend for doing that instead of checking
00:21:11.700 | out the coffee in Melbourne.
00:21:15.540 | All right.
00:21:20.500 | And I'm going to guess it's eight.
00:21:26.940 | Nope.
00:21:27.940 | Zero.
00:21:28.940 | I've noticed that most of the time, there's something pointing down, the key to the right
00:21:42.460 | of it is going to be pointing up.
00:21:44.000 | Oh, that seems to go down and up a lot of times.
00:22:01.460 | Cool. Okay. Next, squiggly versions. The not versions. Okay. Makes sense.
00:22:17.700 | And these are now the equivalents to order through them, of course, that makes sense.
00:22:28.840 | And they also are the equivalent shifted versions.
00:22:34.420 | Oh, it's not so pretty in this font.
00:22:47.500 | Oh, well, let me publish it. It should look pretty.
00:22:51.140 | Oh, this is only nor, is it?
00:22:54.100 | Wow. Come on. Hope it had some weird fancy way.
00:23:06.380 | Okay. Truth table for nor.
00:23:23.360 | Wow. So it's actually an operator that does very little.
00:23:47.900 | Just one thing. I can just imagine as Adam is watching this, he's madly searching math
00:24:07.280 | to prove us the wrong kind generalizations of nor so he can put it in the next version.
00:24:12.380 | And this kind of embarrassment in the future. There we go. There's a nice talking font.
00:24:24.640 | Okay. You don't think man is going to be just as disappointing there.
00:24:34.840 | I think it is makes me wonder why we bother the universe is just helping you get through
00:24:45.000 | a lot of symbols. Yeah, well, quite.
00:24:48.940 | Yeah, trying to do a world record here. Okay. Everybody happy with our those so far.
00:25:02.700 | And we've got Tilda somewhere. Tilda somewhere. I'll just type it. I don't know how to type
00:25:12.440 | Tilda. Tilda. Oh, of course, it won't be in the language bar. I don't need it in the language
00:25:24.340 | bar. Oh, Tilda. Okay. There we go. Diatic and monadic. Monadic. Tilda is not.
00:25:53.160 | I don't know why they've got four things. Trying to make it look more fancy than it
00:26:17.760 | is, I guess. Okay. What happens if we do 9 or -2.3? Doesn't like it. There you go. Not
00:26:37.280 | a bit of a disappointment as well. I'd be inclined to have it work like Python where
00:26:44.200 | anything that's not zero or an empty string is turned into one. I quite like that.
00:26:51.000 | It does have a dyadic version. Don't worry. They're coming. Without or excluding.
00:27:00.600 | Okay. 3, 1, 4, 5 without 5, 1. Looks like it's removing the actual numbers. Makes sense.
00:27:30.320 | It's tough that doesn't appear on the right. Yeah, exactly. And it's doing them on whole
00:27:45.000 | kind of arrays, which you can see in this case remembering that a string is just an
00:27:50.560 | array of characters. So presumably if we did something like 1, 2, 3 without 1, 2. That's
00:28:01.000 | interesting. Oh, I probably need to be careful with my parentheses. Interesting. How is that
00:28:14.440 | different? You have to enclose the 1, 2 on the right. Make it a scalar. Oh, I see what
00:28:25.600 | you're saying. This is actually not 1, 2 at all. This is actually just a parenthesized
00:28:30.920 | array. Yes, I see. What's the keyboard shortcut for enclose again? Oh, good job, Isaac. Thank
00:28:42.600 | you. Thank you, thank you. And I don't think, well, I don't think I need that parenthesis
00:28:52.720 | because the space should be tightly bound. Yeah, yeah, yeah. Okay. Let's check the docs
00:29:00.920 | to see if there's anything else. I don't think you need the parenthesis on the right either.
00:29:05.720 | No, I guess I don't really, do I? Yeah. And if that actually makes it more obvious what's
00:29:11.600 | going on. Yeah. Thanks. Okay. So it's checking for equal underbar. Makes sense.
00:29:34.480 | And they use hash tables. Okay. Makes sense too. Which is basically the same as Python.
00:29:58.680 | Actually, the problem with looking just at symbols is that we miss out on some. And did
00:30:13.600 | Serana put a list, I think, on the main topic? Yes, she did. Okay. She's got all these ones.
00:30:26.640 | This is going to be more complete, I think. All right. I guess we're out of all the ends.
00:30:38.920 | So maybe we should do this one. Presumably this is something like the other shoe. I thought
00:30:49.920 | we did that last time, no? Did we? I thought we did the opposite direction. We definitely
00:30:55.720 | did the left shoe. Yeah, we got left shoe. Oh, no right shoe. Okay. Now the shoe's on
00:31:02.180 | the other foot. We also got up shoe and down shoe as well. Oh, really? Yeah. Okay. What's
00:31:21.440 | the keyboard shortcut? So it'll be X, I believe. I'm just pasting it at the moment. Okay. Help.
00:31:46.320 | Oh, yes. You believe right, Isaac? Okay. We have chord ML one. So this is disclosure first.
00:32:05.880 | The dyadic is pick. Okay. All right. Well, these examples are nice and straightforward.
00:32:34.880 | Oh, interestingly, though, in the second case, it's also like unboxing it or whatever the
00:32:48.860 | word they use is. Unenclosing it, is it? Why is that? I guess that's interesting. Is that
00:33:06.800 | just how it prints them? That's how it prints characters. Yeah. Yeah. Sorry, what you're
00:33:12.860 | gonna say, Heather? I don't know if it's, is it disclosing it or is it, I mean, if you just
00:33:20.080 | take the one, two in parentheses, then that would not be enclosed. Right. Okay. So my question
00:33:26.760 | then is, I guess, remind me the enclose. Yeah, it's definitely doing that. Okay. So it's taking
00:33:52.840 | the first thing and unboxing it. But I guess disclosing is what they use to mean unboxing.
00:34:02.240 | Let's see how they describe it. It's the first item. I guess you can't exact, I have a lot
00:34:23.620 | of trouble understanding enclose, to be honest. Because like I don't, like, in J, it's easier.
00:34:34.920 | There's a data type called a box, you know, and like you use less than put something in
00:34:43.080 | a box and now you've taken that thing and now it's a different data type. It's the box
00:34:47.560 | of that thing. It seems in APL, that's not quite what's happening. It's still, this is
00:34:54.240 | still an array that it contains an array. They have this idea of depth instead. And
00:35:02.920 | so I guess when you select something like a first element, by definition, you are reducing
00:35:10.220 | the depth, you know, because that element is you're going into it to get it out. I remember
00:35:17.760 | Adam said this was brought up also, this is not an array, an array. And he said, oh, look
00:35:23.840 | at this epsilon down below. Right. Yeah, I found that confusing. He said it packages
00:35:33.980 | it. But like you never get the package, you know, it always acts like an array as far
00:35:43.320 | as I can tell. It makes an atomic thing. So it kind of feels like it's different to J.
00:35:53.300 | I think in J, if you select the first element of something and it's in a box, you get back
00:35:57.320 | a box and you have to unbox it. Whereas APL doesn't behave quite that way. Do we get how
00:36:03.640 | these left shoe and right shoe are the opposite of each other? I don't understand this concept
00:36:08.920 | of first. That doesn't match. Yeah, we do. Because this is, so this has depth two, because
00:36:18.120 | end closed took something which was an array and put it inside an array. So we don't have
00:36:23.840 | an array with an array in it. So that's depth two. So here's the same thing. Here's the
00:36:29.840 | same thing disclosed, which has taken the first element and therefore it's got a depth
00:36:35.240 | one less than we used to have. And so therefore it's done the, yeah, it's taken us back to
00:36:44.760 | this. So to put it another way, we could say like A is this. And then we could say this
00:37:02.800 | matches, which is colon. A, I should do it the other way around. A matches this.
00:37:25.760 | Okay.
00:37:52.680 | And so that's a bit of a weird one. Disclose of the Zelda thing is zero in each case. Alright.
00:38:04.720 | So let's look at the direct versions now. It looks like it's just indexing in. Okay.
00:38:19.000 | So if you've got a scaler on the left, it just grabs the third thing or grabs the second
00:38:24.880 | thing. This goes into the second thing and then finds the first thing in the second thing.
00:38:31.920 | All right. Seems easy enough. Okay. Well, that's fine. See if there's anything weird
00:38:59.160 | about this to know about. Okay. Elements of X, selection and success is with deeper levels.
00:39:08.040 | Yep. Simple scaler items may be picked by empty vector items. Arbitrary depth. What
00:39:21.120 | is going on here with these ones where they've got two sets going on? So this is
00:39:45.760 | row two, column one is JKL. I'm getting so confused as to which is which. Okay. We're
00:40:01.240 | talking about this one at the moment. So this one here is enclose. So that creates an array
00:40:07.560 | with an array in it. And then it concatenates one. Wait, isn't that exactly the same as
00:40:15.120 | just putting a space between them? Yeah. Why are they confusing us? Okay. And then, oh,
00:40:38.040 | that's interesting. So now they're using that as an index. And why are they building up
00:40:56.920 | G in such a weird way? All right. I think we are going to need this example because
00:41:06.920 | this is something I... I think with the boxing, this would be made pretty clear what's going
00:41:15.280 | on. Yeah. Okay. And not having the boxing there, I think is making it look a lot harder
00:41:20.000 | than it really should be. Really? Okay. Maybe they were running out of room or something
00:41:34.480 | that let's see why they don't just do this. Okay. So we've got this weird thing. So I
00:41:56.000 | think we index in second row first column gives JKL for first element of JKL for gives
00:42:04.240 | you JKL. Okay. So all this is the index. And we're sorry, what's the keyboard shortcut
00:42:18.680 | for X? X. And we need to fix this. X. Okay. So sorry. We go into the second. This has
00:42:43.560 | been going to the second row first column. I believe so. Yeah. And then this is the first
00:42:51.680 | thing from that. Well, we should try that on a matrix to confirm. So two rows, three
00:43:10.640 | columns of iota 6. Okay. So you can't grab a row from a matrix.
00:43:33.600 | Okay. Oh, and you need the left shoe because you want that to be an atomic thing. The index.
00:43:56.600 | I think so. Yeah, it's gonna give you an error. What's the keyboard shortcut for quad? Okay.
00:44:20.680 | So that's a second row first column. And if you want to entire row, do you say the entire
00:44:34.960 | row? Well, we could try doing this, I guess. No. So I'm not sure you can.
00:44:55.760 | We just did it with G, didn't we? No. No, so the difference is okay. So it looks like you
00:45:01.440 | use a plain array to go into an array of arrays as in this one. So this is an array of arrays.
00:45:27.360 | To go into a matrix, you need a rank 1 or shape 1 thing, I guess, such as we have here.
00:45:49.120 | And so here now we've got a shape 1 thing, and then a scalar. So the shape 1 thing is
00:45:57.440 | going to go into the matrix to row 2 column 1. And this now contains two items. So this
00:46:05.720 | is the first item. Okay. So I think it's one way to get the row is to use the up arrow
00:46:15.920 | and down arrow. Yeah, exactly. Okay. That's weird. So the items of x are simple integer
00:46:35.200 | scalars or vectors. Okay. Yeah. So when we enclose them, we're creating a vector. And
00:46:40.080 | the vector identifies a set of indices 1 per axis at that level of nesting. Okay. So that
00:46:48.760 | description makes sense after I know what it means. I'm not sure I could have read it
00:46:52.200 | to figure out what it means. I still don't know what simple scalar items in y may be
00:47:01.120 | picked by empty vector items in x. An empty vector. How do you even create an empty vector?
00:47:12.160 | Is that iota 0? No. I don't know. I might leave that one for now because it's not going to
00:47:20.520 | help zip through it. Maybe somebody can try to figure that out. Okay. That was annoyingly
00:47:28.320 | long for our hope. But this is live. Should we do the up tack and down tack if that's
00:47:38.920 | what they're called? Yes. Is that what they're called? Does anybody know? Yes, that's what
00:47:53.800 | they're called. Okay. And how do I type them? And as in Nancy. So the one with the pointing
00:48:12.400 | upward is B and then it goes down and up again. Oh, D? No. B? Nancy and Barry. This one is
00:48:28.640 | sub tack. Okay. And that's only dyadic. Decode. Okay. This should be fun. Okay. Okay. Okay.
00:48:56.960 | Okay. Okay. This is very confusing. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Okay.
00:49:26.440 | The first element of X has no effect on the result. This function is only the base one.
00:49:40.320 | That's okay. It's a polynomial. Okay. Here's a polynomial that evaluates. So we start with
00:49:52.960 | Y1. Okay. This is Y1 times X to the n minus 1 times 2 to the 0. So 2 plus 4 plus oh, sorry.
00:50:14.200 | X to n minus 1. X is on the left. Oh, sorry. And that's 0, I guess. Yeah, that's 0. Okay.
00:50:27.760 | So it's 1 times 1 plus 1 times 2 plus 0 plus 1 times 8.
00:50:35.840 | It's the usual formula that we use to convert binary to decimal.
00:50:40.240 | Yeah. I understand. I'm just trying to see how it maps to that.
00:50:43.960 | Yeah. Okay. So this is a binary. This is the binary number 1 1 0 1 because we're doing
00:50:51.320 | it base two. Okay. So then what about base 10?
00:51:07.240 | Yep. Makes sense. Whoops. You're telling it what is 1 1 0. Okay. So that's 1 times 10 to
00:51:21.320 | the 0 plus 1 times 10 to the 1, blah, blah, blah. So we should be able to do 3, 4, 1,
00:51:31.160 | 1, 2, 3, 4, 5, 6. And that should just be that number, right? Yep. Cool. All right.
00:51:40.000 | When you've got an array on the left, each element of X defines the ratio between the
00:51:52.440 | units to the corresponding pairs. Okay. So the ratio, okay. So the ratio of the units
00:52:01.480 | is 24 to 60 to start with. So presumably this is like, presumably what this is is two hours,
00:52:16.520 | the two days, 40, sorry, two hours, 46 minutes and 40 seconds. So that would be two hours.
00:52:28.600 | I've got to do parentheses. And 46 minutes. And 40 seconds. Okay. Why? So, okay. So, okay.
00:52:54.040 | I see. So we start out with 40.
00:53:23.120 | And so this unit's considered 1. And so then the next one is going to be 60 times. Okay.
00:53:31.880 | So here's the 60 times. The next one will be another 60 times. Hence, I should write
00:53:37.240 | this as 60 times 60 to be more clear. Yes. And I must have pressed insert. I see. And
00:53:55.360 | so the 24 indeed is not doing anything. Okay. That's fun. So that's up tech. Higher rank
00:54:21.480 | array arguments. Whoa. Okay. Each of the vectors taken as the radix vector for each of the
00:54:32.800 | vectors on the first axis, first axis is the rows.
00:54:37.720 | Jeremy, before you move on, do you want to, the last example or the polynomial evaluation
00:54:43.920 | is that is a complex number. Do you want to put that in it as well?
00:54:48.920 | No. You're right. Sure. So that's going to be 1J1 to the power of 0 plus 1J1 to the power
00:55:18.040 | of 1 times 2. Is that how it works? Yes. Plus 1J1 to the power of 3. Right. To the power
00:55:35.480 | of 2 times 3. So 1J1 to the power of 0 is obviously going to be 1.
00:55:46.640 | And then 1J1 to the power of 1 is obviously going to be 1J1. That one's times 2. Okay.
00:56:01.520 | And then we've got 1J1 squared, which is going to be 1J1 squared, which is 1 plus i times
00:56:27.240 | 1 plus i, which equals 1 plus 2i plus minus 1. Okay. Which is indeed 0J2. Okay. That's
00:56:40.520 | another of those. And then that times itself again. Yes, it's easier to see than the polar
00:56:58.100 | coordinate. Why is that? Oh, because 45 degrees and 90 degrees, then no. Oh, okay. Sorry. I'm
00:57:08.360 | not much of a complex numbers person. So 1J1 is the 1 comma 1 on the Cartesian plane. Is
00:57:15.040 | that what you're saying? Right. 1J1 angle phase is 45 degrees. And when you do times,
00:57:21.720 | is that the same as multiplying at that angle? Correct. Power goes, translates to multiplying
00:57:29.680 | by phase and also magnitude gets to that power. Okay. Maybe you can find some link or something
00:57:40.640 | that explains that for dummies like me and put it in the forum or something for this
00:57:44.840 | person, because I never learned any of that when I was studying philosophy at university.
00:58:02.120 | So, this one is 4 by 1, 2, 3, 4, 5, 6, 7, 8. And here's the 8. X is the thing on the
00:58:24.160 | left. Still wish they said alpha instead of X. So each of the vectors, each of these vectors
00:58:34.400 | is taken as the radix vector for each of these vectors. But there's three of these rows and
00:58:46.160 | four of these rows. How does that work? Oh, I see. It's doing an outer product. So it's
00:58:56.520 | doing -- it's doing this with this. And that's what this is. Is that right?
00:59:17.160 | I think we need to explain in terms of radix. I don't know what a radix vector is. It's
00:59:27.600 | like the base -- like 13 in radix 2 is 1, 1, 0, 1, just like above. No. Okay. I'm wrong
00:59:45.920 | about how these are combined. How do these work? I don't get it either. I think APL Wiki
01:00:09.000 | has a better explanation. Oh, great. But still complicated.
01:00:20.240 | Then I'll search for decode. So, examples. The third paragraph.
01:00:50.200 | One, two, three. Okay. So we've got these ones. Okay. Okay. We've done this one. One
01:01:14.000 | tack. One tack is -- oh, okay. So that's -- I keep forgetting how this works. X is on
01:01:39.320 | the left. And then we multiply it by -- oh, that is the sum, right? One, two, power of
01:01:51.440 | anything is one. One pair of anything is one. Yep. So we end up with three times one plus
01:02:04.560 | one times one plus four times one, et cetera. It gets tricky when the left-hand side is
01:02:17.000 | an array. Yes. Okay. So then, doing it here with a matrix is -- oh, very first thing on.
01:02:43.240 | Let's sum the column. Yeah. Why? What's it doing? Is it doing it to each -- yeah, I guess
01:02:57.520 | that's my question. Why?
01:03:17.440 | Oh. If the left argument is a scalar, it's converted to a vector filled with that number.
01:03:45.560 | Oh. So it's one, one. Which size? Columns. Let's find out. That one. Okay. So it's basically
01:04:04.840 | a lining. So -- okay. So because decode expects kind of a scalar on the left and a vector
01:04:14.880 | on the right. Not quite sure. I don't know what 48 did. So kind of the base case seems
01:04:42.960 | to be more this version. And then the one where you've got a scalar is just kind of
01:04:49.720 | a shortcut for it. The scalar one is good for converting to bases. Yes. Or de-converting
01:05:03.120 | to bases. To base 10. 31 is useful for converting to days and minutes and -- the one that the
01:05:27.920 | left-hand side is an array. It's not clear what the use is. The one with the left-hand
01:05:36.520 | side is an array. It's useful for the kind of example they gave here, I guess. So how
01:05:43.640 | many seconds is 2 hours, 46 minutes and 40 seconds? Yeah, I meant when the right-hand
01:05:49.240 | side is a matrix and the left-hand side is an array. What if you do 2, 2, 2? What would
01:05:56.040 | that do? Just a moment here. There's 12 of these. Okay. So it doesn't like that. So it
01:06:13.880 | has to be 3. Okay. And you have to get 2, 2, 2. Is that -- no. Oh. Yeah, 23 is 1 plus
01:06:35.780 | 5 times 2 to the power of 2, now to the power of 1 plus 9 times 4. Is it? No, it's not.
01:07:05.560 | It's 1 to the power of 0 times 2 plus 5 to the power of 1. It doesn't even say what it
01:07:22.600 | does in that case, does it? The first one is ignored. Oh, it uses the ratio of them.
01:07:35.260 | So with this ratio, 2, 2, 2 should have been similar to 1. So it doesn't really do anything.
01:07:59.200 | We will come back to this. I was looking at this before the class also and couldn't figure
01:08:13.420 | it out. Yeah, it's something going on here as well. All right.
01:08:39.240 | I hope -- I'm not expecting, but I'm hoping down attack is less confusing.
01:08:52.080 | Oh, and what was this called? Decode. Presumably this is going to be something called encode.
01:09:21.120 | What is this? All right. Okay. It's going to be the opposite.
01:09:45.780 | Okay. All right. All right. All right. All right. All right. All right. All right. All right.
01:10:10.440 | Okay. What's going on here? Okay. All right. Okay. All right. All right. All right. All
01:10:39.920 | right. That's a hard one to start with. Okay. So this is decoding 7 to a binary number.
01:11:09.760 | Of length according to what it was on the left. Oh, do left-hand size.
01:11:29.340 | And columns. Here's 5. Here's 7. Here's 12. Okay. So we should be able to do the same
01:11:55.420 | thing. No. Oh. Yep.
01:12:22.300 | Yep. Y and X must both be simple numeric arrays. It's the representation of Y in the number
01:12:36.420 | system defined by X. If the first element of X is 0, the value will be fully represented.
01:13:00.620 | You're getting the digits of the right-hand side and the basis specified by the left-hand
01:13:06.740 | side one by one. Oh, there you go. That's the difference. So if the first element is
01:13:12.060 | 0, then it's going to make this as big as it has to be to get the whole number here.
01:13:16.540 | If it's not 0, then it truncates it. Makes sense.
01:13:33.860 | What truncate is a very special case when the thing is 10?
01:13:39.980 | Not really. If the thing is binary, this is a truncated binary representation. It's the
01:13:49.660 | least significant digits in that representation. Right. Okay. Yeah. You're getting the digits
01:13:56.700 | one by one in that basis. This is how you get the least significant digits.
01:14:07.700 | Okay. I see what you mean by truncated now.
01:14:23.820 | So here 75 in base two is probably column one. I don't understand column two.
01:14:53.540 | Oh, okay. So that's representation of 75 in base eight. Yeah. And the other one is hex.
01:15:06.620 | Hexadecimal. Except we don't have letters. B4, after all, 3, 1, 1. binary, 1, 1, 0, 1,
01:15:29.420 | 0, 1, 0. It's hard to imagine that one would want to do this.
01:15:33.340 | I mean, it could be some kind of performance like things sometimes. Where you need multiple
01:15:44.540 | representations at once. I don't think we need it for a quick like one of these glyphs.
01:15:51.740 | Yeah. All right. Makes sense. Wait, we've done these. Yeah, which one is the booleans?
01:16:08.860 | We've done that. All right. So let's do up and down shoe might be easier ones to work
01:16:19.100 | on. These ones here. Yeah. Does that make sense to go with left shoe and right shoe?
01:16:27.980 | Not really. It's unique intersection and union. It's what they are. Oh, okay. All right. Let's
01:16:35.900 | tell them they don't really match with those. Duplicate.
01:17:04.380 | Rest of the clits.
01:17:33.820 | The rest. I guess we could give it a number.
01:17:53.500 | Okay. All right. How do I write these?
01:18:12.780 | They're going to be C and the V.
01:18:19.020 | This is a script to be called up shoe. And what are their names of the things they do?
01:18:31.340 | Up shoe is just intersection. It's just dyadic. It's only dyadic?
01:18:45.020 | And then it's called set intersection more precisely. Oh, I see, dyadic. Set intersection
01:19:04.940 | means intersection. Yeah, sorry. You're saying, okay, this one's V, right?
01:19:14.940 | Yep. That one, the monadic is unique and the dyadic is union.
01:19:25.740 | Okay, that looks straightforward enough.
01:19:53.340 | So intersection of 22 appears here, AB appears here, FG does not appear here, and vice versa.
01:20:12.620 | Okay. This is similar to something we saw before, right?
01:20:19.420 | The tilde, I think, but it would be, you have to use the tilde going both directions. You'd
01:20:25.820 | have to use it twice, I think, to get the intersection.
01:20:30.940 | Yeah, right. Can we try to do that then? So if we wanted the intersection of
01:20:48.060 | Yeah, so this is wrong, isn't it? It should be like
01:21:10.220 | this answer to this should be one. So in Venn diagram, tilde is stuff that is
01:21:29.660 | outside the difference. Yeah. Yeah. So it's the set minus this and minus this. Okay.
01:21:49.180 | Yeah, union of those two. Yes. Okay. Great.
01:22:01.820 | Anything weird about this? These actually match the math notations for once. Yes.
01:22:17.980 | All right. That's nice and simple. Okay.
01:22:29.660 | Okay.
01:22:31.660 | Okay.
01:22:33.660 | Okay.
01:22:35.660 | Okay.
01:23:04.300 | So the dyadic version seems pretty simple.
01:23:08.860 | The monadic also looks pretty simple. And we've learned a way to do this before.
01:23:26.380 | Using not equal. Yes, exactly. Reduce.
01:23:34.780 | Was it slash not equal? Yes, that sounds right.
01:23:43.980 | I mean, not equal. It's like a four or a six.
01:23:53.660 | Is it that one or the one with the three things? That one.
01:23:58.620 | Right, which is back to the index into index.
01:24:11.980 | I think you're right, actually. Yes. And I think we looked at doing this.
01:24:32.540 | Put it another way. It's this.
01:25:03.180 | And then did we come up with a way to do that with a
01:25:06.860 | with a train?
01:25:10.140 | You should be able to whenever A is on both sides.
01:25:19.740 | Yeah. I mean, it's an ugly version of it, I think.
01:25:26.700 | No. Why is that wrong? I thought this means put it on both sides.
01:25:39.420 | That does. But the tilde in between, shouldn't that be a jot?
01:25:44.540 | This one. Oh, it does have to be a jot there. Yes. I think so.
01:25:54.860 | Looks familiar. Yes, yes. What is jot?
01:25:58.060 | Change. There we go.
01:26:02.380 | Oh, do we need that tilde inside, Prince? Yes.
01:26:07.580 | I think so. Let's see. We applied this to the A.
01:26:11.820 | And then, yeah, because we have to reverse it.
01:26:16.300 | This actually has to go on the right hand side. Because it's here.
01:26:23.260 | If it's on the left hand side. If it's on the right hand side, it would be fine.
01:26:27.020 | But we need to not be called to apply to the left hand side.
01:26:29.980 | So we have to reverse the order of slash.
01:26:34.780 | So, yeah, interesting question as to how to do this more neatly. I'm sure there's a way.
01:26:44.300 | Okay.
01:26:49.340 | Okay. That's that.
01:27:11.580 | Okay. Let's leave it there.
01:27:14.540 | I'm going to do an extra one tomorrow if people are around.
01:27:23.980 | In the hope that we can get close to polishing this off.
01:27:31.100 | This is like learning Chinese, isn't it?
01:27:38.700 | Glyphs. Oh, there's less to learn than Chinese.
01:27:41.980 | Thankfully.
01:27:45.660 | They're more complicated to understand what they mean than Chinese glyphs, though.
01:27:51.500 | You would know better.
01:27:53.740 | All right. Thanks, all. Bye.
01:27:57.260 | - Bye-bye. - Thank you.
01:27:58.600 | - Bye-bye.
01:27:59.440 | [BLANK_AUDIO]