How to Draw a Pascal's Triangle of Arbitrary Dimensions

Including Derivations, Movies, and Reference Matlab code

 

v1.0

Sept 2007

 


 

 

1      Overview.. 5

1.1       Two-dimensional Pascal's Triangle. 5

1.2       Three-dimensional Pascal's Pyramid. 6

1.2.1        Using time/color as another dimension. 7

1.3       Four-dimensional Pascal's figure. 7

2      Properties of Pascal's figures. 8

2.1       Basic properties to note in 2-term case. 8

2.2       Properties extended to 3 terms. 11

2.2.1        Additional properties that become apparent in 3D.. 15

2.3       Properties extended to 4 terms. 17

3      Extension to an arbitrary number of dimensions. 22

3.1       First, a note on scaling, and definitions. 23

3.2       Finding the D-dimensional regular unit simplex. 23

3.3       1-dimensional regular unit simplex for the P =2 case (i.e., 2 points defining a line segment) 24

3.4       2 dimensional regular unit simplex for the P = 3 case (i.e. 3 points defining an equilateral triangle) 25

3.5       3 dimensional regular unit simplex for the P = 4 case (i.e. 4 points defining a tetrahedron) 26

3.6       Extension to general case. 27

3.6.1.1     Rotation of the simplex. 28

3.6.2        Table showing certain simplex features as P increases. 29

3.6.3        Derivation of ..... 30

3.6.4        Note on limits as P -> ∞.. 31

3.7       So finally...how do draw the compete Pascal's figure for arbitrary P. 31

3.7.1        Distance between Levels in the exponent dimension. 31

3.7.1.1     example of P =3. 32

3.7.1.2     Generalizing this to P dimensions. 32

3.7.2        Now to draw the complete Pascal's figure. 33

3.7.2.1     How to find any one point on the figure. 33

3.7.2.2     How to find the set of all points in the figure for one exponent. 34

3.7.2.3     The entire Pascal's figure for all exponent Levels. 34

3.7.2.4     What are the coefficients corresponding to each point?. 35

3.7.2.5     How many coefficients add to form a new coefficient?. 36

3.7.2.6     How many total points are there for a particular N, P?. 37

4      Reference Matlab Files. 38

 


 

LIST OF FIGURES

 

Figure 1 : Pascal's Triangle. 5

Figure 2 : 3D Pascal's Pyramid. 6

Figure 3 : Level 4 of 3D Pascal's Pyramid. 7

Figure 4 : Time-sequenced view of 3D Pascal's Pyramid. 7

Figure 5 : 4D Pascal's figure, time-sequenced view.. 8

Figure 6 : 4D Pascal's figure, Levels 1-4. 8

Figure 7 : 4D Pascal's figure, Levels 0-20. 8

Figure 8 : Balls occur along the center line in every other row. 10

Figure 9 : Three non-orthogonal axis in 2 dimensions. 11

Figure 10 : Location of  a3b0c1  in Level 4 of Pascal's Pyramid. 12

Figure 11 : Location of a2b1c1 in Level 4 of Pascal's Pyramid. 13

Figure 12 : Top view of exponents 0,1,2 for 3D Pyramid. 14

Figure 13 : Top view of exponents 1,2,3 for 3D Pyramid. 14

Figure 14 : Converting 3 non-orthogonal axis to 2 orthogonal axis. 16

Figure 15 :  Four non-orthogonal axis in three dimensions. 18

Figure 16 : Level 4 of the 4D Pascal's Simplex. 19

Figure 17 : View directly downward along the a axis. 21

Figure 18 : Formation of 2D simplex from 1D simplex. 25

Figure 19 : The coefficient is the count of matching paths through N rows of terms. 36

 


 

LIST OF TABLES

Table 1 : Assembly of a 2D Level from 1D rows. 15

Table 2 : Assembly of a 3D Level from 2D components. 20

Table 3 : Table of values pertaining to Pascal's figure for various dimensions. 29

Table 4 : Index of Matlab .m files. 39

 

 


 

 

1         Overview

 

This document shows the extension of "Pascal's Triangle" to an arbitrary number of dimensions, with illustrations and movies for 2, 3 and 4 dimensional “Pascal’s Pyramids.”  

 

1.1      Two-dimensional Pascal's Triangle

 

Pascal's Triangle is a geometric representation of the coefficients of

 

 

The rows of the triangle can be determined by adding along the arrows.

 

 

 

 

Figure 1 : Pascal's Triangle

 

 

Each row can be used to determine coefficients of a binomial power. 

 

 For example,

 

 

The coefficients above (i.e., 1,4,6,4,1) can be read from the 4th Level of Pascal's Triangle corresponding to exponent = 4.  

 

 

1.2      Three-dimensional Pascal's Pyramid

 

A similar figure in 3 dimensions can be used to calculate the coefficients of

 

 

In this case the coefficients for each exponent are represented by a 2-dimensional triangle, and the entire figure (including the exponent dimension) is thus a 3-dimensional pyramid.

 

Click here for movie (then click screen to start) or right click here to download

 

Figure 2 : 3D Pascal's Pyramid

 

The movie shows a rotating view to give a sense of the 3-D shape.   As in the previous case, adding along the lines gives the correct number for each ball.

 

Again, using the exponent = 4 as an example, the coefficients of

 

 

can be found on the level of the pyramid corresponding to exponent = 4:

 

 

 

Figure 3 : Level 4 of 3D Pascal's Pyramid

 

 

 

1.2.1      Using time/color as another dimension

 

Now consider the previous 3D Pyramid viewed directly from the "top".   Each level (corresponding to a value of N) can be viewed in a timed sequence, with each level appearing as a different color.    

 

Click here for movie (then click screen to start) or right click here to download movie

 

Figure 4 : Time-sequenced view of 3D Pascal's Pyramid

 

This is another view of the same figure that was illustrated in Figure 2.   This top-down view is analogous to the way the 4D figure will be shown below.

 

1.3      Four-dimensional Pascal's figure

 

A similar shape can be used to depict the coefficients of

 

 

In this case, analogous to the view described in Section 1.2.1,  the most practical way to view this is as a series of 3D pyramids, each corresponding to one exponent, separated by time and color.  

 

Click here for movie (then click screen to start) or right click here to download movie

 

Figure 5 : 4D Pascal's figure, time-sequenced view

 

In the following movie, levels for exponents 1 through 4 are shown at the same time.

 

Click here for movie (then click screen to start) or right click here to download movie

 

Figure 6 : 4D Pascal's figure, Levels 1-4

 

As the exponent increases, the pyramid grows.   The following movie illustrates the progression as  N goes from 0 through 20.

 

Click here for movie (then click screen to start) or right click here to download movie

 

Figure 7 : 4D Pascal's figure, Levels 0-20

 

 

2         Properties of Pascal's figures

 

This section lists some properties in the 2D, 3D, and 4D cases.  Properties which may seem obvious in 2D or 3D can be used to understand the 4D case, which is harder to visualize.

 

2.1      Basic properties to note in 2-term case

 

Let's return to the 2-dimensional Pascal's Triangle, corresponding to

 

 

 

(Property 1) Sum of Exponents

 

 The sum of the exponents on each term of  must be N. 

 

 

(Property 2) Position of points in one Level

 

 Note that the horizontal position of the ball containing the coefficient for

 

 

can be found by moving m spaces to the left and n spaces to the right within the row for exponent m+n.

 

 

(Property 3)  Number of dimensions

 

In this case, with two terms (a + b), the entire figure including the exponent axis is 2-dimensional (i.e., a triangle).   The figure corresponding to a single value of the exponent is 1-dimensional (i.e. a line corresponding to one row in the Pascal's Triangle).   This figure for a single value of the exponent is referred to as a "Level" throughout this document.

 

 

(Property 4)  View down the exponent axis

 

Note that as a consequence of Properties 1 and 2, the positions of the balls in a row of the Triangle repeat in every other row, depending on whether the exponent is even or odd.   For example, the center line of the triangle only has a ball in rows corresponding to even numbered exponents, because only in this case are there terms  where m = n.  This is illustrated below.

 

 

Figure 8 : Balls occur along the center line in every other row.

 

 

Now imagine viewing Figure 8 directly down the center line, from the "top"  (i.e., viewing directly down the y-axis).    In this view the 2D triangle is reduced to a 1D line.   In every other level (for example, exponent = 0, 2, 4, etc.) the balls of the lower level appear directly underneath those of the upper level (except for the two outermost balls, which protrude farther).   Thus the entire figure can be viewed without overlap only by showing each row in turn, in a timed sequence.  

 

In this way the exponent dimension is converted into the dimension of time.   This is analogous to the way the 4D figure is diagrammed.

 

 

 (Property 4b)  Foreshortening

 

If the rows are placed  apart, then all neighboring balls are separated by a distance of 2 (i.e., the top 3 balls of the Pascal's Triangle form an equilateral triangle with side = 2).     However, when the exponent dimension is "flattened" by viewing the triangle directly down the y-axis (as described above), then the lines between balls appear of length 1 (because the x-axis distance between balls on adjacent rows is 1). 

 

The "lines of addition" in this view appear shorter because part of their length is in the now-invisible y-axis.   The artists term for this is "foreshortening."

 

2.2      Properties extended to 3 terms

 

Now let's return to the 3-term case,

 

 

 

(Property 1) Sum of Exponents

 

The sum of the exponents on each term of  must be N. 

 

 

(Property 2) Position of points in one Level

 

Note that (similar to the previous 2-term case), it is convenient to define 3 non-orthogonal axis (a,b,c) as shown below.

 

 

 

Figure 9 : Three non-orthogonal axis in 2 dimensions

 

 

In this case the position of the ball for

 

 

can be determined by moving m units in the direction of the a axis, and n units in the direction of the b axis, and p units in the direction of the c axis.

 

Two examples are shown below.

 

 

Figure 10 : Location of  a3b0c1  in Level 4 of Pascal's Pyramid

 

 

 

Figure 11 : Location of a2b1c1 in Level 4 of Pascal's Pyramid

 

 

(Property 3)  Number of dimensions

 

In this case, with three terms (a + b + c), the entire figure including the exponent axis is 3-dimensional (i.e., a pyramid).   The figure corresponding to a single value of the exponent is 2-dimensional (i.e. a triangle corresponding to one Level in the Pascal's Pyramid).

 

 

(Property 4)  View down the exponent axis

 

Now again consider viewing the entire Pascal's Pyramid directly from the "top" (i.e. directly down the z-axis).   This is the view in the movie Figure 4, or in the starting and ending position of the movie Figure 2.    In this view,  the positions of the balls repeat every 3 levels.  For example, there is a ball in the center only for exponents 0, 3, 6, etc., because only in this cases are there terms  where m = n = p, and thus the movement in the a, b, and c directions are equal, and the ball is left in the center.     Thus, at the beginning and end of the movie in Figure 2,  the ball containing value "6" in Level 3 cannot be seen from directly above, because it is directly underneath the ball containing "1" in Level 0.  

 

In this view, at most 3 levels can be shown on one drawing without overlap.    The following drawing shows for example Levels 0, 1 and 2;   plotting exponent=3 at the same time would result in overlap with the ball for exponent = 0.

 

 

Figure 12 : Top view of exponents 0,1,2 for 3D Pyramid

 

And the following drawing shows exponents 1,2, and 3.  

 

 

Figure 13 : Top view of exponents 1,2,3 for 3D Pyramid

 

Alternatively, each level can be shown in a timed sequence, as was shown in Figure 4.   In this view the exponent axis (z-axis) has been converted to the dimension of time.

 

 

(Property 4b) Foreshortening

 

Note that in this top-down view the "lines of addition" appear shorter than they actually are, because part of the length is in the dimension not being viewed (i.e. the height, or exponent dimension).  

 

It will be shown later that the lines between balls in this 3D figure are of length  in 3 dimensional space, but when projected in to 2 dimensions by viewing down the exponent axis, the drawn length is only 1.  

 

2.2.1      Additional properties that become apparent in 3D

 

At this 3-term stage some additional properties can be seen.

 

(Property 5)  Recursive construction of each Level

 

As already described, each level (i.e., each value of the exponent N) of the 3D pyramid can be depicted as a 2D drawing, as shown for example in Figure 3 for the level corresponding to N = 4.    

 

Consider one exponent level, such as the 4th level depicted in Figure 3.   It is a 2-dimensional triangular figure.    Each row in the triangle can be seen to be proportional to one of the rows of the original basic Pascal's Triangle.   Also, the constant of proportionality is the coefficient from Pascal's Triangle.

 

For example:

 

Pascal's Triangle Row for Exponent = 4

 

 

 

X

Pascal's Triangle first (4+1) rows

 

 

 

=

In Pascal's 3D Pyramid, the 2D Level  corresponding to Exponent=4 can be assembled from a set of 1D rows.

1

1

1

4

1  1

4  4

6

1  2  1

6  12  6

4

1  3  3  1

4  12 12  4

1

1  4  6  4  1

1  4  6  4  1

Table 1 : Assembly of a 2D Level from 1D rows

 

 

(Property 6) Converting 3 non-orthogonal axis to 2 orthogonal axis

 

It was noted previously in Section 2.2 that the position of balls for any particular level can be found using 3 non-orthogonal axis (a,b,c) in 2 dimensions.   However, for a variety of reasons (including for example plotting in Matlab),  it is necessary to first project these onto 2 orthogonal axis in 2 dimensions.   The way to do this is obvious from the following drawing:

 

 

 

Figure 14 : Converting 3 non-orthogonal axis to 2 orthogonal axis

 

 

 

or, in matrix notation

 

 

or

 

 

where

 

 

 

(Note:  and  )

 

 

2.3      Properties extended to 4 terms

 

Now let's return to the 4-term case, depicting the coefficients of

 

 

As described in Section 1.3,  the most practical way to view this is as a series of 3D pyramids, each corresponding to one exponent.   

 

Now we review Properties 1-6 for the 4D case.

 

 

(Property 1) Sum of Exponents

 

 The sum of the exponents on each term of  must be N. 

 

 

(Property 2) Position of points in one Level

 

Note that (similar to the previous 3D-dimensional case), it is convenient to define 4 non-orthogonal axis (a,b,c,d) as shown below.

 

 

Figure 15 :  Four non-orthogonal axis in three dimensions

 

In this case the position of the ball for

 

 

can be determined by moving m units in the direction of the a axis, and n units in the direction of the b axis, p units in the direction of the c axis, and q units in the direction of the d axis.

 

(Property 3)  Number of dimensions

 

In this case, with four terms (a + b + c + d), the entire figure including the exponent axis is 4-dimensional.   The figure corresponding to a single value of the exponent is 3-dimensional (i.e. a Pyramid figure corresponding to one Level in the Pascal's 4D Simplex).

 

 

(Property 4)  View down the exponent axis

 

As mentioned in Section 1.2.1, the movies of the 4D case are analogous to the "top-down" view as was shown in Figure 4 for the 3D case.   

 

This is described further under "Property 4" in Sections 2.1 and  2.2.   These ideas may be obvious when considering the flattening of 2 dimensions to 1 (Sections 2.1), or 3 dimensions to 2 (Section 2.2).   However in the 4D->3D case, we are only left with a clear conceptual view of the 3D "remainder" after the flattening.

 

Similarly to previous cases, note that in the 4D case the positions of the balls repeat every 4 levels.  For example, there is a ball in the center only for exponents 0, 4, 8, etc., because only in this cases are there terms  where m = n = p = q, and thus the movement in the a, b, c, and d directions are equal, and the ball remains in the center.  So note for example in Figure 6, the ball labeled "24" in the center of the Level 4 pyramid is exactly at the origin, and therefore occupies the same space (in 3D) as the ball for Level 0. 

 

To avoid this overlap, the levels can be shown 4 at a time, as was shown in the movie in Figure 6.    This figure is analogous to Figure 12 and Figure 13 for the 3D case.  

 

Alternatively, the levels can be shown in a timed sequence.   Thus Figure 5 for the 4D case is analogous to Figure 4 for the 3D case.

 

(Property 4b) Foreshortening

 

The “lines of addition” in these drawings are of length 1.   This can be deduced from the fact that the 4 points of the tetrahedron corresponding to N=1 lie on the unit sphere (whereas the point corresponding to N=0 is the origin).  But in the following Section, it is shown that the “lines of addition” should be of length .   So what happened to the extra length?  It is "foreshortened" by the projection from 4D into 3D.   Part of the length of each line is in the 4th dimension and is not visible.

 

Note that this drawn length in the "flattened exponent" view is 1, the same as in the 3D and 2D cases.  This is constant for all dimensional values P, even though the actual length reduces as P increases (shown below).  In other words, as more dimensions are added, there is less discrepancy between the actual length and the foreshortened length.

 

 

(Property 5)  Recursive construction of each Level

 

As described previously, each level (i.e. each value of the exponent N)  of the 4D pyramid can be depicted as a 3D drawing. 

 

Consider the 3D pyramid corresponding to one exponent level, such as the exponent = 4 level depicted by itself in the following movie:   

 

Click here to play movie (then click screen to start) or right click here to download movie

 

Figure 16 : Level 4 of the 4D Pascal's Simplex

 

Each 2D level of this 3D shape can be seen to be proportional to one of the Levels of the 3D Pascal's Pyramid.   Also, the constant of proportionality is the coefficient from a row of the original Pascal's Triangle.

 

For example:

 

Pascal's Triangle Row for Exponent = 4

 

 

 

X

Each 2D level from the 3D Pyramid  corresponding to (a+b+c) case;  the first 4 exponent levels 

 

 

 

=

In Pascal's 4D Simplex, the 3D Level (pyramid) corresponding to Exponent = 4, can be  assembled from a set of 2D triangles.  

1

1

1

4

1

1  1

4

4  4

6

1

2  2

1  2  1

6

12 12

6  12  6

4

1

3  3

3  6  3

1  3  3  1

4

12 12

12 24 12

4  12 12  4

1

1

4  4

6  12  6

4  12 12  4

1  4  6  4  1

1

4  4

6  12  6

4  12 12  4

1  4  6  4  1

Table 2 : Assembly of a 3D Level from 2D components

 

Now it can be seen in general how the P+1-dimensional Pascal's Simplex can be built up from the previous ones.

 

 

(Property 6) Converting 3 non-orthogonal axis to 2 orthogonal axis

 

Now to plot each level, the non-orthogonal (a,b,c,d) space must be converted to the space of the 3 orthogonal axis (x-axis, y-axis, z-axis).   The x, y and z axis are illustrated in Figure 15.

 

Note that the easiest way to do this is to consider a to be directly on the new z-axis, at z= 1, x=0, y=0.   Then the problem of finding the other points reduces to finding the level on the z-axis for the other 3 points.   The math is further simplified if we consider one of the points to be directly along the y-axis.   For example, the following figure shows a view directly "downward" along the z-axis.  

 

Figure 17 : View directly downward along the a axis

 

The goal is to locate b,c, and d along the z-axis such that the distance between any pair of points in the set {a,b,c,d} is the same.   After some algebra, it can be shown that the proper height is z = -1/3, at which point the circle in Figure 17 must have radius

 

 

because all points must lie on the unit sphere.  

 

Therefore,

 

 

 

which can be denoted by

 

 

The four corners of the pyramid represented in (a,b,c,d) coordinates are (1,0,0,0) and (0,1,0,0), (0,0,1,0), and (0,0,0,1).   Using the transformation above gives (x,y,z) coordinates for these 4 points

 

 

.

 

And simple calculation shows that the distance between any two points i and j is

 

.

 

 

But note also that the matrix  can be expressed in terms of the matrix from the previous chapter:

 

 

This represents an iterative way to derive the general case.

 

 

3         Extension to an arbitrary number of dimensions

 

In this Section the exact positions of the balls in an arbitrary number of dimensions is determined more rigorously, going back to 2, 3, and 4 dimensions, and then extending to any number of dimensions.

 

3.1      First, a note on scaling, and definitions.

 

The following terms are used below (loosely defined).

 

A shape with P points in P-1 dimensions,  such as a triangle (3 points in 2 dimensions) or a pyramid (4 points in 3 dimension) is called in general[1] a "simplex."

 

If the points are all of distance "1" from the origin, then it is a "unit simplex."

 

If the points are all equally distant from each other, then it is a "regular unit simplex."

 

It is convenient to represent Pascal's figures in terms of a regular unit simplex.  

 

Consider the sum of P terms,  raised to an exponent,

 

 

This produces a Pascal's Simplex that is P-dimensional, including the exponent dimension.   The figure for one Level (i.e., corresponding to a single value of the exponent N )  is a figure in D dimensions, where D = P-1.    

 

The scaling convention used throughout this document is that the D dimensional figure for a single exponent is a "regular unit simplex."    The figure including the exponent dimension is a regular simplex of P = D+1 dimensions, but as will be shown later, it is slightly larger than the P-dimensional regular unit simplex.

 

It would be equally logical to define things the other way around, and have the P-dimensional figure including the exponent axis to lie at multiples of the unit simplex in P-dimensions.  In that case, the figure for one Level would be slightly smaller than the unit D dimensional unit simplex.   But that would change the scaling on all of the equations.   

3.2      Finding the D-dimensional regular unit simplex

 

Now consider the problem of construction a "Pascal's Simplex" for an arbitrary number of terms, representing the coefficients of:

 

 

The first step to finding the points of the complete Pascal's figure can be reduced to the problem of finding the P-1 dimensional (i.e., D dimensional) regular unit simplex, as defined in the previous section.

 

If we can construct the matrix analogous to  and  of the previous chapters,  then the P points in D = P-1 dimensional space which form the D dimensional regular unit simplex scan be found as:

 

 

In the above,  is the P x P identity matrix, and  is a D x P matrix.    The P columns of   define P points in D  dimensional space.   These points are the points of the unit simplex.   They are all at distance 1 from the origin, and are all the same distance from each other.

 

To explain this, first the 2, 3, and 4 dimensional cases are described in more detail, and the pattern to extend this to more dimensions can be more easily seen.  

 

3.3      1-dimensional regular unit simplex for the P =2 case (i.e., 2 points defining a line segment)

 

In the case of , the Pascal's triangle is 2D, and each Row is 1D ( a line, in the direction of the x-axis).  The position along the 1D line for the coefficients of the term  can be found by moving left the number of units of the a exponent, and right the number of units of the b exponent.   In other words, the position on the x-axis is :

 

The two points of the simplex are thus:

 

 

where

 

 

and

 

 

In other words, the two points of the P=2 simplex in 1-D space (a line) are  and  .     The distance between these points is 2.  

 

Note that if we construct a Pascal's Triangle for this case, and want the distance between all the points to be the same, the distance between the rows corresponding to each exponent should be , so that the distance between all points is 2.

 

 

3.4      2 dimensional regular unit simplex for the P = 3 case (i.e. 3 points defining an equilateral triangle)

 

The P=3 simplex is of course an equilateral triangle in the x-y plane.   But consider forming this as described in the following figure:

 

 

Figure 18 : Formation of 2D simplex from 1D simplex

 

We start with the P=2 simplex, which is two points at x = -1 and x = 1.   A new dimension is then added (the y-axis).   The two points at x = -1 and x = +1, are then "pushed down" along the unit circle by a distance of 1/2 along the axis of the new dimension (i.e., pushed down -1/2 on the y axis).   Because we are following the unit circle, the P=2 simplex must "shrink" by .   

 

The coordinates for the three points forming the 2D simplex can be found as

 

 

using the matrix defined in Section 2.2.1 .    In other words, the coordinates of the 3 points on the x and y axis are (0, 1), (-1/2 , ), and (-1/2 , -),  as can be seen from Figure 18.

 

The distance between the three points is now .

 

 

But now notice that

 

 

This pattern can be used repeatedly, as will be shown below

 

3.5      3 dimensional regular unit simplex for the P = 4 case (i.e. 4 points defining a tetrahedron)

 

It was already shown in Section 2.3 that the 3D unit simplex (corresponding one exponent Level in the 4D Pascal's figure) can be found by the following steps:

 

1. Start with the 2D simplex (isosceles triangle from the previous section)

2. Add a new dimension (the z-axis)

3. Position a new point at z = 1, x= 0, y = 0

4. Push down the 2D simplex (isosceles triangle) by -1/3 along the z-axis, which causes it to shrink by in order to keep the points on the unit sphere.

5.  The 4 points thus defined are all equally distant from each other, and that distance is .

 

 

It was further shown that this points can be found by

 

 

where

 

 

 

3.6      Extension to general case

 

At this point, it should be obvious that the P-point simplex in P-1 dimensional space can be found from the (P-1) point simplex by following the same steps as outlined above (again defining D = P-1):

 

Step 1. Start with the P-1 point simplex (figure in P-2 dimensional space)

 

Step 2. Add a new dimension

 

Step 3. Position a new point at 1 on the new axis, 0 on all the other axis.

 

Step 4. "Push down" the previous simplex by -1/(P-1) = -1/D along the newly-defined axis, which causes it to shrink by

 

 

in order to keep the points on the D-dimensional unit sphere.  

 

The DxP matrix  can be found as

 

 

 

Step 5.  The P points forming the unit simplex are then found by:

 

 

 

This matrix  is a D x P matrix, with the P columns defining P points in D-dimensional space.  It  has the property that all the columns are of unit length:

 

 

and that all of the columns are equally distant from each other, i.e., that

 

,

 

where  is a constant indicating the length (the value of which will be demonstrated later)

 

3.6.1.1  Rotation of the simplex

 

The steps outlined above are not the only way to form the regular unit simplex.    as found above is only one possible rotation of the regular unit simplex.    The matrix

 

 

is also regular unit simplex if the matrix  is a "rotation", meaning that all of its columns are of unit length and are mutually orthogonal.   Thus  is just a rotated view of .

 

3.6.2      Table showing certain simplex features as P increases.

 

Filling in the facts that have been derived above for the P = 2, 3, and 4 cases, it is possible to see the pattern, and thus values for a general value of P can be filled in as shown below (again, D= P-1):

 

 

 

P (number of points in simplex)

1

2

3

4

P

 Dimensions

in P-point simplex, and in each Level

0

1

2

3

P-1, also defined as D

Dimensions in full Pascal's figure, including exponent dimension

1

2

3

4

P

Amount to "push down" the previous simplex

n/a

1

1/2

1/3

1 / D

Amount to shrink the previous simplex so that all the points remain on unit circle

n/a

n/a

Distance between points on regular unit simplex

n/a

2 =

Distance between Levels on the exponent axis in the complete Pascal's figure

n/a

 

Table 3 : Table of values pertaining to Pascal's figure for various dimensions

 

The last two rows of this table will be explained later in the text.

 

3.6.3      Derivation of

 

As shown above, the distance  between the P points of the regular unit simplex can be guessed to be

 

simply by recognizing the pattern from P = 2,3,4, etc.   However, this can be algebraically shown also.    Suppose that the distance between the n points of a unit simplex in n-1 dimensional space is:

 

 

Then from the table above, the n+1 points of the n dimensional simplex are formed by shrinking the n-1 dimensional simplex by

 

 

therefore, the distance between points in the new simplex must be

 

 

which reduces to

 

.

 

 

Since this is obviously true for n = 2, or 3, or 4, as demonstrated earlier, then by induction it must be true for all n. 

 

Also, the distance between points on the simplex must be the product of all product shrinking factors, which leads to the relationship:

 

 

or

 

 

 

 

3.6.4      Note on limits as P -> ∞

 

Note that as P increases, the distance between the points asymptotically approaches

 

 

Also the shrinking factor

 

 

 

approaches 1, and the "push down" distance on the new axis

 

 

becomes very near zero.

 

Thus, for very large P, the P+1 point simplex is formed by adding a point at (1, 0, 0, .....0) in the new dimension, and barely "pushing down" and "shrinking" the other dimensions at all.    And the distance between all the points remains about .

 

 

3.7      So finally...how do draw the compete Pascal's figure for arbitrary P.

 

Again, we define D = P - 1 for shorthand.

 

3.7.1      Distance between Levels in the exponent dimension

 

It has been seen previously that when we consider the polynomial

 

,

 

the figure corresponding to any single value of N has P-1 dimensions.   If these are depicted on a single graph for all exponents, then the exponent introduces another dimension, and the entire figure is P dimensions.      

 

The Levels corresponding to each value of N must be located at some distance from each other on the new exponent dimension.   But at what distance?

3.7.1.1  example of P =3

 

For example, we saw in Section 2.2 that for P = 3, the figure for any value of the exponent N is a two-dimensional triangle.  But all of them can be graphed in 3-dimensional space, using the exponent as the "height" between the 2-dimensional layers.

 

It is logical to construct such a 3D pyramid by placing the 2D triangles at a distance on the z-axis such that the distance between all neighboring points of the pyramid is constant, whether they are on the same exponent level or not.   The figure for N=1 is a triangle.   If we define the points of this triangle as being the 3 points of the unit simplex, as described in Section 3.1, then these points are  apart from each other.   

 

Other values of N similarly have all their neighboring points separated by .    So if we want to construct a 3D pyramid by placing these 2D figures for each exponent value in planes along the z-axis,  how far should each triangle be separated on the z-axis so that the distances between neighboring points are all ?   That is, the neighboring points even from adjacent values of N should also be  apart.   This should be recognizable as being the same problem as constructing the P=4 simplex, except that the scale is slightly different (i.e. it is not a unit simplex).   

 

The apex of this 3D pyramid corresponds to the exponent N = 0;  the next level (a triangle of three 1's) corresponds to the exponent N = 1.    With a little algebra it is possible to see that if the two are placed at a distance of on the z-axis, then all four points will be equidistant, and will be  away from each other.  

 

But this is simply the same as the P=4 regular unit simplex drawn bigger by a factor of . 

 

 

3.7.1.2  Generalizing this to P dimensions.

 

With a little algebra, it is possible to show that the generalization of this is that the P-1 dimensional figures should be placed on the exponent axis at intervals of

 

 

to maintain this property, and keep the distance between all neighboring points at

 

 .

 

in the resulting P  dimensional figure.  

 

Consider the P dimensional figure which includes the point  corresponding to exponent N=0 and the P-1 dimensional unit simplex corresponding to exponent N=1.   Such a figure is exactly proportional to the P-dimensional unit simplex;  however it is slightly larger, because the lengths the same as those in the P-1 dimensional unit simplex.   

 

In other words, it is the P-dimensional, P+1 point unit simplex enlarged by a factor of

 

 

where, as always, D = P-1.   This can be viewed as "undoing" the shrinking described as step 4 in Section 3.6

 

 

3.7.2      Now to draw the complete Pascal's figure

 

The P-point (P-1 dimensional) unit simplex derived in Section 3.6 above can be used to map a set of points in P-1 dimensional space that correspond to the "locations" of coefficients for

 

 

in a Pascal's figure.

 

In the case of P=3, the location of coefficients in the x-y plane was diagrammed for some examples in Figure 10 and Figure 11.   This general method has been labeled as "Property 2" previously.   This can be generalized to P non-orthogonal axis in D dimensions.

 

3.7.2.1  How to find any one point on the figure

 

Now suppose we want to find the location in D dimensional space for the coefficient corresponding to the term

 

 

The P points of the D = P-1 dimensional unit simplex define a set of P non-orthogonal axis. According to Property 2, we can move units in the direction of the first non-orthogonal axis, and units in the direction of the second non-orthogonal axis, and so on.    To find this point in terms of  P-1 orthogonal axis, the transformation defined earlier is used:

 

 

 

 

3.7.2.2  How to find the set of all points in the figure for one exponent.

 

The Level corresponding to exponent  consists of the set of points located as in the previous section, for all sets of

 

 

such that

 

.

 

If each column vector satisfying the above is arranged into a P x Q matrix  (where Q will be described later), then the set of points

 

 

defines the entire Pascal's Level for exponent = N.   Each of the vectors in the matrix  is of length D = P-1, describing a point in D dimensional space.

 

3.7.2.3  The entire Pascal's figure for all exponent Levels.

 

The entire Pascal's figure, including all exponents, can be found by placing the P-1 dimensional figures for each N in a P-dimensional space, positioned on the exponent axis at location 

 

 

 

In other words, the values of  defined above are appended to each vector in , making them of length P.

 

 

3.7.2.4  What are the coefficients corresponding to each point?

 

The Pascal's figure for

 

 

consists not only of a set of points in P-1  dimensional space, but also a coefficient value associated with each point, which is the coefficient of the term

 

 

when the polynomial is expanded.

 

Of course the values of these can be found iteratively, by adding neighboring points from the N-1 Level of the Pascal's figure;  that is the primary notable property of "Pascal's Triangle."    However, as P increases beyond 2, the complexity of the figure is such that this is not a practical aid to finding the coefficients.   Fortunately, they are found easily by considering the problem as one of combinatorics.  

 

Consider writing out the N terms of the polynomial

 

.

.

.

 

Then the coefficient for

 

 

is the number of "paths" through this list of N terms that pass through 1 item from each row, and in total pass through the term  times, and through the  term  times, and so on.   The count of different paths that match this criterion is of course the coefficient.   One such path is illustrated below:

 

Figure 19 : The coefficient is the count of matching paths through N rows of terms

 

 The portion of the path shown in the drawing would add two to  because it passes through  twice,  for example.  

 

The number of paths which match this criterion for a particular set of values  can be recognized as the combinatoric

 

 

 

3.7.2.5  How many coefficients add to form a new coefficient?

 

This previous section also provides an explanation for why the coefficients at each point of the Pascal's figure for exponent N are a sum of the coefficients from the "nearest neighbor" points in the Pascal's figure for exponent N-1.

 

Suppose we pick a specific point

 

 

 

satisfying

 

Then the "nearest neighbors" at level N-1 are those points

 

 

for which one and only one exponent is one less than the corresponding exponent in 

 

.

 

In other words,  a "nearest neighbor" is any point for which  =  for one value of i, and  =  for all other values of i. Obviously this implies

 

 

There are as many "nearest neighbor" points as there are non-zero values in the set of exponents , which is at most P.

 

Considering the coefficients as being the number of matching paths through a figure such as Figure 19 explains why the nearest neighbor coefficients from exponent N-1 sum to create a new coefficient for exponent N.

 

3.7.2.6  How many total points are there for a particular N, P?

 

The number can be found iteratively by considering Property 5.

 

If  is the number of distinct points in the Pascal's figure for

 

,

 

then obviously

 

 

And from Property 5 applied to the P=3 case as in Section 2.2.1, it can be seen that

 

 

Generalizing this, it can be seen that

 

,   for N>0

 

which provides at least an iterative way to calculate .

 

 

4         Reference Matlab Files

 

The .zip file below contains  Matlab .m files for generating all of the plots in this document.   The table below provides an index.   These files were generated using Matlab Version 6.5.0.1924 Release 13.

 

File Name

Comment

Scripts

 

mainscr3d.m

Script to draw a rotating picture of 3D Pascal’s figure.   A number of Levels are shown all at the same time.

 

Used for: Figure 2

mainscr4d.m

Script to draw a rotating picture of 4D Pascal’s figure.   A number of Levels are shown all at the same time.

 

Used for:  Figure 6, Figure 16

mainscr3seq.m

Script to draw a 2D picture of the 3D Pascal’s figure by sequencing through the Levels over time.

 

Used for : Figure 4

mainscr4seq.m

Script to draw a 3D picture of the 4D Pascal’s figure by sequencing through the Levels over time.

 

Used for : Figure 5, Figure 7

 

 

Functions

 

calcpt3.m

Given an Exponent value N, calculates the set of (a,b,c) coordinates for the points in the figure depicting (a+b+c)^N

calcpt4.m

Given an Exponent value N, calculates the set of (a,b,c,d) coordinates for the points in the figure depicting (a+b+c+d)^N

threed22d.m

Converts (a,b,c) coordinates to (x,y) coordinates using the matrix  derived in Section 2.2.1.   Also calculates the trinomial coefficients associated with each location, as in Section 3.7.2.4

fourd23d.m

Converts (a,b,c,d) coordinates to (x,y,z) coordinates using the matrix  derived in Section 2.3.  Also calculates the quadranomial coefficients associated with each location, as in Section 3.7.2.4

plotbalz4th.m

Given a set of (x,y,z) coordinates, this plots a set of balls at those locations, with numbers written in the balls.

calclines3.m

Calculates the “lines of addition” between points at two adjacent Levels of the 3D Pascal’s figure, in (x,y,z) coordinates.

calclines4.m

Calculates the “lines of addition” between points at two adjacent Levels of the 4D Pascal’s figure, in (a,b,c,d) coordinates (which can be converted to (x,y,z) coordinates using fourd23d).

plotlines.m

Given a set of lines in (x,y,z) coordinates, this plots the line segments.

donothing.m

Does nothing.  Used for delay between steps while viewing rotating figures.

Table 4 : Index of Matlab .m files

 

Pascal_mfiles_v1.0.zip

 

 



[1] It is only called a "simplex" if the points are generally scattered so that no space of fewer than P-1 dimensions contains all of the points.  For example, 3 points in located on the same line are not a "simplex."