Is there a generalization of the standard deviation formula for sampling from an urn containing two values, $|b - a| * √(\Pr(a) * \Pr(b))$, to one that works for three or more values (i.e., $a$, $b$, and $c$)? I assume the pattern inside the $√$ would extend via multiplying by $\Pr(c)$, but I'm not sure how the absolute value factor would change since it represents a distance between $a$ and $b$.
Also, how does this formula turn into the "regular" standard deviation formula when an arbitrary number of values is supplied?
$E(X)=aP_a+bP_b$, $E(X^2)=a^2P_a+b^2P_b$. $var(X)=E(X^2)-E(X)^2$ $=a^2P_a(1-P_a)+b^2P_b(1-P_b)-2abP_aP_b=P_aP_b(a-b)^2$,
which gives the standard deviation you have. Note that the absolute value is simply the result of the square root.
To get the formula for $n$ items, use the same approach. $E(X)=\sum_1^n a_kP_k$ and $E(X^2)=\sum_1^na_k^2P_k$ immediately giving the variance $E(X^2)-E(X)^2$. Using a similar manipulation, $Var(X)=\sum_{j=1}^{n-1}\sum_{k=j+1}^nP_jP_k(a_j-a_k)^2$