-term growth rates</span>
R_opt = sum(Pi.*log(P*x_opt));
R_unif = sum(Pi.*log(P*x_unif));
display(<span class="string">'The long term growth rate of the log-optimal strategy is: '</span>);
disp(R_opt);
display(<span class="string">'The long term growth rate of the uniform strategy is: '</span>);
disp(R_unif);

<span class="comment">% Generate random event sequences</span>
rand(<span class="string">'state'</span>,10);
N = 10;  <span class="comment">% number of random trajectories</span>
T = 200; <span class=