# Triangular Numbers and Simplices

# Triangular Numbers and Simplices

Join the DZone community and get the full member experience.

Join For FreeHortonworks Sandbox for HDP and HDF is your chance to get started on learning, developing, testing and trying out new features. Each download comes preconfigured with interactive tutorials, sample data and developments from the Apache community.

A couple weeks ago I posted a visual proof that

This says that the *n*th triangular number equals C(*n*+1, 2), the number of ways to choose two things from a set of *n* + 1 things.

I recently ran across a similar proof here. A simplex is a generalization of a triangle, and you can prove the equation above by counting the number of edges in simplices.

A 0-simplex is just a point. To make a 1-simplex, add another point and connect the two points with an edge. A 1-simplex is a line segment.

To make a 2-simplex, add a point not on the line segment and add two new edges, one to each vertex of the line segment. A 2-simplex is a triangle.

To make a 3-simplex, add point above the triangle and add three new edges, one to each vertex of the triangle. A 3-simplex is a tetrahedron.

Now proceed by analogy in higher dimensions. To make an an *n*-simplex, start with an *n*-1 simplex and add one new vertex and *n* new edges. This construction shows that the number of edges in an *n* simplex is 1 + 2 + 3 + … + *n*.

Another way to count edges is to note that an *n*-simplex has *n*+1 vertices and an edge between every pair of vertices. So an *n* simplex has C(*n*+1, 2) edges. So C(*n*+1, 2) must equal 1 + 2 + 3 + … + *n*.

Hortonworks Community Connection (HCC) is an online collaboration destination for developers, DevOps, customers and partners to get answers to questions, collaborate on technical articles and share code examples from GitHub. Join the discussion.

Published at DZone with permission of John Cook , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

## {{ parent.title || parent.header.title}}

## {{ parent.tldr }}

## {{ parent.linkDescription }}

{{ parent.urlSource.name }}