Question 1197325
<font color=black size=3>
Part (a)


5 buildings violate code, 10-5 = 5 do not


5/10 = probability first selection doesn't violate code
4/9 = probability second selection doesn't violate code
3/8 = probability third selection doesn't violate code


The numerators decrease: 5,4,3
So do the denominators: 10,9,8
This assumes that we're sampling without replacement.


Multiply out the fractions to get this result
(5/10)*(4/9)*(3/8) = (5*4*3)/(10*9*8)
(5/10)*(4/9)*(3/8) = (5*4*3)/(2*5*3*3*2*4)
(5/10)*(4/9)*(3/8) = 1/(2*3*2)
(5/10)*(4/9)*(3/8) = 1/12


The probability of selecting 3 buildings that don't violate code is 1/12.


----------------------------------------


Alternate route:


n = 5 buildings that don't violate code
r = 3 selections
Use the nCr combination formula
n C r = (n!)/(r!(n-r)!)
5 C 3 = (5!)/(3!*(5-3)!)
5 C 3 = (5!)/(3!*2!)
5 C 3 = (5*4*3!)/(3!*2!)
5 C 3 = (5*4)/(2!)
5 C 3 = (5*4)/(2*1)
5 C 3 = (20)/(2)
5 C 3 = 10
There are 10 ways to pick three out of the five buildings that are to code.


Using that same formula, you should find that 10C3 = 120 which represents the number of ways to pick any three buildings (whether they are to code or not).


As you can probably see, we are using nCr instead of nPr because order doesn't matter. A grouping like ABC is the same as CBA.


We have 10 ways to pick the three buildings that are to code out of 120 ways to pick the three buildings.
10/120 = 1/12


----------------------------------------


Answer: <font color=red>1/12</font>


======================================================================


Part (b)


We'll use the answer of the previous part.


The events "all 3 don't violate code" and "at least one violates code" are complementary events. 
One or the other must happen. 


P(all 3 don't violate code) + P(at least one violates code) = 1
P(at least one violates code) = 1 - P(all 3 don't violate code)
P(at least one violates code) = 1 - 1/12
P(at least one violates code) = 12/12 - 1/12
P(at least one violates code) = (12 - 1)/12
P(at least one violates code) = 11/12



Answer: <font color=red>11/12</font>
</font>