> 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…
All the primes above 2^32 are out, but that accounts for only two point something percent.
Only 17% of all 64-bit Integers are products of two 32-bit integers
51–60 of 115 posts
Re: Only 17% of all 64-bit Integers are products of two 32-bit integers
#52Re: Only 17% of all 64-bit Integers are products of two 32-bit integers
#53Re: Only 17% of all 64-bit Integers are products of two 32-bit integers
#54I must be missing something. Aren’t ~50% of 64-bit integers the product of the number 2 and another 32-bit integer?
Re: Only 17% of all 64-bit Integers are products of two 32-bit integers
#55There 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.
Re: Only 17% of all 64-bit Integers are products of two 32-bit integers
#56I must be missing something. Aren’t ~50% of 64-bit integers the product of the number 2 and another 32-bit integer?
Re: Only 17% of all 64-bit Integers are products of two 32-bit integers
#57I must be missing something. Aren’t ~50% of 64-bit integers the product of the number 2 and another 32-bit integer?
Re: Only 17% of all 64-bit Integers are products of two 32-bit integers
#58> 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…
Why does order matter? Whether a 64-bit number can be written as the product of two 32-bit ones depends only on the prime factors of the 64-bit number - it's a property of the number itself, and apparently 17% of 64-bit numbers have this property.
However, since a * b = b * a, our input space has a lot of duplicate outputs. So from this alone you can conclude roughly half of the output space must be uncovered by any input pair, simply because there aren't enough input pairs.
Re: Only 17% of all 64-bit Integers are products of two 32-bit integers
#59Earlier quoted context omitted.
Concatenating arbitrary 32 bit ints covers all possible 64 bit ints. So the space of all pairs of 32 bit ints is in bijection with 64 bit ints. Commutativity introduces a relation on pairs of 32 bit ints (a,b) ~ (b,a), which accounts for one bit of information. Thus, at most 50% of 64bit ints show up as products of 32 bit ints.
Except the perfect squares don't reduce by half, so it's not quite 50% but it's very close.