Python代写|Matlab代写 - ECE541 Stochastic Signals and Systems
时间:2020-11-09
A casino has N slot machines, numbered 0, 1, . . . , N N 1, arranged in a circular configuration such that machine n is adjacent to machine n + 1 mod N. (Thus machines N N 1
and 0 are adjacent.) In the following, we assume + and d operators use mod N arithmetic
such that
n + 1 ≡ (n + 1) mod N, n n 1 ≡ n n 1 mod N.
Because of Covid-19 safety restrictions, customers are not allowed to operate adjacent
machines. That is, if machine n is in use (occupied), then machines n n 1 and n + 1
must be unoccupied. We say slot machine n is available if machines n n 1, n and n + 1
are all unoccupied. In this problem, we examine the cost of Covid-19 restrictions using a
continuous-time Markov chain system model. Customers arrive as a rate λ Poisson process.
Each customer plays a slot machine for an exponential (µ) time, independent of the time any
other customer plays any other machine. If a customer arrives, and no machine is available,
then the customer is blocked and immediately departs the casino. We will compare the
following casinos:
1. In casino 1, an arriving customer randomly chooses an available machine.
2. In casino 2, odd numbered machines are covered over and customers are permitted
only to use machine 0, 2, 4, . . .. Any unoccupied even number machine is available. An
arriving customer randomly chooses one of the available machines.
We will compare the casinos by blocking probability. To calculate the blocking probability,
suppose the Markov state of the casino is x and πx is the stationary probability of state x.
There is a set of states B in which no machines are available. At either casino, a customer
is blocked with probability
P[B] = Xπx x∈B
However, the definition of the state x depends on the casino and the stationary probabilities
πx are different for the two casinos.
Your grade is based on your report. Your report should characterize πx for both casinos
and include your code for computing P[B]. Your report must include a plot. Let βk equal
the blocking probability at casino k. Your plot is a semilogy plot of β1 and β2 as a function
of the normalized load ρ = λ/µ for several values of N, including the largest value of N for
which you can compute β1. Your report should explain what limited your largest value of
N.
Here are some comments and possibly helpful hints:
• Casino 2 is just an M/M/c/c queue and the state x is just the number of occupied slot
machines.
1
• Casino 1 is more complicated. The state x is a vector x = x0 x1 · · · xNN1
where
xi
is a binary variable such that xi = 1 if slot machine i is occupied and otherwise
xi = 0.
• Casino 1 has a set of feasible states x. You should ignore/exclude infeasible states x
that would correspond to neighboring slot machines being occupied.
• It might be helpful to analyze by hand the stationary probabilities πx for small values
of N. You might identify some structural properties that could make the job easier.
• For large N, you will need to do computations in MATLAB or python or some equivalent. You must include your source code in your report.