With the help of sympy.binomial() method, we can find the number of ways to choose k items from a set of n distinct items. It is also often written as nCk, and is pronounced “n choose k”.
Syntax: binomial(N, K)
N – It denotes the number of items to choose from.
K – It denotes the number of items to choose.
Returns: Returns the number of ways to choose K items from a set of N distinct items
N = 4, K = 2 N choose K : 6
N = A, K = B N choose K : binomial(A, B)
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course