# How to get a list of exponentially distributed points sampled in a range

I want to get 256 points exponentially sampled in a range, and then get its histogram.

If I plot PDF, I get the following:

Plot[Table[PDF[ExponentialDistribution[\[Lambda]], x], {\[Lambda], {10}}] // Evaluate, {x, 0, 0.5}, Filling -> Axis, PlotRange -> All]


But when I try to get a list, I am not sure how to proceed:

list = N[Table[PDF[ExponentialDistribution[1/10], x], {x, 0, 0.5}]] //Sort
Histogram[list]


You could use:

trdist = TruncatedDistribution[{0, 0.04}, ExponentialDistribution];
sample = RandomVariate[trdist, 256];

Histogram[sample, {Subdivide[-0.04, 0.08, 15]}] You can use RandomVariate to generate samples for given distributions.

sample = RandomVariate[ExponentialDistribution[1/10], 10000] ;
Show[Histogram[sample,100,"ProbabilityDensity"],Plot[PDF[ExponentialDistribution[1/10],x],{x,0,50}]]

• I also want to specify the range like 256 exponentially distributed points with decay constant as 10 (or any other number) but ranging between 0 and 30 only. – tabi_k Jul 7 at 7:02
• @tabi_k Maybe with TruncatedDistribution ? – b.gates.you.know.what Jul 7 at 12:04
• TruncatedDistribution[{0, 0.04}, RandomVariate[ExponentialDistribution, 256]] Didn't work @b.gates.you.know.what – tabi_k Jul 8 at 6:02