Friday, September 19, 2025
HomeLanguagessympy.stats.UniformSum() in Python

sympy.stats.UniformSum() in Python

With the help of sympy.stats.UniformSum() method, we can get the continuous random variable which represents the irwin-hall distribution.

Syntax : sympy.stats.UniformSum(name, n)
Where, n is real number.

Return : Return the continuous random variable.

Example #1 :
In this example we can see that by using sympy.stats.UniformSum() method, we are able to get the continuous random variable representing irwin-hall distribution by using this method.




# Import sympy and UniformSum
from sympy.stats import UniformSum, density
from sympy import Symbol, pprint
  
z = Symbol("z")
n = Symbol("n", positive = True)
  
# Using sympy.stats.UniformSum() method
X = UniformSum("x", n)
gfg = density(X)(z)
  
pprint(gfg)


Output :

floor(z)
___
\ `
\ k n – 1 /n\
) (-1) *(-k + z) *| |
/ \k/
/__,
k = 0
——————————–
(n – 1)!

Example #2 :




# Import sympy and UniformSum
from sympy.stats import UniformSum, density
from sympy import Symbol, pprint
  
z = 3
n = 5
  
# Using sympy.stats.UniformSum() method
X = UniformSum("x", n)
gfg = density(X)(z)
  
pprint(gfg)


Output :

3
___
\ `
\ k 4 /5\
) (-1) *(3 – k) *| |
/ \k/
/__,
k = 0
————————
24

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32301 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6665 POSTS0 COMMENTS
Nicole Veronica
11840 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11898 POSTS0 COMMENTS
Shaida Kate Naidoo
6781 POSTS0 COMMENTS
Ted Musemwa
7056 POSTS0 COMMENTS
Thapelo Manthata
6739 POSTS0 COMMENTS
Umr Jansen
6744 POSTS0 COMMENTS