Live data from Hacker News

Only 17% of all 64-bit Integers are products of two 32-bit integers

lemire.me

21–30 of 115 posts

Re: Only 17% of all 64-bit Integers are products of two 32-bit integers

#22

There are about 4 billion 64 bit integers for each 32 bit integer. The chance of a random 64 bit integer being a 32 bit integer is 0.0000000233 % The chance of a random 64 bit integer being a product of two 32 bit integers is 17% Nice

Wonder what the limit is as you add more 32 bit integers to the product. Just the primes over 32 bit?

Re: Only 17% of all 64-bit Integers are products of two 32-bit integers

#23
post #13

There are about 4 billion 64 bit integers for each 32 bit integer. The chance of a random 64 bit integer being a 32 bit integer is 0.0000000233 % The chance of a random 64 bit integer being a product of two 32 bit integers is 17% Nice

There are about 18.446 quintillion more 64-bit integers than 32-bit integers.

I think they meant to write "There are about 4 billion TIMES more 64 bit integers than 32 bit integers".

Re: Only 17% of all 64-bit Integers are products of two 32-bit integers

#24

> I find it interesting to consider that if you pick a value at random, it will usually fail! That is, most 64-bit integers cannot be written as the product of two 32-bit integers. While I find the 17% number interesting to think about, "most" is far less interesting. Multiplication doesn't care about order so you're instantly cutting 2^64 possibilities down to about 2^63. That's a hair's breadth away from "most" alr…

> While I find the 17% number interesting to think about, "most" is far less interesting. Multiplication doesn't care about order so you're instantly cutting 2^64 possibilities down to about 2^63. That's a hair's breadth away from "most" already

It's much worse than that. It's difficult for a 64-bit product to have the high bit set if the multiplicands are both no larger than 32 bits.

Re: Only 17% of all 64-bit Integers are products of two 32-bit integers

#25
post #22

There are about 4 billion 64 bit integers for each 32 bit integer. The chance of a random 64 bit integer being a 32 bit integer is 0.0000000233 % The chance of a random 64 bit integer being a product of two 32 bit integers is 17% Nice

Wonder what the limit is as you add more 32 bit integers to the product. Just the primes over 32 bit?

If you're allowed to multiply as many 32-bit numbers as you want, the only numbers you won't be able to achieve by so doing are those with any prime factor larger than 2^32.

This is more than just the prime numbers. For example, a 41-bit prime can be multiplied by 16 and it will still fit into 64 bits.

Re: Only 17% of all 64-bit Integers are products of two 32-bit integers

#26
post #11

If this seems counterintuitive, consider that only about a third of the two-digit numbers ({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32, 35, 36, 40, 42, 45, 48, 49, 54, 56, 63, 64, 72, 81}) can be written as the product of two one-digit numbers.

where is the graph and the theorem for integers of n bits, with n going to infinity?

Re: Only 17% of all 64-bit Integers are products of two 32-bit integers

#27
post #13

There are about 4 billion 64 bit integers for each 32 bit integer. The chance of a random 64 bit integer being a 32 bit integer is 0.0000000233 % The chance of a random 64 bit integer being a product of two 32 bit integers is 17% Nice

There are about 18.446 quintillion more 64-bit integers than 32-bit integers.

True, but there are as many 64-bit integers as pairs of 32-bit integers.

Therefore the fact that relatively few 64-bit numbers are products of 32-bit integers means that a lot of pairs of 32-bit integers give by multiplication the same product.

Re: Only 17% of all 64-bit Integers are products of two 32-bit integers

#29
post #2

I dream of a future where all 64-bit integers are products of 32-bit integers. Together, we can change math for the better.

Indeed, but justice requires that we recursively continue all the way to the base case, until all 32-bit integers are products of 16-bit integers, all 16-bit integers are products of 8-bit integers, all 8-bit integers are products of 4-bit integers, all 4-bit integers are products of 2-bit integers, and all 2-bit integers are products of 1-bit integers. Only when we have reach all the way down that list to the very, very smallest of the numbers around us and brought justice to them will the future be able to arrive. I literally can not wait for that day.

Re: Only 17% of all 64-bit Integers are products of two 32-bit integers

#30
post #29
post #2

I dream of a future where all 64-bit integers are products of 32-bit integers. Together, we can change math for the better.

Indeed, but justice requires that we recursively continue all the way to the base case, until all 32-bit integers are products of 16-bit integers, all 16-bit integers are products of 8-bit integers, all 8-bit integers are products of 4-bit integers, all 4-bit integers are products of 2-bit integers, and all 2-bit integers are products of 1-bit integers. Only when we have reach all the way down that list to the very,…

Enough of this divided binary world, we are all one
Post reply on HN