# Pascal's pyramid

In mathematics, Pascal's pyramid is a three-dimensional arrangement of the trinomial numbers, which are the coefficients of the trinomial expansion and the trinomial distribution. Pascal's Pyramid is the three-dimensional analog of the two-dimensional Pascal's triangle, which contains the binomial numbers and relates to the binomial expansion and the binomial distribution. The binomial and trinomial numbers, coefficients, expansions, and distributions are subsets of the multinomial constructs with the same names. Pascal's Pyramid is more precisely called "Pascal's tetrahedron", since it has four triangular surfaces. (The pyramids of ancient Egypt had five surfaces: a square base and four triangular sides.)

## Structure of the tetrahedron

Because the tetrahedron is a three-dimensional object it is difficult to display it on a piece of paper or a computer screen. Assume the tetrahedron is divided into a number of levels, or floors, or slices, or layers. The top layer (the apex) is labeled "Layer 0". Other layers can be thought of as overhead views of the Tetrahedron with the previous layers removed. The first six layers are as follows:

Layer 0
1

Layer 1
1       1
1

Layer 2
1       2       1
2       2
1

Layer 3
1       3       3       1
3       6       3
3       3
1

Layer 4
1       4       6       4       1
4      12     12      4
6      12      6
4       4
1

Layer 5
1       5      10     10      5       1
5      20     30     20      5
10     30     30     10
10     20     10
5       5
1

The layers of the Tetrahedron have been deliberately displayed with the point down so that the Tetrahedron is not confused with Pascal's triangle.

## Overview of the tetrahedron

• There is three-way symmetry of the numbers in each layer.
• The number of terms in the nth Layer is the nth triangular number: (n + 1) × (n + 2) / 2.
• The sum of the values of the numbers in the nth Layer is 3n.
• Each number in any layer is the sum of the three adjacent numbers in the layer above.
• Each number in any layer is a simple whole number ratio of the adjacent numbers in the same layer.
• Each number in any layer is a coefficient of the Trinomial Distribution and the trinomial expansion. This non-linear arrangement makes it easier to:
• display the trinomial expansion in a coherent way;
• compute the coefficients of the Trinomial Distribution;
• calculate the numbers of any Tetrahedron layer.
• The numbers along the three edges of the nth Layer are the numbers of the nth Line of Pascal's triangle. And almost all the properties listed above have parallels with Pascal's triangle and Multinomial Coefficients.

## Trinomial expansion connection

The numbers of the Tetrahedron are derived from trinomial expansion. The nth Layer is the detached coefficient matrix (no variables or exponents) of a trinomial expression (e.g.: A + B + C) raised to the nth power. The trinomial is expanded by repeatedly multiplying the trinomial by itself:

(A + B + C)1 × (A + B + C)n = (A + B + C)n+1

Each term in the first expression is multiplied by each term in the second expression; and then the coefficients of like terms (same variables and exponents) are added together. Here is the expansion of (A + B + C)4:

1A4B0C0 + 4A3B0C1 + 6A2B0C2 + 4A1B0C3 + 1A0B0C4 +
4A3B1C0 + 12A2B1C1 + 12A1B1C2 + 4A0B1C3 +
6A2B2C0 + 12A1B2C1 + 6A0B2C2 +
4A1B3C0 + 4A0B3C1 +
1A0B4C0

Writing the expansion in this non-linear way shows the expansion in a more understandable way. It also makes the connection with the Tetrahedron obvious−the coefficients here match those of Layer 4. All the implicit coefficients, variables, and exponents, which are normally not written, are also shown to illustrate another relationship with the Tetrahedron. (Usually, "1A" is "A"; "B1" is "B"; and "C0" is "1"; etc.) The exponents of each term sum to the Layer number (n), or 4, in this case. More significantly, the value of the coefficients of each term can be computed directly from the exponents. The formula is: (x + y + z)! / (x! × y! × z!), where x, y, z are the exponents of A, B, C, respectively, and "!" means factorial (e.g.: n! = 1 × 2 ×...× n). The exponent formulas for the 4th Layer are:

$\textstyle {(4+0+0)!\over 4!\times 0!\times 0!} \ {(3+0+1)!\over 3!\times 0!\times 1!} \ {(2+0+2)!\over 2!\times 0!\times 2!} \ {(1+0+3)!\over 1!\times 0!\times 3!} \ {(0+0+4)!\over 0!\times 0!\times 4!}$

$\textstyle {(3+1+0)!\over 3!\times 1!\times 0!} \ {(2+1+1)!\over 2!\times 1!\times 1!} \ {(1+1+2)!\over 1!\times 1!\times 2!} \ {(0+1+3)!\over 0!\times 1!\times 3!}$

$\textstyle {(2+2+0)!\over 2!\times 2!\times 0!} \ {(1+2+1)!\over 1!\times 2!\times 1!} \ {(0+2+2)!\over 0!\times 2!\times 2!}$

$\textstyle {(1+3+0)!\over 1!\times 3!\times 0!} \ {(0+3+1)!\over 0!\times 3!\times 1!}$

$\textstyle {(0+4+0)!\over 0!\times 4!\times 0!}$

The exponents of each expansion term can be clearly seen and these formulae simplify to the expansion coefficients and the Tetrahedron coefficients of Layer 4.

## Trinomial distribution connection

The numbers of the Tetrahedron can also be found in the Trinomial Distribution. This is a discrete probability distribution used to determine the chance some combination of events occurs given three possible outcomes−the number of ways the events could occur is multiplied by the probabilities that they would occur. The formula for the Trinomial Distribution is:

[ n! / ( x! × y! × z!) ] × [ (PA)x × (PB)y × (PC)z]

where x, y, z are the number of times each of the three outcomes does occur; n is the number of trials and equals the sum of x+y+z; and PA, PB, PC are the probabilities that each of the three events could occur.

For example, in a three-way election, the candidates got these votes: A, 16%; B, 30%; C, 54%. What is the chance that a randomly selected four-person focus group would contain the following voters: 1 for A, 1 for B, 2 for C? The answer is:

[ 4! / ( 1! × 1! × 2!) ] × [ (16%)1 × (30%)1 × (54%)2] = 12 × 0.0140 = 17%

The number 12 is the coefficient of this probability and it is number of combinations that can fill this "112" focus group. There are 15 different arrangements of four-person focus groups that can be selected. Expressions for all 15 of these coefficients are:

$\textstyle {4!\over 4!\times 0!\times 0!} \ {4!\over 3!\times 0!\times 1!} \ {4!\over 2!\times 0!\times 2!} \ {4!\over 1!\times 0!\times 3!} \ {4!\over 0!\times 0!\times 4!}$

$\textstyle {4!\over 3!\times 1!\times 0!} \ {4!\over 2!\times 1!\times 1!} \ {4!\over 1!\times 1!\times 2!} \ {4!\over 0!\times 1!\times 3!}$

$\textstyle {4!\over 2!\times 2!\times 0!} \ {4!\over 1!\times 2!\times 1!} \ {4!\over 0!\times 2!\times 2!}$

$\textstyle {4!\over 1!\times 3!\times 0!} \ {4!\over 0!\times 3!\times 1!}$

$\textstyle {4!\over 0!\times 4!\times 0!}$

The numerator of these fractions (above the line) is the same for all expressions. It is the sample size−a four-person group−and indicates that the coefficients of these arrangements can be found on Layer 4 of the Tetrahedron. The three numbers of the denominator (below the line) are the number of the focus group members that voted for A, B, C, respectively.

Shorthand is normally used to express combinatorial functions in the following "choose" format (which is read as "4 choose 4, 0, 0", etc.).

$\textstyle {4\choose 4,0,0} \ {4\choose 3,0,1} \ {4\choose 2,0,2} \ {4\choose 1,0,3} \ {4\choose 0,0,4}$

$\textstyle {4\choose 3,1,0} \ {4\choose 2,1,1} \ {4\choose 1,1,2} \ {4\choose 0,1,3}$

$\textstyle {4\choose 2,2,0} \ {4\choose 1,2,1} \ {4\choose 0,2,2}$

$\textstyle {4\choose 1,3,0} \ {4\choose 0,3,1}$

$\textstyle {4\choose 0,4,0}$

But the value of these expression is still equal to the coefficients of the 4th Layer of the Tetrahedron. And they can be generalized to any Layer by changing the sample size (n).

This notation makes an easy way to express the sum of all the coefficients of Layer n:

$\textstyle \sum_{x,y,z} {n \choose x,y,z}$ = 3n.

## Addition of coefficients between layers

The numbers on every layer (n) of the Tetrahedron are the sum of the three adjacent numbers in the layer (n−1) "above" it. This relationship is rather difficult to see without intermingling the layers. Below are italic Layer 3 numbers interleaved among bold Layer 4 numbers:

1         4         6         4           1
1         3         3         1
4        12       12        4
3         6         3
6        12        6
3         3
4         4
1
1

The relationship is illustrated by the lower, central number 12 of the 4th Layer. It is "surrounded" by three numbers of the 3rd Layer: 6 to the "north", 3 to the "southwest", 3 to the "southeast". (The numbers along the edge have only two adjacent numbers in the layer "above" and the three corner numbers have only one adjacent number in the layer above, which is why they are always "1". The missing numbers can be assumed as "0", so there is no loss of generality.) This relationship between adjacent layers is not a magical coincidence. Rather, it comes about through the two-step trinomial expansion process.

Continuing with this example, in Step 1, each term of (A + B + C)3 is multiplied by each term of (A + B + C)1. Only three of these multiplications are of interest in this example:

 Layer 3 term Multiply by Product term 6A1B1C1 1B1 6A1B2C1 3A1B2C0 1C1 3A1B2C1 3A0B2C1 1A1 3A1B2C1

(The multiplication of like variables causes the addition of exponents; e.g.: D1 × D2 = D3.)

Then, in Step 2, the summation of like terms (same variables and exponents) results in: 12A1B2C1, which is the term of (A + B + C)4; while 12 is the coefficient of the 4th Layer of the Tetrahedron.

Symbolically, the additive relation can be expressed as:

C(x,y,z) = C(x−1,y,z) + C(x,y−1,z) + C(x,y,z−1)

where C(x,y,z) is the coefficient of the term with exponents x, y, z and x+y+z = n is the layer of the Tetrahedron.

This relationship will work only if the trinomial expansion is laid out in the non-linear fashion as it is portrayed in the section on the "trinomial expansion connection".

## Ratio between coefficients of same layer

On each layer of the Tetrahedron, the numbers are simple whole number ratios of the adjacent numbers. This relationship is illustrated for horizontally adjacent pairs on the 4th Layer by the following:

1   <1:4>   4   <2:3>   6   <3:2>   4   <4:1>   1
4   <1:3>   12   <2:2>   12   <3:1>   4
6   <1:2>   12   <2:1>   6
4   <1:1>   4
1

Because the tetrahedron has three-way symmetry, the ratio relation also holds for diagonal pairs (in both directions), as well as for the horizontal pairs shown.

The ratios are controlled by the exponents of the corresponding adjacent terms of the trinomial expansion. For example, one ratio in the illustration above is:

4   <1:3>   12

The corresponding terms of the trinomial expansion are:

4A3B1C0 and 12A2B1C1

The following rules apply to the coefficients of all adjacent pairs of terms of the trinomial expansion:

• The exponent of one of the variables remains unchanged (B in this case) and can be ignored.
• For the other two variables, one exponent increases by 1 and one exponent decreases by 1.
• The exponents of A are 3 and 2 (the larger being in the left term).
• The exponents of C are 0 and 1 (the larger being in the right term).
• The coefficients and larger exponents are related:
• 4 × 3 = 12 × 1
• 4 / 12 = 1 / 3
• These equations yield the ratio: "1:3".

The rules are the same for all horizontal and diagonal pairs. The variables A, B, C will change.

This ratio relationship provides another (somewhat cumbersome) way to calculate tetrahedron coefficients:

The coefficient of the adjacent term equals the coefficient of the current term multiplied by the current-term exponent of the decreasing variable divided by the adjacent-term exponent of the increasing variable.

The ratio of the adjacent coefficients may be a little clearer when expressed symbolically. Each term can have up to six adjacent terms:

For x = 0:     C(x,y,z−1) = C(x,y−1,z) × z / y     C(x,y−1,z) = C(x,y,z−1) × y / z
For y = 0:     C(x−1,y,z) = C(x,y,z−1) × x / z     C(x,y,z−1) = C(x−1,y,z) × z / x
For z = 0:     C(x,y−1,z) = C(x−1,y,z) × y / x     C(x−1,y,z) = C(x,y−1,z) × x / y

where C(x,y,z) is the coefficient and x, y, z are the exponents. In the days before pocket calculators and personal computers, this approach was used as a school-boy short-cut to write out Binomial Expansions without tedious algebraic expansions or clumsy factorial computations.

This relationship will work only if the trinomial expansion is laid out in the non-linear fashion as it is portrayed in the section on the "trinomial expansion connection".

## Relationship with Pascal's triangle

It is well known that the numbers along the three outside edges of the nth Layer of the tetrahedron are the same numbers as the nth Line of Pascal's triangle. However, the connection is actually much more extensive than just one row of numbers. This relationship is best illustrated by comparing Pascal's triangle down to Line 4 with Layer 4 of the tetrahedron.

Pascal's triangle
1
1       1
1       2       1
1       3       3       1
1       4       6       4       1

Tetrahedron Layer 4
1       4       6       4       1
4      12     12      4
6      12      6
4       4
1

Multiplying the numbers of each line of Pascal's triangle down to the nth Line by the numbers of the nth Line generates the nth Layer of the Tetrahedron. In the following example, the lines of Pascal's triangle are in italic font and the rows of the tetrahedron are in bold font.

1
× 1 =
1

1       1
× 4 =
4       4

1       2       1
× 6 =
6      12      6

1       3       3       1
× 4 =
4      12     12      4

1       4       6       4       1
× 1 =
1       4       6       4       1

The multipliers (1 4 6 4 1) compose Line 4 of Pascal's triangle.

This relationship demonstrates the fastest and easiest way to compute the numbers for any layer of the Tetrahedron without computing factorials, which quickly become huge numbers. (Extended precision calculators become very slow beyond Tetrahedron Layer 200.)

If the coefficients of Pascal's triangle are labeled C(i,j) and the coefficients of the Tetrahedron are labeled C(n,i,j), where n is the layer of the Tetrahedron, i is the row, and j is the column, then the relation can be expressed symbolically as:

C(i,j) × C(n,j) = C(n,i,j)     i = 0 to n, j = 0 to i

[It is important to understand that i, j, n are not exponents here, just sequential labeling indexes.]

## Parallels to Pascal's triangle and Multinomial Coefficients

This table summarizes the properties of the trinomial expansion and the trinomial distribution, and it compares them to the binomial and multinomial expansions and distributions:

 Type of polynomial bi-nomial tri-nomial multi-nomial Order of polynomial 2 3 m Example of polynomial A+B A+B+C A+B+C+...+M Geometric structure (1) triangle tetrahedron m-simplex Element structure line layer group Symmetry of element 2-way 3-way m-way Number of terms per element n+1 (n+1) × (n+2) / 2 (n+1) × (n+2) ×...× (n+m−1) / (m−1) Sum of values per element 2n 3n mn Example of term AxBy AxByCz AxByCz...Mm Sum of exponents, all terms n n n Coefficient equation (2) n! / (x! × y!) n! / (x! × y! × z!) n! / (x1! × x2! × x3! ×...× xm!) Sum of coefficients "above" 2 3 m Ratio of adjacent coefficients 2 6 m × (m−1)

(1) A simplex is the simplest linear geometric form that exists in any dimension. Tetrahedrons and triangles are examples in 3 and 2 dimensions, respectively.
(2) The formula for the binomial coefficient is usually expressed as: n! / (x! × (n−x)!); where n−x = y.

## Other properties

### Exponentional construction

Arbitrary layer n can be obtained in a single step using the following formula:

$\left(b^{d\left(n+1\right)}+b^d+1\right)^n,$

where b is the radix and d is the number of digits of any of the central multinomial coefficients, that is

$\textstyle d=1+\left\lfloor\log_b{n\choose k_1,k_2,k_3}\right\rfloor,\ \sum_{i=1}^3{k_i} = n,\ \left\lfloor\frac{n}{3}\right\rfloor \le k_i \le \left\lceil\frac{n}{3}\right\rceil,$

then wrapping the digits of its result by d(n+1), spacing by d and removing leading zeros.

This method generalised to arbitrary dimension can be used to obtain slices of any Pascal's simplex.

#### Examples

For radix b = 10, n = 5, d = 2:

$\textstyle\left(10^{12} + 10^2 + 1\right)^5$
= 10000000001015
= 1000000000505000000102010000010303010000520302005010510100501

1                     1                     1
000000000505     00 00 00 00 05 05     .. .. .. .. .5 .5
000000102010     00 00 00 10 20 10     .. .. .. 10 20 10
~  000010303010  ~  00 00 10 30 30 10  ~  .. .. 10 30 30 10
000520302005     00 05 20 30 20 05     .. .5 20 30 20 .5
010510100501     01 05 10 10 05 01     .1 .5 10 10 .5 .1

wrapped by d(n+1)     spaced by d      leading zeros removed


For radix b = 10, n = 20, d = 9:

$\textstyle\left(10^{189} + 10^9 + 1\right)^{20}$
Pascal's pyramid layer #20.

### Sum of coefficients of a layer by rows

Summing the numbers in each row of a layer n of Pascal's pyramid gives

$\left(b^d + 2\right)^n,$

where b is the radix and d is the number of digits of the sum of the 'central' row (the one with the greatest sum).

 1 ~ 1    \ 1  ~ 1      \ 1   ~ 1          \ 1    ~  1               \ 1     ~  1
---      1 \ 1 ~ 2   \ 2 \ 2  ~ 4       \ 3 \ 3   ~ 06            \ 4 \ 4    ~ 08
1       -----      1 \ 2 \ 1 ~ 4    \ 3 \ 6 \ 3  ~ 12         \ 6 \12 \ 6   ~ 24
1   2      ---------       1 \ 3 \ 3 \ 1 ~ 08      \ 4 \12 \12 \ 4  ~ 32
1   4   4       -------------          1 \ 4 \ 6 \ 4 \ 1 ~ 16
1  06  12  08         ------------------
1  08  24  32  16

120       121          122               1023                     1024


### Sum of coefficients of a layer by columns

Summing the numbers in each column of a layer n of Pascal's pyramid gives

$\left(b^{2d} + b^d + 1\right)^n,$

where b is the radix and d is the number of digits of the sum of the 'central' column (the one with the greatest sum).

 1     |1|       |1|            |1|                     | 1|                              | 1|
---   1| |1    |2| |2|        |3| |3|                | 4|  | 4|                        | 5|  | 5|
1    -----   1| |2| |1     |3| |6| |3|           | 6|  |12|  | 6|                  |10|  |20|  |10|
1 1 1   ---------    1| |3| |3| |1       | 4|  |12|  |12|  | 4|            |10|  |30|  |30|  |10|
1 2 3 2 1    -------------      1|  | 4|  | 6|  | 4|  | 1       | 5|  |20|  |30|  |20|  | 5|
1 3 6 7 6 3 1     --------------------------      1|  | 5|  |10|  |10|  | 5|  | 1
1 04 10 16 19 16 10 04 01     --------------------------------
1 05 15 30 45 51 45 30 15 05 01

1110   1111      1112           1113                    101014                             101015


## Usage

While studying genetics, it's common to use the Pascal's pyramid to find out the proportion between different genotypes on the same crossing. This is done by checking the line that is equivalent to the number of phenotypes (genotypes + 1). That line will be the proportion.[more detail needed]