# RandomPolyhedron

RandomPolyhedron[spec]

gives a pseudorandom polyhedron with the specified specification spec.

RandomPolyhedron[spec,k]

gives a list of k pseudorandom polyhedra.

# Details and Options • RandomPolyhedron gives a Polyhedron drawn from a specific distribution.
• RandomPolyhedron is typically used in testing and verification of time complexity for algorithms.
• Possible specifications spec include:
• {"ConvexHull",dist,n} convex hull of n random points from the distribution dist
• RandomPolyhedron[spec,{k1,k2,}] gives k1×k2× arrays of pseudorandom polyhedra.
• RandomPolyhedron gives a different sequence of pseudorandom polyhedra whenever you run the Wolfram Language. By using SeedRandom, you can get a repeatable sequence.
• RandomPolyhedron has the same options as Polyhedron with the following additions:
•  DataRange Automatic the range of vertex points to generate WorkingPrecision MachinePrecision precision of vertex points
• With the default setting DataRangeAutomatic, coordinates are chosen in the range 0 to 1.

# Examples

open allclose all

## Basic Examples(2)

Generate a random convex hull polyhedron:

Generate a list of random polyhedra:

Compute the volume:

## Scope(4)

### Basic Uses(1)

Generate a random polyhedron with a specified property:

### Convex Hull Polyhedra(3)

Generate a random convex hull polyhedron:

Generate a list of random convex hull polyhedra:

Generate a random convex hull polyhedron from the Dirichlet distribution:

Uniform distribution:

Normal distribution:

## Options(2)

### DataRange(1)

DataRange allows you to specify the range of vertex points to generate:

Specify a different range:

### WorkingPrecision(1)

Generate a random polyhedron using machine arithmetic:

Using 30 digits of precision:

## Applications(3)

### Basic Uses(2)

Random polyhedra with 10 vertex points:

Generate random polyhedra for testing algorithms and verification of time complexity:

Time complexity for algorithms for convex polyhedra:

### Geometry Probability(1)

Simulate random convex polyhedra and compute volumes:

Estimate distribution:

Compare its histogram to the PDF:

Average volume of polyhedra with 10 vertices over a unit square:

## Properties & Relations(5)

Use SeedRandom to get repeatable random polyhedra:

Use BlockRandom to block one use of RandomPolyhedron from affecting others:

Use ConvexPolyhedronQ to check the property of a random polyhedron:

The OuterPolyhedron of a random polyhedron is simple:

Random polyhedra do not have voids:

Using PolyhedronDecomposition to decompose a polyhedron into tetrahedra:

## Neat Examples(1)

Random polyhedron collections:

Introduced in 2019
(12.0)