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.
from sympy.stats import UniformSum, density
from sympy import Symbol, pprint
z = Symbol( "z" )
n = Symbol( "n" , positive = True )
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 :
from sympy.stats import UniformSum, density
from sympy import Symbol, pprint
z = 3
n = 5
X = UniformSum( "x" , n)
gfg = density(X)(z)
pprint(gfg)
|
Output :
3
___
\ `
\ k 4 /5\
) (-1) *(3 – k) *| |
/ \k/
/__,
k = 0
————————
24
Last Updated :
08 Jun, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...