Statistics Help Watch

SS__
Badges: 13
Rep:
?
#1
Report Thread starter 4 weeks ago
#1
Hey Guys, I have a question regarding discrete random variables.

I was given a question where I had to find the mean and standard deviation. This was fine. In the second part, I was given a formula for cost (y=0.163x+14.5) and told to use my answers to the first part to deduce the mean and SD for the cost.

I know how to do it, but I don’t know why I do it. I know for mean, I just substitute my mean from before into the formula, and for SD I only sub in to the gradient. But why?

Any help would be great, thanks!
Posted on the TSR App. Download from Apple or Google Play
0
reply
BlackPeopleGood
Badges: 4
Rep:
?
#2
Report 4 weeks ago
#2
(Original post by SS__)
Hey Guys, I have a question regarding discrete random variables.

I was given a question where I had to find the mean and standard deviation. This was fine. In the second part, I was given a formula for cost (y=0.163x+14.5) and told to use my answers to the first part to deduce the mean and SD for the cost.

I know how to do it, but I don’t know why I do it. I know for mean, I just substitute my mean from before into the formula, and for SD I only sub in to the gradient. But why?

Any help would be great, thanks!
The gradient is the only important bit. Any constant moves the entire graph up or down by the same amount so this doesnt affect SD as SD is the % from mean. The difference between each point and the mean is still the same regardless of the constant. However the mean is affected by the constant as it shifts the points.
0
reply
Pangol
Badges: 12
Rep:
?
#3
Report 4 weeks ago
#3
(Original post by SS__)
Hey Guys, I have a question regarding discrete random variables.

I was given a question where I had to find the mean and standard deviation. This was fine. In the second part, I was given a formula for cost (y=0.163x+14.5) and told to use my answers to the first part to deduce the mean and SD for the cost.

I know how to do it, but I don’t know why I do it. I know for mean, I just substitute my mean from before into the formula, and for SD I only sub in to the gradient. But why?

Any help would be great, thanks!
Think of your raw data as a load of values on a number line.

The mean is telling you where the "middle" of the data is. If you added or subtracted a number from all of your values, this is the same as translating all of your data along the number line. The "middle" would move with the data. Similarly, if you multiplied all of your values by a number, they would get more spread out (if the number is >1, a similar argument applies if not), and the "middle" would move in a corresponding way. This is why you have to factor in both the multiplication and addition when finding the new mean.

The standard deviation is telling you how "spread out" the data is. If you multiplied all of the values by a number - 2, say - then they are now spread out twice as much as they were before. That's why you have to factor in multiplication when finding the new SD. But if you added or subtracted a constant to all of the values, they would now be in a different place, but they would be "spread out" in exactly the same way. That's why you don't have to factor in addition when finding the new SD.
1
reply
SS__
Badges: 13
Rep:
?
#4
Report Thread starter 4 weeks ago
#4
(Original post by Pangol)
Think of your raw data as a load of values on a number line.

The mean is telling you where the "middle" of the data is. If you added or subtracted a number from all of your values, this is the same as translating all of your data along the number line. The "middle" would move with the data. Similarly, if you multiplied all of your values by a number, they would get more spread out (if the number is >1, a similar argument applies if not), and the "middle" would move in a corresponding way. This is why you have to factor in both the multiplication and addition when finding the new mean.

The standard deviation is telling you how "spread out" the data is. If you multiplied all of the values by a number - 2, say - then they are now spread out twice as much as they were before. That's why you have to factor in multiplication when finding the new SD. But if you added or subtracted a constant to all of the values, they would now be in a different place, but they would be "spread out" in exactly the same way. That's why you don't have to factor in addition when finding the new SD.
Oh I see now. Thanks!
Posted on the TSR App. Download from Apple or Google Play
0
reply
RDKGames
  • Community Assistant
Badges: 20
Rep:
?
#5
Report 4 weeks ago
#5
(Original post by SS__)
Hey Guys, I have a question regarding discrete random variables.

I was given a question where I had to find the mean and standard deviation. This was fine. In the second part, I was given a formula for cost (y=0.163x+14.5) and told to use my answers to the first part to deduce the mean and SD for the cost.

I know how to do it, but I don’t know why I do it. I know for mean, I just substitute my mean from before into the formula, and for SD I only sub in to the gradient. But why?

Any help would be great, thanks!
Using some common formulae you should've come across

For the mean, we have

$\begin{align*} \mathbb{E}[Y] & = \mathbb{E}[0.163X+14.5] \\ & = \mathbb{E}[0.163X] + \mathbb{E}[14.5] \\ & = 0.163\mathbb{E}[X]+14.5 \end{align*}$

hence why for the mean of the cost (y) you substitute the mean of (x).


For the standard deviation, let \mathrm{Var}(Y) denote the variance of Y and let \sigma(Y) denote the standard deviation of Y.

$\begin{align*} \sigma(Y) & = \sqrt{\mathrm{Var}(Y)} \\ & = \sqrt{\mathrm{Var}(0.163X+14.5)} \\ & = \sqrt{\mathrm{Var}(0.163X)} \\ & = \sqrt{0.163^2\mathrm{Var}(X)} \\ & = 0.163 \sqrt{\mathrm{Var}(X)} \\ & = 0.163\sigma(X) \end{align*}$

Hence why you only need the gradient for this.

If any of the steps do not make sense, then do ask for clarification.
0
reply
SS__
Badges: 13
Rep:
?
#6
Report Thread starter 4 weeks ago
#6
(Original post by RDKGames)
Using some common formulae you should've come across

For the mean, we have

$\begin{align*} \mathbb{E}[Y] & = \mathbb{E}[0.163X+14.5] \\ & = \mathbb{E}[0.163X] + \mathbb{E}[14.5] \\ & = 0.163\mathbb{E}[X]+14.5 \end{align*}$

hence why for the mean of the cost (y) you substitute the mean of (x).


For the standard deviation, let \mathrm{Var}(Y) denote the variance of Y and let \sigma(Y) denote the standard deviation of Y.

$\begin{align*} \sigma(Y) & = \sqrt{\mathrm{Var}(Y)} \\ & = \sqrt{\mathrm{Var}(0.163X+14.5)} \\ & = \sqrt{\mathrm{Var}(0.163X)} \\ & = \sqrt{0.163^2\mathrm{Var}(X)} \\ & = 0.163 \sqrt{\mathrm{Var}(X)} \\ & = 0.163\sigma(X) \end{align*}$

Hence why you only need the gradient for this.

If any of the steps do not make sense, then do ask for clarification.
Thank you so much for this, really helps. I understand the mean derivation but I don't get the 2nd and 4th step for SD. What happens to the 14.5, and why can we take out 0.163 as 0.163^2? Thank again.

Also for the mean, why is E(14.5) equal to 14.5? and why is E(0.163X) the same as 0.163E(X)? Thanks
Last edited by SS__; 4 weeks ago
0
reply
RDKGames
  • Community Assistant
Badges: 20
Rep:
?
#7
Report 4 weeks ago
#7
Also for the mean, why is E(14.5) equal to 14.5? and why is E(0.163X) the same as 0.163E(X)? Thanks
These two come down to the fact that \mathbb{E} is a linear operator.

Perhaps you have seen this, perhaps not, but \mathbb{E}[X] = \displaystyle \sum_{\mathrm{all} \ x} xP(X=x) which is how the expectation is defined for a discrete r.v. X.


By a certain theorem, we have that:

\mathbb{E}[aX+b] = \displaystyle \sum_{\mathrm{all} \ x} (ax+b)P(X=x)

where a,b are constants.

But now we can break this sum all the way down:

$\begin{align*} \mathbb{E}[aX+b] & = \sum_{\mathrm{all} \ x} (ax+b)P(X=x) \\ & = \sum_{\mathrm{all} \ x}[axP(X=x) + bP(X=x)] \\ & = \underbrace{\sum_{\mathrm{all} \ x} axP(X=x)}_{=\mathbb{E}[aX]} + \underbrace{\sum_{\mathrm{all} \ x} bP(X=x)}_{= \mathbb{E}[b]} \\ & = a \underbrace{\sum_{\mathrm{all} \ x} x P(X=x)}_{=\mathbb{E}[X]} + b \underbrace{\sum_{\mathrm{all} \ x} P(X=x)}_{=1} \\ & = a \mathbb{E}[X] + b \end{align*}$

This rule is precisely why \mathbb{E}[0.163X+14.5] = 0.163\mathbb{E}[X]+14.5 essentially, and answers both your questions here.

(Original post by SS__)
Thank you so much for this, really helps. I understand the mean derivation but I don't get the 2nd and 4th step for SD. What happens to the 14.5, and why can we take out 0.163 as 0.163^2? Thank again.
Similarly to above, we can prove that \mathrm{Var}(aX+b) = a^2 \mathrm{Var}(X), which is pretty much what you are asking. In the process you will see how the constant disappears and a becomes a^2 on the outside.

The definition is \mathrm{Var}(X) = \mathbb{E}[(X-\mathbb{E}[X])^2].

We can show that \mathrm{Var}(X) = \mathbb{E}[X^2] - \mathbb{E}[X]^2 by following the steps *here* which I'll omit from this post.

This means that \mathrm{Var}(aX+b) = \mathbb{E}[(aX+b)^2] - \mathbb{E}[aX+b]^2.

Take the first term and expand it;
$\begin{align*} \mathbb{E}[(aX+b)^2] & = \mathbb{E}[a^2X^2 + 2abX + b^2] \\ & = a^2 \mathbb{E}[X^2] + 2ab \mathbb{E}[X] + b^2 \end{align*}$

Now take the second term and expand it;
$\begin{align*} \mathbb{E}[aX+b]^2 & = (a\mathbb{E}[X]+b)^2 \\ & = a^2 \mathbb{E}[X]^2 + 2ab \mathbb{E}[X] + b^2 \end{align*}$

Subtracting the second from the first makes the constants cancel as well as the middle term. Hence b vanishes from our expression entirely.

$\begin{align*} \mathrm{Var}(aX+b) & = \mathbb{E}[(aX+b)^2] - \mathbb{E}[aX+b]^2 \\ & = a^2 \mathbb{E}[X^2] - a^2 \mathbb{E}[X]^2 \\ & = a^2 \underbrace{(\mathbb{E}[X^2] - \mathbb{E}[X]^2)}_{=\mathrm{Var}(X)} \\ & = a^2 \mathrm{Var}(X) \end{align*}$



I recommend you note these proofs so you can refer to them whenever you forget why we're allowed to do these things.
Last edited by RDKGames; 4 weeks ago
0
reply
SS__
Badges: 13
Rep:
?
#8
Report Thread starter 4 weeks ago
#8
(Original post by RDKGames)
These two come down to the fact that \mathbb{E} is a linear operator.

Perhaps you have seen this, perhaps not, but \mathbb{E}[X] = \displaystyle \sum_{\mathrm{all} \ x} xP(X=x) which is how the expectation is defined for a discrete r.v. X.


By a certain theorem, we have that:

\mathbb{E}[aX+b] = \displaystyle \sum_{\mathrm{all} \ x} (ax+b)P(X=x)

where a,b are constants.

But now we can break this sum all the way down:

$\begin{align*} \mathbb{E}[aX+b] & = \sum_{\mathrm{all} \ x} (ax+b)P(X=x) \\ & = \sum_{\mathrm{all} \ x}[axP(X=x) + bP(X=x)] \\ & = \underbrace{\sum_{\mathrm{all} \ x} axP(X=x)}_{=\mathbb{E}[aX]} + \underbrace{\sum_{\mathrm{all} \ x} bP(X=x)}_{= \mathbb{E}<b>} \\ & = a \underbrace{\sum_{\mathrm{all} \ x} x P(X=x)}_{=\mathbb{E}[X]} + b \underbrace{\sum_{\mathrm{all} \ x} P(X=x)}_{=1} \\ & = a \mathbb{E}[X] + b \end{align*}$

This rule is precisely why \mathbb{E}[0.163X+14.5] = 0.163\mathbb{E}[X]+14.5 essentially, and answers both your questions here.



Similarly to above, we can prove that \mathrm{Var}(aX+b) = a^2 \mathrm{Var}(X), which is pretty much what you are asking. In the process you will see how the constant disappears and a becomes a^2 on the outside.

The definition is \mathrm{Var}(X) = \mathbb{E}[(X-\mathbb{E}[X])^2].

We can show that \mathrm{Var}(X) = \mathbb{E}[X^2] - \mathbb{E}[X]^2 by following the steps *here* which I'll omit from this post.

This means that \mathrm{Var}(aX+b) = \mathbb{E}[(aX+b)^2] - \mathbb{E}[aX+b]^2.

Take the first term and expand it;
$\begin{align*} \mathbb{E}[(aX+b)^2] & = \mathbb{E}[a^2X^2 + 2abX + b^2] \\ & = a^2 \mathbb{E}[X^2] + 2ab \mathbb{E}[X] + b^2 \end{align*}$

Now take the second term and expand it;
$\begin{align*} \mathbb{E}[aX+b]^2 & = (a\mathbb{E}[X]+b)^2 \\ & = a^2 \mathbb{E}[X]^2 + 2ab \mathbb{E}[X] + b^2 \end{align*}$

Subtracting the second from the first makes the constants cancel as well as the middle term. Hence b vanishes from our expression entirely.

$\begin{align*} \mathrm{Var}(aX+b) & = \mathbb{E}[(aX+b)^2] - \mathbb{E}[aX+b]^2 \\ & = a^2 \mathbb{E}[X^2] - a^2 \mathbb{E}[X]^2 \\ & = a^2 \underbrace{(\mathbb{E}[X^2] - \mathbb{E}[X]^2)}_{=\mathrm{Var}(X)} \\ & = a^2 \mathrm{Var}(X) \end{align*}$



I recommend you note these proofs so you can refer to them whenever you forget why we're allowed to do these things.
Thanks for the proofs, really helpful. I understand for the most part but there is one thing I'm unsure about. The step where you expand \mathrm{Var}(X) = \mathbb{E}[(X-\mathbb{E}[X])^2], where does the -2E(X)E(X) go? Everything else checks out for me.
0
reply
RDKGames
  • Community Assistant
Badges: 20
Rep:
?
#9
Report 4 weeks ago
#9
(Original post by SS__)
Thanks for the proofs, really helpful. I understand for the most part but there is one thing I'm unsure about. The step where you expand \mathrm{Var}(X) = \mathbb{E}[(X-\mathbb{E}[X])^2], where does the -2E(X)E(X) go? Everything else checks out for me.
Notice that -2\mathbb{E}[X]\mathbb{E}[X] \equiv -2\mathbb{E}[X]^2.

So it can be merged with the last term of the expansion \mathbb{E}[X]^2 to give the -\mathbb{E}[X]^2 term in the result on Wikipedia.
0
reply
SS__
Badges: 13
Rep:
?
#10
Report Thread starter 4 weeks ago
#10
(Original post by RDKGames)
Notice that -2\mathbb{E}[X]\mathbb{E}[X] \equiv -2\mathbb{E}[X]^2.

So it can be merged with the last term of the expansion \mathbb{E}[X]^2 to give the -\mathbb{E}[X]^2 term in the result on Wikipedia.
Oh I see, I wasn't aware you could treat it like that. Thanks for that
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • Solent University
    Postgraduate and Professional Open Evenings Postgraduate
    Mon, 25 Mar '19
  • Cardiff University
    Undergraduate Open Day Undergraduate
    Wed, 27 Mar '19
  • University of Portsmouth
    Postgraduate and Part-Time Open Evenings Postgraduate
    Wed, 27 Mar '19

Where do you need more help?

Which Uni should I go to? (127)
17.81%
How successful will I become if I take my planned subjects? (73)
10.24%
How happy will I be if I take this career? (123)
17.25%
How do I achieve my dream Uni placement? (103)
14.45%
What should I study to achieve my dream career? (70)
9.82%
How can I be the best version of myself? (217)
30.43%

Watched Threads

View All