if all digits are distinct so {1,3,7,8}=4! ways
only two digits are same so :
five cases :
case 1 : {1,3,3,8} =4!/2!
case 2:{1,7,7,8}=4!/2!
case 3:{3,3,7,7}=4!/(2!*2!)
case 4:{1,3,3,7}=4!/2!
case 5:{8,1,7,7}=4!/2!
case 6:{8,3,3,7}=4!/2!
case 7;{1,7,7,3}=4!/2!
ADD all these = 4!/2!+4!/2!+4!/2!+4!/2!+4!/2!+4!/2!+4!/(2!*2!)+4!
=102 ans
this above method is sometimes not so good but with this way we can also do this question ! :)
but the better approach is :
You have to try all cases:
Case 1: all distinct digits: 4!=24
Case 2: two same digits and two different digits:
that implies two more sub-cases:
(i) {3,3,-,-} these two blanks can only be filled by two out of the three {7,1,8} = C(3,2)=3 and then arrangement of these 4 numbers = (4!/2!); In total by pdt rule=3*12=36
(ii) {7,7,-,-} similarly here 2 out of the three {3,1,8}=3 and then arrangement=(4!/2!). total by pdt rule=3*12=36;
Case 3: two same and other two same:
{3,3,7,7}=(4!/(2!*2!))=6
by sum rule, total possibilities=6+2*36+24=102