copying solution to IPRB over to Probability