General Discrete Random Variables (DRV's)

General Discrete Random Variables (DRV's) are I would say a very difficult topic to initially develop your understanding. But truthfully, it's quite simple once you overcome the initial confusion. It is such this way because it's a new concept.

Keep in mind, that we are dealing with probability. That's all this is.

DRV's assign a certain outcome of a sitation a value for x. For instance, one outcome of a sitation may be represented by \(x = 0\), another outcome would be assigned \(x=1\). The probability of any outcome is represented in notation as \(P(X = x)\). This may seem strange, but when measuring probabilities, we are finding the probability \(P(X)\). This is helpful, as it allows us to measure the probability of a range of outcomes (multiple values for \(x\)). For instance:

  • \(P(U > X \ge L)\): The probability in which X is bigger then the upper limit, yet lower then or equal to the lower limit
  • \(P(X > 2 | X < 5)\): X is bigger then 2 given it is less then 5.

There is one measurement of probability range that is slightly wacky: 'given'. It is represented with |. This statement means to measure the probability of the first condition given the second is true. We can expand all given statements with this formula:

\(P(B|A) = \cfrac{P(A \ \text{and} \ B)}{P(A) }\)


Non-Uniform DRV's


DRV's are typically represented in the form of a table, where you can see the values for \(x\) in the top-most row, and then the probability of that outcome, where: \(P(X=x)\):

\(x\)01234
\(P(X = x)\)0.10.20.050.60.05

Here is the same table with an additional row:

\(x\)01234
\(P(X = x)\)0.10.20.050.60.05
\(P(X \le x)\)0.10.30.350.951

There are two properties of DRV's. Should either of these properties not be met, the table can NOT be described as a probability distribution function.

  1. \(P(X=x) \ge 0 \): A probability can never be negative
  2. \(\sum P(X=x) =1\): The sum of probabilites is always 1

From the table above:

1) \(P(X = 2)\)

\(= 0.05\)

2) \(P(X \le 2)\)

\(= 0.35\)

3) \(P(X \ge 3)\)

\(= 0.65\)

4) \(P(1 \lt X \le 3)\)

\(= 0.65\)


Mean/Expected Values


The mean \((\mu) \) is the average value for \(x\), it is also known as the expected value: \(E(X)\). Here is how to calculate it:

\(\bbox[5px, border: 2px solid red]{\mu = E(X) = \sum \left[x \times p(x) \right]} \)

This means, add each value of \(x\) multiplied by \(P(x)\)

As it is the average, we can sense that the \(\mu \) lies at the center of the distribution.


\(x\)01234
\(P(X = x)\)0.20.10.40.050.25

5) Calculate the expected value of the table above

\(\begin{aligned} E(x) &= \mu \\[5pt] &= 0(0.2) + 1(0.1) + 2(0.4) + 3(0.05) + 4(0.25) \\[5pt] &= 0.1 + 0.8 + 0.15 + 1 \\[5pt] &= 2.05\end{aligned} \)


Variance and Standard Deviation


Both variance \(\sigma^2\), and standard deviation \(\sigma\), are measures of spread: that is, how wide that distribution is. More specifically, the standard deviation, \(\sigma \), defines the average distance of data points from the mean, \(\mu \): however, you do not need to know that level of detail in this course. Just know that both measure data spread from the mean.

Standard deviation is the square root of the variance:

\(\sigma = \sqrt{\sigma^2}\)

The variance can be calculated manually in two ways:

1.

\(\sigma^2 = \sum \left[ (x-\mu)^2 \times p(x) \right]\)

2.

\(\sigma^2 = E(X^2) - \left[ E(X) \right]^2 \)

\(E(X^2) = \sum \left[ x^2 \times p(x) \right] \)

or,

\(\sigma^2 = \sum \left[ \left[ x^2 \times p(x) \right] - \left[ E(X) \right]^2 \right] \)


\(x\)0123456
\(P(X = x)\)0.100.40.050.150.20.1

From the table above,

1) Calculate \(\mu \)

\(\begin{aligned} &= 0(0.1) + 1(0) + 2(0.4) + 3(0.05) + 4(0.15) + 5(0.2) + 6(0.1) \\[5pt] &= 0.8 + 0.15 + 0.6 + 1 + 0.6 \\[5pt] &= 3.15 \end{aligned} \)

2) Calculate \(\sigma\)

\(\begin{aligned} \sigma^2 &= \sum \left[ (x-\mu)^2 \times p(x) \right] \\[5pt] &= \sum \left[ (x-3.15)^2 \times p(x) \right] \\[5pt] &= 0.1(0-3.15)^2 + 0(1-3.15)^2 + 0.4(2-3.15)^2 + 0.05(3-3.15)^2 + 0.15(4-3.15)^2 + 0.2(5-3.15)^2 + 0.1(6-3.15)^2 \\[5pt] &= 3.1275 \\[15pt] \sigma &= \sqrt{3.1275} \\[5pt] &= 1.7685 \\[5pt] &= 1.77 \end{aligned} \)


Uniform DRV's


A uniform DRV is a type of DRV in which all probabilities are equally likely.

For example, here is a table representing a uniform DRV:

\(x\)12345678
\(P(X = x)\)\(\frac{1}{8}\)\(\frac{1}{8}\)\(\frac{1}{8}\)\(\frac{1}{8}\)\(\frac{1}{8}\)\(\frac{1}{8}\)\(\frac{1}{8}\)\(\frac{1}{8}\)

Uniform DRV's can also be represent with:

\(p(x) = \frac{1}{n} \ \ \text{for} \ x=1,2,3...,n \)

The DRV shown in the table can thus also be shown with

\(p(x) = \cfrac{1}{8} \ \ \text{for} \ x=1,2,3,4,5,6,7,8\)


Uniform DRV's have these static properties:

  1. \(\mu = \cfrac{n+1}{2}\)
  2. \(\sigma^2 = \cfrac{n^2 -1}{12}\)

3) \(Y\) is a discrete random variable which has uniform distribution. Given \(Y = 1,2,3,...,n\). The variance of \(Y\) is 10.

a. Find \(n\)

\(\begin{aligned} 10 &= \cfrac{x^2-1}{12} \\[5pt] &= x^2 \\[5pt] &= 121 \\[5pt] x &= \pm 11 \\[5pt] \text{Remember} \ &x \ \text{must be} \gt 0 \text{,} \\[5pt] \therefore x &= 11 \end{aligned} \)

b. Find \(\mu \)

\(\begin{aligned} \mu &= \cfrac{n+1}{2} \\[5pt] &= \cfrac{12}{2} \\[5pt] &= 6 \end{aligned} \)

4) A fair, unweighted six sided dice is rolled. Let roll, \(R\) indicate the upwards facing face of the resultant dice throw.

a. What is the probability distribution for R?

\(p(r) = \cfrac{1}{6}\ \ \ \text{for} \ \ r = 1,2,3,4,5,6 \)

b. Find \(\mu \) assosiated with R

\(\begin{aligned} \mu &= \cfrac{n+1}{2} \\[5pt] &= 3.5 \end{aligned} \)

c. Find \(\sigma \)

\(\begin{aligned} \sigma^2 &= \cfrac{n^2 -1}{12} \\[5pt] &= \cfrac{6^2 -1}{12} \\[5pt] \sigma &= \sqrt{\frac{35}{12}} \\[5pt] &= 1.708 \end{aligned} \)

d. What is the probability that X is less then or equal to \(2\mu - 3\sigma \)

\(\begin{aligned} P(X \le (2\mu - 3\sigma)) &= P(X \le (7 -5.1235)) \\[5pt] &= P(X \le 1.877) \\[5pt] &= \frac{1.877}{6} \\[5pt] &= 0.3128 \end{aligned} \)


Linear Changes of DRV's


Discrete Probability Functions can be translated in two ways, as a result each way may change the mean, standard deviation and variance:

1) Translation of origin: \(X \pm c\)

New Mean: \(\mu \pm c\)

Standard Deviation DOES NOT CHANGE

Variance DOES NOT CHANGE

2) Scale Dilation: \(kX\)

New Mean: \(\mu \times k\)

Standard Deviation: \(|k|\sigma_x\)

Variance: \(k^2 \sigma^2 \)

New mean = \(k\mu \pm c\)


Let this table represent the DRV, X:

\(x\)1234
\(P(X = x)\)0.20.40.30.1

Let the DRV, \(Y=3X-2\). This is what Y looks like:

\(y\)14710
\(P(Y = y)\)0.20.40.30.1

We can see that linear changes of DRV's do not change directly change probabilities, but the values for conditions.

Using only the table for X, and the equation for Y;

5) Find \(\mu_y\)

\(\begin{aligned} \mu_x &= 1(0.2) + 2(0.4) +3(0.3) + 4(0.1) \\[5pt] &= 2.3 \\[5pt] \mu_y &= 3\mu -2 \\[5pt] &= 3(2.3) - 2 \\[5pt] &= 4.9 \end{aligned} \)

6) Find \(\sigma_y \)

\(\begin{aligned} \text{VAR(} x \text{)} &= \sum \left[ p(x) (x- \mu)^2 \right] \\[5pt] &= 0.2(1-2.3)^2 + 0.4(2-2.3)^2 + 0.3(3-2.3)^2 + 0.1(4-2.3)^2 \\[5pt] &= 0.81 \\[5pt] \sigma_x &= \sqrt{0.81} \\[5pt] &= 0.9 \\[5pt] \sigma_y &= |3| \times \sigma_x \\[5pt] &= 3(0.9) \\[5pt] &= 2.7 \end{aligned} \)


\(y\)9152127
\(P(Y = y)\)0.20.50.1

Given the table above depicts a DRV, \(Y = 6X+3\), find \(\mu_x \).

We can find the missing value by subtracting all probabilities from their static sum: 1. Let this number equal \(a\).

\(\begin{aligned} 1 &= 0.2+a+0.7+0.1 \\[5pt] a &= 0.2 \end{aligned} \)


Now, we can find \(\mu_y \)

\(\begin{aligned} \mu_y &= 9(0.2) + 15(0.2) + 21(0.5) + 27(0.1) \\[5pt] &= 18 \end{aligned} \)

We can re-arrange to find that \(X = \cfrac{Y}{6} - \cfrac{1}{2} \)

\(\begin{aligned} \mu_x &= \cfrac{\mu_y}{6} - \cfrac{1}{2} \\[5pt] &= \cfrac{18}{6} - \frac{1}{2} \\[5pt] &= 2.5 \end{aligned} \)

Contact/Owner

This website in its entirety is owned, programmed, developed and made public by Aaron Fonte

If you have any bugs, suggestions or statements to make, I welcome you to contact my public email: fonteaaron@protonmail.com. The site is best viewed on PC.

Remove Ads

There are currently no ads to remove, but from the 19th of Feburary, expect ads on the site. These ads would be removed with a subscription of $2.99 a month.

Forums

Get Excited! We are currently working on a forums page.

This forum is to be considered the second half of this website.

Remember, this site is in insaaaanely early dev, so give me a few months and I'll crack on with it.

The idea is, you use the same account for HSHelp as the forum page. The ad-free subscription especially comes in handy for the forums page - as a means of accessing information and contact to other users without ads bothering you. You would need an account to post threads/comments, but anonymous users may read only.

Dependencies

Special Thanks to the following dependencies of this website:

  • JQuery
  • MathJax
  • MHChem (for MathJax)
  • Google Ads, eventually
  • STRIPE API, eventually
  • Our Users :)