Processing math: 22%

First time here? Check out the FAQ!

Ask Your Question
0

Solve system of symbolic binary nonlinear equations

asked 3 years ago

Sanu gravatar image

updated 3 years ago

slelievre gravatar image

I have 10 binary variables x0, ..., x4 and y0, ..., y4. I know yi=xi+x(i+1)mod.

I want to write x_i in terms of y variables.

I know for this toy case we can use Gaussian elimination. But in actual case y_is are nonlinear equations.

I tried this idea:

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, xy) 
R.inject_variables()
Z = list(R.gens()) 
E = [y_0 == x_0*x_1 + x_2,
     y_1 == x_1*x_2+x_3,
     y_2 == x_2*x_3+x_4,
     y_3 == x_3*x_4+x_0,
     y_4 == x_4*x_0+x_1] 
solve(E, x0, x1, x2, x3, x4)

It is not working.

Preview: (hide)

Comments

Please add the actual (nonlinear) case, so that a better answer can be given.

rburing gravatar imagerburing ( 3 years ago )
1

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

Max Alekseyev gravatar image

updated 3 years ago

First off, it is not possible to express x_i in terms of y_i since, for instance, all zero values for y_i correspond to at least two different sets of x_i: all zeros and all ones.

Since x_i and y_i are binary, we also have equations x_i^2+x_i=0 and y_i^2+y_i=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 x_i immediately imply values for y_i. So, the above approach may be an overkill.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 1,069 times

Last updated: Mar 13 '22