N for 6 is 6*5*4*3*2*1 but what is 6.1 ?

  • Context: Undergrad 
  • Thread starter Thread starter tony873004
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the calculation of factorials for non-integer values, specifically exploring the factorial of 6.1 and its relation to the gamma function. Participants are considering the implementation of this functionality in a computer program, discussing both theoretical and practical aspects of factorials and the gamma function.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant notes that the factorial for 6 is 6*5*4*3*2*1 and questions how to calculate 6.1!, mentioning a calculator output of 868.957.
  • Another participant explains that the factorial can be derived from the gamma function, stating the relationship x! = Γ(x+1) and that factorials are typically for nonnegative integers.
  • A participant shares a link to a website discussing the gamma function and its relation to factorials, indicating that this topic appears frequently in the forum.
  • One participant expresses concern about implementing non-integer factorials in their calculator program, suggesting they might omit the n! function due to complexity.
  • Another participant suggests that creating a table of gamma function values could help in calculating non-integer factorials, mentioning the use of interpolation for accuracy.
  • A participant raises a question about how to handle values between 0 and 1 in their calculations, expressing uncertainty about the reliability of their interpolation routine and considering error handling for non-integer inputs.
  • One participant proposes branching to different subroutines for integer and non-integer values instead of trying to combine them in calculations.

Areas of Agreement / Disagreement

Participants express varying levels of comfort and understanding regarding the implementation of non-integer factorials, with some suggesting methods for calculation while others express uncertainty and concern about complexity. No consensus is reached on the best approach to handle non-integer inputs.

Contextual Notes

Participants discuss the limitations of their calculators and the challenges of implementing non-integer factorial calculations, including the need for error handling and the reliability of interpolation methods. There is also a mention of the specific behavior of the gamma function for values between 0 and 1.

tony873004
Science Advisor
Gold Member
Messages
1,753
Reaction score
143
I know that n! for 6 is 6*5*4*3*2*1 but what is 6.1! ? My calculator says 868.957. How do they come up with this?

I'm trying to write a computer program that mimics the calculator program that comes with windows.

I know that using my above formula that I have to make an exception for 0!=1, and Invalid Input for Function for a negative number.

Anything else I should know about n! ??
 
Mathematics news on Phys.org
The factorial is a special case of the gamma function. The relationship is [itex]x! = \Gamma (x+1)[/itex] and the factorial is usually reserved for nonnegative integers.
 
Thanks for your replies. This forum is great!
That link scared me away. I think I might drop the n! button from my calculator since I can't make it do non-integers and the Windows calculator can.
 
Actually, it's not too hard do. You can create a table of values for the gamma function over the interval (0, 1] from which you can obtain values of [itex]\Gamma (x)[/itex] for larger x values using the fact that [itex]\Gamma (x+1) = x \Gamma(x)[/itex]. If you want greater accuracy you can write a simple interpolation routine.
 
But what would I do with the values between 0 & 1? Add them to the integer's factorial, or multiply them (probably not. I'm guessing they'd be less than 1, and 6.1! > 6!). I'm not sure I could trust my interpolation routine. If I could come up with that I could probably forget the table altogether. I could also make the Calculator generate an error message on non-integer inputs. Do people ever use the n! button? I never have.
 
tony873004 said:
But what would I do with the values between 0 & 1? Add them to the integer's factorial, or multiply them (probably not. I'm guessing they'd be less than 1, and 6.1! > 6!). I'm not sure I could trust my interpolation routine. If I could come up with that I could probably forget the table altogether. I could also make the Calculator generate an error message on non-integer inputs. Do people ever use the n! button? I never have.

No. You would branch to one of two subroutines - one for integer values and one for noninteger values.
 

Similar threads

  • · Replies 59 ·
2
Replies
59
Views
232K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 55 ·
2
Replies
55
Views
8K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K