Post Reply 
polynomial calculations over Z/Zp (for prime p)?
12-24-2013, 11:56 AM (This post was last modified: 12-24-2013 12:40 PM by Jeff Nye.)
Post: #4
RE: polynomial calculations over Z/Zp (for prime p)?
(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.
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)? - Jeff Nye - 12-24-2013 11:56 AM



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