We need to remember that a ratio is a fraction comparing two quantities.
We have 9 + 5 + 1 + 4 = 19 students.
And those ones who like peanuts are 5. Then, the ratio is:
5.9m questions
7.7m answers