Hi, please run a Monte Carlo simulation for two probability distributions. I have two…
- User
Hi, please run a Monte Carlo simulation for two probability distributions.
I have two tasks, will take between 1-5 hrs, and the other will take between 2-6 hrs. They are normal distributions.
I would like to compute the mean time to complete both tasks.
- Assistant
The mean time to complete both tasks, based on the Monte Carlo simulation, is approximately7.00 hours.
- User
Please compute the probability that the tasks will take more than 9 hours
- Assistant
The probability that the tasks will take more than 9 hours is approximately7.09%.
- User
Please change to a uniform distribution and rerun the simulation
- Assistant
With a uniform distribution:
The mean time to complete both tasks is approximately7.00 hours.
The probability that the tasks will take more than 9 hours is12.45%.
The mean time to complete both tasks is approximately7.00 hours.
The probability that the tasks will take more than 9 hours is12.
- User
Okay, now how do I do it analytically?
- Assistant
For two independent tasks following auniform distribution, we can compute the mean, variance, and probability analytically.
- Expected Total Time
For a uniform distributionU(a,b)U(a, b)U(a,b), the mean is:
For your tasks:
Task 1:U(1,5)U(1,5)U(1,5)→E[T1]=1+52=3E[T_1] = \frac{1+5}{2} = 3E[T1]=21+5=3
Task 2:U(2,6)U(2,6)U(2,6)→E[T2]=2+62=4E[T_2] = \frac{2+6}{2} = 4E[T2]=22+6=4
Task 1:U(1,5)U(1,5)U(1,5)→E[T1]=1+52=3E[T_1] = \frac{1+5}{2} = 3E[T1]=21+5=3
Task 2:U(2,6)U(2,6)U(2,6)→E[T2]=2+62=4E[T_2] = \frac{2+6}{2} = 4E[T2]=22+6=4
Since expectation is linear:
- Variance of Total Time
For a uniform distributionU(a,b)U(a, b)U(a,b), the variance is: