diff --git a/chapter_02/birthday.py b/chapter_02/birthday.py index 796c848..dc2f4f1 100644 --- a/chapter_02/birthday.py +++ b/chapter_02/birthday.py @@ -31,7 +31,7 @@ match = 0 b = np.random.randint(0,364,m) for i in range(m): - for j in range(m): + for j in range(i, m): # starting from i to avoir comparing the same pair a second time if (i != j) and (b[i] == b[j]): match += 1 if (match != 0):