I guess looking at ⌹ looks like a more standard APL Cultivation; looking at the text-justifying function would be a more exotic lesson... I'm happy with any/both!
The name is of course due to its symbol (⌹) which isn't really a domino (🁫) but rather a division sign in a quad, the latter representing division/inversion (÷).
You're of course familiar with the ÷ primitive.
Know that matrix multiplication is +.× but we don't have a corresponding operator for matrix division.
You can actually use +.×⍣¯1 for matrix division, but since ⍣ wasn't always around (and certainly not ⍣¯1) and for notational ease, ⌹ provides this functionality too.
Matrix inversion, what is that? Anyone volunteer a defintion?
See? I knew it'd be good to have a mathmagician here with us today.
We can even use ⌹ on scalars, where it behaves just as ÷ except it errors on 0÷0 (where ÷ doesn't error). This is convenient if you want to make sure to catch division-by-zero errors.
@JamesHeslip draw the perpendicular segment from the point 2 7 to the line through 0 0 and 3 1. The intersection point has coordinates (2 7⌹3 1)×⌹3 1: ⌹3 1 is the unit vector in the same direction as 3 1; the distance from 0 0 to the point is |2 7⌹3 1.
ok, cool, thanks! so then the coordinates of the intersection point are (2 7⌹3 1)×3 1, so the "length" in the 3 1-direction is what scalar multiple of 3 1 gives those coordinates?
just think about the fact that multiplying two complex numbers has little to do with the "corresponding" 2D vectors in terms of vector operations we are used to
OK, I'll accept that; I thought there would be a relationship because basic instruction (elementary school level) always seems to discuss complex numbers as though they were vectors on the complex plane...
@JeffZeitlin if you identify complex numbers with vectors, 2j7÷3j1 is the complex number which when scaled up by the norm of3j1 and rotated by the angle 3j1 makes with the x-axis lands you on 2j7
@JeffZeitlin whereas multilpying real numbers together (or real number by vector) corresponds to sclaing, multiplying complex numbers together in general corresponds to scaling by the magnitude and rotating by the angle from the x-axis
@JeffZeitlin we do discuss complex numbers like that, but if you read Vladimir's remark, describing these ^ operations in terms of dot products isn't straightforward
:-D What non-sense is this? It doesn't even fulfil any of the equations:
2 7+.×x y
12.0406
1 8+.×x y
14.971
1 1+.×x y
1.04774
But as you can see, it is pretty close.
This is an over-determined system, so APL found the solution that fits best.
It defines "best" by a very common method called the least squares fit, which can also be used to make other kinds of fits.
What it means is that it tries to minimise the squares of the "errors". In a sense, it smoothes the errors out, which means we can use it for smooth curve-fitting too.
Unfortunately, we won't have enough time to go through many possibilities today, but you can see a few uses if you search APLcart for ⌹ fit. Let's just take the very first one from there: ⊢⌹1,∘⍪⊣
Let's say e.g.
x←0 1 3 4 5
y←0 2 4 7 7
(Yes, this was drawn by APL)
x(⊢⌹1,∘⍪⊣)y
0.22093 1.45349
This means the best linear fit is y(x)=0.22093x+1.45349