 I respectfully acknowledge that I am standing on the unceded traditional territory of the Comox and Qualicum First Nations. I thank them for the use of their lands and I want to express my sorrow for the victims of the residential schools. On a recent episode of Arraycast, Connor Hookstra posed a problem to us and that problem is take this list of numbers and by taking one number at a time out, multiply the rest of the numbers and then get the product. So first step I'd take the three out and multiply these numbers together and that would be my first position. Second position I would take the four out and then I would multiply three times five six three two and I would get the second position and then so on as I go down the list. So this is what it should look like and to be quite honest I was terrified when Connor proposed this and the reason is because I generally don't think this way with Jay. I play around with things, I don't come up with fast solutions but I'm persistent and I will come up with solutions and on the way I quite learn quite a bit but in this case I had one of Jay's primitives, it's the adverb outfix and what outfix does, I can show you what outfix does, if I change this is a verb, it's the verb that will multiply across all all the positions in that it's given. So I'm going to change that to this which actually just takes whatever it's fed and then it'll spit it back out. So we're going to see how this works. So with that this is what's happening, you can see we've got three removed and then the rest of the numbers are there and then the four is removed and you end up with three, five, six, three, two, so three, skipping the four, five, six, three, two and so on. So you've got your six different lists, one for each number being removed and outfix just does that for you. Now outfix is pretty cool in another way too because you can actually change the number of entries that you're taking out, change the number of your entries that you're taking out. So this case I'm taking out two at a time. So I take out the three and the four and I'm left with five, six, three, two and then I take out the four and the five and I'm left with three, six, three, two and so you can do those kind of things with it, very powerful adverb. It's a dyadic adverb and that's why this argument on this side is here because it causes that adverb to act on this argument depending on the feed that is given from this argument. Now in the case of my solution, I just went here to one because I'm only taking one at a time and instead of just spitting them back out, what I did is I just did a product reduce across the remaining numbers and as a result when I do this, I get the answer spit out to me. So that number will be looking the same as this number up here. This is a little artifact here and it's actually a bug in the program and it happens just because of this product, this multiplier in here. For some reason, there's something in that was reacting with the program. I pointed out to Henry Rich who's the maintainer of the program and he's fixed it so it no longer will happen in the newer versions of J903. It was actually happening in J902 as well so it will go on happening in 902 but it's just a really little flaky little bug there and it's been fixed. So that's the easy answer. Now the other solution that the Connor and Stephen came up with, I was actually really impressed with and what this is, is it's a fork. So if I take that, in order to make it a fork, I have to put parentheses around it because if I didn't put parentheses around it and just gave it this argument, then it would go right to left and just work its way through and I don't want it to do that. I wanted to recognize that these things are grouped together and as soon as they're grouped together, this verb will take this argument and it just uses that argument. This verb will do a multiplication across this entire argument. Notice I'm not dropping anything at this point and then the result of the whole multiplication divided by each number in its turn gives me the answer. So there's the answer. So how does this work? Well, you might have already figured it out but if I take this, so now all I'm doing is I'm doing exactly what this here was doing on this side. It's taking this list and it's doing a multiplication across the whole thing but if I take that and then I divide it as this is being divided, I can divide it by each entry in here and because it's an array language, it will do all the entries together but just to show you, let's pick five. So what I'm doing here, if you take a look at it, you can actually see it before it happens, this five here, this five here is going to cancel out this five here and what I'm going to end up with is all these numbers here, all those numbers there are going to get multiplied together and this five cancels out on that five. So that's the way that these things work and since you can do it with all of them at once, you end up with what you were doing originally which is basically, so there's the 532 in the place of the five there. You can see that and that's when five was divided. If I put three in there, these two threes would cancel out and I end up with a 720 in both places. So it's pretty cool but I did take it one step further and the step further that I took it was because of J and what I did was J has things called hooks and what hooks do is hooks will take an argument such as this argument and what it does is if it's a monadic hook because there's only one argument to it, it's going to copy this to the other side and then it's going to execute it. So it takes this verb, does a multiplication across everything, takes this whole thing because it's a hook and copies it over here so you get this divided by but this tilde, this little passive adverb is what reverses the arguments. So that rather than having these numbers divide the product, I reverse them and I have the product divide these numbers. So it's a bit complicated but that's the way hooks work and it shortens down the solution and of course you've seen this solution work before and it does work. So that's my explanation and my talk about the different areas that J uses to solve Conor's problem and I will try and put a link somewhere for Conor's solution. He's done it in video as well or you could listen to ArrayCast and that's a podcast at Conor, Adam and Stephen and Richard and Rodrigo sometimes and other people do about the Array Languages. So I hope you enjoyed this. I hope you learned something from it and if you are interested, have a listen to ArrayCast. It's a podcast that we do. Thanks a lot.