Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 18 Apr 2023 18:28:54 +0200
From: magnum <>
Subject: Re: Birthday paradox

On 2023-04-18 17:57, magnum wrote:
> Can anyone point me to a (approximation) formula for the birthday 
> paradox, where for example we have a bitmap with 4096 bits and populate 
> it with 1024 random bits. What is the expected number of bits set in the 
> bitmap?
> I think the answer is ~907, as that's what I'm seeing in my experiments 
> - and also what this simple script shows:

Talking to the duck works every time :)

Found it at

It's as simple as 4096*(1-(4095/4096)^1023) where ^ means power of, as 
in bc(1):

$ bc -l <<< '4096*(1-(4095/4096)^1023)'


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.