function [An0,bn0,cn0,dn0] = Process_2EPT_Min(An,bn,cn,Ap,bp,cp,N)
%%% Derives the Generalised EPT density with realization (An0,bn0,cn0,dn0)
%%% for the probability density function of the minimum of the discrete 2-EPT
%%% process with realization
C1 = max(size(An));
C2 = max(size(Ap));
A = zeros(C1 + C2,C1 + C2);
b = zeros(C1+C2,1);
c = zeros(1,C1+C2);
A(1:C1,1:C1) = An;
A(C1+1:end,C1+1:end) = Ap;
c(1:C1) = -cn;
c(C1+1:end) = cp;
b(1:C1) = bn;
b(C1+1:end) = bp;
dn0 = 1 - cn*inv(An)*bn;
bn0 = bn;
An0 = An;
cn0 = -cn;
for i = 2:N;
[A2,b2,c2,d2] = Convolution(An0,bn0,cn0,dn0,A,b,c,0);
[An2,bn2,cn2,Ap2,bp2,cp2,D] = Additive_Decomposition(A2,b2,c2,0);
dn2 = 1 - cn2*inv(An2)*bn2;
An0 = An2;
bn0 = bn2;
cn0 = cn2;
dn0 = dn2;
end
cn0 = -cn0;
end