Practical lesson. Continuous random variable
At the practical lesson, we will solve standard problems (on calculating numerical characteristics, obtaining the distribution density). And in the laboratory class, we will consolidate the knowledge gained using the Microsoft Excel program. This video is dedicated to the practical lesson.
Let’s look at the first problem. Let a rod 5 centimeters long is given, and it breaks into two parts for good luck (we will assume that the fracture is even). ξ is the length of the left part. The task is to find the distribution density of the value ξ and plot it. When we want to solve a problem of this kind, first, it is convenient to find the distribution function of a given random variable rather than the distribution density. Therefore, we define the distribution function of the random variable ξ at the point x.
Let’s see what values the random variable ξ can take. If we break the rod very close to the left edge, it is almost 0, but if we break it very close to the right edge, it is almost 5. That is, in fact, the random variable ξ takes values from 0 to 5. But we will assume that we will not break it at 0 in any way. Therefore, the distribution function is 0 for x≤0, and 1 for x>5 since it accepts values from the range from 0 to 5 only.
All we need to do is to find the value of the distribution function in the range from 0 to 5. Since the rod breaks for good luck, the x-coordinate of the fracture can equally likely fall at any point. Let’s use the geometric probability. You should remember that the distribution function of a random variable is nothing more than the probability that a given random variable has taken the value less than x. If x lies on the interval from 0 to 5, the probability that the length of the segment does not exceed x is equal to the ratio of the length of x to the length of the entire segment (5). This means that there will be x/5 (see the video). We find the density of the distribution. To do this, the function must be differentiated. On these intervals (x does not belong to (0, 5)), the function is equal to constants, so there the derivative is 0, and it is equal to 1/5 if x is from the interval (0, 5). You need to build a graph. Let’s draw the coordinate axes. On the abscissa axis, we put the value of the random variable ξ, on the ordinate axis – fξ(х) (see the video). At the origin, the function value is 0. We denote the value 1/5. We get it like this. And then again 0. That is, we get such a “shelf” (see the video). We have randomly demonstrated the value that has a uniform distribution. It is clear that such random variables do not necessarily occur in problems. Here we have shown that this distribution is actually quite common.
Let’s look at another example. Let’s assume that the probability distribution density of a random variable is given (see the slide), but note that it is not completely given to us, we have some unknown constant c. We need to find this constant and its numerical characteristics. This means that you also need to find the expected value, variance, and standard deviation.
How do we find the constant? The first thing that comes to mind is that not every function can be a distribution density. An important property of the distribution density is, first, that it is not negative. We immediately understand that the value of c cannot be negative. And the second important property “the normalization condition” says that the integral on the entire numerical axis of the distribution density is equal to 1. And since it is equal to 1, we can substitute this function and get the value of the constant c. Since the zeros are outside the range from 0 to 4, we get an integral from 0 to 4 (see the video), which is equal to 1. We substitute 4, get 8. We substitute 0, get 0. So, 8c = 1, i.e. c = 1/8. Otherwise, you could calculate the area under the graph. That is, our function is a linear function, and the normalization condition tells us that the area under the graph is 1.Here, the area of the triangle with base 4 is 1, so the height of this triangle is ½, here we have the point (4, ½), and, therefore, the coefficient is 1/8.
We find the expected value, variance, and standard deviation for the random variable given. Let me rewrite it again. The distribution density of this random variable (in fact, it is not necessary to write down the index ξ, most often, it is written when you need to distinguish random variables) will be 0 if x does not belong to the range from 0 to 4; and 1/8*x if x belongs to this range (see the video). The expected value of this random variable will be calculated as an integral from minus infinity to plus infinity xf(x)dx. The integral is calculated (see the video). The result is 64/24 or 8/3.
We find the variance. When calculating the variance for continuous random variables, it is convenient to use an additional formula Dξ=Мξ2 – (Мξ)2. The expected value is already known, it’s 8/3. We need to find (Мξ)2. The calculations are as follows (see the video). We divide 256 by 32 and get 8. In total, we get 8 – (8/3)2. We get 8/9 – this is the variance. Always check it. The variance of a random variable cannot be negative because it is the average square, the square is always non-negative. So we’ve checked that we didn’t get a negative number – it’s good. But then the standard deviation σξ =√Dξ = 2√2/3.Thus, the problem is solved.
Sometimes the distribution density of a random variable is set not by a function, but by a graph. In this case, everything is the same. We will not consider such an example.
Let’s look at a couple of standard distribution problems discussed at the second lecture of this section (see the video). The first distribution that we will consider is indicative. Let me remind you that a random variable ξ has an exponential distribution with the parameter α if its distribution density is given by the following formula (see the video). Here, in fact, we will use this. We know that the probability that the machine will not fail in 5 hours of operation is equal to the number shown on the slide. If T is the uptime, “the machine will not fail in 5 hours” means that the uptime will be more than five hours (T>5). There are two ways. This is the integral from 5 to plus infinity (or it was possible to subtract the integral from 0 to 5 from 1) from αе-αxdx (please note that α is not known yet). If we integrate it, we get (see the video) 1–е-αх in the range from 5 to plus infinity. And this probability is 0.63212. Then е-5α = 1–0.63212=0.36788. We take the logarithm. We get that -5α=-0.99998..., it’s approximately 1. This means that α is approximately equal to 0.2. We understand that our random variable has the exponential distribution with the parameter of 0.2.
We need to find the variance of a random variable. At the lecture, we showed that the variance of such a random variable is equal to 1/α2. That is, 1/0.2. We get 25. The problem is solved.
Let’s consider the last problem. Now we have a normal distribution. Let’s remember that a random variable has a normal distribution if its density is calculated using the following formula (see the video), where a is the expected value (the average value of our random variable), and σ2 is the variance (standard deviation). At the same time, we know that a is equal to 25, that is, our random variable has a normal distribution with the parameter 25. σ2 is not known yet. Where can we find it? For example, from the second condition. We know that the probability that a random variable falls in the range from 20 to 30 is 0.2. This (since 25 is the middle of this interval) can be written as the probability that |ξ–25|<5. And I’ll write it down like this: (see the video). And this probability is equal to 0.2. The value of (ξ–25)/σ has a standard normal distribution. So we know how to get the answer (see the video). So, f(5/σ)=0.6. Then the question arises: how to find the argument of the function f by its value. What should I do here? There are two options. Since we know that the function f is not written analytically, it is tabular, that is, all its values are entered in special tables. The only thing you need to pay attention to is what function is called the Laplace function. It has its own nuances. Make sure that it is an integral from minus infinity to x, then you can use the formulas used at the lecture (if it is different, everything will be different there).
In this task, we will use MS Excel (I have already calculated it in advance). Please note that we use the NORMSINV function with the parameter of 0.6 (see the video). INV means “back”, that is, we get the argument by value. Then this value (see the video) is approximately 0.25, which means that σ is approximately 20. We need to find the probability of falling within the interval from 35 to 40. We also reduce it to a standard random variable, i.e. we subtract 25 and divide it by σ = 20 (see the video). This can be calculated using the value of the Laplace function at 0.75 minus the value of the Laplace function at 0.5. We use MS Excel again. Here, on the contrary, we need a value for the argument, so we use the NORMSDIST function. It has two parameters, the first is an argument, and the second is an integral or differential function. We are interested in the integral function, so the second parameter here is 1. Similarly, we calculate the value of the Laplace function at the point 0.5. The answer is approximately 0.773 and 0.691. Let me not count, let’s look in MS Excel, the difference between these values is calculated: it’s approximately 0.082, that is the probability of falling within the interval we are interested in. The problem is solved. There will be similar tasks at the practical lesson. You can start solving these tasks. There will be a video for the laboratory work. Thank you for your attention.