function [MarkovOutcome,p] = OZweather(n)

initstate=randi(3);


pR = 0;
pS = 0;
pN = 0;


if initstate == 1
    a = 'R';
    pR = 1;
elseif initstate == 3
    a = 'S';
    pS = 1;
elseif initstate==2
    a='N';
    pN =1;
end

W = a;



for i = 1:n
    if a == 'R'
        b = randi(4);
        if b<2.5
            a = 'R';
            pR = pR+1;
        elseif b<3.5
            a = 'N';
            pN = pN+1;
        else
            a= 'S';
            pS = pS+1;
        end
        W = strcat(W,a);
    elseif a =='S'
        b = randi(4);
        if b<2.5
            a = 'S';
            pS = pS+1;
        elseif b<3.5
            a = 'N';
            pN = pN+1;
        else
            a= 'R';
            pR = pR+1;
        end
        W = strcat(W,a);
    else 
         b = randi(2);
        if b==1
            a = 'S';
            pS = pS+1;
        elseif b==2
            a= 'R';
            pR = pR+1;
        end
        W = strcat(W,a);
    end
end

MarkovOutcome=W;
        
p= [pR/n pN/n pS/n];

    