Python | sympy.ff() method
Last Updated :
14 Jul, 2019
With the help of
sympy.ff() method, we can find the
Falling factorial. Falling factorial is defined by –
where
x can be arbitrary expression and
k is an integer.
Syntax: ff(x, k)
Parameter:
x – It denotes any arbitrary expression.
k – It denotes an integer.
Returns: Returns falling factorial corresponding to the given inputs.
Example #1:
from sympy import *
x = symbols( 'x' )
k = 5
print ( "Value of x = {} and k = {}" . format (x, k))
ff_x_k = ff(x, k)
print ( "Falling factorial ff(x, k) : {}" . format (ff_x_k))
|
Output:
Value of x = x and k = 5
Falling factorial ff(x, k) : x*(x - 4)*(x - 3)*(x - 2)*(x - 1)
Example #2:
from sympy import * x = 7
k = 5
print ( "Value of x = {} and k = {}" . format (x, k))
ff_x_k = ff(x, k)
print ( "Falling factorial ff(x, k) : {}" . format (ff_x_k))
|
Output:
Value of x = 7 and k = 5
Falling factorial ff(x, k) : 2520
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...