Binomial Coefficient in Java
binomial coefficients are the positive integers that occur as coefficients in the binomial theorem. Commonly, a binomial coefficient is indexed by a pair of integers n ≥ k ≥ 0 and is written is the coefficient of the xk term in the polynomial expansion of the binomial power (1 + x)n; this coefficient can be computed by the multiplicative formula.
formula : n!/k!(n-k)!
For example, (x+y)3=1⋅x3+3⋅x2y+3⋅xy2+1⋅y3, and the coefficients 1, 3, 3, 1 form row three of Pascal’s Triangle. For this reason the numbers (nk) are usually referred to as the binomial coefficients.
#programming
#java
#shorts
Comments are closed.