4 ms·
> Then we form a bijection (x, y) <-> x/y and we see that there are as many pixels as rational numbers. I don't think that works, though. Take for example thes
by function_seven 12y ago
> Then we form a bijection (x, y) <-> x/y and we see that there are as many pixels as rational numbers.
I don't think that works, though. Take for example these two coordinates:
(30, 75)
(90, 225)
Those would both map to the same rational—2/5—and that would make it not a one-to-one mapping.
- HZet0r 12y agoYou're right - good point. For one way, I guess you could let p_i represent the ith prime number (there are infinitely many) and use p_x / p_y instead. Unsure about the other way.
- roywiggins 12y agoThere's a general result that the set of "All pairs of elements from two countable sets" is, itself, countable. (the Cartesian product of two countable sets is countable). For example, the set of all pairs of natural numbers can be counted something like this: 1,1 2,1 2,2 1,2 3,1 3,2 3,3 1,3 2,3 ...
- function_seven 12y agoNice! I'm convinced now.
- rmidthun 12y agoThere is a way to map each rational to a specific positive integer. First, you need to define a mapping between positives and integers, this is pretty simple. 0 1 2 3 4 0 -1 1 -2 2 in c code: if(x<0) ? (x * -2)-1 : x * 2; (pretend that's fixed width above) Next, any rational can be broken down into a unique prime factorization. 4/6 = 2^1 * 3^-1, 4/15 = 2^2 * 3^-1 * 5^-1 From the factorization, define a transform where the exponent for each prime is replaced using the mapping above: so (2^2 * 3^-1 * 5^-1) becomes (2^4 * 3^1 * 5^1) = 240. Since the original rational can be negative, you'll need to use the first transformation again, so 4/15 = 240, -4/15 = -240, which work out to 480 and 479 respectively. 0 and 1 are left unchanged by the factorization process so 0 maps to 0, 1 to 2, and -1 to 1.