New answers tagged


Python 3.8 (pre-release) from math import comb C=lambda n,k:comb(n,k) if n>=0 and k>=0 else 0 f=lambda n,v,x,y,z:C(n,v)*C(n-v,x-v)*C(n-x,y-v)*C(n-x-y+v,z-v)*4**(n-x-y-z+2*v) Try it online! We fill the Venn diagram's compartments one by one, and we multiply the numbers of options we have at each step: C(v,n) - to fill the common intersection A∩B∩C, ...

Top 50 recent answers are included