Post Reply 
polynomial calculations over Z/Zp (for prime p)?
12-24-2013, 03:49 PM
Post: #6
RE: polynomial calculations over Z/Zp (for prime p)?
(12-24-2013 11:56 AM)Jeff Nye Wrote:  
(12-24-2013 04:09 AM)Han Wrote:  
Code:

p:=3;
p1:=[ 12 13 -20 5 ] % p;
p2:=(12x^3 + 13x^2 - 20x + 5) % p;
p3:=poly[ 12 13 -20 5 ] % p;

These didn't work for me (using the latest firmware).

However, last night I stumbled upon the CAS %%(n,p) operator, which seems to be the % operator in xcas. With %% instead of %, example p1 worked fine. Example p2 produces a polynomial with non-modular coefficients. For example p3, I needed to say poly([ 12 13 -20 5 ] %% p).

Linear algebra seems to work with integers mod p. The expression [[4,3],[5,1]]%%3 defines a matrix of integers mod 3.

Thank you for the corrections

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: polynomial calculations over Z/Zp (for prime p)? - Han - 12-24-2013 03:49 PM



User(s) browsing this thread: 1 Guest(s)