Sunday, December 7, 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

2 COMMENTS

Most Popular

Dominic
32429 POSTS0 COMMENTS
Milvus
103 POSTS0 COMMENTS
Nango Kala
6803 POSTS0 COMMENTS
Nicole Veronica
11945 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12015 POSTS0 COMMENTS
Shaida Kate Naidoo
6934 POSTS0 COMMENTS
Ted Musemwa
7189 POSTS0 COMMENTS
Thapelo Manthata
6883 POSTS0 COMMENTS
Umr Jansen
6869 POSTS0 COMMENTS