PTList  =  {1}

PTList  =  
      Table[
If[(i == 1  ||  
              i ==  Length[PTList] + 1), 1, 
          PTList[[i - 1]] + PTList[[i]]], 
{i, 1, 
          Length[PTList] + 1}]

\(PascalsTriangle[
        Depth_]\  := 
Table[\ 
PTList = 
          If[j == 
              1\ , {1}, 
\ \ \ \ \ \ \ \ Table[
	
              If[\((i == 1\  || \ i == \ Length[PTList] + 1)\), 
                1, 
		PTList[\([i - 1]\)] + 
                  PTList[\([i]\)]], 
	{i, 1, 
                Length[PTList] + 1}]], 
\ {j, 1, 
          Depth}]\)

PascalsTriangle[5]

PascalsTriangle[8] // TableForm

H + T

Expand[(H + T)^2]

BinExp = 
        Table[Expand[(H + T)^i], {i, 1, 
            10}];
BinExp // TableForm

Variables[BinExp]

CoefficientList[BinExp, H] /. T -> 1 // 
      TableForm

This notebook created by Dr. Garrett R. Love for the Shodor Education Foundation. Copyright 2001