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:
# import sympy from sympy import * x = symbols('x') k = 5print("Value of x = {} and k = {}".format(x, k)) # Use sympy.ff() method ff_x_k = ff(x, k) print("Falling factorial ff(x, k) : {}".format(ff_x_k)) |
chevron_right
filter_none
Output:
Value of x = x and k = 5 Falling factorial ff(x, k) : x*(x - 4)*(x - 3)*(x - 2)*(x - 1)
Example #2:
# import sympy from sympy import * x = 7k = 5print("Value of x = {} and k = {}".format(x, k)) # Use sympy.ff() method ff_x_k = ff(x, k) print("Falling factorial ff(x, k) : {}".format(ff_x_k)) |
chevron_right
filter_none
Output:
Value of x = 7 and k = 5 Falling factorial ff(x, k) : 2520
Recommended Posts:
- class method vs static method in Python
- Difference between Method Overloading and Method Overriding in Python
- Get() method for dictionaries in Python
- Real-Time Edge Detection using OpenCV in Python | Canny edge detection method
- Python Program to detect the edges of an image using OpenCV | Sobel edge detection method
- Line detection in python with OpenCV | Houghline method
- Python | os._exit() method
- Python | os.WEXITSTATUS() method
- Python | os.abort() method
- Python | os.renames() method
- Python | os.lseek() method
- Python calendar module | formatmonth() method
- Python | PyTorch sin() method
- Python | Sympy Line.is_parallel() method
- Python PIL | GaussianBlur() method
- Python | range() method
- Python | Numpy np.hermefit() method
- Python | Numpy np.hermevander() method
- Python String Title method
- Python groupby method to remove all consecutive duplicates
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

