Finite-state Markov chains
[38/100%]Let be the transition matrix for a finite state Markov chain and let state be recurrent. Prove that is aperiodic if .
Show that every Markov chain with states contains at least one recurrent set of states. Explaining each of the following statements is sufficient.
If state is transient, then there is some other state such that and .
If the of (a) is also transient, there is a third state such that , ; that state must satisfy , .
Continue iteratively to repeat (b) for successive states, . That is, if are generated as above and are all transient, generate such that and . Then for .
Show that for some , is not transient, i.e., it is recurrent, so a recurrent class exists.
Consider a finite-state Markov chain in which some given state, say state 1, is accessible from every other state. Show that the chain has exactly one recurrent class of states and state . (Note that the chain is then a unichain.)
Show how to generalize the graph in Figure 4.4 to an arbitrary number of states with one cycle of nodes and one of nodes. For , let node 1 be the node not in the cycle of nodes. List the set of states accessible from node 1 in steps for each and show that the bound in Theorem 4.2.11 is met with equality. Explain why the same result holds for all larger .
Theorem 4.2.11 (referenced in this problem, restated from Section 4.2): if is the matrix of an ergodic (i.e., recurrent, aperiodic, irreducible) finite-state Markov chain with states, then there is an integer such that for all ; the smallest such satisfies .
This is the proof of Theorem 4.2.11, split across Exercises 4.4--4.7; each generalizes the previous one, culminating in the bound above.
Show that an ergodic Markov chain with states must contain a cycle with states. Hint: Use ergodicity to show that the smallest cycle cannot contain states.
Let be a fixed state on this cycle of length . Let be the set of states accessible from in steps. Show that for each , . Hint: For any given state , show how to construct a walk of steps from to from the assumed walk of steps.
Define to be the singleton set and show that
Show that if one of the inclusions above is satisfied with equality, then all subsequent inclusions are satisfied with equality. Show from this that at most the first inclusions can be satisfied with strict inequality and that for all .
Show that all states are included in .
Show that for all .
Consider a Markov chain with one ergodic class of states, say and other states that are all transient. Show that for all and .
Let be the number of states in the smallest cycle of an arbitrary ergodic Markov chain of states. Show that for all . Hint: Look at the proof of Theorem 4.2.11 in Exercise 4.5.
For , draw the graph of an ergodic Markov chain (generalized for arbitrary ) for which there is an for which for . Hint: Look at Figure 4.4.
For arbitrary , draw the graph of an ergodic Markov chain (generalized for arbitrary ) for which there is an for which for . Assume that and are relatively prime.
A transition probability matrix is said to be doubly stochastic if
That is, the row sum and the column sum each equal 1. If a doubly stochastic chain has states and is ergodic (i.e., has a single class of states and is aperiodic), calculate its steady-state probabilities.
Find the steady-state probabilities for the Markov chain below. Express your answer in terms of the ratio , where . Pay particular attention to the special case .
[width=0.9figs/figs_original/ch4_ex9.png
Sketch . Give one sketch for , one for , and one for .
Find the limit of as approaches ; give separate answers for , , and . Find limiting values of for the same cases.
Find the steady-state probabilities for each of the Markov chains in the figure below. Assume that all clockwise probabilities in the first graph are the same, say , and assume that in the second graph.
[width=0.85figs/figs_original/ch4_ex10.png
Find the matrices for the same chains. Draw the graphs for the Markov chains represented by , i.e., the graph of two step transitions for the original chains. Find the steady-state probabilities for these two-step chains. Explain why your steady-state probabilities are not unique.
Find for each of the chains.
Assume that is a right eigenvector and is a left eigenvector of an stochastic matrix where . Show that . Hint: Consider two ways of finding .
Assume that has distinct eigenvalues. The right eigenvectors of then span space (see Section 5.2 of Strang [28]), so the matrix with those eigenvectors as columns is non-singular. Show that is a matrix whose rows are the left eigenvectors of . Hint: Use (a).
For any given integer , let be a diagonal matrix with a single non-zero element, . Using the assumptions and results of (b), show that
Hint: Visualize straightforward vector/matrix multiplication.
Verify (referenced here; restated: , where is the diagonal matrix of eigenvalues of ).
I added a restatement of equation (4.30), cited bare in part (d), from Section 4.4 of the source PDF, so the problem is solvable without looking it up.
Let be an eigenvalue of a stochastic matrix and let be a left eigenvector for . Show that for each component of and each that
By taking magnitudes of each side and looking at the appropriate , show that
Show that .
Consider a finite state Markov chain with matrix which has aperiodic recurrent classes, and a set of transient states. For any given recurrent class , consider a vector such that for each , for each , and otherwise. Show that is a right eigenvector of with eigenvalue 1. Hint: Redraw Figure 4.5 (a graph showing the block-triangular structure of for a unichain with transient set and recurrent class , transitions going only from to , from to , or within ) for multiple recurrent classes and first show that is an eigenvector of in the limit.
I added a description of Figure 4.5, cited bare in the hint, restated from the source PDF, so the problem is solvable without looking it up.
Answer the following questions for the following stochastic matrix :
Find in closed form for arbitrary .
Find all distinct eigenvalues and the multiplicity of each distinct eigenvalue for .
Find a right eigenvector for each distinct eigenvalue, and show that the eigenvalue of multiplicity 2 does not have two linearly independent eigenvectors.
Use (c) to show that there is no diagonal matrix and no invertible matrix for which .
Rederive the result of (d) using the result of (a) rather than (c).
Let be a 3 by 3 block of a Jordan form, i.e.,
Show that the th power of is given by
Hint: Perhaps the easiest way is to calculate and and then use iteration.
Generalize (a) to a block of a Jordan form. Note that the th power of an entire Jordan form is composed of these blocks along the diagonal of the matrix.
Let be a stochastic matrix represented by a Jordan form as and consider (i.e., ). Show that any repeated eigenvalue of (and, in particular, any eigenvalue represented by a Jordan block of or more) must be strictly less than 1. Hint: Upper bound the elements of by taking the magnitude of the elements of and and upper bounding each element of a stochastic matrix by 1.
Let be the eigenvalue of largest magnitude less than 1. Assume that the Jordan blocks for are at most of size . Show that each ergodic class of converges at least as fast as .
Let be an eigenvalue of a matrix , and let and be right and left eigenvectors respectively of , normalized so that . Show that
Show that .
Use induction to show that .
Let be the transition matrix for an aperiodic Markov unichain with the states numbered as in Figure 4.5 (referenced here; restated: state 1 through are the transient states , numbered before the recurrent states through , denoted , so that has the block form , where is the (generally non-square) block of transition probabilities from to ).
Show that can be partitioned as
That is, the blocks on the diagonal are simply products of the corresponding blocks of , and the upper right block is whatever it turns out to be.
Let be the probability that the chain will be in a recurrent state after transitions, starting from state , i.e., . Show that for all transient .
Let be the minimum over all transient and show that for all transient (i.e., show that approaches the all zero matrix with increasing ).
Let be a left eigenvector of of eigenvalue 1. Show that and show that must be positive and be a left eigenvector of . Thus show that exists and is unique (within a scale factor).
Show that is the unique right eigenvector of of eigenvalue 1 (within a scale factor).
I added a description of Figure 4.5's block structure, cited bare in the task, restated from the source PDF's Section 4.3, so the problem is solvable without looking it up.
Generalize Exercise 4.17 to the case of a Markov chain with recurrent classes and one or more transient classes. In particular, show that:
has exactly linearly independent left eigenvectors, of eigenvalue 1, and that the th can be taken as a probability vector that is positive on the th recurrent class and zero elsewhere.
has exactly linearly independent right eigenvectors, of eigenvalue 1, and the th can be taken as a vector with equal to the probability that recurrent class will ever be entered starting from state .
Show that
Suppose a recurrent Markov chain has period and let , , be the th subset in the sense of Theorem 4.2.9. Assume the states are numbered so that the first states are the states of , the next are those of , and so forth. Thus the matrix for the chain has the block form given by
[P] = \begin{bmatrix} 0 & [P_{0}] & \ddots & \ddots & 0 \\ 0 & 0 & [P_{1}] & \ddots & \ddots \\ \ddots & \ddots & \ddots & \ddots & \ddots \\ 0 & 0 & \ddots & \ddots & [P_{d-2}] \\[P_{d-1}] & 0 & \ddots & \ddots & 0 \end{bmatrix},where has dimension for , where the index is interpreted as 0 throughout (i.e., mod arithmetic is used on indices). In what follows it is often more convenient to express as an matrix whose entries are 0 except for the rows of and the columns of , where the entries are equal to those of . In this view, .
Show that has the form
where . Expressing as an matrix whose entries are 0 except for the rows and columns of where the entries are equal to those of , this becomes .
Show that is the matrix of an ergodic Markov chain and let its eigenvector of eigenvalue 1 (scaled to be a probability vector) be and let be the corresponding right eigenvector scaled so that . Let and be the corresponding -vectors. Show that .
Show that . Note that is an -tuple that is non-zero only on the components of .
Let and let . Show that is a left eigenvector of of eigenvalue .
(Continuation of Exercise 4.19.)
Show that, with the eigenvectors defined in Exercise 4.19,
where, as before, is taken to be 0.
Show that, for ,
Show that
Show that
where is the steady-state probability vector for . Hint: Show that and .
Show that the above result is also valid for periodic unichains.
Suppose and are each ergodic Markov chains with transition probabilities and respectively. Denote the steady-state probabilities of and by and respectively. The chains are now connected and modified as shown below. In particular, states and are connected and the new transition probabilities for the combined chain are given by
All other transition probabilities remain the same. Think intuitively of and as being small, but do not make any approximations in what follows. Give your answers to the following questions as functions of , , and .
[width=0.85figs/figs_original/ch4_ex21.png
Assume that , (i.e., that is a set of transient states in the combined chain). Starting in state , find the conditional expected time to return to given that the first transition is to some state in chain .
Assume that , . Find , the expected time to first reach state starting from state . Your answer should be a function of and the original steady-state probabilities in chain .
Assume , . Find , the expected time to first reach state , starting in state . Your answer should depend only on and .
Assume and . Find , the steady-state probability that the combined chain is in one of the states of the original chain .
Assume , . For each state in , find , the expected number of visits to state , starting in state , before reaching . Your answer should depend only on and .
Assume , . For each state in , find , the steady-state probability of being in state in the combined chain. Hint: Be careful in your treatment of state .
Section 4.5.1 showed how to find the expected first-passage times to a fixed state, say 1, from all other states. It is often desirable to include the expected first recurrence time from state 1 to return to state 1. This can be done by splitting state 1 into two states, first an initial state with no transitions coming into it but the original transitions going out, and second, a final trapping state with the original transitions coming in.
For the chain on the left side of Figure 4.6 (a four-state recurrent Markov chain, restated below), draw the graph for the modified chain with five states where state 1 has been split into two states.
[width=0.5figs/figs_original/ch4_fig46.png
Suppose one has found the expected first-passage times for states (or in general from 2 to ). Find an expression for , the expected first recurrence time for state 1 in terms of and .
I added the left-hand chain of Figure 4.6, cited bare in part (a), restated from the source PDF's Section 4.5.1, so the problem is solvable without looking it up.
Assume throughout that is the transition matrix of a unichain (and thus the eigenvalue 1 has multiplicity 1). Show that a solution to the equation exists if and only if lies in the column space of , where is the identity matrix.
Show that this column space is the set of vectors for which . Then show that lies in this column space.
Show that, with the extra constraint that , the equation has a unique solution.
For the Markov chain with rewards shown below (states 1 and 2, transition probabilities , , rewards , ):
[width=0.45figs/figs_original/ch4_fig48.png
Find the solution to (referenced here; restated: the relative-gain equation , together with the normalization ) and find the gain .
Modify the figure above by letting be an arbitrary probability. Find and again and give an intuitive explanation of why affects .
I added a restatement of equation (4.37), cited bare in part (a), from Section 4.5 of the source PDF, so the problem is solvable without looking it up.
Show that the gain per stage is 0. Hint: Show that is zero where the steady-state vector is non-zero.
Let be the transition matrix for the recurrent states and let be the reward vector and the relative-gain vector for . Show that . Hint: Use Theorem 4.5.4.
Show that for all . Hint: Compare the relative-gain equations for to those for .
Show that for each , . Hint: Start with the relative-gain equation for .
Show that . Hint: Sum the result in (d).
Show that and that is finite, non-negative, and has positive components for . Hint: Use Lemma 4.3.6.
Demonstrate the final result of the corollary by using the previous results on .
Consider the Markov chain below:
[width=0.4figs/figs_original/ch4_ex26.png
Suppose the chain is started in state and goes through transitions; let be the expected number of transitions (out of the total of ) until the chain enters the trapping state, state 1. Find an expression for in terms of (take for all ). Hint: View the system as a Markov reward system; what is the value of ?
Find the numerical value of . Interpret the meaning of the elements in the solution of .
Give a direct argument why provides the solution directly to the expected time from each state to enter the trapping state.
Show that (referenced here; restated: the dynamic-programming recursion , in vector form ) can be rewritten in the more compact form
Explain why it is also true that
One might guess that (A.63) could be used iteratively, finding from . Explain why this is not possible in any straightforward way. Hint: Think through explicitly how one might calculate from .
I added a restatement of equation (4.48), cited bare in part (a), from Section 4.6 of the source PDF, so the problem is solvable without looking it up.
Consider finding the expected time until a given string appears in an IID binary sequence with , .
Following the procedure in Example 4.5.1, draw the 3 state Markov chain for the string . Find the expected number of trials until the first occurrence of that string.
For (b) and (c), let , i.e., zero followed by ones. Draw the corresponding Markov chain for .
Let , be the expected first-passage time from state to state . Note that . For each , , show that and where and are each expressed as a product of powers of and . Hint: use induction on using as the base. For the inductive step, first find as a function of starting with and using the equation .
Let . Draw the corresponding Markov chain for this string. Evaluate , the expected time for to occur.
Find for the Markov chain below. Hint: Think in terms of the long term transition probabilities. Recall that the edges in the graph for a Markov chain correspond to the positive transition probabilities.
[width=0.35figs/figs_original/ch4_ex29.png
Let and denote the first two rows of and let and denote the first two columns of . Show that and are independent left eigenvectors of , and that and are independent right eigenvectors of . Find the eigenvalue for each eigenvector.
Let be an arbitrary reward vector and consider the equation
Determine what values and must have in order for (A.64) to have a solution. Argue that with the additional constraints , (A.64) has a unique solution for and find that .
Let and be arbitrary final reward vectors with .
Let be an arbitrary stationary policy and prove that for each .
For the optimal dynamic policy, prove that for each . This is known as the monotonicity theorem.
Now let and be arbitrary. Let . Show that
Consider a Markov decision problem with states in which some state, say state 1, is inherently reachable from each other state.
Show that there must be some other state, say state 2, and some decision, , such that .
Show that there must be some other state, say state 3, and some decision, , such that either or .
Assume, for some , and some set of decisions that, for each , , for some (i.e., that each state from 2 to has a non-zero transition to a lower numbered state). Show that there is some state (other than 1 to ), say and some decision such that for some .
Use (a), (b), and (c) to observe that there is a stationary policy for which state 1 is accessible from each other state.
George drives his car to the theater, which is at the end of a one-way street. There are parking places along the side of the street and a parking garage that costs $5 at the theater. Each parking place is independently occupied or unoccupied with probability . If George parks parking places away from the theater, it costs him cents (in time and shoe leather) to walk the rest of the way. George is myopic and can only see the parking place he is currently passing. If George has not already parked by the time he reaches the th place, he first decides whether or not he will park if the place is unoccupied, and then observes the place and acts according to his decision. George can never go back and must park in the parking garage if he has not parked before.
Model the above problem as a 2 state dynamic programming problem. In the `driving' state, state 2, there are two possible decisions: park if the current place is unoccupied or drive on whether or not the current place is unoccupied.
Find , the minimum expected aggregate cost for stages (i.e., immediately before observation of the th parking place) starting in state or 2; it is sufficient to express in terms of . The final costs, in cents, at stage 0 should be , .
For what values of is the optimal decision the decision to drive on?
What is the probability that George will park in the garage, assuming that he follows the optimal policy?
Show that if two stationary policies and have the same recurrent class and if for all , then for all . Hint: See the first part of the proof of Lemma 4.6.7.
Assume that satisfies (i.e., that it satisfies the termination condition of the policy improvement algorithm) and that satisfies the conditions of (a). Show that is satisfied for all states .
Show that . Hint: Follow the reasoning at the end of the proof of Lemma 4.6.7.
Consider the dynamic programming problem below with two states and two possible policies, denoted and . The policies differ only in state 2.
[width=0.9figs/figs_original/ch4_ex34.png
Find the steady-state gain per stage, and , for stationary policies and . Show that .
Find the relative-gain vectors, and , for stationary policies and .
Suppose the final reward, at stage 0, is , . For what range of does the dynamic programming algorithm use decision in state 2 at stage 1?
For what range of does the dynamic programming algorithm use decision in state 2 at stage 2? At stage ? You should find that (for this example) the dynamic programming algorithm uses the same decision at each stage as it uses in stage 1.
Find the optimal gain and as a function of stage assuming .
Find and show how it depends on .
Consider a Markov decision problem in which the stationary policies and each satisfy and each correspond to ergodic Markov chains.
Show that if is not satisfied with equality, then .
Show that . Hint: Use (a).
Find the relationship between the relative gain vector for policy and the relative-gain vector for policy . Hint: Show that ; what does this say about and ?
Suppose that policy uses decision 1 in state 1 and policy uses decision 2 in state 1 (i.e., for policy and for policy ). What is the relationship between for equal to 1 and 2?
Now suppose that policy uses decision 1 in each state and policy uses decision 2 in each state. Is it possible that for all ? Explain carefully.
Now assume that is the same for all . Does this change your answer to (e)? Explain.
Consider a Markov decision problem with three states. Assume that each stationary policy corresponds to an ergodic Markov chain. It is known that a particular policy is the unique optimal stationary policy (i.e., the gain per stage in steady state is maximized by always using decision 2 in state 1, decision 4 in state 2, and decision 1 in state 3). As usual, denotes the reward in state under decision , and denotes the probability of a transition to state given state and given the use of decision in state . Consider the effect of changing the Markov decision problem in each of the following ways (the changes in each part are to be considered in the absence of the changes in the other parts):
is replaced by .
is replaced by .
is replaced by for all state 1 decisions .
For all , is replaced by for the decision of policy .
For each of the above changes, answer the following questions; give explanations:
-
Is the gain per stage, , increased, decreased, or unchanged by the given change?
-
Is it possible that another policy, , is optimal after the given change?
Let be the optimal stationary policy for a Markov decision problem and let and be the corresponding gain and steady-state probability respectively. Let be the optimal dynamic expected reward for starting in state at stage with final reward vector .
Show that ; . Hint: Consider premultiplying by or where is the optimal dynamic policy at stage .
Show that the lower bound is non-decreasing in and the upper bound is non-increasing in .
Consider an integer-time queueing system with a finite buffer of size 2. At the beginning of the time interval, the queue contains at most two customers. There is a cost of one unit for each customer in queue (i.e., the cost of delaying that customer). If there is one customer in queue, that customer is served. If there are two customers, an extra server is hired at a cost of 3 units and both customers are served. Thus the total immediate cost for two customers in queue is 5, the cost for one customer is 1, and the cost for 0 customers is 0. At the end of the th time interval, either 0, 1, or 2 new customers arrive (each with probability ).
Assume that the system starts with customers in queue at time (i.e., in stage 1) and terminates at time 0 (stage 0) with a final cost of 5 units for each customer in queue (at the beginning of interval 0). Find the expected aggregate cost for .
Assume now that the system starts with customers in queue at time with the same final cost at time 0. Find the expected aggregate cost for .
For an arbitrary starting time , find the expected aggregate cost for .
Find the cost per stage and find the relative cost (gain) vector.
Now assume that there is a decision maker who can choose whether or not to hire the extra server when there are two customers in queue. If the extra server is not hired, the three-unit fee is saved, but only one of the customers is served. If there are two arrivals in this case, assume that one is turned away at a cost of 5 units. Find the minimum dynamic aggregate expected cost , , for stage 1 with the same final cost as before.
Find the minimum dynamic aggregate expected cost for stage , .
Now assume a final cost of 1 unit per customer rather than 5, and find the new minimum dynamic aggregate expected cost , .