Exercise

Two independent normal distributions

Rohit has two freelance jobs. The pay for each job follows two independent normal distributions:

  • income1 from Rohit's first job has a mean of $500 and a standard deviation of $50
  • income2 from Rohit's second job has a mean of $1,000 and a standard deviation of $200

Rohit has asked for your help simulating his income so that he can budget his expenses properly. You'll use sampling to find the 95% confidence interval of Rohit's total income from both jobs.

You are going to perform simulations using normal distributions, which are probably the most important probability distribution used in Monte Carlo simulation.

The following have been imported for you: NumPy as np, and SciPy's stats module as st.

Instructions

100 XP
  • Use st.norm.rvs() to sample 1,000 times from the normal distribution, setting the proper mean and standard deviation and assigning the results to income1 and income2.
  • Approximate total_income by adding income1 and income2 together.