title: Am I calculating the probability correctly with this code within Java?
body: <p>I am trying to calculate the total probability of an investment returning positive after a given number of periods. It's been a while since I've done probability, so I don't really remember it all that well. Am I doing it right? I am getting fairly low numbers.</p>
  
  <pre><code>double totalProbPos = 1;
  for (int i = 0; i &lt; maxPeriods; i++) {
      totalProbPos *= (probPos / 100);
  }
  totalProbPos = round(totalProbPos);
  System.out.println("\nThe probability that your investment will return positive after " + maxPeriods + " periods is: \n    " + totalProbPos + "%.");
  </code></pre>
  
  <p>Where:<code>maxPeriods, probPos</code> are given by the user.</p>