Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r = 3;
- n = 2 r + 1;
- init = DiamondMatrix[r];
- matrices = SparseArray[# -> 1, {n, n}] & /@ Position[DiamondMatrix[r - 1, n], 1];
- matrices = Dilation[Normal@#, DiamondMatrix[1]] & /@ matrices;
- vectors = Flatten@*Normal /@ matrices;
- LinearSolve[Transpose[vectors], Flatten[init], Modulus -> 2]
Advertisement
Add Comment
Please, Sign In to add comment