[Mathematics]-factorial calculation

Source: Internet
Author: User

Source: http://iask.sina.com.cn/ B /1882074.html

 

1) 0! = 1, 0! = 1! (Reference: http://baike.baidu.com/view/245476.htm#5)
2) negative number without factorial (reference: http://zhidao.baidu.com/question/11523163.html)
3) decimals do not have factorial (in general) (reference: http://baike.baidu.com/view/245476.htm#5)
Customizable: X! = Gamma (X + 1)
3.5! = Gamma (4.5)
= 3.5 Gamma (3.5)
= 3.5*2.5 Gamma (2.5)
= 3.5x2.5*1.5 Gamma (1.5)
= 3.5*2.5*1.5*0.5 * Gamma (0.5)
= 3.5*2.5*1.5*0.5 √ π -------> "√ π "Refers π Root
= (105/16) * √ π -------> Use the score to represent the previous calculation (calculate the root number in the calculator: Select "View-> science", enter the number of the root number, and click "inv" on the left ", click x ^ 2 again)
= 11.631728396567448929144224109426 (the result is calculated from the system calculator)

 

 

Decimal factorialBrief Introduction:(Reference: http://zhidao.baidu.com/question/24646307.html)

The factorial of decimal places is a generalized factorial, which is related to the Gamma function,

Condition Formula
A> 1 A! = A * (A-1 )!
A <1 and a> 0 A! =Gamma(A + 1) =Gamma()

WhileGamma(A) points included in variableGamma(A) = Limit 0 → + ∞ x ^ (A-1) * exp (-x) dx given.
WhileGamma(0.5) exactly equalπThe square rootGamma(1, 0.5) = sqr (π),

So there are 0.5! = 0.5 *Gamma(1, 0.5) = sqr (π)/2

 

There are two ways to directly obtain:
1. You can use a calculator or a computer to calculate 3.5! = 11.631728396567448929144224109426

2. Use formula X! = Gamma (x + 1)

 

C language implementationCode: Http://www.cnblogs.com/hcbin/archive/2010/04/26/1721099.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.