Factories processing jobs

110 Views Asked by At

We have two factories that can process jobs; each job takes two days to complete. The factories agree on a minimum threshold $a\in[0,1]$ to accept jobs. Every day, a value $v\in[0,1]$ is drawn uniformly, and either one or two jobs appear, with probability $50\%$ one and $50\%$ two, and each job has value $v$. If a job appears and a factory is free that day, and the job has value at least $a$, the factory takes the job and earns $a$ dollars. (So if two jobs appear and both factories are free, both may take a job.) It doesn't matter which factory takes which job. Jobs that are not taken that day disappear immediately.

Over an infinite amount of time, what is the average amount of money per day earned by both factories in total, in terms of $a$?

I tried writing a recurrence for this: suppose that $M$ is the desired amount. If for a given day we have $v<a$, no job is taken and we pass one day. Otherwise, either one or both factories take jobs, depending on how many factories are free and how many jobs are available that day. I'm not sure how to set up the variables for the recurrence here, and which states are needed.

1

There are 1 best solutions below

5
On BEST ANSWER

I consider the system as system with $9$ states, to every one of which I assign number $e_1..e_9$ which are proportional to the probabilities of the states. the 9 states are:

$2$ free factories and no valid jobs drawn - $e_1$
$2$ free factories with one valid jobs drawn - $e_2$
$2$ free factories and two valid jobs drawn - $e_3$
$1$ free factory and $1$ busy factory, and no valid jobs drawn - $e_4$
$1$ free factory and $1$ busy factory, with one valid jobs drawn - $e_5$
$1$ free factory and $1$ busy factory, and two valid jobs drawn - $e_6$
$2$ busy factories and no valid jobs drawn - $e_7$
$2$ busy factories with one valid jobs drawn - $e_8$
$2$ busy factories and two valid jobs drawn - $e_9$

Now, what is actually important is not the specific state, but rather what is the position of factories in the same day. so let's define new variables:

$E_1 = e_1+e_2+e_3$
$E_2 = e_4+e_5+e_6$
$E_3 = e_7+e_8+e_9$

Now, let's ask what states today bring us to to $E_1$ tomorrow ? clearly those are: $e_1, e_4, e_7, e_8, e_9$, so we have: $E_1 = e_1 + e_4 + e_7 + e_8 + e_9$. the same line for $E_2$ and $E_3$ will show that: $E_2 = e_2 + e_5 + e_6$, and $E_3 = e_3$

We can draw more identities: We know that $\dfrac{e_1}{e_2} = \dfrac{e_1}{e_3} = \dfrac{2a}{1-a}$. that because: $e_1 = E_1*a$ - as we have chance of $a$ that the $v$ drawn is lower than $a$, so no valid jobs offered. now, the chance that $v>a$ is $(1-a)$, and if that the case we have $50$% for one valid job and $50$% for two valid jobs. so $e_2 = e_3 = E_1 * \dfrac{1-a}{2}$. the same way we conclude that: $\dfrac{e_1}{e_2} = \dfrac{e_1}{e_3} = \dfrac{e_4}{e_5} = \dfrac{e_4}{e_6} = \dfrac{e_7}{e_8} = \dfrac{e_7}{e_9} = \dfrac{2a}{1-a}$

From all those identities and definition of $E_1, E_2, E_3$, we can express all the $9$ states in terms of $e_1$ and $a$:

1) We know that on one hand: $E_2 = e_4 + e_5 + e_6$ but also $E_2 = e_2 + e_5 + e_6$, so we have $e_4 = e_2$

2) we know that $e_8 = e_9 = e_7(\dfrac{1-a}{2a})$, so $E_3 = e_7 + e_8 + e_9 = e_7 (1 + \dfrac{1-a}{a}) = \dfrac{e_7}{a}$. We also know that $E_3 = e_3$, so we have $\dfrac{e_7}{a} = e_3$ or $e_7 = a*e_3$

3) we know that $e_2 = e_3 = e_1(\dfrac{1-a}{2a})$

4) so according to 1, we know that $e_4 = e_1(\dfrac{1-a}{2a})$. So we have $e_5 = e_6 = e_4 * (\dfrac{1-a}{2a}) = e_1(\dfrac{1-a}{2a}) * (\dfrac{1-a}{2a}) = e_1(\dfrac{1-a}{2a})^2$

5) according to 2, we know that $e_7 = e_1(\dfrac{1-a}{2})$, so we have $e_8 = e_9 = e_7(\dfrac{1-a}{2a}) = e_1(\dfrac{(1-a)^2}{4a})$.

To summarize:

$$ e_1 = e_1$$ $$ e_2 = e_3 = e_1(\dfrac{1-a}{2a})$$ $$ e_4 = e_1(\dfrac{1-a}{2a})$$ $$ e_5 = e_6 = e_1(\dfrac{1-a}{2a})^2$$ $$ e_7 = e_1(\dfrac{1-a}{2})$$ $$ e_8 = e_9 = e_1(\dfrac{(1-a)^2}{4a})$$

Now, let's compute the sum of the probabilities ratios: $$ S = e_1+e_2\ldots +e_9 = e_1(\dfrac{1+2a-a^2}{2a^2})$$

Now, we should ask what is the expected number of jobs per day we accept ? clearly, it is: $$ \dfrac{e_2 + 2e_3 + e_5 + e_6}{S} = \dfrac{1+a-2a^2}{1+2a-a^2} $$

I have tried to plug $a=\frac{1}{2}$, and got that the expected number of jobs accepted per day is $\frac{1}{1.75}$ or $\frac{4}{7}$, to calculate the expected profit all you have to do is to multiply by $a$

  • that result was validated with running 2 simulations of 10 millions days. the total number of jobs got were 5713768 and 5717083, which is indeed around $\frac{4}{7}$.

One can calculate the optimal $a$ to maximize the expected profit per day. the function is $a*\dfrac{(1+a-2a^2)}{1+2a-a^2}$ in $(0,1)$ which is around $a = 0.55609$, and the maximal profit is around $0.2892$.