Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Discrete Uniform Distribution | Discrete Distributions
Probability Theory

Svep för att visa menyn

book
Discrete Uniform Distribution

Let's talk about discrete distributions.

What is it?

Discrete distribution is a distribution that has a finite number of possible outcomes.

To dive deeper into this definition, it is better to look at the first example, uniform distribution.

To work with this distribution, we should import the uniform object from scipy.stats, and then we can apply numerous functions to this distribution.

Key characteristics:

Each outcome is equally likely to happen.

Example:

When we roll a dice, it is always an equal probability for each event. As we remember from this chapter, the probability is a fraction where the amount of the desired outcome is the numerator and the amount of all outcomes is the denominator.

distribution

Some theory:

Mean of the distribution, also called the expected value, defines the sample's average value. Standard deviation expresses how much the random value from the sample differs from the mean.

There is no point in talking about mean and standard deviation here; the reason is that all outcomes are equally likely to happen. There are no deviations or outliers. By the way, we even can not make a prediction based on uniform distribution.

We are not going to work with this distribution a lot because we will deal with the distributions that have more predictive power.

But we must get acquainted with it! Try to build a random sample of the uniform distribution. We can do it with the uniform object from scipy.stats, the syntax is uniform.rvs(size), where we should define the size.

Uppgift

Swipe to start coding

Try to build the uniform distribution following this algorithm:

  1. Import seaborn library with sns alias.
  2. Import uniform object from scipy.stats.
  3. Import matplotlib.pyplot with plt alias.
  4. Create uniform distribution with the size 20000.
  5. Create the histplot from Seaborn based on uniform distribution.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 4. Kapitel 1

Fråga AI

expand
ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

book
Discrete Uniform Distribution

Let's talk about discrete distributions.

What is it?

Discrete distribution is a distribution that has a finite number of possible outcomes.

To dive deeper into this definition, it is better to look at the first example, uniform distribution.

To work with this distribution, we should import the uniform object from scipy.stats, and then we can apply numerous functions to this distribution.

Key characteristics:

Each outcome is equally likely to happen.

Example:

When we roll a dice, it is always an equal probability for each event. As we remember from this chapter, the probability is a fraction where the amount of the desired outcome is the numerator and the amount of all outcomes is the denominator.

distribution

Some theory:

Mean of the distribution, also called the expected value, defines the sample's average value. Standard deviation expresses how much the random value from the sample differs from the mean.

There is no point in talking about mean and standard deviation here; the reason is that all outcomes are equally likely to happen. There are no deviations or outliers. By the way, we even can not make a prediction based on uniform distribution.

We are not going to work with this distribution a lot because we will deal with the distributions that have more predictive power.

But we must get acquainted with it! Try to build a random sample of the uniform distribution. We can do it with the uniform object from scipy.stats, the syntax is uniform.rvs(size), where we should define the size.

Uppgift

Swipe to start coding

Try to build the uniform distribution following this algorithm:

  1. Import seaborn library with sns alias.
  2. Import uniform object from scipy.stats.
  3. Import matplotlib.pyplot with plt alias.
  4. Create uniform distribution with the size 20000.
  5. Create the histplot from Seaborn based on uniform distribution.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 4. Kapitel 1
Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Vi beklagar att något gick fel. Vad hände?
some-alt