In a year, there's a total of 12 months. So if 4 of them have 30 days, then the rest don't: 12 - 4 = 8 months. So 8 months out of 12 don't have 30 days, and 4 out of 12 have 30 days.
So the ratio of the months with 30 days to the months with other than 30 days is 4/8. To simplify your answer, you divide both sides by 2 and you get a ratio of 1/2.
All in all, the ratio is 1/2.
Hope this helps! :)