Hi OnePieceIsReal,Welcome, and since you asked to be corrected, there is a small mistake here:
your answer is right, but the road you took to it isn't. That deserves more of your attention than a wrong answer would, because a method that accidentally works is a method you'll trust again.
Your first move is the real insight, though. Since 0+1+2+...+9 =
45, the digits have to sum to the whole set. Hold onto that.
The correct route, in two stepsStep 1 - find every digit set that sums to 45. There are
two, not one. The full set {0,1,...,9} sums to
45, and so does {1,2,...,9}, because dropping the
0 costs nothing. Remove any other digit and the sum falls short. So two families of numbers qualify.
Step 2 - count each family, and never let 0 lead.- Using all ten digits: total arrangements are
10!, but the ones with
0 in front aren't 10-digit numbers at all. Fix 0 in the lead and arrange the other nine:
9! of those. Valid count =
10! - 9!.
- Using {1,...,9}: no 0 in the pool, so every arrangement is a legal 9-digit number:
9!.
Total = (10! - 9!) + 9! =
10!, choice
A.
Why your two mistakes hid each otherYou counted the leading-zero strings you should have discarded, and you skipped the 9-digit family you should have added. Each group has exactly
9! members, and that's no coincidence: take any discarded string, delete its leading 0, and what's left
is one of those 9-digit numbers. One-to-one, both directions. Your two errors were the same size, so they cancelled and the total still read 10!.
The habit to buildWhenever
0 sits in your digit pool, one question comes first, every time:
can 0 take the lead? Quick test - how many
2-digit numbers use each of {0, 1} exactly once? It looks like 2x1 =
2, but 01 is just 1. Only
10 qualifies, so the answer is
1.
Your instinct on the digit sum was excellent. Now make that leading-zero check automatic.
Answer: AOnePieceIsReal
This is the first time I am giving a solution to a problem, pls correct me if I am wrong
as the digits must not repeat and also the sum of digits is 45,
If we add the digits 0-9, the sum is 45, thus all the digits can be used therefore, no of ways of forming digits-
For first digit- 10 ways
For 2nd-9 ways
For 3rd-8 ways
For 4th- 7 thus upto last will be 1, multiplying all give us 10¡ as answer.