added a new function to calculate rho, which is used in the simulation problem a).