Uniform distribution along the segment. Uniform probability distribution

The distribution function in this case, according to (5.7), will take the form:

where: m – mathematical expectation, s – standard deviation.

The normal distribution is also called Gaussian after the German mathematician Gauss. The fact that a random variable has a normal distribution with parameters: m, is denoted as follows: N (m,s), where: m =a =M ;

Quite often in formulas, the mathematical expectation is denoted by A . If a random variable is distributed according to the law N(0,1), then it is called a normalized or standardized normal variable. The distribution function for it has the form:

.

The density graph of a normal distribution, which is called a normal curve or Gaussian curve, is shown in Fig. 5.4.

Rice. 5.4. Normal distribution density

The determination of the numerical characteristics of a random variable by its density is considered using an example.

Example 6.

A continuous random variable is specified by the distribution density: .

Determine the type of distribution, find the mathematical expectation M(X) and variance D(X).

Comparing the given distribution density with (5.16), we can conclude that the normal distribution law with m = 4 is given. Therefore, mathematical expectation M(X)=4, variance D(X)=9.

Standard deviation s=3.

The Laplace function, which has the form:

,

is related to the normal distribution function (5.17), the relation:

F 0 (x) = Ф(x) + 0.5.

The Laplace function is odd.

Ф(-x)=-Ф(x).

The values ​​of the Laplace function Ф(х) are tabulated and taken from the table according to the value of x (see Appendix 1).

The normal distribution of a continuous random variable plays an important role in probability theory and in describing reality; it is very widespread in random natural phenomena. In practice, very often we encounter random variables that are formed precisely as a result of the summation of many random terms. In particular, an analysis of measurement errors shows that they are the sum of various types of errors. Practice shows that the probability distribution of measurement errors is close to the normal law.

Using the Laplace function, you can solve the problem of calculating the probability of falling into a given interval and a given deviation of a normal random variable.

As mentioned earlier, examples of probability distributions continuous random variable X are:

  • uniform probability distribution of a continuous random variable;
  • exponential probability distribution of a continuous random variable;
  • normal distribution probabilities of a continuous random variable.

Let us give the concept of uniform and exponential distribution laws, probability formulas and numerical characteristics of the functions under consideration.

IndexUniform distribution lawExponential distribution law
Definition Called uniform probability distribution of a continuous random variable X, the density of which remains constant on the segment and has the form Exponential is called probability distribution of a continuous random variable X, which is described by a density having the form

where λ is a constant positive value
Distribution function
Probability falling into the interval
Expected value
Dispersion
Standard deviation

Examples of solving problems on the topic “Uniform and exponential distribution laws”

Task 1.

Buses run strictly on schedule. Movement interval 7 min. Find: a) the probability that a passenger arriving at a stop will wait less than two minutes for the next bus; b) the probability that a passenger arriving at a stop will wait at least three minutes for the next bus; c) mathematical expectation and standard deviation of the random variable X - passenger waiting time.

Solution. 1. According to the conditions of the problem, a continuous random variable X = (passenger waiting time) evenly distributed between the arrivals of two buses. The length of the distribution interval of the random variable X is equal to b-a=7, where a=0, b=7.

2. The waiting time will be less than two minutes if the random variable X falls into the interval (5;7). We find the probability of falling into a given interval using the formula:<Х<х 2)=(х 2 -х 1)/(b-a) .
P(x 1< Х < 7) = (7-5)/(7-0) = 2/7 ≈ 0,286.

P(5 We find the probability of falling into a given interval using the formula:<Х<х 2)=(х 2 -х 1)/(b-a) .
3. The waiting time will be at least three minutes (i.e., from three to seven minutes) if the random variable X falls into the interval (0;4). We find the probability of falling into a given interval using the formula:< Х < 4) = (4-0)/(7-0) = 4/7 ≈ 0,571.

P(0 4. The mathematical expectation of a continuous, uniformly distributed random variable X – the passenger’s waiting time – will be found using the formula: M(X)=(a+b)/2

. M(X) = (0+7)/2 = 7/2 = 3.5. 5. The standard deviation of a continuous, uniformly distributed random variable X – the passenger’s waiting time – will be found using the formula:σ(X)=√D=(b-a)/2√3

. σ(X)=(7-0)/2√3=7/2√3≈2.02.

The exponential distribution is given for x ≥ 0 by the density f(x) = 5e – 5x. Required: a) write down an expression for the distribution function; b) find the probability that as a result of the test X falls into the interval (1;4); c) find the probability that as a result of the test X ≥ 2; d) calculate M(X), D(X), σ(X).

Solution. 1. Since the condition is given exponential distribution , then from the formula for the probability distribution density of the random variable X we obtain λ = 5. Then the distribution function will have the form:

2. The probability that as a result of the test X falls into the interval (1;4) will be found by the formula:
P(a< X < b) = e −λa − e −λb .
P(1< X < 4) = e −5*1 − e −5*4 = e −5 − e −20 .

3. The probability that as a result of the test X ≥ 2 will be found by the formula: P(a< X < b) = e −λa − e −λb при a=2, b=∞.
P(X≥2) = P(1< X < 4) = e −λ*2 − e −λ*∞ = e −2λ − e −∞ = e −2λ - 0 = e −10 (т.к. предел e −х при х стремящемся к ∞ равен нулю).

4. Find for the exponential distribution:

  • mathematical expectation according to the formula M(X) = 1/λ = 1/5 = 0.2;
  • variance according to the formula D(X) = 1/ λ 2 = 1/25 = 0.04;
  • standard deviation according to the formula σ(X) = 1/λ = 1/5 = 1.2.

With the help of which many real processes are simulated. And the most common example is the public transport schedule. Suppose that a certain bus (trolleybus/tram) runs every 10 minutes, and you come to a stop at a random moment in time. What is the probability that the bus will arrive within 1 minute? Obviously 1/10th. What is the likelihood that you will have to wait 4-5 minutes? Same . What is the probability that you will have to wait for a bus for more than 9 minutes? One tenth!

Let's consider some finite interval, let for definiteness it be a segment. If random value has constant probability distribution density on a given segment and zero density outside it, then they say that it is distributed evenly. In this case, the density function will be strictly defined:

Indeed, if the length of the segment (see drawing) is , then the value is inevitably equal - so that the unit area of ​​the rectangle is obtained, and it is observed known property:


Let's check it formally:
, etc. From a probabilistic point of view, this means that the random variable reliably will take one of the values ​​of the segment..., eh, I’m slowly becoming a boring old man =)

The essence of uniformity is that whatever internal gap fixed length we haven't considered (remember the “bus” minutes)– the probability that a random variable will take a value from this interval will be the same. In the drawing I have shaded three such probabilities - once again I emphasize that they are determined by areas, not function values!

Let's consider a typical task:

Example 1

A continuous random variable is specified by its distribution density:

Find the constant, calculate and compose the distribution function. Build graphs. Find

In other words, everything you could dream of :)

Solution: since on the interval (finite interval) , then the random variable has a uniform distribution, and the value of “ce” can be found using the direct formula . But it’s better in a general way - using a property:

...why is it better? So that there are no unnecessary questions;)

So the density function is:

Let's do the drawing. Values impossible , and therefore bold dots are placed below:


As a quick check, let's calculate the area of ​​the rectangle:
, etc.

Let's find expected value, and you can probably already guess what it is equal to. Remember the “10-minute” bus: if randomly approaching the stop for many, many days, then average you will have to wait for him for 5 minutes.

Yes, that’s right - the expectation should be exactly in the middle of the “event” interval:
, as expected.

Let's calculate the variance using formula . And here you need an eye and an eye when calculating the integral:

Thus, dispersion:

Let's compose distribution function . Nothing new here:

1) if , then and ;

2) if , then and:

3) and finally, when , That's why:

As a result:

Let's make the drawing:


On the “live” interval, the distribution function growing linear, and this is another sign that we have a uniformly distributed random variable. Well, of course, after all derivative linear function- there is a constant.

The required probability can be calculated in two ways, using the found distribution function:

or using a certain integral of density:

Whoever likes it.

And here you can also write answer: ,
, the graphs are plotted along the solution path.

... “it’s possible” because there is usually no punishment for its absence. Usually;)

There are special formulas for calculating a uniform random variable, which I suggest you derive yourself:

Example 2

A continuous random variable is given by density .

Calculate the mathematical expectation and variance. Simplify the results as much as possible (abbreviated multiplication formulas to help).

The resulting formulas are convenient to use for checking; in particular, check the problem you just solved by substituting specific values ​​of “a” and “b” into them. Brief solution at the bottom of the page.

And at the end of the lesson, we will look at a couple of “text” problems:

Example 3

The scale division value of the measuring device is 0.2. Instrument readings are rounded to the nearest whole division. Assuming that the rounding errors are distributed uniformly, find the probability that at the next measurement it will not exceed 0.04.

For better understanding solutions Let's imagine that this is some kind of mechanical device with an arrow, for example, a scale with a division value of 0.2 kg, and we have to weigh a pig in a poke. But not in order to find out his fatness - now it will be important WHERE the arrow stops between two adjacent divisions.

Let's consider a random variable - distance arrows from nearest left division. Or from the closest one to the right, it doesn’t matter.

Let's compose the probability density function:

1) Since the distance cannot be negative, then on the interval . Logical.

2) From the condition it follows that the arrow of the scales with equal probability can stop anywhere between divisions * , including the divisions themselves, and therefore on the interval:

* This is an essential condition. So, for example, when weighing pieces of cotton wool or kilogram packs of salt, uniformity will be maintained over much narrower intervals.

3) And since the distance from the NEAREST left division cannot be greater than 0.2, then at is also equal to zero.

Thus:

It should be noted that no one asked us about the density function, and I presented its complete construction exclusively in cognitive chains. When finishing the task, it is enough to write down only the 2nd point.

Now let's answer the question of the problem. When will the error in rounding to the nearest division not exceed 0.04? This will happen when the arrow stops no further than 0.04 from the left division on right or no further than 0.04 from the right division left. On the drawing I shaded the corresponding areas:

It remains to find these areas using integrals. In principle, they can be calculated “in school fashion” (like the areas of rectangles), but simplicity is not always understood;)

By the theorem of addition of probabilities of incompatible events:

– the probability that the rounding error will not exceed 0.04 (40 grams for our example)

It is easy to see that the maximum possible rounding error is 0.1 (100 grams) and therefore probability that the rounding error will not exceed 0.1 equal to one.

Answer: 0,4

There are alternative explanations/formulations of this problem in other sources of information, and I chose the option that seemed most understandable to me. Special attention it is necessary to pay attention to the fact that in the condition we can talk about errors NOT rounding, but about random measurement errors, which are usually (but not always), distributed by normal law. Thus, Just one word can radically change your decision! Be alert and understand the meaning.

And as soon as everything goes in a circle, our feet bring us to the same bus stop:

Example 4

Buses on a certain route run strictly on schedule and every 7 minutes. Compose a density function of a random variable - the waiting time for the next bus by a passenger who randomly approached the stop. Find the probability that he will wait for the bus no more than three minutes. Find the distribution function and explain its meaningful meaning.

A distribution is considered uniform in which all values ​​of a random variable (in the region of its existence, for example, in the interval) are equally probable. The distribution function for such a random variable has the form:

Distribution density:

1

Rice. Graphs of the distribution function (left) and distribution density (right).

Uniform distribution - concept and types. Classification and features of the category "Uniform distribution" 2017, 2018.

  • - Uniform distribution

    Basic discrete distributions of random variables Definition 1. A random variable X, taking values ​​1, 2, ..., n, has a uniform distribution if Pm = P(X = m) = 1/n, m = 1, ..., n.


  • - Uniform distribution

    It's obvious that. Consider the following problem. There are N balls in the urn, of which M are white... .


  • - Uniform distribution

    Laws of distribution of continuous random variables Definition 5. A continuous random variable X, taking a value on the interval, has a uniform distribution if the distribution density has the form. (1) It is easy to verify that, .


  • - Uniform distribution

    If a random variable... .< b; a и b – это параметры равномерного закона. Найдем функцию распределения F(x)... .


  • - Uniform distribution

    A distribution is considered uniform in which all values ​​of a random variable (in the region of its existence, for example, in the interval) are equally probable. The distribution function for such a random variable has the form: Distribution density: F(x) f(x) 1 0 a b x 0 a b x ... .


  • - Uniform distribution

    Definition 16. A continuous random variable has a uniform distribution on the segment if the distribution density of this random variable is constant on this segment and equals zero outside it, that is (45) The density graph for a uniform distribution is shown...

  • This issue has long been studied in detail, and the most widely used method is the polar coordinate method, proposed by George Box, Mervyn Muller and George Marsaglia in 1958. This method allows you to obtain a pair of independent normally distributed random variables with mathematical expectation 0 and variance 1 as follows:

    Where Z 0 and Z 1 are the desired values, s = u 2 + v 2, and u and v are random variables uniformly distributed on the interval (-1, 1), selected in such a way that condition 0 is satisfied< s < 1.
    Many people use these formulas without even thinking, and many do not even suspect their existence, since they use ready-made implementations. But there are people who have questions: “Where did this formula come from? And why do you get a couple of quantities at once?” Next, I will try to give a clear answer to these questions.


    To begin with, let me remind you what probability density, distribution function of a random variable and inverse function are. Suppose there is a certain random variable, the distribution of which is specified by the density function f(x), which has the following form:

    This means that the probability that the value of a given random variable will be in the interval (A, B) is equal to the area of ​​the shaded area. And as a consequence, the area of ​​the entire shaded area must be equal to one, since in any case the value of the random variable will fall into the domain of definition of the function f.
    The distribution function of a random variable is the integral of the density function. And in this case, its approximate appearance will be like this:

    The meaning here is that the value of the random variable will be less than A with probability B. And as a consequence, the function never decreases, and its values ​​lie in the interval.

    An inverse function is a function that returns an argument to the original function if the value of the original function is passed into it. For example, for the function x 2 the inverse is the function of extracting the root, for sin(x) it is arcsin(x), etc.

    Since most pseudorandom number generators produce only a uniform distribution as output, there is often a need to convert it to some other one. In this case, to normal Gaussian:

    The basis of all methods for transforming a uniform distribution into any other is the inverse transformation method. It works as follows. A function is found that is inverse to the function of the required distribution, and a random variable uniformly distributed on the interval (0, 1) is passed into it as an argument. At the output we obtain a value with the required distribution. For clarity, I provide the following picture.

    Thus, a uniform segment is, as it were, smeared in accordance with the new distribution, projected onto another axis through an inverse function. But the problem is that the integral of the density of a Gaussian distribution is not easy to calculate, so the above scientists had to cheat.

    There is a chi-square distribution (Pearson distribution), which is the distribution of the sum of squares of k independent normal random variables. And in the case when k = 2, this distribution is exponential.

    This means that if a point in a rectangular coordinate system has random X and Y coordinates distributed normally, then after converting these coordinates to the polar system (r, θ), the square of the radius (the distance from the origin to the point) will be distributed according to the exponential law, since the square of the radius is the sum of the squares of the coordinates (according to Pythagorean law). The distribution density of such points on the plane will look like this:


    Since it is equal in all directions, the angle θ will have a uniform distribution in the range from 0 to 2π. The converse is also true: if you define a point in the polar coordinate system using two independent random variables (an angle distributed uniformly and a radius distributed exponentially), then the rectangular coordinates of this point will be independent normal random variables. And it is much easier to obtain an exponential distribution from a uniform one using the same inverse transformation method. This is the essence of the polar Box-Muller method.
    Now let's derive the formulas.

    (1)

    To obtain r and θ, it is necessary to generate two random variables uniformly distributed on the interval (0, 1) (let’s call them u and v), the distribution of one of which (let’s say v) must be converted to exponential to obtain the radius. The exponential distribution function looks like this:

    Its inverse function is:

    Since the uniform distribution is symmetrical, the transformation will work similarly with the function

    From the chi-square distribution formula it follows that λ = 0.5. Substitute λ, v into this function and get the square of the radius, and then the radius itself:

    We obtain the angle by stretching the unit segment to 2π:

    Now we substitute r and θ into formulas (1) and get:

    (2)

    These formulas are already ready to use. X and Y will be independent and normally distributed with a variance of 1 and a mathematical expectation of 0. To obtain a distribution with other characteristics, it is enough to multiply the result of the function by the standard deviation and add the mathematical expectation.
    But it is possible to get rid of trigonometric functions by specifying the angle not directly, but indirectly through the rectangular coordinates of a random point in the circle. Then, through these coordinates, it will be possible to calculate the length of the radius vector, and then find the cosine and sine by dividing x and y by it, respectively. How and why does it work?
    Let us choose a random point from those uniformly distributed in a circle of unit radius and denote the square of the length of the radius vector of this point by the letter s:

    The selection is made by specifying random rectangular coordinates x and y, uniformly distributed in the interval (-1, 1), and discarding points that do not belong to the circle, as well as the central point at which the angle of the radius vector is not defined. That is, condition 0 must be met< s < 1. Тогда, как и в случае с Гауссовским распределением на плоскости, угол θ будет распределен равномерно. Это очевидно - количество точек в каждом направлении одинаково, значит каждый угол равновероятен. Но есть и менее очевидный факт - s тоже будет иметь равномерное распределение. Полученные s и θ будут независимы друг от друга. Поэтому мы можем воспользоваться значением s для получения экспоненциального распределения, не генерируя третью случайную величину. Подставим теперь s в формулы (2) вместо v, а вместо тригонометрических функций - их расчет делением координаты на длину радиус-вектора, которая в данном случае является корнем из s:

    We get the formulas as at the beginning of the article. The disadvantage of this method is that it discards points that are not included in the circle. That is, using only 78.5% of the generated random variables. On older computers, the lack of trigonometry functions was still a big advantage. Now, when one processor command calculates both sine and cosine in an instant, I think these methods can still compete.

    Personally, I still have two questions:

    • Why is the value of s distributed evenly?
    • Why is the sum of the squares of two normal random variables distributed exponentially?
    Since s is the square of the radius (for simplicity, I call the radius the length of the radius vector that specifies the position of a random point), we first find out how the radii are distributed. Since the circle is filled evenly, it is obvious that the number of points with radius r is proportional to the length of the circle of radius r. And the circumference of a circle is proportional to the radius. This means that the distribution density of the radii increases uniformly from the center of the circle to its edges. And the density function has the form f(x) = 2x on the interval (0, 1). Coefficient 2 so that the area of ​​the figure under the graph is equal to one. When this density is squared, it becomes uniform. Since theoretically in this case it is necessary to divide the density function by its derivative of the transformation function (that is, x 2). And clearly it happens like this:

    If a similar transformation is made for a normal random variable, then the density function of its square will turn out to be similar to a hyperbola. And the addition of two squares of normal random variables is a much more complex process associated with double integration. And the fact that the result will be an exponential distribution, for me personally, remains to be verified by a practical method or accepted as an axiom. And for those who are interested, I suggest that you take a closer look at the topic, gaining knowledge from these books:

    • Ventzel E.S. Probability theory
    • Knut D.E. The Art of Programming, Volume 2

    In conclusion, here is an example of implementing a normally distributed random number generator in JavaScript:

    Function Gauss() ( var ready = false; var second = 0.0; this.next = function(mean, dev) ( mean = mean == undefined ? 0.0: mean; dev = dev == undefined ? 1.0: dev; if ( this.ready) ( this.ready = false; return this.second * dev + mean; ) else ( var u, v, s; do ( u = 2.0 * Math.random() - 1.0; v = 2.0 * Math. random() - 1.0; s = u * u + v * v; while (s > 1.0 || s == 0.0); this.second = r * u; this.ready = true; return r * v * dev + mean ) ) g = new Gauss(); // create an object a = g.next(); // generate a pair of values ​​and get the first one b = g.next(); // get the second c = g.next(); // generate a pair of values ​​again and get the first one
    The parameters mean (mathematical expectation) and dev (standard deviation) are optional. I draw your attention to the fact that the logarithm is natural.