Compute the expected value and variance of a discrete random variable from probability table

821 Views Asked by At

This equation comes from Edgenuity's course of Statistics, and I am taking the course as a high school senior. I understand how to find the standard deviation.

Standardized tests for certain subjects, given to high school students, are scored on a scale of 1 to 5. Let X represent the score on a randomly selected exam. The distribution of scores for one subject’s standardized test is given in the table.
enter image description here

What is the standard deviation of the distribution?
A. 1.3
B. 1.6
C. 1.7
D. 2.5

Edit: Firstly, I multiplied each score with its corresponding probability and then added all of these pairs together.

$(1*0.18)+(2*0.20)+(3*0.26)+(4*0.21)+(5*0.15) = 2.95$

$2.95$ is the mean of the distribution.

Secondly, I found the standard deviation using the mean and the score values.

$\sqrt{[(1-2.95)^2+(2-2.95)^2+(3-2.95)^2+(4-2.95)^2+(5-2.95)^2]/5} ≈ 1.415 $

$≈ 1.415$ is the standard deviation of the distribution, so the closest answer choice would be (A).

2

There are 2 best solutions below

1
On

Note that variance ($\sigma^2$) is given by: $$\sigma^2=\sum p_i(x_i-m)^2$$ where $m$ is the mean score. So we have, breaking the square: $$\sigma^2=\sum {x_i}^2 p_i +\left(m^2\sum p_i\right) -2m^2$$ $$\sigma^2=\sum {x_i}^2 p_i -m^2$$ $$\sigma^2 =\sum {x_i}^2 p_i -\left(\sum x_i p_i\right)^2$$ Plug in the values, you'll get: $$\sigma^2=10.43-8.7025=1.7275$$ So standard deviation($\sigma$)$=\sqrt{1.7275}\approx 1.3$

Clearly, your calculated value of $m$ is wrong. The correct value would be $m=2.95$

0
On

It helps to write the formulas out in detail and compute the intermediate steps.

$$\mu = E(X) = \sum_{i=1}^5 ip_i\\ = 1(.18)+2(.20)+3(.26)+4(.21)+5(.15) = 2.95.$$

Using R as a calculator:

p = c(.18, .20, .26, .21, .15)
sum(p)
[1] 1      # validity check
sum((1:5)*p)  
[1] 2.95   # E(X)

$$\sigma^2 = V(X) = \sum_{i=1}^5 (i-\mu)^2p_i\\ = (1-2.95)^2(.18) + (2-2.95)^2(.20) + \cdots + (5-2.95)^2(.15)=1.7275.$$

sum(((1:5)-2.95)^2*p)
[1] 1.7275

Alternative formula for variance: $$\sigma^2 = Var(X) = E(X^2) - \mu^2 = \sum_{i=1}^5 i^2p_i - \mu^2\\ =1(.18)+4(.20)+9(.26)+16(.21)+25(.15)-2.95^2 = 1.7275.$$

sum((1:5)^2*p) - 2.95^2
[1] 1.7275

Approximation by simulation: Simulate a million realizations of $X$ and then take the sample mean and variance of the sample of a million, which should agree with $\mu$ and $\sigma^2,$ respectively, to a few decimal places.

set.seed(2021)
x = sample(1:5, 10^6, rep=T, p=c(.18,.20,.26,.21,.15))
mean(x)
[1] 2.951815  # aprx 2.95
var(x)
[1] 1.728759  # aprx 1.7275
sd(x)
[1] 1.314823  $ close to Answer (A)