Intervals and cardinality

Let $x,y,a,b$ be real numbers. For $x<y$ and $a<b$, show the cardinality of $[a,b]$ equals the cardinality of $[x,y]$.

I did the above problem, by defining a linear function as a bijection between the intervals. The next part of the problem states,

Extend your result (from above) to open and half-open intervals.

I'm just not sure what exactly I'm supposed to do next, the question seems vague. Am I supposed to show $(a,b)\sim (x,y)$? $[a,b]\sim (x,y)$? $[a,b)\sim (x,y]$?

-
I think so. They do all have the same cardinality anyway, same as the closed interval I mean. – Vishesh Oct 1 '12 at 11:56
I’m not sure myself how that’s intended to be interpreted, but I suspect that it just wants you to show that any two non-empty open intervals have the same cardinality and that any two non-empty half-open intervals have the same cardinality, regardless of their direction. All of that can be done using the method that you’ve already discovered. Finding a bijection between intervals of two different types is a bit harder. – Brian M. Scott Oct 1 '12 at 11:57
You may need to ask the problem-poser. The only non-trivial problem is if the number of closed ends does not match. Then one can use a little trick related to Hilbert's Infinite Hotel. – André Nicolas Oct 1 '12 at 11:58
Okay, thank you. And can I use the same function that I used for the closed intervals? f(t)=[(y-x)(t-a)]/(b-a) +x – Alti Oct 1 '12 at 12:08
@Alti: If the end-points, or lack of them, match, then sure. A simple variant takes care of $[a,b)$ and $(x,y]$. But if numbers of endpoints don't match, like $[a,b)$ and $(x,y)$, you will need a way to suck $a$ into the interior, but that will displace a point in (x,y)$, and so on. – André Nicolas Oct 1 '12 at 12:15 2 Answers Hint: It is not clear whether you are supposed to take care of situations where the numbers of boundary points don't match. But if you are, the following idea will work. We find for example a bijection$\varphi$from$[0,1)$to$(0,1)$. Let$\varphi(1)=1/3$. For all$x$of the shape$\frac{1}{3\cdot 2^n}$, where$n$is a non-negative integer, let$\varphi(x)=\frac{1}{3\cdot 2^{n+1}}$. And for all other$x$, let$\varphi(x)=x$. Remark: Suppose that we have a hotel with a finite number of rooms, all occupied. If a person comes wanting a room, she is out of luck. But if the hotel is countably infinite, the situation is much better. The manager just moves the occupant of Room$1$into Room$2$, the occupant of Room$2$into Room$3$, and so on forever. Now Room$1$is free. Indeed if a countably infinite number of people come looking for a room, they can all be accommodated. Just move the occupant of Room$k$to Room$2k$, and all the odd-numbered rooms are free. - Thank you. Yes I did have to do that for a previous question actually, using a different combination of intervals like the one you have shown. – Alti Oct 3 '12 at 2:43 Hint: 1. First note that all those calculations can be done over$(0,1)$with various combinations of endpoints. 2. Now note that the difference between$[0,1]$and$[0,1)$is only one point. Use the facts that$[0,1)$has a countably infinite subset, and that$\mathbb N$and$\mathbb N\setminus\{0\}\$ have a bijection between them, to find a bijection between the two intervals.

3. Repeat for other endpoints combination.

-
Thank you, I did do that for a previous question. – Alti Oct 3 '12 at 2:43