Edited:
I should point out that, in the above solution, I used the nice rule that says "
n unique objects can be arranged in n! ways"
Alternatively, if we don't know the above rule, we can use the Fundamental Counting Principle (FCP). For example, in case 1, we need to arrange the digits 2, 3, 5, 7.
To apply the FRC, we'll take the task of arranging the 4 digits and break it into 4 stages:
Stage 1: Select a digit for the units position.
Stage 2: Select a digit for the tens position.
Stage 3: Select a digit for the hundreds position.
Stage 4: Select a digit for the thousands position.
Stage 1: there are 4 digits, so this stage can be accomplished in 4 ways
Stage 2: once we have completed stage 1, there are 3 digits remaining, so stage 2 can be accomplished in 3 ways
Stage 3: once we have completed stage 2, there are 2 digits remaining, so stage 3 can be accomplished in 2 ways
Stage 4: once we have completed stage 3, there is 1 digit remaining, so stage 4 can be accomplished in 1 ways
From here, the FCP tells us that all 4 stages can be completed in 4x3x2x1 ways (24 ways)
If you're interested in learning more, here's a free video on the FCP:
https://www.gmatprepnow.com/module/gmat-counting?id=775
Cheers,
Brent