bsp_3_1.m

% Beispiel für Kap 3.1
%% Roulette
p = 19/37;
q = 18/37;
P = diag(q*ones(5,1), 1) + diag(p*ones(5,1), -1);
P(1,2) = 0;
P(6,5) = 0;
P(1,1) = 1;
P(6,6) = 1
P5 = P*P*P*P*P
P5(3,6)

%% GGV bei Autovermietung
P = [0.5, 0.3, 0.2, 0.0;
     0.2, 0.6, 0.1, 0.1;
     0.3, 0.1, 0.4, 0.2;
     0.2, 0.2, 0.3, 0.3];
% homogenes System lösen = Null space finden
x = null(P' - eye(4))';
x = x/sum(x)
x*P - x;    % Test klappt!

%% GGV bei Roulette
P = [1 , 0 , 0 , 0 , 0 , 0;
  19/37 , 0 , 18/37 , 0 , 0 , 0;
  0 , 19/37 , 0 , 18/37 , 0 , 0;
  0 , 0 , 19/37 , 0 , 18/37 , 0;
  0 , 0 , 0 , 19/37 , 0 , 18/37;
  0 , 0 , 0 , 0 , 0 , 1];
x = null(P' - eye(6))'    % es gibt zwei, sie sind schon normiert