''' When is the probability that in an image with N pixels, c point-like objects will not occupy the same pixel < 0.5 ? Multiply probabilities of consequtive c people not overlapping ''' N = 365 ratio = 1. c = 0 while(c < N): # c is the number of people c += 1 ratio = ratio *(N-c+1)/N # no overlap p = 1 - ratio # overlap print("#",c,"P(none), P(some)",ratio,p) if (p < 0.5): overlap = c+1 print(" # overlapping b-days =", overlap) # now you can tidy up the output # with np.around(x,digits) # or C/Fortran-style formatting