Wednesday, July 3, 2024
HomeLanguagesPythonSympy stats.WignerSemicircle() in Python

Sympy stats.WignerSemicircle() in Python

With the help of sympy.stats.WignerSemicircle() method, we can get the continuous random variable which represents the Wigner Semicircle distribution.

Syntax : sympy.stats.WignerSemicircle(name, R)
Where, R is real number.
Return : Return the continuous random variable.

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




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


Output :

_________
/ 2 2
2*\/ r – z
————–
2
pi*r

Example #2 :




# Import sympy and WignerSemicircle
from sympy.stats import WignerSemicircle, density
from sympy import Symbol, pprint
  
z = 0.87
r = 2
  
# Using sympy.stats.WignerSemicircle() method
X = WignerSemicircle("x", r)
gfg = density(X)(z)
  
pprint(gfg)


Output :

0.900430452616969
—————–
pi

Thapelo Manthata
I’m a desktop support specialist transitioning into a SharePoint developer role by day and Software Engineering student by night. My superpowers include customer service, coding, the Microsoft office 365 suite including SharePoint and power platform.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments