[5044] in cryptography@c2.net mail archive

home help back first fref pref prev next nref lref last post

Re: number of ones

daemon@ATHENA.MIT.EDU (Tom Weinstein)
Thu Jul 1 13:21:57 1999

Date: Wed, 30 Jun 1999 21:47:11 -0700
From: Tom Weinstein <tomw@geocast.com>
To: Mike Stay <staym@accessdata.com>
Cc: coderpunks@toad.com, cryptography@c2.net

Mike Stay wrote:
> 
> I wrote
> > What's the average number of ones in a randomly-chosen N-bit number?
> 
> Duh..
> Sorry, I was thinking of the average number of bits that change on
> increment.  The answer's obviously N/2 for the above.

N-1
 __    1
\     ---
/__   2^n
i=0

which is just the sum of the probabilities for each bit to change.

-- 
What is appropriate for the master is not appropriate| Tom Weinstein
for the novice.  You must understand Tao before      | tomw@geocast.com
transcending structure.  -- The Tao of Programming   |


home help back first fref pref prev next nref lref last post