we where given the following
Red = 30
Green = 29
Both Red and Green = 17
if there are 17 of them that likes both kinds of jelly beans, there are 17 of them that like both and those are taken into account for the red and green statistics.
in order to provide a nuber of students that like only red, we must ignore those who like both
so,
Only Red = Red - Both
recall, Red = 30
Both = 17
therefore,
Only Red = 30 -17
Only Red =13