diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/random-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/random-doc.m2 index d270a83ae2..4ecacb9a56 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/random-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/random-doc.m2 @@ -61,6 +61,29 @@ Node SeeAlso setRandomSeed +Node + Key + (random, QQ) + Headline + get a random rational number + Usage + random x + Inputs + x:QQ + Height => ZZ + Outputs + :QQ -- randomly chosen from the interval $[0, x]$ + Description + Text + A random number is chosen from the uniform distribution on the interval + $[0, x]$ and then rounded (using the @wikipedia "Farey sequence"@) to the + nearest rational number with denominator bounded by the @CODE "Height"@ + option. + Example + apply(10, i -> random(7_QQ, Height => 5)) + SeeAlso + setRandomSeed + Node Key (random, Type)