I have forgotten

• https://me.yahoo.com
COST (GBP)
0.05
0.00
0

# Rising Factorial

Calculates the rising factorial with arguments \e x and \e n.
Controller: CodeCogs

C++

## Rising Factorial

 doublerising_factorial( double x int n )
The rising factorial has the following formula

$[x]^n&space;=&space;\prod_{k&space;=&space;0}^{n&space;-&space;1}&space;(x&space;+&space;k)$

Note that the number of ways of arranging n objects in m ordered boxes is $\inline&space;&space;[m]^n$. (Here, the ordering in each box matters). Thus, 2 objects in 2 boxes have the following 6 possible arrangements:

$-/12&space;\qquad&space;1/2&space;\qquad&space;12/-&space;\qquad&space;-/21&space;\qquad&space;2/1&space;\qquad&space;21/-$

Moreover, the number of non-decreasing maps from a set of n to a set of m ordered elements is $\inline&space;&space;[m]^n&space;/&space;n!$. Thus the set of nondecreasing maps from $\inline&space;&space;(1,2,3)$ to $\inline&space;&space;(a,b,c,d)$ is the 20 elements:

$aaa&space;\quad&space;abb&space;\quad&space;acc&space;\quad&space;add&space;\quad&space;aab&space;\quad&space;abc&space;\quad&space;acd&space;\quad&space;aac&space;\quad&space;abd&space;\quad&space;aad$
$bbb&space;\quad&space;bcc&space;\quad&space;bdd&space;\quad&space;bbc&space;\quad&space;bcd&space;\quad&space;bbd&space;\quad&space;ccc&space;\quad&space;cdd&space;\quad&space;ccd&space;\quad&space;ddd$

## Example:

#include <codecogs/maths/discrete/combinatorics/arithmetic/rising_factorial.h>
#include <iostream>
int main()
{
std::cout << Maths::Combinatorics::Arithmetic::rising_factorial(5, 3) << std::endl;
return 0;
}

## Output:

210

## References:

SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html

### Parameters

 x the first rising factorial argument n the second falling factorial argument

### Returns

the rising factorial of the pair of values x and n

### Authors

Lucian Bentea (August 2005)
##### Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.