The total sum of students given four quarters = The student who spent the money on gum plus the students that kept the money.

The total sum of students given four quarters is 51 students.
The student who spent the money on gum is 34 students.
The probability of the students that spent the money, given that the students were given four quarters,

The probability is,

The probability is 0.667.