« first day (834 days earlier)      last day (1535 days later) » 

Hmm, now to think of a CMC
 
Well, pick an easy one for starters.
To be fair I'm a bit rusty too
 
CMC: Without using the builtin, calculate det(M), for a given square matrix M
 
So arbitrary size?
 
9:14 PM
Yeah, might as well :P
 
Let me set up spotify and I'll be right back
 
[[1, 2, 3], [4, 5, 6], [7, 8, 9]] -> 0
I've got a movie set up :P Into the Spiderverse
 
Now, to choose an approach
Well
Should we go the Laplace / cofactor expansion way?
 
If that's expand by a column, then yes
That's how I learnt it anyway
 
I will have to review some technicalities before that, but working on it
btw i saw you in the contact (or maybe Spyfall, I can't remember now) and went "Caird!" but then thought it would be weird to reach out to you out of the blue :)
 
9:21 PM
Yeah Spyfall I think
I realised I hadn't posted anything this year
 
I posted some answers in july and august
but complete break between january and april and april and june
 
I actually think this one is pretty challenging btw :)
It will surely take a while for me
 
Yeah, its definitely making me realise how rusty I am
 
Though
I remember I bountied leaky's answer
on this exact question on main
and IIRC it was at least 15 bytes
 
9:25 PM
Yeah but Leaky's nuts
 
Of course
I'm tempted to check if Dennis answered too but I don't want to look
Uhh..
@cairdcoinheringaahing I must confess that I don't really know how to do this in Jelly
 
I'm giving it a go, but I'm inclined to agree
at 21 bytes so far :/
 
Because the way I thought I'd solve this is using the method with column elimination (ie Laplace)
And this requires recursion
And I still don't know how to use ß in Jelly :)
 
I'm using recursion as well, but with multiple links, not ß
 
Ah well
Then
I may be able to do it
I'll give it a go actually
 
9:34 PM
Remind me how Ŀ gets indexes again?
Is 1 the bottom link?
 
No
It's the top one
AFAIK
 
If you want the bottom link you can use Ñ if you're on the link immediately before the main link
 
Or Ç to cycle from the top to the bottom
 
My answer is starting to look like a program lol
Oh god
I think I'm done
But... 25 bytes
 
9:45 PM
I've had to restart :/
 
No rush anyway...
I'll have to golf this thing down
 
10:01 PM
So I realised my solution is faulty
I disregarded the fact that the head atom pops....
 
10:16 PM
@cairdcoinheringaahing How about working together on it from scratch?
 
Yeah that seems better than anything I've got
 
Perfect
So
 
First thing is figuring out how to get the co-factor of (x, y)
Actually, that gives me an idea:
CMC: Given a matrix M and a tuple (x, y) return the co-factor of the corresponding element
 
That should be easy
 
[[1, 2, 3], [4, 5, 6], [7, 8, 9]] (3, 3) -> -3
 
10:22 PM
Wait a second
I think this is actually harder than needed
Can I show you my thoughts?
 
Yeah go ahead
 
So for example for [[1, 2, 3], [4, 5, 6], [7, 8, 9]], I was thinking about doing a first row expansion so 1*det([[5, 6], [8, 9]]) - 2*det([[4, 7], [8,9]]) + 3*det([[4, 5], [5, 8]])
Makes sense so far?
 
Well for this task
I had something along the lines of: ḢNÐeṚḋZœcLÑƲ
So given the matrix, do ḢNÐe so [1, -2, 3]
Ooops, idk what that is doing there
But anyway
Since head pops, we're left with [[4,5,6],[7,8,9]].
Which is kinda what we want
We do ZœcL to get the right combinations of matrix-element pairs
So at this point we have the matrices and the factors
One just needs to recurse
And of course multiply and sum
But this is where I get stuck
 
I don't get how the last bit ZœcLÑƲ works
 
10:29 PM
So
We have [[4,5,6],[7,8,9]]. We want to associate 1 with the columns not containing it
We zip [[4,5,6],[7,8,9]] to get [[4,7],[5,8],[6,9]], the columns
and 1 needs to be paired with [5,8],[6,9], 2 with [[4,7], [6,9]] and 3 with [[4,7],[5,8]]
Wait a second...
Yeah it's fine
So
We need this association
Regarding ÑƲ, it's just a placeholder for now
But do you get the main point so far?
 
Oh, that's the bit that was confusing me
 
Good
We'll have to clarify that later
Do you agree that now all we need to do is multiply the elements we already have with the determinants of the matrices we already have and sum to get the answer?
 
Good
Setting up this recursion is where I get stuck though...
Pretty damn hard challenge for a warm up @cairdcoinheringaahing
 
Yeah, didn't exactly think it through :/
 
10:38 PM
Do you even want to proceed with this or pause?
 
I'm testing a few recursion methods
 
Good
 
I feel like a ? clause may work
 
Well, yes
Help me get some things straight
Should we recurse until we reach a 1 by 1 matrix?
 
I think that would be better than a 2x2
 
10:41 PM
Then Ḋ? might work
 
That's if deque right, not a single quick?
 
Yes
I wonder what I'm doing wrong...
I have ḢNÐeṚḋZœcLßƲµḢḢ$Ḋ? and I thought it may work
 
I don't think you need Ḣ$, because you're just doing on a 1x1?
 
Hmm isn't that 1 by 1 of the form [[something]]?
 
10:48 PM
So ḢNÐeṚ gets the first row, signed appropriately (presumably) and dot-products it with the (presumably computed through) recursion determinants
 
Got it, add a after the ß, because it's currently recurring with all of the sub-matrices at once, rather than one by one
 
Ohhh
Yeah
Nice catch
It works!
 
Thank you
So I'm down to 19: ḢNÐeṚḋZœcL߀ƲµḢḢ$Ḋ?
With your help...
 
Weird phenomenon: if you take an nxn matrix and fill it with 1, 2, 3..., 9, 0 (repeating to fill), the determinant is 0
 
10:51 PM
Yeah I always found that interesting
Any shorter way to generate the matrix without the nth column?
 
I can't think of any way
 
Oh there actually is!
 
> Ƥ Map a link over prefixes, and if given a <nilad>, overlapping infixes if positive, or the overlapping outfixes of abs(<nilad>) if negative. <monad>Ƥ or <monad><nilad>Ƥ
Don't overlapping outfixes mean exactly that?
 
10:54 PM
Of course set to length 1 so ?
 
I never quite understood how Ƥ works aside from prefixes
Worth a shot though
 
Let me test
It's perfect!
This way, it also loops at the same time
 
That's helpful :P
 
Down to 17
ḢNÐeṚḋZß-ƤƊµḢḢ$Ḋ?
Wait
I think I sent the wrong code
Let's think of some other test case
This one with 0 as a result can be deceiving
 
[[1, 2], [4, 5]]
Should be -3
 
11:00 PM
I can't get it to work for some reason...
Although it should be the exact same thing
Weird... It should be fine but it isn't
Oh... I'm so dumb...
@cairdcoinheringaahing ḢNÐeḋZß-Ƥ$µḢḢ$Ḋ?
 
Oh right, an extra link :/
 
I forgot to get rid of reversal because Ƥ actually gives them in another order
 
Oh, saves another byte then
 
Yes, plus that ^^^
I don't think I'm able to bring this down any further
It was actually nice working on it tbf
 
Yeah, it was good to do it again
:/ Dennis has a 10 byte answer
 
11:08 PM
WHAT
Thoughts: ḢḢ$ is really annoying
 
NÐe is really annoying
 
Yeah, he used the same initial idea of prefixes
 
@cairdcoinheringaahing No!
 
11:09 PM
I just don't want to see that :((
 
Oh, sorry :/
 
It'll make me unhappy
 
We were actually quite close
 
I genuinely remember there was a trick to make that [1,-1,1,-1,...] alternate in very few bytes but I just can't remember how to do it
 
Dennis uses it :P
3 bytes to alternate the signs, and sum
 
11:11 PM
Unsurprisingly....
@cairdcoinheringaahing Wait a minute...
Sum as well?
 
Hmm...
Damn, I used that trick extensively in the past but I can't remember what it is...
I'll just look i guess
 
You have the link if you want to peek, I'm going to bed (midnight here) :P
o/
 
@cairdcoinheringaahing Good night o/
BASE CONVERSION
of course.....
It's kinda heartwarming that his initial answer is 16 too soo :)
 
Ours looks a lot like a combination of HyperNeutrino's and Dennis'
 

« first day (834 days earlier)      last day (1535 days later) »