# randomPoints -- a function to find random points in a variety.

## Synopsis

• Usage:
randomPoints(I)
randomPoints(n, I)
• Inputs:
• n, an integer, an integer denoting the number of desired points.
• I, an ideal, inside a polynomial ring.
• R, a ring, a polynomial ring
• Optional inputs:
• Strategy => , default value Default, to specify which strategy to use, Default, BruteForce, LinearIntersection.
• ExtendField => , default value false, whether to allow points not rational over the base field
• Homogeneous => , default value true, whether to include the origin as a valid point to output PointCheckAttempts => ZZ points to search in total, see PointCheckAttempts
• NumThreadsToUse => an integer, default value 1, number of threads to use in the BruteForce strategy, see NumThreadsToUse
• DimensionFunction => , default value dim, specify a custom dimension function, such as the default dimViaBezout or the Macaulay2 function dim
• DecompositionStrategy => , default value null, see DecompositionStrategy
• PointCheckAttempts => ..., default value 0, Number of times the the function will search for a point
• Replacement => ..., default value Binomial, When changing coordinates, whether to replace variables by general degre 1 forms, binomials, etc.
• Verbose => ..., default value false, turns out Verbose (debugging) output
• Outputs:
• a list, a list of points in the variety with possible repetitions.

## Description

Gives at most $n$ many point in a variety $V(I)$.

 i1 : R = ZZ/5[t_1..t_3]; i2 : I = ideal(t_1,t_2+t_3); o2 : Ideal of R i3 : randomPoints(3, I) o3 = {{0, -1, 1}, {0, -1, 1}, {0, -1, 1}} o3 : List i4 : randomPoints(4, I, Strategy => Default) o4 = {{0, -1, 1}, {0, -1, 1}, {0, -1, 1}, {0, -1, 1}} o4 : List i5 : randomPoints(4, I, Strategy => LinearIntersection) o5 = {{0, -1, 1}, {0, -1, 1}, {0, -1, 1}, {0, -1, 1}} o5 : List

The default strategy switches between LinearIntersection and MultiplicationTable for the DecompositionStrategy (after first trying a brute force strategy).

Using DecompositionStrategy => MultiplicationTable (currently only implemented for Homogeneous ideals) is sometimes faster and other times not. It tends to work better in rings with few variables. Because of this, the default strategy runs MultiplicationTable first in rings with fewer variables and runs Decompose first in rings with more variables.

 i6 : S=ZZ/103[y_0..y_30]; i7 : I=minors(2,random(S^3,S^{3:-1})); o7 : Ideal of S i8 : elapsedTime randomPoints(I, Strategy=>LinearIntersection, DecompositionStrategy=>MultiplicationTable) -- 5.04581 seconds elapsed o8 = {{-4, -35, -7, 0, 0, 1, 5, -13, 0, -47, 0, 41, 0, -51, -46, 35, 0, 0, ------------------------------------------------------------------------ -47, 14, -30, 42, 30, 4, -41, 24, 0, 0, 15, 20, 1}} o8 : List i9 : elapsedTime randomPoints(I, Strategy=>LinearIntersection, DecompositionStrategy=>Decompose) -- 2.55275 seconds elapsed o9 = {{11, 9, -9, -15, -7, 27, 19, -36, 48, 26, -4, 3, 29, -8, 7, -32, 16, ------------------------------------------------------------------------ 11, 7, 7, 25, -14, -39, 17, -16, 4, -50, -12, 21, -50, 51}} o9 : List

## Ways to use randomPoints :

• "randomPoints(Ideal)"
• "randomPoints(ZZ,Ideal)"

## For the programmer

The object randomPoints is .