% FIND POLICY
% Case 1
probs = [0.7, 0.8, 0.9, 0];
payoff = [0, 10, 20, 30];
discount = 0.8;
[stateValues, policy, count] = PW311_FindPolicy(probs, payoff, discount)
% Case 2
probs = [0.6, 0.6, 0.6, 0];
discount = 0.95;
[stateValues, policy, count] = PW311_FindPolicy(probs, payoff, discount)
% case 3
probs = [0.6, 0.6, 0.6, 0];
discount = 0.99;
[stateValues, policy, count] = PW311_FindPolicy(probs, payoff, discount)

% FIND POLICY AND SIMULATE
% Case 1 (again)
probs = [0.7, 0.8, 0.9, 0];
payoff = [0, 10, 20, 30];
discount = 0.8;
[stateValues, policy, count] = PW311_FindPolicy(probs, payoff, discount);
% simulate policy
rng('default')
startState = 1;
numRepl = 1000;
numSteps = 40;
[value, confInt] = PW311_Simulate(probs,payoff,discount,...
    startState,numRepl,numSteps,policy);
stateValues(1)
value
confInt








