# Questions tagged [matrix]

A matrix is a list of numbers arranged in a rectangle with rows and columns. In programming, it is also known as a 2D array. Use this tag if your challenge is about manipulating matrices.

196 questions
Filter by
Sorted by
Tagged with
471 views

### Find the number of n-by-n (-1, 0, 1) matrices with zero permanent as quickly as possible

The permanent of an $n$-by-$n$ matrix $A = (a_{i,j})$ is defined as: $$\operatorname{perm}(A)=\sum_{\sigma\in S_n}\prod_{i=1}^n a_{i,\sigma(i)}$$ For a fixed $n$, consider the $n$-by-$n$ ...
2k views

975 views

### Square-Random-Symmetrical

Challenge Write a program or a function that returns or prints a square-random-symmetrical matrix. Input N: The size of the matrix i.e 6 x 6 Output The matrix. ...
2k views

### A knight's graph on an N-by-N board

In chess, a knight can only move to the positions marked with X relative to its current position, marked with ♞: A Knight's Graph is a graph that represents all legal moves of the knight chess piece ...
330 views

### Minimal Centrosymmetrization

Topically related. Objective: Given a matrix of positive integers $M$, output the smallest centrosymmetric matrix which contains $M$ (this matrix may contain non-positive integers as well). A ...
5k views

### Is the bus load legal?

I was in the bus today, and noticed this sign: ...
4k views

### Roman Army Shields

Sandbox post (deleted) The old roman army formations are very famous around the world. In these formations roman legionaries grouped in a geometric shape (usually a rectangle) protecting the flanks ...
3k views

### Beware of the matrix tornado!

The matrix tornado is just like any other tornado: it consists of things rotating around a center. In this case, elements of the matrix instead of air. Here is an example of a matrix tornado: First ...
1k views

### Collapsing Matrices

Related: Let's design a digit mosaic, Print/Output the L-phabet. Sandbox post here Given 2 inputs C = columns and rows, S = starting point output a matrix as ...
Challenge Given nine numbers, a, b, c, d, e, f, g, h, i, as input which correspond to the square matrix: \mathbf{M} = \begin{pmatrix}a& b& c\\ d& e&...