Let us assume total number of students were surveyed = x.
1/4 of x students preferred red = 1/4 x.
1/8 of of x students preferred blue = 1/8 x
Remaining students = (x - 1/4 x - 1/8 x)
3/5 of the remaining students chose green that is 3/5 of (x - 1/4 x - 1/8 x).
15 students preferred green.
So, we can setup an equation:
[tex]\frac{3}{5}\left(x-\frac{1}{4}x-\frac{1}{8}x\right)=15[/tex]
[tex]\mathrm{Multiply\:both\:sides\:by\:}5[/tex]
[tex][tex]5\cdot \frac{3}{5}\left(x-\frac{1}{4}x-\frac{1}{8}x\right)=15\cdot \:5[/tex][/tex]
[tex]3(\frac{8x-2x-x}{8}) =75[/tex]
[tex]3(\frac{5x}{8}) =75[/tex]
Dividing both sides by 3.
[tex]\frac{5x}{8} =25[/tex]
Multiplying both sides by 8, we get
5x = 200.
Dividing both sides by 5, we get
x= 40.