18/11/25 12:19:14.40 9toFqzz4.net
>>327
debugged again
soccer= function(A=5,B=10,N=100){
if(A>B){
tmp=A
A=B
B=tmp
}
pa=pd=0
for (i in 1:N){
pd=pd+dpois(i,A)*dpois(i,B)
for(j in 0:(i-1)){
pa=pa+dpois(i,A)*dpois(j,B)
}}
c(Upset=pa,Ordinal=1-pa-pd,Draw=pd)
}