I'm having some trouble with hierarchical models.

Suppose that a company has determined that the number of jobs per week, N, varies from week to week and has a Poisson distribution with mean . The number of hours to complete each job, , is gamma distributed with parameters and . The total time to complete all jobs in a week is:

Note that T is the sum of a random number of random variables.

What is ?

a)

The correct answer is , but I don't know how to get there? Is it correct to do like this?

=

=

and because is gamma distributed =>

b)=

The correct answer is , but I don't know how to get there. I don't really know how to think when it comes to hierarchical models. It's kind of difficult, I think. Thanks in advance for your help.