Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No. Column scrambling doesn't affect row ordering and row scrambling doesn't affect column ordering. They are literally orthogonal. You can't tell, from a scrambled matrix, whether the rows or the columns were scrambled first.

Here's a more explicit breakdown:

    (0,0) (1,0) (2,0)
    (0,1) (1,1) (2,1)
    (0,2) (1,2) (2,2)
Column scrambling: swap 1&2:

    (0,0) (2,0) (1,0)
    (0,1) (2,1) (1,1)
    (0,2) (2,2) (1,2)
Now row scrambling: swap 0&1:

    (0,1) (2,1) (1,1)
    (0,0) (2,0) (1,0)
    (0,2) (2,2) (1,2)
Notice how the x coordinates still all match along the vertical, and y coordinates still all match along the horizontal.

Let's try it in the other order, row first:

    (0,1) (1,1) (2,1)
    (0,0) (1,0) (2,0)
    (0,2) (1,2) (2,2)
And columns:

    (0,1) (2,1) (1,1)
    (0,0) (2,0) (1,0)
    (0,2) (2,2) (1,2)
It's the same result irrespective of the order.


Another way to think of it is that permuting rows corresponds to multiplying a matrix on the left by a permutation matrix, and permuting columns, on the right. Since matrix multiplication is associative, they commute!


Yet another way to think of it is that a matrix is an encoding of a linear (or affine) function, matrix multiplication is composition of such functions, and since composition is associative, they commute. :)


Thanks! my mental model was incorrect.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: