[sage-devel] Re: random polynomial generation

2007-11-09 Thread didier deshommes
On 11/7/07, Martin Albrecht <[EMAIL PROTECTED]> wrote: > > Hi everybody, > > I've attached a 'random_monomial.py' to > >http://trac.sagemath.org/sage_trac/ticket/980 > > which implements Steffen's and my proposal. Hey guys, I've attached a patch for this at http://trac.sagemath.org/sage_trac/

[sage-devel] Re: random polynomial generation

2007-11-07 Thread Martin Albrecht
Hi everybody, I've attached a 'random_monomial.py' to http://trac.sagemath.org/sage_trac/ticket/980 which implements Steffen's and my proposal. Thoughts? Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 _www: http://www.informatik.uni-bre

[sage-devel] Re: random polynomial generation

2007-10-26 Thread Steffen
On 26 Okt., 18:30, "didier deshommes" <[EMAIL PROTECTED]> wrote: > 2007/10/26, Steffen <[EMAIL PROTECTED]>: > > Ok, here an example. Lets take a polynomial over F:=GF(nextprime(2**42)) in two variables x and y and a maximum total degree of 3. > > > 1) Polynomial with max number of monomial. We

[sage-devel] Re: random polynomial generation

2007-10-26 Thread Mike Hansen
> Mike, your code had a subtle bug, where > random_monomials(n,degree,terms) failed each time for degree =1 (but > was fine for degree=0). Yeah, I knew that when I wrote it -- it was just something quick that I wrote up. The degree 1 case is trivial to handle though. --Mike --~--~-~--~

[sage-devel] Re: random polynomial generation

2007-10-26 Thread didier deshommes
2007/10/26, Steffen <[EMAIL PROTECTED]>: > 1) Polynomial with max number of monomial. We dont need to worry about > that case, since here all the monomial are chosen, that means actually > there is nothing to choose. So this will be efficient anyway. > 2) A user wants an exact < totalmax number of

[sage-devel] Re: random polynomial generation

2007-10-26 Thread Steffen
On 26 Okt., 00:48, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > On Oct 25, 2007, at 4:23 PM, Martin Albrecht wrote: > > > On Friday 26 October 2007, Robert Bradshaw wrote: > >> This is an interesting construction, but I am wondering if a uniform > >> distribution for all polynomials of specified

[sage-devel] Re: random polynomial generation

2007-10-25 Thread Mike Hansen
No, it's not. I just wrote it up now as a proof-of-concept. --Mike On 10/25/07, didier deshommes <[EMAIL PROTECTED]> wrote: > > 2007/10/25, Mike Hansen <[EMAIL PROTECTED]>: > > > > > Is this function in sage? Where is it located? > > > > Which function? > > Sorry, the random_monomials() functio

[sage-devel] Re: random polynomial generation

2007-10-25 Thread didier deshommes
2007/10/25, Mike Hansen <[EMAIL PROTECTED]>: > > > Is this function in sage? Where is it located? > > Which function? Sorry, the random_monomials() function. > > --Mike > > > > --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com

[sage-devel] Re: random polynomial generation

2007-10-25 Thread Mike Hansen
> Is this function in sage? Where is it located? Which function? --Mike --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at ht

[sage-devel] Re: random polynomial generation

2007-10-25 Thread didier deshommes
2007/10/25, Mike Hansen <[EMAIL PROTECTED]>: > > > Since integers are chosen uniformly, this would guarantee (?) that the > > polynomial is generated uniformly. Only hitch is that I don't know if > > there is such inttovec is in in SAGE yet. mhansen, any idea? > > Yes, this is pretty much what I'm

[sage-devel] Re: random polynomial generation

2007-10-25 Thread Robert Bradshaw
On Oct 25, 2007, at 4:23 PM, Martin Albrecht wrote: > On Friday 26 October 2007, Robert Bradshaw wrote: >> This is an interesting construction, but I am wondering if a uniform >> distribution for all polynomials of specified degree < d, with a >> specified number of terms, is the most natural one

[sage-devel] Re: random polynomial generation

2007-10-25 Thread Mike Hansen
> Since integers are chosen uniformly, this would guarantee (?) that the > polynomial is generated uniformly. Only hitch is that I don't know if > there is such inttovec is in in SAGE yet. mhansen, any idea? Yes, this is pretty much what I'm doing. While I don't have those exact functions, they

[sage-devel] Re: random polynomial generation

2007-10-25 Thread didier deshommes
2007/10/25, Martin Albrecht <[EMAIL PROTECTED]>: > This construction is random if the random number generator ("randint") is > random. Btw. how random is randint? The core generator for all random functions in Python uses the mersenne twister which is pretty strong. I have another suggestion for

[sage-devel] Re: random polynomial generation

2007-10-25 Thread Martin Albrecht
On Friday 26 October 2007, Robert Bradshaw wrote: > This is an interesting construction, but I am wondering if a uniform > distribution for all polynomials of specified degree < d, with a > specified number of terms, is the most natural one to give, and how > grave the impact is on efficiency. (De

[sage-devel] Re: random polynomial generation

2007-10-25 Thread Robert Bradshaw
This is an interesting construction, but I am wondering if a uniform distribution for all polynomials of specified degree < d, with a specified number of terms, is the most natural one to give, and how grave the impact is on efficiency. (Depending on the coefficient ring, this goal may not

[sage-devel] Re: random polynomial generation

2007-10-25 Thread Martin Albrecht
Hi, after realizing that Steffen and I share an office at RHUL I discussed this thing with him today for some time. The improved implementation (#980) still doesn't produce random polynomials for two reasons: The code does not seem to produce monomials of degree up to $d$ uniformly at random.

[sage-devel] Re: random polynomial generation

2007-10-24 Thread didier deshommes
I've attached a patch that takes care of 1) only and updated http://sagetrac.org/sage_trac/ticket/980 . The individual degree distribution is a little better: {{{ sage: GF(10007)['x,y,q'].random_element(6,10) -2005*x^6 + 2400*x^4*y^2 - 3609*x^3*y^3 + 488*x*y^5 - 3093*x^4*y*q + 3482*x*y*q^3 - 989*x

[sage-devel] Re: random polynomial generation

2007-10-24 Thread Steffen
On Oct 24, 5:45 am, "didier deshommes" <[EMAIL PROTECTED]> wrote: > 2007/10/23, Steffen <[EMAIL PROTECTED]>: > > > Exactly, thats one of two points. The maximum degree in every variable > > is (maximum total degree of resulting polynomial) / (number of > > varialbes of the polynomial). Thus for

[sage-devel] Re: random polynomial generation

2007-10-23 Thread didier deshommes
2007/10/23, Steffen <[EMAIL PROTECTED]>: > Exactly, thats one of two points. The maximum degree in every variable > is (maximum total degree of resulting polynomial) / (number of > varialbes of the polynomial). Thus for example GF(10007) > ['x,y,z'].random_element(5,9) will be limited in every var

[sage-devel] Re: random polynomial generation

2007-10-23 Thread William Stein
On 10/23/07, Steffen <[EMAIL PROTECTED]> wrote: > > Given this definition (which I agree is correct), I would expect that > > if I ask for a total degree of 4, I would sometimes see monomials like > > x^4 or x*y^3. I think the lack of these monomials is what surprises > > (and, coincidentally, pl

[sage-devel] Re: random polynomial generation

2007-10-23 Thread Steffen
On 17 Okt., 06:20, cwitty <[EMAIL PROTECTED]> wrote: > On Oct 16, 8:32 pm, "didier deshommes" <[EMAIL PROTECTED]> wrote: > > > 2007/10/16, Steffen <[EMAIL PROTECTED]>: > > > > Hi didier, > > > > the implementation does not return a polynomial of a total degree of > > > at most 4, but a polynomia

[sage-devel] Re: random polynomial generation

2007-10-16 Thread cwitty
On Oct 16, 8:32 pm, "didier deshommes" <[EMAIL PROTECTED]> wrote: > 2007/10/16, Steffen <[EMAIL PROTECTED]>: > > > Hi didier, > > > the implementation does not return a polynomial of a total degree of > > at most 4, but a polynomial of total degree of at most 4/2 = 2 in x > > and in y. If I change

[sage-devel] Re: random polynomial generation

2007-10-16 Thread didier deshommes
2007/10/16, Steffen <[EMAIL PROTECTED]>: > Hi didier, > > the implementation does not return a polynomial of a total degree of > at most 4, but a polynomial of total degree of at most 4/2 = 2 in x > and in y. If I change the total degree to 5, nothing happens, since > 5/2 = 2. This might be a bug

[sage-devel] Re: random polynomial generation

2007-10-16 Thread Steffen
Hi and thanks for your quick answers! > Hi Stephen, > This is not an "exact" function. The only guarantee we have is that we > will get a polynomial with total degree of *at most* 4 and total > number of terms is *at most* 9. > > You're right, in such a big field the coefficient is almost alwa

[sage-devel] Re: random polynomial generation

2007-10-15 Thread Nick Alexander
> "??" will give you this together with the corresponding code. > > There are some glitches in the system, but it works pretty well. Glitches that I would love to hear about, and hopefully fix. Nick --~--~-~--~~~---~--~~ To post to this group, send email to sage-

[sage-devel] Re: random polynomial generation

2007-10-15 Thread didier deshommes
2007/10/15, Steffen <[EMAIL PROTECTED]>: > > Hi, > > I need to create a random multivariate polynomial. I do it as follows: > > F = GF(10007)['x,y'].random_element(4,9) Hi Stephen, This is not an "exact" function. The only guarantee we have is that we will get a polynomial with total degree of

[sage-devel] Re: random polynomial generation

2007-10-15 Thread Justin C. Walker
On Oct 15, 2007, at 4:47 PM, Steffen wrote: > > Hi, > > I need to create a random multivariate polynomial. I do it as follows: > > F = GF(10007)['x,y'].random_element(4,9) > > Now, sage creates a polynomial in x and y of degree 2 in every > variable, since 4 = 2+2. Furthermore 9 restricts the po