How many integer numbers between 0 and 9999 are there that have exactly one digit 1 and exactly one digit 3? What do I need to think about this problem?


  How many integer numbers between 0 and 9999 are there that have exactly one digit 1 and exactly one digit 3?


The only thing I know that the total configurations is $10^4$ so if I want to count the numbers which at least have 1 three firstly I get the numbers which not have three's $9^4$ and then subtract and the same for four but how can I count with more restrictions?
The position of the digit $1$ can be chosen in $4$ ways, the position of the digit $3$ can be chosen in $3$ ways. The remaining two digits should belong to the set $\{0,2,4,5,6,7,8,9\}$ which has $8$ elements.  

Hence the number of integers between 0 and 9999 that have exactly one digit 1 and exactly one digit 3 is
$$4\cdot 3\cdot 8\cdot 8=768.$$
I get a different answer...while I understand your logic here.
Here is mine:
Suppose $A = \{1,\} B =\{ 3\}, C = \{0,2,4,5,6,7,8,9\}$ and $D = \{0,2,4,5,6,7,8,9\}$
In a 4-digit number, we can place: $A-B-C-D$ in $4!$ ways.
Now, we know that there is only 1 way to choose $A$, 1 way to choose $B$, but 8 ways to choose $C$ and 8 ways to choose $D$.
So, by product rule, we have:
$$4! * 1 * 1 * 8 * 8 = 1536$$.
I get $1536 = 2*768$, but I guess it is because of the way I think of it, the order of $C$ and $D$ matters $(=2!)$.
As I understand this problem to be referring to k-permutations (the order of each digit matters), shouldn't the answer be $1536$ and not $768$?