1

How would I go about solving this question without ‘brute forcing’ it? (By this, I mean is there a trick to doing so? I figured that it had something to do with halves and so this made it easier for me to lower the number of odds satisfying this condition):

The number 371 has only odd digits, since
3 , 7 and 1 are all odd. The number 493 does not have only odd digits, since 4 is even. The number 339 has only odd digits, but the number 3 is repeated. How many numbers n with 1 ≤ n < 10000 have only odd digits such that no digits are repeated?

  • 2
    Try to solve this question by making 4 different cases : When $n$ is one- digit number, when $n$ is 2 digit number, 3 digits, 4 digits. Then use fundamental principle of counting. – Aman Kushwaha Aug 19 '21 at 09:41
  • 2
    I think it depends on what you mean by 'brute forcing', you definitely do not have to write down all the numbers. It might be easier to count all $1$-, $2$-, $3$-, $4$- and $5$-digit numbers having this property separately using combinatorics (like drawing balls from an urn) and then add the results together. – Matthias Klupsch Aug 19 '21 at 09:53
  • 1
    For $2$ digit numbers (i.e. $10 \leq n \leq 99$), there are $\binom{5}{2}$ ways of choosing $2$ distinct digits from the $5$ odd digits. Then, once the $2$ distinct digits are chosen, they can be permuted in $2!$ ways. – user2661923 Aug 19 '21 at 10:03

1 Answers1

1

Well, since we can only choose odd digits, these are 1,3,5,7,9, we only have 5 choices. As a result, for one-digit numbers, we have 5 choices. For two-digit numbers, we have $5\cdot 4= 20$ choices, since we cannot choose the same digit twice, and order matters (e.g. $35\neq 53$). Similarly, for three-digit numbers, we have $5\cdot 4\cdot 3= 60$ choices, and for four-digit ones, we have $5\cdot 4\cdot 3\cdot 2= 120$ of them. As a result, the total amount of numbers between 1 and 10000 that only have odd digits such that none of them is repeated equals to $$ 5+ 20+ 60+ 120= 205. $$

vmastr
  • 880