# Density of a random variable

#### alfred

##### New member
Professor Roberto has to take an oral examination. The grading scale is as follows: 5: = best and 1: = worst. At most he only gives the note 4. Each student under review is questioned if he is a Lakers fan. The student's grade is based on his answer (is a fan / not a fan) and on the language in which he answered (not English / English): If the student is a fan of the Lakers reduces his note 2 points. If he answers in English reduces his note 1 point. These reductions are additive so the notes which can be obtained are {4,3,2,1}

Is fulfilled:
With probability 0.7 the student is not a fan of the Lakers
With probability 0.29 the student is a fan of the Lakers and speaks English
With probability 0.21 the student speaks English but is not a fan of the Lakers

Let N be the random variable indicating the student note. Calculate the density of N.
Can anyone help me? How/Where should I start doing this exercises? What does density mean?

#### Bacterius

##### Well-known member
MHB Math Helper
[JUSTIFY]Well a good start would be to understand all the words of the question. A probability density function is basically (loosely put) a function which, for any interval $[a, b]$, the probability that the random variable takes on a value between $a$ and $b$. We let:
$$P(a \leq X \leq b) = \int_a^b f_X(x) ~ \text{d} x$$
And we say that the random variable $X$ has density $f_X(x)$. And the probability that $X$ is between $a$ and $b$ is just the area under the curve of $f_X(x)$ between $x = a$ and $x = b$. Now that's for continuous distributions. But you have a discrete distribution (the professor can only grade 1, 2, 3, ..., he can't grade 2.4, or 0.954, or $\pi$, ..). So we need to modify this a bit. In the discrete world, integrals become plain sums, and "density" isn't as meaningful (though it is still the correct term) so we'll just call it "probability":
$$P(a \leq X \leq b) = \sum_{x = a}^b p(x)$$
Where $p(x)$ is the probability that discrete random variable $X$ takes the value $x$.

As you can see, this is intuitive. Now what we want is to find the function $p(x)$ (the "density") which indicates the probability of the professor grading 1, 2, 3, and so on.

We immediately see that $p(5) = 0$, since it is said the professor never grades 5, so the probability of him grading 5 is zero.

Now the other values of the function $p$ depend on two things - whether the student is a Lakers fan, and on the language he used to answer. The professor starts with grade 4 and subtracts points depending on the factors above.

Now we are given a few probabilities. You can see there is one conspicuously missing: the probability that the student speaks English (period). Can you work out this probability from the given data using rules of probability you learned (exclusion/inclusion, conditional probability, ..)?

When you have the probability that a student is a fan of the Lakers (given to you) and the probability that the student speaks English (work it out) you can now work out the values of $p$ at any point. Here is the working for the first value, you will work out the others. Let's find $p(4)$.

We know the professor grades 4 if and only if the student is not a fan of the Lakers (otherwise he gets his grade decreased by 2) and if he does not speak English (otherwise he loses one point). Knowing the probabilities of this happening for some random student, what would be the probability that the professor grades 4? These are two events which must be satisfied, so:
$$p(4) = P(\text{student is not a fan of the Lakers}) \times P(\text{student does not speak English})$$
The values of $p(3)$, $p(2)$, and $p(1)$ can be worked out with a similar reasoning.

Does it make more sense now?[/JUSTIFY]

Last edited: