# Evaluating a list of multivariate equations at random values.

I have a list of multivariate equations, there are o multivariate equations in the list where o is an integer and v = 2o, the variables that make up the equations are the generators of P = PolynomialRing(K,'x',n) where n = v + o so for example if o = 2 then v = 4 and n = 6 so the variables that make up the multivariate equations in the list would be P.gens() = (x0, x1, x2, x3, x4, x5). Now i need to substitute in random values from GF(q) for the first v variables in each of the multivariate equations in the list so in the example above where v = 4 random values from GF(q)would be substituted in for the variables x0, x1, x2, x3in each of the multivariate equations in the list, leaving equations in only two variables x4 and x5. I have tried to implement this but i don't really know where to start as i know i am doing something wrong but what i have is the following. If the list of multivariate equations is called eqn for example.

for i in range(v):
xi = var('x'+str(i))
eqnsub0 = eqn[i].subs({x[i]:GF(q).random_element()})


I already know this is very wrong as the indexing will already go out of bounds since v > o but i don't really know where to start with this. Any help would be great, thanks.

edit retag close merge delete