user_guide:tutorials:release:4.1:random

This tutorial is probably also available as a Jupyter notebook in the demo folder in the polymake source and on github.

Different versions of this tutorial: latest release, release 4.13, release 4.12, release 4.11, release 4.10, release 4.9, release 4.8, release 4.7, release 4.6, release 4.5, release 4.4, release 4.3, release 4.2, release 4.1, release 4.0, release 3.6, nightly master

Random Constructions

The easiest way to randomly construct a polytope is by sampling points on the unit sphere. The following chooses 100 points on the unit sphere in 3-space.

> $p1=rand_sphere(3,100);
> print $p1->SIMPLICIAL;
true

A second way to randomly construct a polytope is by sampling points by a standard normal distribution. The following chooses 100 points sampled from the standard normal distribution in 3-space.

> $p2 = rand_normal(3, 100);
> print $p2 -> SIMPLICIAL, "\n", $p2 -> F_VECTOR;
true
24 66 44

With probability one such polytopes under either distribution are simplicial.

> ($d,$m,$n) = (4,50,30);
> $p1=rand_sphere($d,$m);
> $p2=polarize($p1);
> $p3=new Polytope(POINTS=>rand_vert($p2->VERTICES,$n));
> print $p3->SIMPLICIAL, " ", $p3->SIMPLE, "\n", $p3->F_VECTOR;
false false
30 162 251 119
  • user_guide/tutorials/release/4.1/random.txt
  • Last modified: 2020/06/04 10:32
  • by 127.0.0.1