Hint: for the first part, how many choices are there for each of the remaining six positions? for part b, you use the same logic as for part a. So for six letters, you choose the three places for a's (how many ways), then choose the other three letters (how many ways?)
I think the analogy with the permutations of letters is making this problem more complicated than it needs to be.
Using the restriction that the number has at least one seven, you can first find the numbers that have exactly one $7$, then the numbers that have two $7$s, and then the number that has three $7$s and then add the results.
To find the number of numbers, think of choosing a digit for each spot: _ _ _
For one seven, you can fix a $7$ in a spot, say the first one, so the number looks like 7_ _ and note that for the other spots you can have any of the other 9 digits ($0,1,2,3,4,5,6,8,$ or $9$), so there are $9\cdot 9=81$ such numbers.
For numbers of the forms _ 7 _ and _ _ 7 the count is different because the first digit cannot be $0$, so there are $8\cdot 9=72$ possibilities for each.
Thus, in total there are $72+72+81=225$ three-digit positive integers with one seven as a digit.
Two sevens: For the form _77 there are 8 possibilities because the first spot cannot be 0, and for each of the forms 7_7 and _ _7 there are 9 possibilities, so in total there are $8+9+9=26$ three-digit positive integers with one seven as a digit.
Three sevens: There is only one, $777$.
So in total there are $225+26+1=252$ three-digit integers with a seven as a digit.
Best Answer
There are $2^{12}=4096$ bit strings altogeher. Of these, the number of bit strings containing exactly 0,1 or 2 1's is $${12\choose 0}+{12\choose 1}+{12\choose 2}=1+12+66=79$$Similarly, the number of bit strings containing exactly 0,1 or 2 0's is also 79. There is no overlap. Thenumber of bit strings satisfying the condition is 4096 - 2 $\times$79=4096-158=3938.