I don't understand at all how you tell the computer to evaluate a complicated factorial expression such as the one given in in the infinite sum of binomial theorem as(adsbygoogle = window.adsbygoogle || []).push({});

Ʃ [n! / k!(n-k)! ] * x^k

where n is the final value of the sum and k is where you are in the loop.

It's supposed to be

INTEGER :: k, n

REAL :: sum, fact, x

ASK INPUT (what are x and n?)

DO k = 0,n

sum = sum + fact*x**k

fact = fact * (n-k)/(k+1)

END DO

Is there a procedure to figure out what the term multiplied by the fact variable should be?

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Fortran Factorials

**Physics Forums | Science Articles, Homework Help, Discussion**