Random number Generator

Can anyone help me the with approach of below problem pls