4

Here is the following problem:

  • I have solved the system of equations with simply using brute force but I feel there must be a more elegant solution to problems of this nature given that the inputs can only be a zero or one: $$x_1x_3 + x_1x_4 + x_3x_4 = 0 \pmod{2}$$ $$x_2x_1 + x_1x_4 + x_2x_4 = 1 \pmod{2}$$ $$x_1x_2 + x_1x_3 + x_2x_3 = 1 \pmod{2}$$ $$x_2x_3 + x_2x_4 + x_3x_4 = 0 \pmod{2}$$
  • Since everything is in mod$2$ I've realized that $x^k = x $ which would seem like a useful trick but everything seems to fall apart once I start using substitution as I inevitably end up multiplying both sides of the equation by zero.

If anyone has some interesting ideas or new direction to face this problem I would be most interested to hear.

3 Answers3

5

You can linearize the problem by introducing a binary (or just nonnegative) variable $y_{ij}$ to represent the product $x_i x_j$ and a nonnegative integer variable $z_k$ to represent the quotient of each right-hand side. Explicitly, your four-equation example becomes \begin{align} y_{13} + y_{14} + y_{34} &= 2z_1 \\ y_{12} + y_{14} + y_{24} &= 2z_2 + 1 \\ y_{12} + y_{13} + y_{23} &= 2z_3 + 1 \\ y_{23} + y_{24} + y_{34} &= 2z_4 \\ y_{ij} &\le x_i \\ y_{ij} &\le x_j \\ y_{ij} &\ge x_i + x_j - 1 \\ y_{ij} &\ge 0 \\ z_k &\in \mathbb{Z}^+ \end{align}

Now you can use an integer linear programming solver.

RobPratt
  • 50,938
  • 3
    As soon as I read the last line I realized this is the user known for the approach on Puzzling SE (lol) – iBug Nov 26 '24 at 08:00
5

The left hand sides of all four equations are of the form $xy+xz+yz$ for variables $x, y, z \in \mathbb F_2$. You can check that this expression is $0$ if at least two of the variables are $0$. If at least two of the variables are $1$, then the expression evaluates to $1$.

The equations therefore mean the following:

  • Of $x_1, x_2, x_3$, at least two are $1$
  • Of $x_1, x_2, x_4$, at least two are $1$
  • Of $x_1, x_3, x_4$, at least two are $0$
  • Of $x_2, x_3, x_4$, at least two are $0$

In particular, two variables are equal to one and two are equal to zero. The ones are both contained in the collections $(x_1, x_2, x_3)$ and in $(x_1, x_2, x_4)$. This is only possible for $x_1 = x_2 = 1$, which leaves $x_3 = x_4 = 0$. This actually forms a solution.

Therefore, solutions are exactly the tuples $(x_1, x_2, x_3, x_4)$ with $x_1, x_2$ odd and $x_3, x_4$ even.

Calvin Lin
  • 77,541
Tzimmo
  • 3,166
  • 1
    While this is a very elegant observation and solution, Eliot is asking for a general method of solving linear multiplicative systems mod 2. Presumably, his example is just that - an example, and he's looking for a general approach which would solve any number and combination of variables... – AnoE Nov 26 '24 at 09:04
  • Exactly I do like this answer above but I intuitively feel there must be a general method that is either numerical or analytical that solves these LMS mod 2 – Eliot Olson Nov 26 '24 at 16:25
-1

While I am too lazy to fill in the details, I am fairly certain you can reduce the 3-SAT problem to this one.

If so, there is no general algorithm that is significantly faster than trying all possible values.