Pascal's triangle style

Without PSTricks or TikZ.

\documentclass[preview,border=12pt]{standalone}

\usepackage{array}
\begin{document}
\begin{tabular}{>{$n=}l<{$\hspace{12pt}}*{13}{c}}
0 &&&&&&&1&&&&&&\\
1 &&&&&&1&&1&&&&&\\
2 &&&&&1&&2&&1&&&&\\
3 &&&&1&&3&&3&&1&&&\\
4 &&&1&&4&&6&&4&&1&&\\
5 &&1&&5&&10&&10&&5&&1&\\
6 &1&&6&&15&&20&&15&&6&&1
\end{tabular}
\end{document}

enter image description here

Suggestion

\documentclass[preview,border=12pt]{standalone}
\usepackage{array}

\begin{document}
Let $A$ be a set of $k$ elements and $B\subseteq A$ has $i$ elements.
\begin{center}
\begin{tabular}{>{$}l<{$}|*{7}{c}}
\multicolumn{1}{l}{$k$} &&&&&&&\\\cline{1-1} 
0 &1&&&&&&\\
1 &1&1&&&&&\\
2 &1&2&1&&&&\\
3 &1&3&3&1&&&\\
4 &1&4&6&4&1&&\\
5 &1&5&10&10&5&1&\\
6 &1&6&15&20&15&6&1\\\hline
\multicolumn{1}{l}{} &0&1&2&3&4&5&6\\\cline{2-8}
\multicolumn{1}{l}{} &\multicolumn{7}{c}{$i$}
\end{tabular}
\end{center}
\end{document}

enter image description here


This creates the image using two stacks. The only trick here is that \x represents the gap between two 1-digit entries, \y the gap between a 1-digit and a 2-digit entry, and \z the gap between two 2-digit entries.

\documentclass{article}
\usepackage[usestackEOL]{stackengine}[2013-10-15]
\def\x{\hspace{3ex}}    %BETWEEN TWO 1-DIGIT NUMBERS
\def\y{\hspace{2.45ex}}  %BETWEEN 1 AND 2 DIGIT NUMBERS
\def\z{\hspace{1.9ex}}    %BETWEEN TWO 2-DIGIT NUMBERS
\stackMath
\begin{document}
\Longstack[l]{
n=0\\
n=1\\
n=2\\
n=3\\
n=4\\
n=5\\
n=6\qquad\ \\
}
\Longstack{
1\\
1\x 1\\
1\x 2\x 1\\
1\x 3\x 3\x 1\\
1\x 4\x 6\x 4\x 1\\
1\x 5\y 10\z 10\y 5\x 1\\
1\x 6\y 15\z 20\z 15\y 6\x 1\\
\overline{0\x 1\x 2\x 3\x 4\x 5\x 6}
}
\end{document}

enter image description here

Furthermore, adding a [l] optional argument to the last \Longstack changes the appearance to the following:

enter image description here

Tags:

Tikz Pgf