# Tag Info

## Hot answers tagged linear-algebra

### Determinant of an Integer Matrix

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

### Construct the Identity Matrix

MATL, 2 bytes Xy A translation of my Octave answer. Try it online. A 4 byte version with no built-ins (thanks to Luis Mendo): ...
• 11k

### Construct the Identity Matrix

TI-BASIC, 2 bytes identity(Ans Fun fact: The shortest way to get a list {N,N} is ...
• 21.2k

### Construct the Identity Matrix

Julia, 9 3 bytes eye This is just a built-in function that accepts an integer n and returns an ...
• 24.2k

### 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,452

### Construct the Identity Matrix

APL, 5 bytes ∘.=⍨⍳ This is a monadic function train that accepts an integer on the right and returns the identity matrix. Try it here
• 24.2k

### 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

### Construct the Identity Matrix

Python 2, 42 bytes lambda n:zip(*[iter((+*n)*n)]*n)[:n] An anonymous function, produces output like ...
• 139k

### Find the Cross Product

Jelly, 14 13 12 bytes ;"s€2U×¥/ḅ-U Try it online! How it works ...
• 207k

### Construct the Identity Matrix

Octave, 10 4 bytes @eye Returns an anonymous function that takes a number n and returns the identity matrix.
• 11k

### Is the matrix rank-one?

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

### Eigenvalues of a Matrix

Haskell, 576 554 532 507 bytes No built-ins! ...
• 16.5k

• 7,100

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

APL(Dyalog Classic),1 byte Try it online! if a flat lis is required this is 8 bytes ,∘⌹3 3∘⍴ Try it online!
• 791

### Are these the basis vectors?

Octave, 43 41 39 bytes @(B,v)(r=rank(B))-rows(B)|r-rank([B;v]) Anonymous function that inputs the set of vectors as a matrix B with each vector in a row, and v as ...
• 101k

### Verify Eigenpairs

Mathematica, 10 bytes #2.#==#3#& Takes input like {vector, matrix, scalar} and returns a boolean.
• 194k

### Construct the Identity Matrix

R, 4 bytes diag When given a matrix, diag returns the diagonal of the matrix. However, when given an integer ...
• 24.2k

### Vandermonde Determinant

Jelly, 5 bytes œc2IP œc2 gets all combinations without replacement of length 2. I computes ...
• 66.2k

### Determinant of an Integer Matrix

R, 3 bytes Trivial Solution det Try it online! R, 94 92 89 bytes re-implemented solution outgolfed by Jarko Dubbeldam ...
• 26.8k