sympy.stats.FiniteRV() function in Python Last Updated : 01 Jun, 2020 Comments Improve Suggest changes Like Article Like Report With the help of sympy.stats.FiniteRV() method, we can create a random variable gives a dictionary of density by using sympy.stats.FiniteRV() method. Syntax : sympy.stats.FiniteRV(name, dict) Return : Return the variable having dictionary of density. Example #1 : In this example, we can see that by using sympy.stats.FiniteRV() method, we are able to create the random variable which denotes the dictionary of densities by using this method. Python3 1=1 # Import sympy and FiniteRV from sympy.stats import FiniteRV, P, E # Using sympy.stats.FiniteRV() method density = {0: .1, 1: .2, 2: .3, 3: .4} X = FiniteRV('X', density) print(E(X)) gfg = P(X > 2) print(gfg) Output : 2.00000000000000 0.40000000000000 Example #2 : Python3 1=1 # Import sympy and FiniteRV from sympy.stats import FiniteRV, P, E # Using sympy.stats.FiniteRV() method density = {0: .11, 1: .20, 2: .13, 3: .4, 4: 0.16} X = FiniteRV('X', density) print(E(X)) gfg = P(X >= 3) print(gfg) Output : 2.30000000000000 0.56000000000000 Comment More infoAdvertise with us Next Article sympy.stats.FiniteRV() function in Python J jitender_1998 Follow Improve Article Tags : Python Python SymPy-Stats Practice Tags : python Similar Reads sympy.stats.Die() function in Python With the help of sympy.stats.Die() method, we can get the fair die having number of faces given by the parameter and having name defined in the parameter itself by using sympy.stats.Die() method. Syntax : sympy.stats.Die(name, faces) Return : Return a fair die having 'n' faces. Example #1 : In this 1 min read sympy.stats.Binomial() function in Python With the help of sympy.stats.Binomial() method, we can create a Finite Random Variable representing a binomial distribution. A binomial distribution is the probability of a SUCCESS or FAILURE outcome in an experiment or survey that is repeated multiple times. Syntax: sympy.stats.Binomial(name, n, p 1 min read sympy.stats.FDistribution() in python With the help of sympy.stats.FDistribution() method, we can get the continuous random variable representing the F distribution. Syntax : sympy.stats.FDistribution(name, d1, d2) Where, d1 and d2 denotes the degree of freedom. Return : Return continuous random variable. Example #1 : In this example we 1 min read sympy.stats.variance() function in Python In mathematics, the variance is the way to check the difference between the actual value and any random input, i.e variance can be calculated as a squared difference of these two values. With the help of sympy.stats.variance() method, we can calculate the value of variance by using this method. Synt 1 min read sympy.stats.Frechet() in python With the help of sympy.stats.Frechet() method, we can get the continuous random variable representing the frechet distribution. Syntax : sympy.stats.Frechet(name, a, s=1, m=0) Where, a, s and m denotes the real number. Return : Return continuous random variable. Example #1 : In this example we can s 2 min read Like