Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random QQ #999

Open
DanGrayson opened this issue Sep 16, 2019 · 4 comments · May be fixed by #3481
Open

random QQ #999

DanGrayson opened this issue Sep 16, 2019 · 4 comments · May be fixed by #3481

Comments

@DanGrayson
Copy link
Member

Frank Schreyer would like "random QQ" to yield negative numbers about half the time (currently, none are provided) and that the various numbers occur with equal probability (currently, fractions of small height occur more often).

Moreover, when working with polynomial rings over the rationals, it seems senseless to provide any denominators:


i21 : R=QQ[x,y]

o21 = R

o21 : PolynomialRing

i22 : random (10, R)

      3 10   5 9    1 8 2   5 7 3   1 6 4   5 5 5   9 4 6   1 3 7    2 8      9   10 10
o22 = -x   + -x y + -x y  + -x y  + -x y  + -x y  + -x y  + -x y  + x y  + x*y  + --y
      5      7      8       3       7       2       4       7                      9

o22 : R
@mahrud
Copy link
Member

mahrud commented Sep 18, 2019

I was going to report the same for ZZ, but seems like they are related:

i1 : random(ZZ^3,ZZ^3)

o1 = | 7 3 0 |
     | 6 1 8 |
     | 8 8 4 |

              3        3
o1 : Matrix ZZ  <--- ZZ

@DanGrayson
Copy link
Member Author

One possible problem with changing the behavior of "random" is that tests that use it may fail.

@mikestillman
Copy link
Member

mikestillman commented Sep 19, 2019 via email

@kschwede
Copy link
Contributor

kschwede commented Aug 2, 2021

I've thought about implementing a better random ZZ (and hence QQ) where the number is created out of some distribution on the integers. Is someone else already implementing this or something similar in some package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants