etony33
etony33
  • Threads: 5
  • Posts: 23
Joined: Feb 2, 2014
February 3rd, 2014 at 10:11:04 AM permalink
The gamma function is simple for positive integers. But with any other number, it gets confusing. I tried looking it up, but don't understand what exactly to do. What would, for example, 2.5! be?
paisiello
paisiello
  • Threads: 21
  • Posts: 546
Joined: Oct 30, 2011
February 3rd, 2014 at 1:02:11 PM permalink
Well there are a few definitions given in the wiki article to find out what the number is:

1) there's the integral formula which might be evaluated either explicitly or numerically (I have forgotten how to do this)
2) there's Stirling's formula which can you give you an approximation of gamma(2.5) =gamma(1.5+1) = 1.258
3) there's the infinite series product formula which you could do in excel; after about 5,000 multiplications I get gamma(2.5)=1.329
4) excel also has a built-in function called gammaln which gives you the log of gamma; so I just took exp(gammaln(2.5)) = 1.32934
5) lastly Wolfram has an evaluator which gives gamma(2.5) = 1.32934 but can give you precision to an arbitrary number of digits

Not sure what numerical method excel or Wolfram are using to arrive at their number but they seem consistent.
etony33
etony33
  • Threads: 5
  • Posts: 23
Joined: Feb 2, 2014
February 3rd, 2014 at 5:42:43 PM permalink
From what I've gathered,
.5!=.5√π
Therefore,
1.5!=1.5*5!=1.5*.5√π
and,
2.5!=2.5*1.5!=2.5*1.5*.5√π=1.875√π

So, any half factorials are exceptionally easy for that reason. But, for example, 3.3! would be more difficult. I mean, it'd be
3.3*2.3*1.3*.3!

But how do I figure out what .3! is?
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6271
Joined: Jun 22, 2011
February 3rd, 2014 at 6:14:39 PM permalink
Quote: etony33

From what I've gathered, .5!=.5√π


That's how I remember it - "one factorial is one, and one-half factorial is one-half the square root of pi".

Quote: etony33

But how do I figure out what .3! is?


It's gamma of 1.3 - which is the integral for x from 0 to infinity of (x(1.3 - 1) / ex) dx.

There's no easy way of reducing that; you need to use a numeric approximation method.
kubikulann
kubikulann
  • Threads: 27
  • Posts: 905
Joined: Jun 28, 2011
February 4th, 2014 at 2:07:25 AM permalink
Quote: etony33

But how do I figure out what .3! is?

You don't. There is no analytical expression (this is why they create notations like ! or gamma or pi or e). Look it up in a table or run it on a software, you have the numerical value.
Reperiet qui quaesiverit
MangoJ
MangoJ
  • Threads: 10
  • Posts: 905
Joined: Mar 12, 2011
February 4th, 2014 at 2:06:46 PM permalink
Who ever is interested in the numerical value of some function, when it comes to math ?
thecesspit
thecesspit
  • Threads: 53
  • Posts: 5936
Joined: Apr 19, 2010
February 4th, 2014 at 2:48:50 PM permalink
Quote: kubikulann

You don't. There is no analytical expression (this is why they create notations like ! or gamma or pi or e). Look it up in a table or run it on a software, you have the numerical value.



How does the software or those tables come up with those values then?
"Then you can admire the real gambler, who has neither eaten, slept, thought nor lived, he has so smarted under the scourge of his martingale, so suffered on the rack of his desire for a coup at trente-et-quarante" - Honore de Balzac, 1829
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6271
Joined: Jun 22, 2011
February 4th, 2014 at 4:59:01 PM permalink
Quote: thecesspit

How does the software or those tables come up with those values then?


There are various ways to approximate integrals. For example, Simpson's Rule.
pacomartin
pacomartin
  • Threads: 649
  • Posts: 7895
Joined: Jan 14, 2010
February 4th, 2014 at 9:18:44 PM permalink
Quote: etony33

The gamma function is simple for positive integers. But with any other number, it gets confusing. I tried looking it up, but don't understand what exactly to do. What would, for example, 2.5! be?



Fact(n)=Fact(n-1)
Gamma(n) = Fact(n-1)
Gamma(x) = Gamma(x-1)

Fact(0)=1
Gamma(t) for 0<t<1 is defined by


A function does not have to be algebraic, but it is must be well defined and produce one value for every input. As someone said earlier, there are numerous ways to approximate integrals. A spreadsheet will supply good numerical approximations.
kewlj
kewlj
  • Threads: 216
  • Posts: 4635
Joined: Apr 17, 2012
February 4th, 2014 at 9:32:34 PM permalink
My Gamma's function was just to be the sweetest most loving, Gamma ever. :-)
24Bingo
24Bingo
  • Threads: 23
  • Posts: 1348
Joined: Jul 4, 2012
February 5th, 2014 at 8:01:09 PM permalink
Quote: pacomartin

Fact(n)=Fact(n-1)
Gamma(n) = Fact(n-1)
Gamma(x) = Gamma(x-1)

Fact(0)=1
Gamma(t) for 0<t<1 is defined by


A function does not have to be algebraic, but it is must be well defined and produce one value for every input. As someone said earlier, there are numerous ways to approximate integrals. A spreadsheet will supply good numerical approximations.



Not quite right.

A: I'm sure this is just a typo, but Fact(n) = n*Fact(n-1) and Gamma(x) = (x-1)*Gamma(x-1)... of course, or the factorials would just be 1, 1, 1, 1, 1, etc.
B: That integral actually converges (and is the answer) for any real number greater than or equal to 1 (and in fact, not for 0 < t < 1, where it blows up around the y-axis), or complex number with a real part greater than or equal to 1. It can be extended to negative non-integers as you say (including complex numbers with whole negative real parts, starting at 1 + bi).
The trick to poker is learning not to beat yourself up for your mistakes too much, and certainly not too little, but just the right amount.
24Bingo
24Bingo
  • Threads: 23
  • Posts: 1348
Joined: Jul 4, 2012
February 7th, 2014 at 11:13:31 PM permalink
Also, I should probably put in a word on how to numerically integrate without the help of a computer (or at least without that of a prewritten program; you're probably going to want a computer, for reasons that will shortly become obvious). For an improper integral, you're going to want to come up with a number s, to be the width of each interval, work out the maximum and the minimum value of the function in each interval ks through (k+1)s, and take the infinite sum of each to get your upper and lower bounds. This function will be strictly increasing between a minimum at 0 and a maximum at (t-1), and strictly decreasing thereafter, so it makes sense to make s a whole fraction of (t-1), so that it will be simply a matter of endpoints.

That leaves the problem of the infinite sum. This can be worked out by setting a finite interval - call it 0 through a - in which to explicitly work out the sum, and designating the rest the "tail." a should be greater than t-1, so that we get to use the left endpoints of the tail as the maxima and the right endpoints as the minima. That way, for the upper bound, we're simply adding s*Σ((a + ns)t-1*e-(a+ns)) from n = 0 to ∞, and the lower bound is as easy as subtracting the first term, or would be except for one issue: as far as I know, there's no closed form for that sum. However, it can be said that it'll be strictly less than e-a*at-1*Σ(e*(1+s/a)1-t)-ns, and strictly more than e-a*at-1*Σe-ns. So what we get for the tail - let's call it z - is that s*e-a*at-1/(1 - (1+s/a)st-s/e-s)) > z > s*ea*at-1*(1/(1-e-s) - 1).

So to answer your question, how would you work out 2.5! (although it's more proper to write Π(2.5)), which is equal to Γ(3.5)? We'll set the step length at 1/2, and the length of the interval to be directly calculated at 10, which won't produce a great answer, but it'll serve to illustrate (and to illustrate why you really shouldn't try to do this by hand).

For the finite part, we get:
f(0) ≈ 0
f(0.5) ≈ 0.10722
f(1) = 1/e ≈ 0.36788
f(1.5) ≈ 0.61487
f(2) ≈ 0.76557
f(2.5) ≈ 0.81117
f(3) ≈ 0.77610
f(3.5) ≈ 0.69205
f(4) ≈ 0.58610
f(4.5) ≈ 0.47721
f(5) ≈ 0.37666
f(5.5) ≈ 0.28993
f(6) ≈ 0.21858
f(6.5) ≈ 0.16195
f(7) ≈ 0.11822
f(7.5) ≈ 0.085201
f(8) ≈ 0.060725
f(8.5) ≈ 0.042859
f(9) ≈ 0.029989
f(9.5) ≈ 0.020821
f(10) ≈ 0.014356

So we add this up, and for the interval, get an upper bound of 3.70714 and a lower bound of 2.90315. (Yikes!) Then we work out the tail by the formula above and get 0.020202 > z > 0.011065, so the answer is somewhere between 2.914 and 3.727. There are more sophisticated methods the computers use, but I'm working a bit off the cuff here; with enough computing power, you could, by increasing a and decreasing s, write a program to work it out to arbitrary precision by this method.

(If this post contains any errors - and I know I made and fixed a rather ludicrous sign error in that second paragraph - I blame my old frenemy Wild Turkey. Wolfram gives the answer as 3.32335, so at least I'm not catastrophically wrong.)
The trick to poker is learning not to beat yourself up for your mistakes too much, and certainly not too little, but just the right amount.
  • Jump to: