title: Bash script for finding binomical coefficient
body: <p>I am trying to generate a function for a binomial coefficient. I'm using nCk=n!/(k!(n-k)!) formula for this.</p>
  <p>My present code is :</p>
  <pre><code>function factorial {
    typeset n=$1
    (( n &lt; 2 )) &amp;&amp; echo 1 &amp;&amp; return
    echo $(( n * $(factorial $((n-1))) ))
  }
  
  function nCk {
    echo $((factorial $1/$(( factorial $2 *factorial $(($1-$2)) ))  ))
  }
  </code></pre>
  <p>But I'm getting errors since I might be messing with the syntax.</p>