19-02-2011, 21:57
Although I've not formally studied maths since it was part of my physics course at university a very long time ago, I still retained an interest in all things mathematical.
I was searching the internet recently for something to help with some software I was writing which required a factorial function and found this unusual formula which I had never seen before
Surprisingly it gives a pretty accurate value for factorial n
where n! = 1 x 2 x 3 x 4 x ........... x (n-2) x (n-1) x n
BTW factorial 0 is defined to be 1
factorial 0 is 1 .......... formula error is approx +0.02 ...... 2%
factorial 1 is 1 .......... formula error is approx -0.004 ..... 0.4%
factorial 2 is 2 .......... formula error is approx -0.003 ..... 0.15%
factorial 3 is 6 .......... formula error is approx -0.003 ..... 0.05%
factorial 4 is 24 ......... formula error is approx -0.009 ..... 0.04%
etc
I'm fairly certain the formula accuracy improves as the numbers get bigger.
In the above formula, e is the mathematical constant which is approx 2.7183
I was searching the internet recently for something to help with some software I was writing which required a factorial function and found this unusual formula which I had never seen before
Surprisingly it gives a pretty accurate value for factorial n
where n! = 1 x 2 x 3 x 4 x ........... x (n-2) x (n-1) x n
BTW factorial 0 is defined to be 1
factorial 0 is 1 .......... formula error is approx +0.02 ...... 2%
factorial 1 is 1 .......... formula error is approx -0.004 ..... 0.4%
factorial 2 is 2 .......... formula error is approx -0.003 ..... 0.15%
factorial 3 is 6 .......... formula error is approx -0.003 ..... 0.05%
factorial 4 is 24 ......... formula error is approx -0.009 ..... 0.04%
etc
I'm fairly certain the formula accuracy improves as the numbers get bigger.
In the above formula, e is the mathematical constant which is approx 2.7183