<?xml version="1.0" encoding="windows-1252"?>
<node id="84150" title="Binomial Golf" created="2001-05-30 02:46:44" updated="2005-08-13 00:45:50">
<type id="120">
perlmeditation</type>
<author id="80749">
tachyon</author>
<data>
<field name="doctext">
The other day the topic of the binomial distribution came up. The binomial distribution is a part of probability theory and looks like this:
&lt;code&gt;
                            1
                          1   1
                        1   2   1
                      1   3   3   1
                    1   4   6   4   1
                  1   5   10  10  5   1
                1   6   15  20  15  6   1
              1   7   21  35  35  21  7   1
            1   8   28  56  70  56  28  8   1
          1   9   36  84  126 126 84  36  9   1
&lt;/code&gt;
&lt;p&gt;I thought writing a sub to generate this would be easy.....
&lt;p&gt;So here is another hole. Rules:
&lt;p&gt;(1) sub accepts one arg which corresponds to the number of levels to print; 
&lt;p&gt;(2) sub prints it out
&lt;p&gt;(3) formating like this is OK
&lt;code&gt;
1
1 1
1 2 1
1 3 3 1      &lt;- this is level 4
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
1 10 45 120 210 252 210 120 45 10 1
&lt;/code&gt;
&lt;p&gt;(4) how about we use strict, just for something different
&lt;p&gt;I have &amp;lt;70 chars, can you do better? I'll post mine in 2 days
&lt;p&gt;tachyon</field>
</data>
</node>
