You will need to use the binomial probability formula:
[n! / x!*(n-x)!]*px*qn-x , where
n = the number of pieces of candy
x = the number of peppermints
p = the success probability (picking peppermints) = 12/24 = 1/2
q = the failure probability (picking butterscotch) = 12/24 = 1/2
P(X = 2) = (5 choose 2) = (5! / [2!*(5-2)!])*(1/2)2*(1/2)3 = 0.3125
P(X ≤ 2) = P(X = 0) + P(X = 1) + P(X = 2)
= (5! / [0!*(5-0)!])*(1/2)0*(1/2)5 + (5! / [1!*(5-1)!])*(1/2)1*(1/2)4 + (5! / [2!*(5-2)!])*(1/2)2*(1/2)3
= 0.03125 + 0.15625 + 0.3125 = 0.5
The probability of picking 2 peppermints in the set of 5 pieces of candy is 0.3125. The probability of picking up to 2 peppermints in the set of 5 pieces of candy is 0.5.
E[X] = np = 5*(1/2) = 2.5
Var[X] = npq = 5*(1/2)*(1/2) = 1.25
σ = sqrt(1.25) = 1.118 ≈ 1.12