XXX always procrastinate over his homework. This time, he is wondering that if he can finish all his projects before deadline. There are n (2<=n<=5) projects to do. Each projects has a deadline d (1<=d<=1000) which means that this project must be finished no later than d o'clock.
For each project, there is an interval [s1, s2] (1<=s1<=s2<=200) meaning that XXX will spend at least s1 hours and at most s2 hours to finish it.
Let random variable t denotes that it takes t hours to finish the project. (Note that t may take real values).
If s1<s2, variable t obeys a continuous uniform distribution. Its probability density function is:
If s1=s2, variable t takes constant value s1.
In probability theory, a probability density function (pdf), or density of a continuous random variable, is a function that describes the relative likelihood for this random variable to take on a given value. The probability for the random variable to fall within a particular region is given by the integral of this variable’s density over the region. The probability density function is nonnegative everywhere, and its integral over the entire space is equal to one.
XXX cannot engage in different projects at the same time. He wants to arrange the order of his projects to be done properly, so that the probability that all projects are finished before or just meet the deadline is maximized.