title: Different results on same expression
body: <p>I have the following code snippets sum <code>s</code> which i have written in two ways. Both the expressions although are same, giving me two different answers. The output is coming to be negative where it is supposed to come in a positive value. Please tell me why it is happening and how to rectify it.</p>
  
  <pre><code>n &lt;- 40
  k &lt;- 20
  m &lt;- 30
  T &lt;- 1.2
  t1 &lt;- 3
  </code></pre>
  
  <p>(1) The first way of expressing the sum</p>
  
  <pre><code>s &lt;- 0
  
  for (j in 0:(m-1)) {
    a &lt;- choose(m-1, j)*(-1)^j*(1/(n-m+1+j))*(1-exp(-T*(n-m+1+j)*(1/t1)))
    s &lt;- s + a
  }
  
  s &lt;- s * m*choose(n, m)
  </code></pre>
  
  <p>(2) The second way of expressing the same sum is</p>
  
  <pre><code>s &lt;- 0
  
  for (j in 0:(m-1)) {
    a &lt;- choose(m-1, j)*(-1)^j*(1/(n-m+1+j))*(1-exp(-T*(n-m+1+j)*(1/t1)))*m*choose(n, m)
    s &lt;- s + a
  }
  </code></pre>