Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Altered listings of rational numbers?

Consider the number in the interval [0,1) given by decimal expansion x = ∑d(i)∙10^(-i) where the sum is over i>0. We avoid d(i) to end in an infinite tail of 9's. Is it possible to list all rationals in [0,1) not ending in an infinite tail of 5's so that the i'th rational on the list has its i'th decimal not equal to 5?

If this is not possible, is it then possible to list all rationals with finitely many 5's in the decimal expansion so that the i'th rational on the list has its i'th digit not equal to 5?

The question is based upon the following question asked by Michael:

http://answers.yahoo.com/question/index;_ylt=ApWDF...

Update:

@Michael: Nicely done! Funny how my mere intuition about asking for the cases of infinitely and finitely many 5-digits ended up as a crucial distinction in your algorithm.

A minor detial: nothing in your algortihm ensures that each y_k is swapped at most once. But it IS true that each y_k is swapped to a LATER position in the list at most once. Hence each y_k can only be swapped to finitely many position so that it ends up in a well defined position.

Update 2:

@Michael: Nicely done! Funny how my mere intuition about asking for the cases of infinitely and finitely many 5-digits ended up as a crucial distinction in your algorithm.

A minor detial: nothing in your algortihm ensures that each y_k is swapped at most once. But it IS true that each y_k is swapped to a LATER position in the list at most once. Hence each y_k can only be swapped to finitely many position so that it ends up in a well defined position.

1 Answer

Relevance
  • Anonymous
    9 years ago
    Favorite Answer

    Here is a proof that it is possible (I believe this proof is correct). Let H be a list of all rationals in [0, 1) with decimal expansions that contain an infinite number of 5s, but not an infinite tail of 5s. Let F be a list of all rationals in [0, 1) with decimal expansions that have a finite number of 5s. Then F and H are disjoint, and their union F U H is the set of interest. The idea is to first assign elements of H to an infinite array such that there are an infinite number of "unassigned" locations in the array. Then place elements of F one-at-a-time in the unassigned locations, and finally perform swapping operations over the elements of F to get everything right.

    First note that each element of H does not have an infinite tail of 5s, and so it must have an infinite number of non-5 digits.

    **Step 1 (placing elements of H = {x_1, x_2, x_3, …} into locations of an array L):

    If x_1 does not have a 5 in digit 1, insert it into location 1 of the array L. Else, find an integer i>1 for which x_1 does not have a 5 in digit i (this is possible because x_1 has an infinite number of non-5 digits). Place x_1 into that location i. Let g(1) be the location of x_1 in L.

    Now for each integer k in {2, 3, 4, …}, define g(k-1) as the location of number x_{k-1} that we have placed in the array L. If x_k does not have a 5 in digit g(k-1)+2, insert it in location g(k-1)+2. Else, insert it into a location i > g(k-1)+2 such that x_k does not have a 5 in digit i (again, this is possible because x_k does not have an infinite tail of 5s). Repeat the process.

    Now we have inserted all elements of H into locations of the array L such that each element is separated by at least two locations from any other element, and all locations "work" (none is in a location i when it has a 5 in digit i). The reason we have left empty holes is to have an infinite number of slots in which we can place elements of F.

    ***Step 2: Place elements of F = {y_1, y_2, y_3, …} sequentially in the "holes" of L. This works because there are an infinite number of holes. Now the array L has no more holes.

    Let h(1), h(2), h(3), … be the locations of y_1, y_2, y_3, and so on, in the array of L. Note that h(1) < h(2) < h(3) and so on.

    ***Step 3: Sequentially swapping elements of F.

    Swapping Lemma: For each positive integer k, there is an integer m>k such that the g(m)th digit of y_k is not 5, and the g(k)th digit of y_m is not 5 (so these locations can be "swapped" to ensure both "work").

    Proof: Fix k and consider y_k. There is a finite integer J such that digits J and beyond of y_k are never 5. Now choose an M>k such that g(M) > J (so y_k is guaranteed not to have a 5 in any digit in location g(M) or beyond). Consider the numbers {y_M, y_{M+1}, y_{M+2}, …}. This set includes all but a finite number of elements of F. Since there are an infinite number of elements of F that do not have 5 in digit g(k), at least one such must be in the set {y_M, y_{M+1}, y_{M+2}, …}. Call this number y_m (where m >= M). Then m>k, y_m does not have a 5 in digit g(k), and y_k does not have a 5 in digit g(m). This proves the swapping lemma.

    Swapping Algorithm: If y_1 is in a location that works, good. Else, swap it with an element y_m such that m>1, so that both y_1 and y_m work in the swap. Now, sequentially for each integer i in {2, 3, 4, …}, if y_i is in a location that works, keep it there, else, swap it with an element y_m with m>i. Keep going.

    This defines a new list L'. Note that all elements are swapped at most once, since any time they are swapped, both numbers involved in the swap are placed in locations that "work." Thus, all elements of F that were in the old list L are still in the new list, and have finite and computable locations in the new list. We are done.

    PS: Nice question! For a while I tried proving it was impossible but that didn't work...

Still have questions? Get your answers by asking now.