n=20
m=18
r=c(1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
t= c(1:m-1);t
w=cumsum(r);w
d=n-w-t;d
c=n*prod(d);c
L1=c(0:r[1])
L2=c(0:r[2])
B1=choose(r[1],L1)
B2=choose(r[2],L2)
H1=L1+1
H2=L2+2
sum1=sum((-1)^L1*B1/H1)
sum2=sum((-1)^L2*B2/H2)
pr=sum1*sum2
f=c*pr;f
m=18
r=c(1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
t= c(1:m-1);t
w=cumsum(r);w
d=n-w-t;d
c=n*prod(d);c
L1=c(0:r[1])
L2=c(0:r[2])
B1=choose(r[1],L1)
B2=choose(r[2],L2)
H1=L1+1
H2=L2+2
sum1=sum((-1)^L1*B1/H1)
sum2=sum((-1)^L2*B2/H2)
pr=sum1*sum2
f=c*pr;f