ScratchData LogoScratchData
Back to lemonpretzel's profile

factorial approximation

LElemonpretzel•Created April 7, 2011
factorial approximation
5
3
436 views
View on Scratch

Description

Approximates factorials using Stirling's Approximation. http://mathworld.wolfram.com/StirlingsApproximation.html It's faster than traditional methods (n*(n-1)*(n-2)* ... *1). As n in n! gets larger and larger, it gets off by more but the percentage that it's off decreases. The closer n gets to ∞, the more accurate this is. (If you type in 2, then the real thing it gets is 1.9... Scratch just approximates it to 2.) Also, for example, using 7! here you get 5039, even though it's actually 5040. It works better with larger numbers where the factorial is in scientific notation.

Project Details

Project ID1708493
CreatedApril 7, 2011
Last ModifiedApril 7, 2011
SharedApril 7, 2011
Visibilityvisible
CommentsAllowed