VOOZH about

URL: https://www.geeksforgeeks.org/python/sympy-stats-negativemultinomial-function-in-python/

⇱ sympy.stats.NegativeMultinomial() function in Python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

sympy.stats.NegativeMultinomial() function in Python

Last Updated : 18 Aug, 2020

With the help of sympy.stats.NegativeMultinomial() method, we can create a discrete random variable with Negative Multinomial Distribution.

Syntax: sympy.stats.NegativeMultinomial(syms, k, p)

Parameters: 
 syms: the symbol
 k: number of failures before the experiment is stopped, a positive integer
 p: event probabilites, p>= 0 and p<= 1

Returns: a discrete random variable with Negative Multinomial Distribution.

Example #1 :

Output :

 x1 x2 x3 3 
p1 *p2 *p3 *(-p1 - p2 - p3 + 1) *Gamma(x1 + x2 + x3 + 3)
-----------------------------------------------------------
 2*x1!*x2!*x3! 

Example #2 :

Output :

 -x2 -x1 
2 *3 *Gamma(x1 + x2 + x3 + 2)
---------------------------------
 36*x1!*x 
Comment
Article Tags: