%%

X = 1:100;
P = [.1,.5,.9];
R=[90,50,10];
Y=zeros(100,3);
fig=figure; 

for i= 1:3
    Y(:,i)=nbinpdf(X,R(i),P(i));
    plot(X,Y(:,i),'linewidth',3)
    hold on;
end

xlabel('X')
ylabel('F_x')
legend('P=0.1 \alpha=90','P=0.5 \alpha=50','P=0.9 \alpha=10')
title('NegBinDist PDF over 100 trials')


%%

X = 1:100;
Y=zeros(100,3);
A=[0.5,1,2];

for i=1:3;
    Y(:,i)= poisspdf(X,A(i));
    plot(X,Y(:,i),'linewidth',3)
    hold on
end

xlabel('X')
ylabel('F_x')
legend('\lambda=0.5','\lambda=1','\lambda=2')
title('Poisson Dist PDF over 100 trials')

%% 
A=[-1,0,1,2,3];
PA=[1/24,1/2,1/4,1/6,1/24];
Y=zeros(1,5);
fig1=figure;


for i = 1:5
    for j = 1:i
        Y(i)=Y(i)+PA(j);
    end
end

stairs(A,Y,'linewidth',2);
xlabel('X','FontSize',15)
ylabel('Probability','FontSize',15)
title('CDF of Given Data','FontSize',25)
