Exponential Distribution

📈 Exponential Distribution in Python

The Exponential Distribution models the time between independent events that occur at a constant rate.
It is closely related to the Poisson Distribution, which models the number of events in a fixed interval.


1. Characteristics of Exponential Distribution

  • Continuous distribution

  • Parameter: scale = 1/λ (λ = event rate)

  • Probability Density Function (PDF):

f(x)=1scalee−x/scalefor x≥0f(x) = \frac{1}{\text{scale}} e^{-x/\text{scale}} \quad \text{for } x \ge 0

  • Mean = scale

  • Standard Deviation = scale

Applications:

  • Time between customer arrivals

  • Lifespan of electronic components

  • Waiting times in queues


 2. Generate Exponential Data Using NumPy


 

Output (example):

[0.34, 1.12, 3.45, 0.56, 4.23, 0.89, 2.34, 1.67, 0.45, 0.78]
  • Values ≥ 0

  • Skewed distribution


 3. Visualize Exponential Distribution


 

  • Histogram is right-skewed

  • KDE shows the smooth probability density


 4. Change Scale Parameter


 

  • Smaller scale → more concentrated near 0

  • Larger scale → more spread out


 5. Mean and Standard Deviation


  • Both should approximately equal the scale parameter


🧠 Summary Table

FunctionParametersDescription
np.random.exponential()scale, sizeGenerate exponential random numbers
scaleMean / 1/λAverage time between events
sizeNumber of samplesOutput array size

🎯 Practice Exercises

  1. Simulate waiting times between calls with scale=3 for 1000 samples.

  2. Compare distributions with scale=1, 2, 5 in one plot.

  3. Compute mean and standard deviation of generated data and compare with scale.

You may also like...