Define the relation $\mathcal{R}$ on the set of all positive integers by: for all positive integers $a$ and $b$, $a\,\mathcal{R}\,b$ if and only if the largest digit of $a$ is equal to the largest digit of $b$. for example, $271\,\mathcal{R}\,770$ because the largest digit of $271$ is $7$ which is also the largest digit of $770$.
a) Find the number of equivalence classes of $\mathcal{R}$.
b) Find and simplify the number of positive integers between $100$ and $1000$ which are in the equivalence class $[271]$.
I have an idea of where to begin but I think I am wrong. For (a) would there be $9$ equivalence classes? And for (b) I got my answer to be $56$.
Your answer to (a) is correct. There is one equivalence class for each possible largest digit, and since you’re looking only at positive integers, the largest digit must be non-zero.
For (b) you need to count the three-digit numbers whose largest digit is $7$. One of these is $777$. How many are there with exactly two sevens? There are $3$ places to put the digit that isn’t $7$, and it must be one of the seven digits $0,1,2,3,4,5,6$, so there are $3\cdot7=21$ such numbers. OOPS: one of those is $077$, which isn’t in the required range. Thus, there are really only $20$ of them. Now how many are there with exactly one $7$? If the $7$ is the first digit, there are $7^2=49$ ways to fill out the other two places with digits less than $7$. Otherwise the first digit must be one of the six digits $1,2,3,4,5,6$. There are then $2$ places to put the $7$ and $7$ choices for the other digit, for a total of $6\cdot2\cdot7$ possibilities. Thus, there are $49+84=133$ numbers with exactly one $7$. The grand total for (b) is therefore $1+20+133=154$.