Probability theory: Uniform distribution

This is part of the course “Probability Theory and Statistics for Programmers”.

Image for post
Image for post
Probability Theory For Programmers

The uniform distribution is one of the simplest distributions. It exists for both discrete and continuous variable. For discrete one it is a distribution whereby a finite number of values are equally likely to be observed. An example of the discrete uniform distribution is throwing a fair dice. The possible values are 1, …, 6, and each time the dice is thrown the probability of a given score is 1/6.

Image for post
Image for post
probability for a discrete random variable with uniform distribution

If all possible values of a continuous random variable inside some interval and all of them have the same probability. Then this variable has the uniform distribution. Since all values of such random variable inside an interval and have the same probabilities we have the probability density function equal to:

Image for post
Image for post
the probability density function for a continuous random variable with uniform distribution

Where a is the start of interval and b is the end.

Let’s take an example. The bus arrives at station one time in 20 minutes. Some passenger came to the station at random time, what the probability that passenger gets on the bus in 5 minutes interval? This time I will show this without code.

Image for post
Image for post
easy as it seems:)

Let’s take a look at the characteristics of the Uniform distribution. The mean and the variance:

Next part ->

Reach the next level of focus and productivity with increaser.org.

Image for post
Image for post
Increaser

Written by

Software engineer, creator of increaser.org. More at geekrodion.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store