According to your question, Let's calculate the probabilities for each case: (The "P" Given beside stands for Probability)
a. Probability of first choosing a white sock, then a white sock:
P(white, white) = (12/30) * (11/29) = 132/870
b. Probability of first choosing a black sock, then a black sock:
P(black, black) = (18/30) * (17/29) = 306/870
c. Probability of first choosing a white sock, then a black sock:
P(white, black) = (12/30) * (18/29) = 216/870
d. Probability of first choosing a black sock, then a white sock:
P(black, white) = (18/30) * (12/29) = 216/870
e. Probability of getting a matching pair (either both white or both black):
P(matching pair) = P(white, white) + P(black, black) = (132/870) + (306/870) = 438/870
f. Probability of getting a mismatching pair (one white and one black):
P(mismatching pair) = P(white, black) + P(black, white) = (216/870) + (216/870) = 432/870
Also If required you can further Simplify the Fractions
Hope the Answer Works ;)