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 always
> nonzero. The problem is in the degrees: we don't check for repetitions
> when generating them (we don't care). As you know, we often view
> multivariate polynomials as dictionaries with the degrees as keys and
> the coefficients as values. The functions works simply (with
> parameters 4 and 9):
> 1) generate 9 random tuples of for the degrees. The only requirement
> we have is that the sum of the element in these tuples must not exceed
>  4. Repetitions are allowed.
> 2) Generate 9 coefficients.
> 3) Create a dictionary where the keys are the degree tuples and the
> values are the coefficients. Repetitions are discarded and that is how
> we end up with a polynomial with less than 9 terms.
> 4) Create a polynomial from this dictionary and return it.

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 in the implementation. However I am happy
with this behaviour and maybe there should be the option for choosing
the total degree or the degree in every variable.
Furthermore I am not happy with this implementation in general. In
step 1.) you do not care about repetitions. This sounds reasonible
since repetitions are part of randomness. Later in step 3) you do care
about repetetions and summarise them under the value 0. If the value 0
gains the same importance as all other values in the corresponding set
of values, than the  multiple occurance of 0 is a repetition, too.

I am quite new in SAGE and have no idea how sage code looks like, but
I will have a look and see if I can do some changes :-)

Cheers, Steffen




--~--~---------~--~----~------------~-------~--~----~
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 http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to