To find the probability of randomly choosing a fantasy book from the shelf, we first need to calculate the total number of books.
The total number of books is:
- Mystery: 12
- Romance: 3
- Fantasy: 9
- Nonfiction: 6
Total = 12 + 3 + 9 + 6 = 30 books
Now, the number of fantasy books is 9. The probability of choosing a fantasy book is given by the formula:
\[ \text{Probability} = \frac{\text{Number of favorable outcomes}}{\text{Total number of outcomes}} \]
In this case, the number of favorable outcomes is 9 (the number of fantasy books), and the total number of outcomes is 30 (the total number of books).
Thus, the probability of randomly choosing a fantasy book is:
\[ \text{Probability} = \frac{9}{30} = \frac{3}{10} \]
So, the correct answer is:
3/10