# How to generate an element from laplace distribution

Hi, I am wondering how to generate a random element according to laplace distribution. I tried the method RealDistribution(). But it failed.

According to the reference manual, laplace distribution is not supported. http://www.sagemath.org/doc/reference...

In the manual, there are some examples showing how to deal with uniform distribution, Gaussian distribution, etc.

My questions are:

(1) How do I know exactly which distributions are supported by the RealDistribution() method?

(2) Is there anyway I can simply generate an element according to laplace distribution in sage?

Thank you in advance.

I found a way to do this by using numpy in sage. http://docs.scipy.org/doc/numpy/refer...

import numpy numpy.random.laplace(loc,scal,size)

will generate an element for laplace distribution. But it is not a very "sage" way to do it. And I am still concerned about my first question.