Share Your Experience: Take the 2024 Developer Survey

# Tag Info

### Determinant of an Integer Matrix

Jelly, 15 bytes LŒ!ðŒcIṠ;ị"Pð€S Try it online! How it works ...
• 49.7k

### Find the inverse of a 3 by 3 matrix

MATL, 54 bytes th3LZ)t,3:q&XdpswP]w-lw/GtY*tXdsGXdsUw-IXy*2/+GtXds*-* Try it online! Just to keep it interesting, doesn't use the inbuilt matrix division or ...
• 6,612

### Billiard balls collision

Python 3, 67 66 bytes, 53 bytes def f(p,v,q,w):p-=q;d=((v-w)/p).real*p;return v-d,w+d Try it online! -1 byte thanks to @ngn -13 bytes thanks to @Neil This ...
• 1,751

### Is the matrix rank-one?

Jelly, 6 bytes ẸÐfÆrE Try it online! How it works ...
• 210k

• 68.7k

### Is this a Jordan matrix?

JavaScript, 58 bytes a=>a.some((r,y)=>r.some((c,x)=>(r/(r=c)==a[x][x])/-y--<c)) Try it online! When c==0 ...
• 34.9k

### Arnold's Cat Map

MATL, 23 bytes tt&n:qt&+&y\tb+&y\b*+Q( The (0,0) point is upper left, as in the examples in the challenge ...
• 105k

### Symbolic matrix multiplication

Haskell, 62 61 59 bytes e=[]:e z=zipWith a!b=[unwords.z(++)r<\$>foldr(z(:))e b|r<-a] Try it online! Example usage: ...
• 26.2k

### Characteristic polynomial

Octave, 16 4 bytes @BruteForce just told me that one of the functions I was using in my previous solution can actually do the whole work: poly Try it online! ...
• 43.8k

### Generalized matrix trace

R, 40 30 bytes function(m,F)Reduce(F,diag(m)) Try it online! Verify the test cases. Traverses down the diagonal, so left-to-right in this case. For arithmetic ...
• 28.6k

### Codegolf the Hafnian

R, 150 142 127 119 bytes function(A,N=nrow(A),k=1:(N/2)*2)sum(apply(gtools::permutations(N,N),1,function(r)prod(A[cbind(r[k-1],r[k])])))/prod(k) Try it online! ...
• 28.6k

### Find the inverse of a 3 by 3 matrix

R, 51 35 27 8 5 bytes solve Try it online! First go at doing one of these golf challenges. Sorry if my formatting is wrong! Saved a total additional 11 bytes ...
• 1,323

### Hankel transform of an integer sequence

APL (Dyalog Extended), 10 bytes Anonymous tacit infix function taking 1-indexed $i$ as left argument and the sequence $\{a_n\}$ as right argument. ⌂det∘↑⊣↑,/ ...
• 30.3k

### Is the matrix rank-one?

Haskell, 50 bytes r takes a list of lists of Integers and returns False if the matrix has ...
• 7,454

### Determinant of an Integer Matrix

Wolfram Language (Mathematica), between 14 and 42 bytes We've had a 3-byte built-in and a 53-byte solution that completely avoids built-ins, so here are some weirder solutions somewhere in between. ...
• 3,206