next | previous | forward | backward | up | index | toc

# randomArrangement(ZZ,PolynomialRing,ZZ) -- generate an arrangement at random

## Synopsis

• Function: randomArrangement
• Usage:
randomArrangement(n,R,N)
• Inputs:
• n, an integer, number of hyperplanes
• R, , a polynomial ring over which to define the arrangement, or a number of variables l instead
• N, an integer, absolute value of upper bound on coefficients
• Optional inputs:
• Validate => , default value false, if true, the method will attempt to return an arrangement whose underlying matroid is uniform.
• Outputs:
• , a random rational arrangement of $n$ hyperplanes defined over $R$.

## Description

As $N$ increases, the random arrangement is a generic arrangement (i.e., a realization of the uniform matroid with probability tending to 1. The user can require that the arrangement generated is actually generic by using the option Validate => true.

 i1 : randomArrangement(4,3,5) o1 = {- 4x + 3x + x , 3x + x , - 2x + 2x , 3x + x + x } 1 2 3 1 3 1 3 1 2 3 o1 : Hyperplane Arrangement 

If an arrangement has the poincare polynomial of a generic arrangement, then it is itself generic.

 i2 : tally apply(12, i -> poincare randomArrangement(6,3,5)) 2 3 o2 = Tally{1 + 6T + 15T + 10T => 8} 2 3 1 + 6T + 14T + 9T => 4 o2 : Tally i3 : A = randomArrangement(6,3,5,Validate=>true) o3 = {5x + 4x + 3x , - 3x + x - 5x , - 5x - 3x + 3x , 3x + 4x - 2x , - 2x - 3x + 5x , 5x + 3x - 5x } 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 o3 : Hyperplane Arrangement  i4 : U = uniformMatroid(3,6); i5 : assert areIsomorphic(U, matroid A)

## Caveat

If the user specifies Validate => true and $N$ is too small, the method may not halt.