.
Hey, how your problem is worded, it perplexes me . . .
The correct wording is this:
How many 2-digit numbers can be written using the digits 5, 4, 6, 2, 8, 1, 7 if
(a) repeating is allowed ?
(b) repeating is not allowed ?
To write correctly, read from good sources.
Or consider to hire somebody, who will edit your writing.