Question
(10%) Suppose you have have a STRIPS representation for actions A1 and A2, and you want to define the STRIPS representation for the composite action A1;A2, which means that you do A1 then do A2.
-
What is the add list for this composite action?
-
What is the delete list?
-
What are the preconditions for this composite action?
-
Give a possible STRIPS representation of the actions Move(here,there) and Pickup(object) and for the composite action Move(here,there);Pickup(object).
Solution
Let the AL(A) and DL(A) denote the add and delete lists of the action A respectively. Let PC(A) denote the preconditions of the action A.
1
: AL(A1;A2) consists of the elements of AL(A2), and those elements of the AL(A1) which will not be deleted by A2.
2
: DL(A1;A2) consists of the elements of DL(A2), and those elements of DL(A1) which will not be added again by A2.
3
: PC(A1;A2) consists of the elements of PC(A1), and those elements of PC(A2) which are not supplied by AL(A1).
4
: A possible STRIPS representation follows:
Question
(20%) The towers of Hanoi problem is to move a set of n disks of different sizes from one peg to another, using a third peg for temporary storage. Disks are moved one at a time, and a larger disk cannot rest on a smaller one. (You might be familiar with a recursive algorithm for solving this problem.) Formulate this problem as a STRIPS-style planning problem. You will need to specify the initial state, the goal state, and the set of STRIPS-style operators. Feel free to use variables in operator description if needed.
Solution
Initial state:
Goal state:
The action description (disc, source and dest are variables.):
Question
(20%) Let us consider a version of the milk/banana/drill shopping problem in which money is included, at least in a simple way.
-
Let CC denote a credit card that the agent can use to buy any object. Modify the description of Buy so that the agent has to have its credit card in order to buy anything.
-
Write a Pickup operator that enables the agent to Have an object if it is portable and at the same location as the agent.
-
Assume that the credit card is at home, but Have(CC) is initially false. Construct a partially ordered plan that achieves the goal, showing both ordering constraints and causal links.
-
Explain in detail what happens during the planning process when the agent explores a partial plan in which it leaves home without the card.
Solution
1
: The modified buy operator is described by the following:
2
: ‘At(y)’ denotes the presense of the agent at y.
3
: The plan, with the causal links and the constraints, is shown below.

4
: Let us consider an agent which implements ‘Plan Space Planning’. For such an agent, plan flaws initially consist of all open goals. The agent iteratively refines a partial plan. At each step of the refinement, the agent non-deterministically resolves a flaw. Initially, the partial plan will consist of only the ‘Start’ and ‘Finish’ states.
The questions rquires us to consider the case when the agent explores a partial plan where the agent leaves home without the card. There are many partial plans where this happens. I will use the following partial plan to explain in detail what happens during the planning process when the agent explores such a plan (The argument can be extended to other compliant partial plans.):

The above is a plausible partial order plan which can be generated during ‘Plan Space Planning’. We see that the set of flaws, F consists of the Open Goals: {Have(CC), Have(Milk), Have(Bananas), At(Home)}. Now, the agent generates the set of resolvers for these flaws. The set of resolvers are the actions {Pickup(CC), Buy(CC), Pickup(Milk), Buy(Milk), Pickup(Bananas), Buy(Bananas), Go(x, Home)}.
Note: Both Pickup(Milk) and Buy(Milk) can satisfy Have(Milk). But, Pickup(Milk) requires Portable(Milk), ObjectAt(x1,Milk) and At(x1); whereas Buy(Milk) requires Have(CC), At(SM) and Sells(SM,Milk). An agent choosing Pickup(Milk) will end up with a partial plan which cannot be further refined. Hence, let us assume that the agent is designed, in its stochastic choice of resolver to improve partial plans, to select Buy(Milk) rather than Pickup(Milk), because the former has more satisfied preconditions. Due to similar reasons, the agent will select Pickup(CC) over Buy(CC).
Now, it is possible that, in the next refinement of the partial plan, the agent selects Pickup(CC) to resolve the flaw of not having a credit card. As the action ‘Start’ provides At(Home) and ObjectAt(CC, Home), which are prerequisites of Pickup(CC), the agent adds a causal link from Start to Pickup(CC). Similarly, a causal link is added to Buy(Drill, HWS). Also, as the action Go(Home, HWS) negates At(Home), a constraint link is added from Pickup(CC) to Go(Home, HWS). Either after or before this refinement, the partial plan can or could have been refined so as to eliminate the flaws due to the unsatisfied prerequisites, Have(Milk), Have(Bananas) and At(Home) by the addition of suitable resolvers shown in the partial order plan provided in answer to the previous subquestion.
Thus, eventually, the agent arrives at a suitable partial order plan.
Question
(12%) We have only considered planners that have goals of achievement: Take steps to ensure that a proposition is true at some time or in some situation. In this exercise, we consider goals of maintenance and prevention. Maintenance goals involve propositions that must remain true over a given interval of time. Prevention goals involve propositions that must never become true over a given interval of time. Discuss how maintenance and prevention goals can be handled by least commitment planning (e.g. the POP algorithm).
Solution
Operators cause changes in the truth values of propositions. Prevention and Maintenance goals, thus boil down to the problem of scheduling actions, so that the truth values of certain propositions are fixed as required. Consider the prevention goal P, which states that A should be false in the time interval (ta1,ta2), and the maintenance goal M, which says that B should be true in the time interval (tb1,tb2).
Let us consider an agent which implements ‘Plan Space Planning’ (PSP). For such an agent, plan flaws initially consist of all open goals. The agent iteratively refines a partial plan. At each step of the refinement, the agent non-deterministically resolves a flaw. Initially, the partial plan will consist of only the ‘Start’ and ‘Finish’ states.
PSP can handle P and M by preprocessing the problem as follows: For the proposition to be prevented (A), create another proposition, NA, such that the truth value of NA is always the opposite of A. Modify all actions which alter the truth value of A to do so. Create new propositions PA(timeInterval) and MB(timeInterval) to indicate whether propositions A and B were prevented and maintained during a specified time interval.
Add PA(timeIntervalTA) and MB(timeIntervalTB) as preconditions for the ‘Finish’ state. After the ‘Start’ operator, their values should be ‘false’. Add the actions ActP(timeInterval) and ActM(timeInterval), which merely provide PA(timeInterval) and MB(timeInterval) respectively as effects, and require NA and B respectively as prerequisites.
Voila! Now, we have arrived at a specification of the problem such that it can be solved by a ‘Least Commitment Planner’. The PSP algorithm is sufficiently sophisticated, due to its ability to create constraint and causal links, to deal with a problem of this specification. When PSP solves the problem specified above, it ensures satisfaction of prevention and maintenance goals.
Question
(14%) Sometimes MDPs are formulated with a reward function R(s,a) that depends on the action taken or a reward function R(s,a,s’) that also depends on the outcome state.
-
Write the Bellman equations for these formulations.
-
Show how an MDP with reward function R(s,a,s’) can be transformed into a different MDP with reward function R(s,a), such that the optimal policies in the new MDP correspond exactly to optimal policies in the original MDP.
-
Now do the same to convert MDPs with R(s,a) into MDPs with R(s).
Solution
1
In an abstract sense, Bellman equations tell us that the utility of a given state can be calculated from the cumulative future rewards that can be obtained by following an optimum policy. I use this to guide my formulation of Bellman equations for the cases where rewards are of the form R(s,a) and R(s,a,s’).
The Bellman equation when the reward function is of the form R(s) is this:
The Bellman equation when the reward function is of the form R(s,a) is this:
The Bellman equation when the reward function is of the form R(s,a,s’) is this:
2
$$\begin{eqnarray} U(s)=max_{a}\sum_{s’}T(s,a,s’)[R(s,a,s’) + gU(s’)]\ U(s)=max_{a}\sum_{s’}T(s,a,s’)R(s,a,s’) + \sum_{s’}T(s,a,s’)gU(s’)\ But:T(s,a,s’)=P(s’|a,s)\ U(s)=max_{a}[\sum_{s’}P(s’|a,s)R(s,a,s’) + \sum_{s’}T(s,a,s’)gU(s’)]\ \text{From the definition of conditional expectation: }\ E[R(s,a,s’)|s,a]=\sum_{s’}P(s’|a,s)R(s,a,s’)\ E[R(s,a,s’)|s,a]\text{ is a function of s and a, } R’(s,a).\ Hence: U(s)=max_{a}[R’(s,a) + \sum_{s’}T(s,a,s’)gU(s’)]\ \end{eqnarray}$$ Thus, we have reduced the Bellman equation where the reward function is of the form R(s,a,s’) to a Bellman equation where the reward function is of the form R(s,a). During the above transformations, we have not really altered the value of the utility function for any state. Hence, the policy which is the solution of the latter Bellman equation will also solve the former.
3
Question
(24%) The goal of this exercise is to give you an understanding of the possible disadvantages of using discounted rewards and to introduce the average reward criterion. Discounted optimization is motivated by domains where reward can be interpreted as money that can earn interest, or where there is a fixed probability that a run will be terminated at any given time. However, many problems do not have either of these properties. Discounting in such domains tends to sacrifice long-term rewards in favor of short-term rewards. Moreover, the discounted optimal policy may depend on the choice of the the discount factor. It is true that for any finite MDP (an MDP with finite state and action spaces) there is some sufficiently large

Consider the 14 state MDP whose state-transition diagram is given below. All transitions are deterministic. The agent receives a reward of +5 on moving from the Printer to Home and a reward of +20 on moving from the Mailroom to Home, all other rewards are zero.

-
How many distinct deterministic policies are there for this MDP? What are they?
-
For each policy, give an expression for the value of state 1 (assuming discounting)?
-
For what values of
in [0,1) does an optimal policy take the agent to the Printer? -
For what values of
in [0,1) does an optimal policy take the agent to the Mailroom? -
A policy
is called “Blackwell optimal” for a discounted MDP if there is a * in [0,1) such that is optimal for all in [ *,1). Does this problem have any Blackwell optimal policies? Explain your answer. -
For each policy, calculate the average reward of state 1. Which policy should the agent follow if it seeks to optimize the average reward?
-
For what range of values of the discount factor
will the agent select a policy that maximizes the average reward?
Solution
1
There are 2 distinct deterministic policies for the given Markov Decision process.
2
Note that the reward function, which is specified based on transitions rather than states, can be restated, without any loss of generality as a reward function whose value depends on the states it visits: We define
3
We want to find some
4
By similar reasoning, when g (or
5
As explained above, when
6
Average reward is defined by:
For policy P, at time 0, the agent is in state 1. At time x, the agent is in state (x%5)+1. Every 5 time-steps, the agent accrues a reward of 5 units. Hence, using this information in the defining equation for average reward:
For policy P’, at time 0, the agent is in state 1. At time x, the agent is in state (x%10)+1. Every 10 time-steps, the agent accrues a reward of 20 units. Hence, using this information in the defining equation for average reward:
So, an agent wanting to optimize average reward should choose policy P’, according to which, it goes to 2’ instead of 2 from 1.
7
Putting together the answers to subquestions 4 and 6, it follows that when g (or