Simplex
In geometry, a simplex (plural simplexes or simplices) or n-simplex is an n-dimensional analogue of a triangle. Specifically, a simplex is the convex hull of a set of (n + 1) affinely independent points in some Euclidean space of dimension n or higher (i.e., a set of points such that no m-plane contains more than (m + 1) of them; such points are said to be in general position).
For example, a 0-simplex is a point, a 1-simplex is a line segment, a 2-simplex is a triangle, a 3-simplex is a tetrahedron, and a 4-simplex is a pentachoron (in each case with interior).
A regular simplex is a simplex that is also a regular polytope. A regular n-simplex may be constructed from a regular (n − 1)-simplex by connecting a new vertex to all original vertices by the common edge length.
In geometric or arithmetic combinatorics, a simplex is simply the n-dimensional point set composed of n+1 points.
Contents
Elements
The convex hull of any nonempty subset of the n+1 points that define an n-simplex is called a face of the simplex. Faces are simplices themselves. In particular, the convex hull of a subset of size m+1 (of the n+1 defining points) is an m-simplex, called an m-face of the n-simplex. The 0-faces (i.e., the defining points themselves as sets of size 1) are called the vertices (singular: vertex), the 1-faces are called the edges, the (n − 1)-faces are called the facets, and the sole n-face is the whole n-simplex itself. In general, the number of m-faces is equal to the binomial coefficient . Consequently, the number of m-faces of an n-simplex may be found in column (m + 1) of row (n + 1) of Pascal's triangle. A simplex A is a coface of a simplex B if B is a face of A. Face and facet can have different meanings when describing types of simplices in a simplicial complex. See Simplicial_complex#Definitions
The regular simplex family is the first of three regular polytope families, labeled by Coxeter as α_{n}, the other two being the cross-polytope family, labeled as β_{n}, and the hypercubes, labeled as γ_{n}. A fourth family, the infinite tessellation of hypercubes, he labeled as δ_{n}.
Δ^{n} | Picture | Name Schläfli symbol Coxeter-Dynkin |
Vertices 0-faces |
Edges 1-faces |
Faces 2-faces |
Cells 3-faces |
4-faces | 5-faces | 6-faces | 7-faces | 8-faces | 9-faces |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Δ^{0} | 0-simplex (point) | 1 | ||||||||||
Δ^{1} | 1-simplex (line segment) {} |
2 | 1 | |||||||||
Δ^{2} | 2-simplex (triangle) {3} |
3 | 3 | 1 | ||||||||
Δ^{3} | 3-simplex (tetrahedron) {3,3} |
4 | 6 | 4 | 1 | |||||||
Δ^{4} | 4-simplex (pentachoron) {3,3,3} |
5 | 10 | 10 | 5 | 1 | ||||||
Δ^{5} | 5-simplex {3,3,3,3} |
6 | 15 | 20 | 15 | 6 | 1 | |||||
Δ^{6} | 6-simplex {3,3,3,3,3} |
7 | 21 | 35 | 35 | 21 | 7 | 1 | ||||
Δ^{7} | 7-simplex {3,3,3,3,3,3} |
8 | 28 | 56 | 70 | 56 | 28 | 8 | 1 | |||
Δ^{8} | 8-simplex {3,3,3,3,3,3,3} |
9 | 36 | 84 | 126 | 126 | 84 | 36 | 9 | 1 | ||
Δ^{9} | 9-simplex {3,3,3,3,3,3,3,3} |
10 | 45 | 120 | 210 | 252 | 210 | 120 | 45 | 10 | 1 | |
Δ^{10} | 10-simplex {3,3,3,3,3,3,3,3,3} |
11 | 55 | 165 | 330 | 462 | 462 | 330 | 165 | 55 | 11 |
In some conventions, the empty set is defined to be a (−1)-simplex. The definition of the simplex above still makes sense if n = −1. This convention is more common in applications to algebraic topology (such as simplicial homology) than to the study of polytopes.
The standard simplex
The standard n-simplex (or unit n-simplex) is the subset of R^{n+1} given by
The simplex Δ^{n} lies in the affine hyperplane obtained by removing the restriction t_{i} ≥ 0 in the above definition. The standard simplex is clearly regular.
The n+1 vertices of the standard n-simplex are the points {e_{i}} ⊂ R^{n+1}, where:
There is a canonical map from the standard n-simplex to an arbitrary n-simplex with vertices (v_{0}, …, v_{n}) given by
The coefficients t_{i} are called the barycentric coordinates of a point in the n-simplex. Such a general simplex is often called an affine n-simplex, to emphasize that the canonical map is an affine transformation. It is also sometimes called an oriented affine n-simplex to emphasize that the canonical map may be orientation preserving or reversing.
Cartesian coordinates for regular N-dimensional simplex in R^{n}
A numerical procedure for the Cartesian coordinates of a regular N-dimensional simplex can be obtained by utilizing the following two geometric properties,
- Property 1. For a regular simplex, the distance from the center to any of the vertices is identical.
- Property 2. The angle subtended by any two vertices of an N-dimensional simplex through its center is
Let represent the vectors from the center of the simplex to each of its vertices. According to property 1, the vector lengths can be arbitrarily chosen to be some fixed number. We take , taking the origin as the center of the simplex.
Property 2 then implies that the dot product between any two (i≠j) is -1/N.
These two conditions allow a simple enumeration scheme for the Cartesian coordinates of a regular N-dimensional simplex. For convenience, the simplex is centered at the origin.
Example in 3-dimensions (N=3)
In three-dimensions, we have to specify , the vertices of a tetrahedron.
- Begin by arbitrarily choosing . By property 2, the remaining vectors must have a dot product equal to -1/N=-1/3 with . Hence, the first coordinate of the remaining vectors must be -1/3.
- We choose so that only the first 2 components are nonzero. Let for some unknown c. By the normalization requirement, we find . By the dot product requirement (Property 2), the second component of the remaining vectors must be .
- The above step is repeated for (i=3,...,N). In particular, we choose such that only the first i components are nonzero.
Matlab code for arbitrary dimension N
The above procedure is implemented in the following Matlab code, which returns the N+1 vertices of the regular simplex as row vectors in the rows of matrix v.
function v = NdimSimplexGen(N) v = zeros(N+1,N); v(1,1) = 1; v(2:(N+1),1) = -1/N*ones(N,1); % Case N=1 is already done if(N>1) % The following assumes N>1 for i = 2:N % Determine the new element v(i,i) by normalization c = sqrt(1-sum(v(i,1:(i-1)).^2)); v(i,i) = c; % Determine all elements below v(i,i) by the acos(-1/n) property w = v(i,1:(i-1)); a = -1/c*(1/N+sum(w.^2)); v((i+1):(N+1),i) = a*ones(N-i+1,1); end end
Geometric properties
The oriented volume of an n-simplex in n-dimensional space with vertices (v_{0}, ..., v_{n}) is
where each column of the n × n determinant is the difference between the vectors representing two vertices. Without the 1/n! it is the formula for the volume of an n-parallelepiped. One way to understand the 1/n! factor is as follows. If the coordinates of a point in a unit n-box are sorted, together with 0 and 1, and successive differences are taken, then since the results add to one, the result is a point in an n simplex spanned by the origin and the closest n vertices of the box. The taking of differences was a unimodular (volume-preserving) transformation, but sorting compressed the space by a factor of n!.
The volume under a standard n-simplex (i.e. between the origin and the simplex in R^{n+1}) is
The volume of a regular n-simplex with unit side length is
as can be seen by multiplying the previous formula by x^{n+1}, to get the volume under the n-simplex as a function of its vertex distance x from the origin, differentiating with respect to x, at (where the n-simplex side length is 1), and normalizing by the length of the increment, , along the normal vector.
Simplexes with an "orthogonal corner"
Orthogonal corner means here, that there is a vertex at which all adjacent hyperfaces are pairwise orthogonal. Such simplexes are generalizations of right angle triangles and for them there exists a n-dimensional version of the Pythagorean theorem:
The sum of the squared n-dimensional volumes of the hyperfaces adjacent to the orthogonal corner equals the squared n-dimensional volume of the hyperface opposite of the orthogonal corner.
where are hyperfaces being pairwise orthogonal to each other but not orthogonal to , which is the hyperface opposite of the orthogonal corner.
For a 2-simplex the theorem is the Pythagorean theorem for triangles with a right angle and for a 3-simplex it is de Gua's theorem for a tetrahedron with a cube corner.
Relation to the (n+1)-hypercube
The Hasse diagram of the face lattice of an n-simplex is isomorphic to the graph of the (n+1)-hypercube's edges, with the hypercube's vertices mapping to each of the n-simplex's elements, including the entire simplex and the null polytope as the extreme points of the lattice (mapped to two opposite vertices on the hypercube). This fact may be used to efficiently enumerate the simplex's face lattice, since more general face lattice enumeration algorithms are more computationally expensive.
The n-simplex is also the vertex figure of the (n+1)-hypercube.
Topology
Topologically, an n-simplex is equivalent to an n-ball. Every n-simplex is an n-dimensional manifold with boundary.
Probability
In probability theory, the points of the standard n-simplex in -space are the space of possible parameters (probabilities) of the categorical distribution on n+1 possible outcomes.
Algebraic topology
In algebraic topology, simplices are used as building blocks to construct an interesting class of topological spaces called simplicial complexes. These spaces are built from simplices glued together in a combinatorial fashion. Simplicial complexes are used to define a certain kind of homology called simplicial homology.
A finite set of k-simplexes embedded in an open subset of R^{n} is called an affine k-chain. The simplexes in a chain need not be unique; they may occur with multiplicity. Rather than using standard set notation to denote an affine chain, it is instead the standard practice to use plus signs to separate each member in the set. If some of the simplexes have the opposite orientation, these are prefixed by a minus sign. If some of the simplexes occur in the set more than once, these are prefixed with an integer count. Thus, an affine chain takes the symbolic form of a sum with integer coefficients.
Note that each face of an n-simplex is an affine n-1-simplex, and thus the boundary of an n-simplex is an affine n-1-chain. Thus, if we denote one positively-oriented affine simplex as
with the denoting the vertices, then the boundary of σ is the chain
- .
More generally, a simplex (and a chain) can be embedded into a manifold by means of smooth, differentiable map . In this case, both the summation convention for denoting the set, and the boundary operation commute with the embedding. That is,
where the are the integers denoting orientation and multiplicity. For the boundary operator , one has:
where ϝ is a chain. The boundary operation commutes with the mapping because, in the end, the chain is defined as a set and little more, and the set operation always commutes with the map operation (by definition of a map).
A continuous map to a topological space X is frequently referred to as a singular n-simplex.
Applications
This section requires expansion. |
Simplices are used in plotting quantities that sum to 1, such as proportions of subpopulations, as in a ternary plot.
Simplices are used in Operations Research for solving problems involving multiple constraints expressed as linear equations. An example is designing a balanced diet which has some amount of calories from each of carbohydrates, proteins and fats. The method for solving problems of this sort using simplices is called the simplex method.
Random sampling
(Also called Simplex Point Picking) There are at least two efficient ways to generate uniform random samples from the unit simplex.
The first method is based on the fact that sampling from the K-dimensional unit simplex is equivalent to sampling from a Dirichlet distribution with parameters α = (α_{1}, ..., α_{K}) all equal to one. The exact procedure would be as follows:
- Generate K unit-exponential distributed random draws x_{1}, ..., x_{K}.
- This can be done by generating K uniform random draws y_{i} from the open interval (0,1) and setting x_{i}=-ln(y_{i}).
- Set S to be the sum of all the x_{i}.
- The K coordinates t_{1}, ..., t_{K} of the final point on the unit simplex are given by t_{i}=x_{i}/S.
The second method to generate a random point on the unit simplex is based on the order statistics of the uniform distribution on the unit interval (see Devroye, p.568). The algorithm is as follows:
[WARNING: This may be broken according to http://www.cs.cmu.edu/~nasmith/papers/smith+tromble.tr04.pdf ]
- Set p_{0} = 0 and p_{K}=1.
- Generate K-1 uniform random draws p_{i} from the open interval (0,1).
- Sort into ascending order the K+1 points p_{0}, ..., p_{K}.
- The K coordinates t_{1}, ..., t_{K} of the final point on the unit simplex are given by t_{i}=p_{i}-p_{i-1}.
Random walk
Sometimes, rather than picking a point on the simplex at random we need to perform a uniform random walk on the simplex. Such random walks are frequently required for Monte Carlo method computations such as Markov chain Monte Carlo over the simplex domain.
An efficient algorithm to do the walk can be derived from the fact that the normalized sum of K unit-exponential random variables is distributed uniformly over the simplex. We begin by defining a univariate function that "walks" a given sample over the positive real line such that the stationary distribution of its samples is the unit-exponential distribution. The function makes use of the Metropolis-Hastings algorithm to sample the new point given the old point. Such a function can be written as the following, where h is the relative step-size:
next_point <- function(x_old) { repeat { x_new <- x_old * exp( Random_Normal(0,h) ) metropolis_ratio <- exp(-x_new) / exp(-x_old) hastings_ratio <- ( x_new / x_old ) acceptance_probability <- min( 1 , metropolis_ratio * hastings_ratio ) if ( acceptance_probability > Random_Uniform(0,1) ) break } return(x_new) }
Then to perform a random walk over the simplex:
- Begin by drawing each element x_{i}, i= 1, 2, ..., K, from a unit-exponential distribution.
- For each i= 1, 2, ..., K
- x_{i} ↝ next_point(x_{i})
- Set S to the sum of all the x_{i}
- Set t_{i} = x_{i} /S for all i= 1, 2, ..., K
The set of t_{i} will be restricted to the simplex, and will walk ergodically over the domain with a uniform stationary density. Note that it is important not to re-normalize the x_{i} at each step; doing so will result in a non-uniform stationary distribution. Instead, think of the x_{i} as "hidden" parameters, with the simplex coordinates given by the set of t_{i}.
This procedure effectively samples x_new
from a gamma random variable with mean of x_old
and standard deviation of h*x_old
. If library routines are available to generate the requisite gamma variate directly, they may be used instead. The Hastings ratio for the MCMC step (which is different and independent of the Hastings-ratio in the next_point
function) can then be computed given the gamma density function. Although it is theoretically possible to sample from a gamma density directly, experience shows that doing so is numerically unstable. In contrast, the next_point
function is numerically stable even after many, many iterations.
See also
- Causal dynamical triangulation
- Distance geometry
- Delaunay triangulation
- Hill tetrahedron
- Other regular n-polytopes
- Hypercube
- Cross-polytope
- Tesseract
- Polytope
- List of regular polytopes
- Schläfli orthoscheme
- Simplex algorithm - a method for solving optimisation problems with inequalities.
- Simplicial complex
- Simplicial homology
- Simplicial set
- Ternary plot
External links
- OEIS sequence [ A135278] Triangle read by rows, giving the numbers T(n,m) = binomial(n+1,m+1); or, Pascal's triangle [ A007318] with its left-hand edge removed.
References
- Walter Rudin, Principles of Mathematical Analysis (Third Edition), (1976) McGraw-Hill, New York, ISBN 0-07-054235-X (See chapter 10 for a simple review of topological properties.).
- Andrew S. Tanenbaum, Computer Networks (4th Ed), (2003) Prentice Hall, ISBN 0-13-066102-3 (See 2.5.3).
- Luc Devroye, Non-Uniform Random Variate Generation. (1986) ISBN 0-387-96305-7.
- H.S.M. Coxeter, Regular Polytopes, Third edition, (1973), Dover edition, ISBN 0-486-61480-8
- p120-121
- p.296, Table I (iii): Regular Polytopes, three regular polytopes in n-dimensions (n>=5)
- Weisstein, Eric W. Simplex. From MathWorld--A Wolfram Web Resource.