"A one man barber show serves customer at an average rate of one every
30 minutes according to an exponential distribution. Customer arrive
according to a Poisson process at a mean rate of three per hour, and
they can wait for a hair cut if the barber is busy cutting someones
hair. However, some customers choose not to wait and go to another
place for a haircut with probability n/3, where n is the number of
customers already in the barber shop. How much profit should the
barber expect to lose from the customer that go to another barber
shop, if the average profit per customer is $9.00? [can you also
suggest how I can apply the solution to this problem if there were two
barbers instead of one] "
So here is a solution.
We can think of the barber shop as a machine that can be in several
states. There can be 0, 1, 2, or 3 customers in the barber shop. If
there are 3 customers in the shop, then any new customer will "choose
to not wait" with probability 1, so the barber shop never has 4
customers.
Now, let's try to compute the probability that the barber shop will
transition from one state to another state. Let's analyze the
possible state transitions during a small interval of time h. We will
assume that h is small enough that we can ignore the possibility that
two transitions occur during the time interval h. So, there are three
things that can happen during that time interval: 1) a new customer
arrives and stays, 2) a customer's hair cut ends, or 3) the state of
the barber shop does not change. We need to figure out the
probabilities of each of theses events.
For event 1), the probability that a new customer arrives is
governed by a "Possion Process". According to Math World (slightly
edited, http://mathworld.wolfram.com/PoissonProcess.html),
"A Poisson is a process satisfying the following properties:
1. The numbers of changes in nonoverlapping intervals are
independent for all intervals.
2. The probability of exactly one change in a sufficiently small
interval h is P = v h.
3. The probability of two or more changes in a sufficiently small
interval h is 0."
Thus, the probability that a customer arrives is v h. Since we know
that on average 3 customers arrive per hour, v must be 3 customers /
hour. So if there are 0, 1, 2, or 3 customers in the shop, the
probability that a new customer will come and stay is v*h, v*h *2/3,
v*h * 1/3, or 0 respectively.
For event 2), we have to compute the probability that a hair cut
will end. The simple way to figure that out is to recall that
exponential processes have no memory, and thus, the probability that a
hair cut will end is not affected by the ending time of the last hair
cut. Hence the hair cut ending events are also a Poisson process.
Applying rule two for Poisson processes yields a probability P = u h
with u = 2 customers / hour (because the average time for a hair cut
is 30 min.) The less simple way to compute this probability is to use
Bayes rule to compute the probability that a customer hair cut will
end in the time interval (t, t+h) given that it started t minutes ago
and has not ended. If you do this computation, you get an answer that
is very nearly the same, but let's not bother with those integrals and
just use P=u h as our probability.
For event 3), the non-event of nothing happening, we can just take
one minus the probabilities of events 1) and 2).
Let old3, old2, old1, and old0 be the probabilities that the shop
will be in a state of 3 customers, 2 customers, 1 customers, or 0
customers at time t and let new3, new2, new1, and new0 be the same
probabilities at time t+h. Then we can use the probabilities for
events 1), 2) and 3) to figure out some equations:
new3 = (1 - h u) * old3 + v h 1/3 * old2,
new2 = h u * old3 + (1 - h u - h v 1/3 ) * old2 + v h 2/3 * old1,
new1 = h u * old2 + (1 - h u - h v 2/3 ) * old1 + v h * old0, and
new0 = h u * old1 + (1 - h v ) * old0.
Let's look at the second equation to understand the idea behind
these equations. The second equation states that the probability of
being in state 2 at time t+h has three components: a) the
probability that the shop was in the state of three customers and a
hair cut finished (h u * old3), b) the probability that the shop had
two customers and nothing happened during the time interval, and c)
the probability that the shop had one customer and a new customer
arrived and stayed ( v h 2/3 * old1 ).
We can now use these equations to figure out the steady state,
time independent probabilities for the states of 0, 1, 2, or 3
customers. For time independence, we set new3 = old3, new2 = old2,
new1 = old1, and new0 = old0. Also the probabilities must add to one
so old0 +old1 +old2 +old3 =1. Then we do a lot of algebra and get the
following solution:
old3 = 2 v^3 /s
old2 = 6 u v^2 /s
old1 = 9 u^2 v /s
old0 = 9 u^3 /s
where s = (2 v^3 + 6 u v^2 + 9 u^2 v + 9 u^3). Plugging in u = 2 and
v = 3 we get
old3 = 3/19,
old2 = 6/19,
old1 = 6/19, and
old0 = 4/19.
Finally we can compute the lost profit. An average of 3 new
customers arrive per hour. If the shop has 3 customers, we lose the
new customer. If the shop has 2 customers, we lose the new customer
2/3 of the time. If the shop has 1 customer, we lose the new customer
1/3 or the time. So, the total of all these lost customers per hour
is
lost customers = ( old3 + 2/3 old2 + 1/3 old1) * (3 customers per
hour)
= 27/19.
The lost revenue is 9* 27/19 = $12.79 per hour.
We solved the problem by forming steady state probability
equations. The equations were simple, linear equations because the
processes were Poisson. The algebra was fairly simple because there
were only 4 possible states for the shop. Had the customer
preferences allowed more than 10 states, we would have to introduce
new techniques to handle the problem. (Simple matrix inversion takes
care of up to 100 state easily. Recurrence equations can handle many
more.)
The second version of the problem with two barbers is almost the
same as the first version. The old-new transition equations are
slightly different. The following backwards hint is really all you
need to solve the second version. Hint: .erots eht ni sremotsuc eno
naht erom si ereht nehw selbuod sdne tucriah a taht doohilekil
eht,esruoc fO |