Message Boards Message Boards

0
|
3102 Views
|
5 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Solve a matrix of congruences?

Posted 5 years ago

I have an 8x8 matrix whose entries are linear combinations of some subset of 23 variables. I know that each entry has to be congruent mod 4 to 0. I've tried:

Solve[M == Z, {variables}, Modulus -> 4] (where M is my 8x8 matrix and Z is the 8x8 matrix of all 0s)

however the empty set is returned. This is odd as I know of at least one solution (and am hoping to find any others). Is there a different way of doing what I've described? Any help is appreciated.

POSTED BY: Joshua Carey
5 Replies
Posted 5 years ago
M={{-4, -4, -2 - 2 (c - d), 3 + c - 2 d, 2 + 2 c, -3 - c + d, 2 - 2 c,4 - d},
      {4, -4, -4, 0, 4, 0, 0, 0}, {6 + 2 (c - d), 4, -4, -8,4 + 2 (2 - 2 c), 2 (2 + 2 c), -8, 2 (4 + 2 d)},
      {-3 - c + 2 d, 4,12, -4, -6 + 2 c, -2 - 2 c - d,4 + 2 (2 + d), -12 - 5 d},
      {-2 - 2 c, -4, -4 - 2 (2 - 2 c),10 - 2 c, -4, 2 + 2 (1 + d), -4 (2 + d), 2 (4 + 2 d)},
      {3 + c - d,0, -2 (2 + 2 c), 2 + 2 c + d, 2 - 2 (1 + d), -4, 2 (2 + d),4 - d},
      {-2 + 2 c, 0, 8, -4 - 2 (2 + d), 4 (2 + d),4 - 2 (2 + d), -4, -8},
      {-4 + d, 0, -2 (4 + 2 d),12 + 5 d, -2 (4 + 2 d), -4 + d, 12, -4}};
Solve[Map[If[IntegerQ[#],Nothing,#==0]&,Flatten[M]],{c,d},Modulus->4]

Eliminate the lone constants and leave the variable expressions and solve mod 4

which in an instant gives

{{c->1,d->0}}

Then

Map[If[IntegerQ[#],Nothing,Mod[#/.{c->1,d->0},4]==0]&,Flatten[M]]

in an instant gives

{True,True,True,True,True,True,True,True,True,
 True,True,True,True,True,True,True,True,True,
 True,True,True,True,True,True,True,True,True,
 True,True,True,True,True,True,True,True,True}
POSTED BY: Bill Nelson

Works perfectly-thanks for the reply and explanation!

POSTED BY: Joshua Carey

How to solve a Matrix of congruences?

POSTED BY: Joshua Carey

It is difficult to diagnose without an actual example.

POSTED BY: Daniel Lichtblau

For example, I have

M={{-4, -4, -2 - 2 (c - d), 3 + c - 2 d, 2 + 2 c, -3 - c + d, 2 - 2 c, 
  4 - d}, {4, -4, -4, 0, 4, 0, 0, 0}, {6 + 2 (c - d), 4, -4, -8, 
  4 + 2 (2 - 2 c), 2 (2 + 2 c), -8, 2 (4 + 2 d)}, {-3 - c + 2 d, 4, 
  12, -4, -6 + 2 c, -2 - 2 c - d, 
  4 + 2 (2 + d), -12 - 5 d}, {-2 - 2 c, -4, -4 - 2 (2 - 2 c), 
  10 - 2 c, -4, 2 + 2 (1 + d), -4 (2 + d), 2 (4 + 2 d)}, {3 + c - d, 
  0, -2 (2 + 2 c), 2 + 2 c + d, 2 - 2 (1 + d), -4, 2 (2 + d), 
  4 - d}, {-2 + 2 c, 0, 8, -4 - 2 (2 + d), 4 (2 + d), 
  4 - 2 (2 + d), -4, -8}, {-4 + d, 0, -2 (4 + 2 d), 
  12 + 5 d, -2 (4 + 2 d), -4 + d, 12, -4}}

where each entry must be congruent to 0 mod 4. I know the solution to be

$d\equiv_4 0,2$

and $c\equiv_4\pm 1$,

but trying to solve with the method I have described in my original post returns the empty set.

POSTED BY: Joshua Carey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract