Git Product home page Git Product logo

dsc-uniform-distribution-online-ds-sp-000's Introduction

The Uniform Distribution

Introduction

Now that you've been introduced to both discrete (Binomial) and continuous (Normal) distributions, and know how to perform a simple test, let's move on with some more distributions. The uniform distribution is a special one, as there is a discrete as well as a continuous version of this distribution!

Objectives

You will be able to:

  • Define a uniform distribution
  • Calculate mean and variance of uniform distribution

Uniform Distribution

The Uniform Distribution describes an event where every possible outcome is equally likely. No single outcome carries any more or less probability of happening than any other possible outcome. The Uniform Distribution can be discrete or continuous.

The Discrete Uniform Distribution

You've seen an example of a Discrete Uniform Distribution before: rolling a 6-sided dice. This idea can be extended to an $n$-sided dice. No matter how many sides the dice has, with a fair dice, you'd be equally likely to roll every side.

If $a$ is the smallest number and $b$ is the biggest number that can be observed (for a fair dice, $a=1$, $b=6$)

Probability Mass Function:

$$p(x) = \dfrac{1}{(b โˆ’ a+1)}\text{ when } a \leq x \leq b, \text{and} $$ $$p(x) = 0\text{ when }x \notin ]a, b[ $$

Uniform Distribution Mean:

$$E(X)= \frac{a + b}{2}$$

Uniform Distribution Variance:

$$Var(X) = \sqrt{\frac{(b-a)(b-a+2)}{12}}$$

The Continuous Uniform Distribution

An example of a Continuous Uniform distributed variable would be the waiting time for an elevator that could be on any floor in the building when you call it and can take between 0 and 40 seconds to arrive at your floor. Since the elevator is equally likely to be at any given floor, you can assume every amount of time between 0 and 40 seconds before the elevator arrives (decimals and fractions allowed, to an infinite amount of precision). The formulas for a continuous uniform distribution diverge slightly!

Probability Density Function:

$$f(x) = \dfrac{1}{(b โˆ’ a)}\text{ when } a \leq x < b, \text{and} $$ $$f(x) = 0\text{ when }x \notin [a, b] $$

Uniform Distribution Mean:

$$E(X)= \frac{a + b}{2}$$

Uniform Distribution Variance:

$$Var(X) = \frac{(b - a)^2}{12}$$

NOTE: If you're confused why there is a 12 in the denominator of the formula of the variance for a Uniform Distribution, you're not alone. The short answer is that it involves calculus. As a data scientist, you don't need to understand the derivation of this formula and where this 12 comes from. However, if you're interested, this Quora answer gives an excellent explanation!

Summary

In this lesson, you learned about the uniform distribution, its applications, and the equations used to compute the mean and variance of a uniformly distributed random variable.

dsc-uniform-distribution-online-ds-sp-000's People

Contributors

loredirick avatar lmcm18 avatar mas16 avatar mike-kane avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.