% octave or matlab, probability of birthday collisions vs. number of people % >> format short g >> p=1-cumprod((365-[1:30]+1)/365); >> [ [1:30]' p'] ans = 1 0 2 0.0027397 3 0.0082042 4 0.016356 5 0.027136 6 0.040462 7 0.056236 8 0.074335 9 0.094624 10 0.11695 11 0.14114 12 0.16702 13 0.19441 14 0.2231 15 0.2529 16 0.2836 17 0.31501 18 0.34691 19 0.37912 20 0.41144 21 0.44369 22 0.4757 23 0.5073 24 0.53834 25 0.5687 26 0.59824 27 0.62686 28 0.65446 29 0.68097 30 0.70632 >>