- #1
Goatsenator
- 20
- 0
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
Ʃ [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?
Ʃ [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?