Saturday, July 25, 2026
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

3 COMMENTS

Most Popular

Dominic
32520 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6903 POSTS0 COMMENTS
Nicole Veronica
12017 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12115 POSTS0 COMMENTS
Shaida Kate Naidoo
7023 POSTS0 COMMENTS
Ted Musemwa
7265 POSTS0 COMMENTS
Thapelo Manthata
6980 POSTS0 COMMENTS
Umr Jansen
6972 POSTS0 COMMENTS