In this case, we'll have to carry out several steps to find the solution.
Step 01:
Data
chocolate chip cookies = 6
peanut butter cookies = 8
sugar cookies = 5
oatmeal raisin cookies = 5
p (peanut butter cookie) = ?
Step 02:
Probability
Event 1:
p (peanut butter cookie) = favorable outcomes / total outcomes
total outcomes = total cookies = 6 + 8 + 5 + 5 = 24
favorable outcomes = peanut butter cookies = 8
p (peanut butter cookie) = 8 / 24 = 1 / 3
Event 2:
total outcomes = 23
favorable outcomes = 7
p (peanut butter cookie) = 7/23
The answer is:
p (peanut butter cookie) = 7/23 = 0.30