# Countability of decimal representations of real numbers

Let $$X=\{x\in \mathbb{R}\ | \ \hbox{the decimal representation of x contains only 4s and 7s}\}$$. Is $$X$$ countable or uncountable? Prove that your answer is correct.

Should an argument like Cantor's diagonalization be used? Or an argument based on the fact that sequences of 0s and 1s are uncountable? I don't know how to really prove that either.

• Cantor's diagonal argument should be any easy adaptation (if the nth place in the nth number is 4, change it to 7; if it is 7 change it to 4). Your other idea seems good too (each real number should have a binary representation and there is a one-to-one correspondence to reals with 4's and 7's as digits). – Leonard Blackburn Apr 8 at 23:45

If the set is uncountable, then you may be able to prove it using a diagonalisation proof, which typically starts with "assume that the set is countable, and that the set can be put in sequence $$a$$", then you show that the sequence can't possibly hold all elements of the set by producing an element that doesn't belong in it.
You might want to see if something resembling the original diagonalisation proof makes sense - given a sequence $$a_n$$ of elements of $$X$$, let $$b_n$$ be the $$n$$-th decimal value of $$a_n$$ and see whether smooshing them together and swapping the 4s and 7s does anything.