The Museum of HP Calculators

HP Forum Archive 16

 Factorials on the Free42Message #1 Posted by Timespace on 27 Sept 2006, 8:22 p.m. I understand that all(?) or most HP scientific calculators do fractional factorials using the Gamma function. But the Free42, being an emulator of HP42, which is a scientific calculator, will not. Does the original HP42 do fractional Factorials? For example, 6.2! on the HP33S = 1050.3178 Thanks

 Re: Factorials on the Free42Message #2 Posted by Gerson W. Barbosa on 27 Sept 2006, 8:41 p.m.,in response to message #1 by Timespace Quote: For example, 6.2! on the HP33S = 1050.3178 You can get the same result on both the real HP-42S and Free42: `7.2 shift PROB GAM`

 Re: Factorials on the Free42Message #3 Posted by Timespace on 27 Sept 2006, 8:50 p.m.,in response to message #2 by Gerson W. Barbosa Thanks. I was doing the shift PROB N!

 Re: Factorials on the Free42Message #4 Posted by Timespace on 27 Sept 2006, 8:55 p.m.,in response to message #2 by Gerson W. Barbosa No. That is not what I wanted. The 6.2! = 1050.3178 7.2! = 7562.2883

 Re: Factorials on the Free42Message #5 Posted by Gerson W. Barbosa on 27 Sept 2006, 9:13 p.m.,in response to message #4 by Timespace Hello Timespace, This is a few threads below. Anyway, it's been copied and pasted here for your convenience: Quoting from the HP-15C Owner's Handbook: Quote: You can also use x! to calculate the Gamma function, used in advanced mathematics and statistics. Pressing f x! calculates Gamma(x+1), so you must subtract 1 from your initial operand to get Gamma(x). For the Gamma function, x is not restricted to nonnegative integers. I hope this clarifies the matter a bit :-) Regards, Gerson. ------------- P.S.: One possible reason N! on the HP-42S doesn't behave like x! on other calculators is to keep it backwards compatible with the HP-41 it came from. The HP-41 FACT function did not calculate Gamma(x). Edited: 27 Sept 2006, 9:33 p.m.

 Re: Factorials on the Free42Message #6 Posted by Timespace on 27 Sept 2006, 9:33 p.m.,in response to message #5 by Gerson W. Barbosa Thanks. So there is no direct way to calculate fractional factorial on the HP42? You have to use x!=Gamma(x+1) on the HP42.

 Re: Factorials on the Free42Message #7 Posted by Les Wright on 28 Sept 2006, 7:32 a.m.,in response to message #6 by Timespace The Gamma function is the generalization of the familiar natural number factorial to all complex numbers. It actually is correct to write x! for a noninteger--the notation just means Gamma(x+1). The so-called "normalization" of the factorial function so that x! = Gamma(x+1) dates back to Legendre, and no one seems totally clear why. FYI, the HP48 series will compute factorial for all real arguments. HP49G and beyond does so too, but also includes, I think redundantly, Gamma under Special Functions in the Math menu. Les

 Re: Factorials on the Free42Message #8 Posted by Marcus von Cube, Germany on 28 Sept 2006, 8:27 a.m.,in response to message #7 by Les Wright Quote: FYI, the HP48 series will compute factorial for all real arguments. HP49G and beyond does so too, but also includes, I think redundantly, Gamma under Special Functions in the Math menu. There is a difference! The factorial function on the 49 was carried over from the 48 with identical behaviour (and presumably identical code). It works for real arguments only. GAMMA is a new implementation which is defined for complex arguments also. Marcus

 Re: Factorials on the Free42Message #9 Posted by Karl Schneider on 27 Sept 2006, 9:50 p.m.,in response to message #4 by Timespace "Timespace" -- There is no such thing as a "fractional factorial". The Gamma function for non-negative real arguments is a smooth and continuous function that passes through all the discrete points of the factorial function, which is defined only for non-negative integers. By definition, Gamma(x+1) = Integral (0, infinity, txe-tdt), so ```Gamma(1) = 0! = 1 Gamma(2) = 1! = 1 Gamma(3) = 2! = 2 Gamma(4) = 3! = 6 ``` and so forth... I'm not certain what the basis of the definitions are, but I surmise that Gamma(x) is defined such that its first discontinuity as x decreases is at x = 0, instead of at x = -1. This effectively separates the behavior of the gamma function into regions of "positive x" and "negative x". Factorials can be defined recursively such that n! = n*(n-1)! -- or alternatively, (n+1)! = (n+1)*n!. Defining 0! = 1 provides the basis for making the definition functional, and equivalent to n! = n*(n-1)*(n-2)*...*1. Gamma is combined with factorial as x! on menuless or limited-menu models in order to conserve keyboard space. Factorial (n!) is separated from Gamma on the HP-42S because the expansive menus make it feasible. Note: Lower-end and business models, such as the HP-10C, HP-12C, and HP-17B* -- don't provide Gamma. These have only n!. -- KS Edited: 28 Sept 2006, 11:38 p.m.

Go back to the main exhibit hall