Factorial
Definition
Factorial is the result of multiplying a sequence of descending natural numbers (such as 4 × 3 × 2 × 1)
The Factorial symbol is "!".
4! is usually pronounced "4 factorial", but some people even say "4 shriek" or "4 bang".
Example
4! = 4 × 3 × 2 × 1 = 24
7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5040
1! = 1
Calculating From the Previous Value
We can easily calculate a factorial from the previous one:
n | n! | ||
---|---|---|---|
1 | 1 | 1 | 1 |
2 | 2 × 1 | = 2 × 1! | = 2 |
3 | 3 × 2 × 1 | = 3 × 2! | = 6 |
4 | 4 × 3 × 2 × 1 | = 4 × 3! | = 24 |
5 | 5 × 4 × 3 × 2 × 1 | = 5 × 4! | = 120 |
6 | etc. | etc. | etc. |
Reference & Resources
- http://www.mathsisfun.com/numbers/factorial.html
Latest Post
- Dependency injection
- Directives and Pipes
- Data binding
- HTTP Get vs. Post
- Node.js is everywhere
- MongoDB root user
- Combine JavaScript and CSS
- Inline Small JavaScript and CSS
- Minify JavaScript and CSS
- Defer Parsing of JavaScript
- Prefer Async Script Loading
- Components, Bootstrap and DOM
- What is HEAD in git?
- Show the changes in Git.
- What is AngularJS 2?
- Confidence Interval for a Population Mean
- Accuracy vs. Precision
- Sampling Distribution
- Working with the Normal Distribution
- Standardized score - Z score
- Percentile
- Evaluating the Normal Distribution
- What is Nodejs? Advantages and disadvantage?
- How do I debug Nodejs applications?
- Sync directory search using fs.readdirSync