We went over this problem in class but I don’t understand what exactly the professor did, so could someone explain step by step how to approach a problem like this? I have a homework assignment with problems similar to this, so I’m hoping if I can understand one I can do the rest.

Let X1,…,Xn be a random sample from a Gamma distribution G(alpha, beta) when alpha = 2. Show that S = the sum of xi from i=1 to n is a sufficient statistic for beta using the factorization theorem.