Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete proof that "the only non-zero values for which the sets of true bits for x and x − 1 are disjoint, are powers of two" #1

Open
nolanw opened this issue Dec 4, 2011 · 1 comment

Comments

@nolanw
Copy link

nolanw commented Dec 4, 2011

I'm curious about the proof you give, in section 12, for the statement "the only non-zero values for which the sets of true bits for x and x − 1 are disjoint, are powers of two". It seems incomplete to me.

You divide the number's bits up WLOG into three pieces: a (possibly empty) series of zeros, followed by a one, followed by a series ones and zeros. The number 1 (i.e. 0x01) cannot be split as such.

1 is of course a power of two, and the most-significant 1 is maintained as a result of the described operations, so I think all you need to do is point out that the third series of bits may also be empty.

(P.S. Thanks for the awesome explanation, I was kind of lost with djb's relatively terse description.)

@agl
Copy link
Owner

agl commented Dec 8, 2011

On Sun, Dec 4, 2011 at 2:57 AM, Nolan Waite
[email protected]
wrote:

I'm curious about the proof you give, in section 12, for the statement "the only non-zero values for which the sets of true bits for x and x − 1 are disjoint, are powers of two". It seems incomplete to me.

You're absolutely right, thanks for that.

I don't have cweb installed at the moment, so I haven't updated the
PDF. But I've fixed the .w file and it'll get included the next time
that I do so.

Cheers

AGL

Adam Langley [email protected] http://www.imperialviolet.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants