Guest User

Untitled

a guest
Oct 13th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. r = 3;
  2. n = 2 r + 1;
  3. init = DiamondMatrix[r];
  4. matrices = SparseArray[# -> 1, {n, n}] & /@ Position[DiamondMatrix[r - 1, n], 1];
  5. matrices = Dilation[Normal@#, DiamondMatrix[1]] & /@ matrices;
  6. vectors = Flatten@*Normal /@ matrices;
  7. LinearSolve[Transpose[vectors], Flatten[init], Modulus -> 2]
Advertisement
Add Comment
Please, Sign In to add comment