All Questions
17
questions
6
votes
1
answer
523
views
Permute the values in each row in a matrix such that the columns sum to the same amount.
The general problem
Given a matrix, I would like to permute the order of values in each row, so that all the columns of the matrix sums to the same value.
A simple example
For example, given:
<...
2
votes
2
answers
152
views
Formula for the number of 0's in an alternating 0-1 matrix
I was working with a piece of code when I stumbled across a matrix, which is similar to this:
$$\begin{matrix}
0&1&0&1&0&1&0&\cdots\\
1&1&1&1&1&1&...