The matrix environments are matrix, bmatrix, Bmatrix, pmatrix, vmatrix, Vmatrix, and smallmatrix. Each provides a table for expressions, aligned in rows and columns. The main difference between the various types of matrix is the kind of delimeters that surround them.
Each row of a matrix ends with two backslashes (\\). Each column ends with an ampersand (&).
array environment has a required parameter that gives column specifications. Each column is represented by one letter which says whether the column is left-, center-, or right-aligned. In addition, vertical bars may be included in this specification to render vertical lines in the array.
smallmatrix environment may be used inline so that the flow of text is not completely disrupted.
If horizontal or vertical lines inside the matrix or tighter control over column alignment are needed, the array environment can be used.