# Pigs, dinosaurs, elephants, and unicorns arrive to the Animal Hospital to have their health check-up according to Poisson processes with rates l1; l2; l3; and l4, respectively. The time for each...

Pigs, dinosaurs, elephants, and unicorns arrive to the Animal Hospital to have

their health check-up according to Poisson processes with rates l1; l2; l3; and l4, respectively.

The time for each health check-up, remarkably, is exponentially distributed with parameter mi (that is, rate mi) for an animal of type i.

Each type i of animals has their own waiting room of size Ni <∞ , and there is also a

common waiting room of size M < ∞. If an animal arrives to his type-appropriate waiting room to find it full, then he can wait in the common waiting room if there’s still space. If the common waiting room is also full, he will just leave.

(a) Write the state space S.

(b) Find the equilibrium probabilities that there are 10 pigs, 40 dinosaurs, 3 elephants and 120 unicorns in the Animal Hospital.

*print*Print*list*Cite

### 1 Answer

a) Suppose that the size of the animal-specific waiting rooms are

Np = 30, Nd = 30, Ne = 2, Nu = 25 for pigs, dinosaurs, elephants and unicorns respectively. Also, that the common waiting room has size M = 150. Assume the dinosaurs are small species of dinosaur (pterodactyls say) and the unicorns are pygmy unicorns (size of a large dog).

The 5 dimensional state-space of the whole system is then

**S = [Sp, Sd, Se, Su, Sc] = [{0,1,..,Np},{0,1,...,Nd},{0,1,...,Ne},{0,1,...,Nu},{0,1,...,M}] = [{0,1,..,30},{0,1,...,30},{0,1,2},{0,1,...,25},{0,1,...,150}]**

The total capacity of the hospital is (including patients potentially being seen) is (Np+1) + (Nd+1) + (Ne+1) + (Nu+1) + M = 241

b) Each of the queues to the animal-specific waiting rooms is an M/M/1 queue where the Poisson arrival rate is li (where i = p,d,e, or u) and the service rate is mi. The *equilibrium* probability of there being ni animals in each waiting room is geometrically distributed with parameter (1-ri) where ri = li/mi (see reference)

So that the probability of there being ni animals in the ith waiting room +1 of an animal of that type currently being seen is

(1-ri)x(ri^ni)

[NB assume that animals arrive via the common room, so that they are seen on a first-come-first-served basis. For example, they may have a ticket stating their number in the queue]

Therefore, the equilibrium probabilities of there being 10 pigs, 40 dinosaurs, 3 elephants and 120 unicorns in the hospital are given by

**(1-rp)x(rp^10), (1-rd)x(rd^40), (1-re)x(re^3), (1-ru)x(ru^120)** (multiply these together for the combined probability of all events, since they are independent)

As the animal-specific waiting room sizes are 30, 30, 2, 25 respectively, the waiting room for pigs has 21 free spaces, the dinosaur room is full as is the elephant room and also the unicorn room. The common room has 9 dinosaurs and 94 unicorns in it, so that there are 150-103 = 47 free 'seats' in the common room.

If the surpluses of the animal-specific waiting rooms exceeds the size of the common room capacity (M=150), the probability of there being that combination of animals in the hospital would be zero. Note the common room could be full even if some (but not all) of the individual waiting rooms have free space.

**Sources:**