[Math] Possible ways of 8 digit numbers using 1,2 and 3 such that the number has atleast one digit for each 1,2,and 3

combinationspermutations

How many 8 digit numbers can be formed using the digits 1,2 and 3 so that the number contains at least one of each of these three digits?

Best Answer

  • The total number of combinations is $3^8$
  • The total number of combinations with only $1$s or $2$s is $2^8$
  • The total number of combinations with only $1$s or $3$s is $2^8$
  • The total number of combinations with only $2$s or $3$s is $2^8$
  • The only combination with only $1$s is $11111111$
  • The only combination with only $2$s is $22222222$
  • The only combination with only $3$s is $33333333$
  • Hence the answer is $3^8-2^8-2^8-2^8+1+1+1=5796$

    (the single-digit numbers are counted twice, so we need to "uncount" them)