Since xi and yi are binary, we also have equations x2i+xi=0 and y2i+yi=0. The ideal generated by these equations together with the given system happens to be 0-dimensional, and thus the system has a finite number of solutions in GF(2):
n = 5
xy = [f'x{i}' for i in range(n)] + [f'y{i}' for i in range(n)]
B = BooleanPolynomialRing(2*n, xy)
R = PolynomialRing(GF(2),2*n, xy)
Y = PolynomialRing(GF(2), n, xy[n:])
R.inject_variables()
x = R.gens()[:n]
y = R.gens()[n:]
print(x,y)
E = [y0 - (x0*x1 + x2),
y1 - (x1*x2 + x3),
y2 - (x2*x3 + x4),
y3 - (x3*x4 + x0),
y4 - (x4*x0 + x1)]
J = R.ideal( E + [g^2+g for g in R.gens()] )
print(J.variety())
This code produces 32 solutions.
![]() | 2 | No.2 Revision |
Since xi and yi are binary, we also have equations x2i+xi=0 and y2i+yi=0. The ideal generated by these equations together with the given system happens to be 0-dimensional, and thus the system has a finite number of solutions in GF(2):
n = 5
xy = [f'x{i}' for i in range(n)] + [f'y{i}' for i in range(n)]
B = BooleanPolynomialRing(2*n, xy)
R = PolynomialRing(GF(2),2*n, xy)
Y = PolynomialRing(GF(2), n, xy[n:])
R.inject_variables()
x = R.gens()[:n]
y = R.gens()[n:]
print(x,y)
E = [y0 - (x0*x1 + x2),
y1 - (x1*x2 + x3),
y2 - (x2*x3 + x4),
y3 - (x3*x4 + x0),
y4 - (x4*x0 + x1)]
J = R.ideal( E + [g^2+g for g in R.gens()] )
print(J.variety())
This code produces 32 solutions.
![]() | 3 | No.3 Revision |
Since xi and yi are binary, we also have equations x2i+xi=0 and y2i+yi=0. The ideal generated by these equations together with the given system happens to be 0-dimensional, and thus the system has a finite number of solutions in GF(2):
n = 5
xy = [f'x{i}' for i in range(n)] + [f'y{i}' for i in range(n)]
B R = BooleanPolynomialRing(2*n, PolynomialRing(GF(2),2*n, xy)
R.inject_variables()
E = [y0 - (x0*x1 + x2),
y1 - (x1*x2 + x3),
y2 - (x2*x3 + x4),
y3 - (x3*x4 + x0),
y4 - (x4*x0 + x1)]
J = R.ideal( E + [g^2+g for g in R.gens()] )
print(J.variety())
This code produces 32 solutions.
![]() | 4 | No.4 Revision |
Since xi and yi are binary, we also have equations x2i+xi=0 and y2i+yi=0. The y2i+yi=0, which will be taken into account if we use BooleanPolynomialRing(...)
rather than PolynomialRing(GF(2),...)
. In this ring, the ideal generated by these equations together with the given system happens to be 0-dimensional, and thus the system has a finite number of solutions in GF(2):
n = 5
xy = [f'x{i}' for i in range(n)] + [f'y{i}' for i in range(n)]
R = PolynomialRing(GF(2),2*n, BooleanPolynomialRing(2*n, xy)
R.inject_variables()
E = [y0 - (x0*x1 + x2),
y1 - (x1*x2 + x3),
y2 - (x2*x3 + x4),
y3 - (x3*x4 + x0),
y4 - (x4*x0 + x1)]
J = R.ideal( E + [g^2+g for g in R.gens()] )
print(J.variety())
This code produces 32 solutions.
![]() | 5 | No.5 Revision |
First off, it is not possible to express xi in terms of yi, since the all zero values for yi correspond to at least two different sets of xi: all zeros and all ones.
Since xi and yi are binary, we also have equations x2i+xi=0 and y2i+yi=0, which will be taken into account if we use BooleanPolynomialRing(...)
rather than PolynomialRing(GF(2),...)
. In this ring, the ideal generated by the given system happens to be 0-dimensional, and thus the system has a finite number of solutions in GF(2):
n = 5
xy = [f'x{i}' for i in range(n)] + [f'y{i}' for i in range(n)]
R = BooleanPolynomialRing(2*n, xy)
R.inject_variables()
E = [y0 - (x0*x1 + x2),
y1 - (x1*x2 + x3),
y2 - (x2*x3 + x4),
y3 - (x3*x4 + x0),
y4 - (x4*x0 + x1)]
J = R.ideal( E )
print(J.variety())
This code produces 32 solutions.
It can also be seen directly as fixing any values for xi immediately imply values for yi. So, the above approach may be an overkill.
![]() | 6 | No.6 Revision |
First off, it is not possible to express xi in terms of yi, since the yi since, for instance, all zero values for yi correspond to at least two different sets of xi: all zeros and all ones.
Since xi and yi are binary, we also have equations x2i+xi=0 and y2i+yi=0, which will be taken into account if we use BooleanPolynomialRing(...)
rather than PolynomialRing(GF(2),...)
. In this ring, the ideal generated by the given system happens to be 0-dimensional, and thus the system has a finite number of solutions in GF(2):
n = 5
xy = [f'x{i}' for i in range(n)] + [f'y{i}' for i in range(n)]
R = BooleanPolynomialRing(2*n, xy)
R.inject_variables()
E = [y0 - (x0*x1 + x2),
y1 - (x1*x2 + x3),
y2 - (x2*x3 + x4),
y3 - (x3*x4 + x0),
y4 - (x4*x0 + x1)]
J = R.ideal( E )
print(J.variety())
This code produces 32 solutions.
It can also be seen directly as fixing any values for xi immediately imply values for yi. So, the above approach may be an overkill.