Uniform Distribution

Maths: Statistics for machine learning

2 min read

Published Oct 22 2025, updated Oct 23 2025


40
0
0
0

Machine LearningMathsNumPyPandasPythonStatistics

The Uniform Distribution is a probability distribution in which all outcomes are equally likely.


That means:

Every value within a given range has the same probability of occurring.


There are two main types:

  • Discrete Uniform Distribution → finite number of equally likely outcomes (e.g., rolling a fair die)
  • Continuous Uniform Distribution → infinite number of equally likely values within an interval [a,b]


1. Continuous Uniform Distribution

Probability Density Function (PDF)

Continuous Uniform PDF Formula

Where:

  • a = minimum value
  • b = maximum value
  • f(x) = constant height (flat line)

The total area under the curve = 1.


Cumulative Distribution Function (CDF)

Continuous Uniform CDF Formula

The CDF increases linearly from 0 → 1 as x moves from a to b.


Examples

  • Random number between 0 and 1 - Every number equally likely
  • Bus arrival time (if unknown within hour) - Any minute equally likely
  • Random pixel intensity - Equal chance for any grayscale value

Uniform Distribution

  • Left Plot (PDF) → a flat, horizontal line between a=0 and b=10, showing all values are equally likely.
  • Right Plot (CDF) → a straight, diagonal line increasing from 0 to 1, showing cumulative probability grows evenly.

The total area under the PDF = 1
The slope of the CDF = constant (since probability is uniform)






2. Discrete Uniform Distribution

A Discrete Uniform Distribution has a finite set of equally likely outcomes.

Discrete Uniform Formula

Where nnn = number of possible outcomes.


Example

Rolling a fair 6-sided die:

x

1

2

3

4

5

6

P(X=x)

1/6

1/6

1/6

1/6

1/6

1/6


Every outcome is equally likely, just like in the continuous case but with discrete values.







In Machine Learning

  • Random initialisation - Weights or biases initialised from a uniform range
  • Random sampling - Generating random feature subsets or values
  • Monte Carlo simulations - Random uniform sampling for probability estimation
  • Data augmentation - Random transformations drawn from uniform ranges
  • Synthetic data generation - Evenly distributed continuous random values

Products from our shop

Docker Cheat Sheet - Print at Home Designs

Docker Cheat Sheet - Print at Home Designs

Docker Cheat Sheet Mouse Mat

Docker Cheat Sheet Mouse Mat

Docker Cheat Sheet Travel Mug

Docker Cheat Sheet Travel Mug

Docker Cheat Sheet Mug

Docker Cheat Sheet Mug

Vim Cheat Sheet - Print at Home Designs

Vim Cheat Sheet - Print at Home Designs

Vim Cheat Sheet Mouse Mat

Vim Cheat Sheet Mouse Mat

Vim Cheat Sheet Travel Mug

Vim Cheat Sheet Travel Mug

Vim Cheat Sheet Mug

Vim Cheat Sheet Mug

SimpleSteps.guide branded Travel Mug

SimpleSteps.guide branded Travel Mug

Developer Excuse Javascript - Travel Mug

Developer Excuse Javascript - Travel Mug

Developer Excuse Javascript Embroidered T-Shirt - Dark

Developer Excuse Javascript Embroidered T-Shirt - Dark

Developer Excuse Javascript Embroidered T-Shirt - Light

Developer Excuse Javascript Embroidered T-Shirt - Light

Developer Excuse Javascript Mug - White

Developer Excuse Javascript Mug - White

Developer Excuse Javascript Mug - Black

Developer Excuse Javascript Mug - Black

SimpleSteps.guide branded stainless steel water bottle

SimpleSteps.guide branded stainless steel water bottle

Developer Excuse Javascript Hoodie - Light

Developer Excuse Javascript Hoodie - Light

Developer Excuse Javascript Hoodie - Dark

Developer Excuse Javascript Hoodie - Dark

© 2025 SimpleSteps.guide
AboutFAQPoliciesContact