Given data:
The number of cups of ice cream a person eats, N=2.
Total number of people attending the party, M=24.
So, the total number of cups of ice cream needed is,
[tex]\begin{gathered} T=N\times M \\ =2\times24 \\ =48\text{ cups} \end{gathered}[/tex]We know,
[tex]1galllon=16cups.[/tex]Therefore,
[tex]1\text{ cup=}\frac{1}{16}gallon[/tex]Therefore, the number of gallon tubs of ice cream to be bought is,
[tex]\begin{gathered} T=48\times\frac{1}{16}\text{gallon} \\ =3\text{ gallons} \end{gathered}[/tex]Hence, 3 gallon tubs of ice cream is to be bought by Trent.