Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Continuous Uniform Distribution | Commonly Used Continuous Distributions
Probability Theory Basics
course content

Contenido del Curso

Probability Theory Basics

Probability Theory Basics

1. Basic Concepts of Probability Theory
2. Probability of Complex Events
3. Commonly Used Discrete Distributions
4. Commonly Used Continuous Distributions
5. Covariance and Correlation

bookContinuous Uniform Distribution

Continuous distribution describes the stochastic experiment with infinite possible outcomes.

Continuous uniform distribution

Continuous uniform distribution describes an experiment where all outcomes within the interval have an equal probability of occurring.
If the variable is uniformly distributed, we can use a geometrical approach to calculate probabilities.

Example

Consider a line segment of length 10 units. What is the probability of randomly selecting a point on the line segment such that the distance from the starting point to this point is between 3 and 7 units?

As a result, the position or the point is uniformly distributed on the line with length 10.
We can simply divide the length of the desired interval by the whole length of the segment.
We can also use the .cdf() method on the scipy.stats.uniform class to calculate the corresponding probability:

12345678910111213141516
from scipy.stats import uniform # Parameters of an experiment whole_length = 10 range_start = 3 range_end = 7 # Geometrical approach desired_length = range_end - range_start geom_proba = desired_length / whole_length print(f'Geometrical probability is {geom_proba:.4f}') # Using `.cdf()` method upper_cdf = uniform.cdf(range_end, loc=0, scale=whole_length) lower_cdf = uniform.cdf(range_start, loc=0, scale=whole_length) cdf_proba = upper_cdf - lower_cdf print(f'Probability using .cdf() is {cdf_proba:.4f}')
copy

The first parameter of the .cdf() method determines the point at which we calculate probability; loc parameter determines the beginning of the segment, and scale determines the length of the segment.

The .cdf() method calculates the probability that an experiment's result falls into a certain interval: .cdf(interval_end) - .cdf(interval_start).
We will consider this method in more detail in Probability Theory Mastering course.

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 1
some-alt