Thu 2016-12-08 13:06:23 UTC+1, John Cremona:

> I think that trying to combine symbolic variables (x1 and x2) with
> modular arithmetic is known to create difficulties.  If you want to do
> the computation mod 101 then something like
>
> F = GF(101)
> R.<x1,x2> = F[]
> 
> # The above 2 lines tell Sage that x1, x2 are independent variables
> over F (R is a polynomial ring in these 1 variables)
>
> a1 = vector([76, 83])
> b1 = 62
> x = vector([x1, x2])
> f1 = b1 - a1.dot_product(x)
> f1
>
> gives
>
> 25*x1 + 18*x2 - 39
>
> (I am not sure why 62 displays as -39 here)

It seems it is the standard display for coefficients
in polynomial rings over a finite field.

See for instance (with R as in your code):

    sage: [R(i) for i in range(0, 101, 10)]
    [0, 10, 20, 30, 40, 50, -41, -31, -21, -11, -1]

Not for fields elements, though.

    sage: [F(i) for i in range(0, 101, 10)]
    [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to