Find the number of positive integers that satisfy both the following conditions:
Each digit is a 1 or a 3
The sum of the digits is 12
We can solve this problem by considering the number of 1s in the integer. Let x represent the number of 1s. Then the number of 3s is 4−x (since there are 4 digits total).
The sum of the digits is then x+3(4−x)=12, which combines like terms to 2x=12. Solving for x, we get x=6.
Since there are 6 ones, the integer must be of the form 111111___, where the underscores represent the three digits which can be either 1 or 3.
There are 2^3=8 ways to fill in the blanks, since each blank can be filled with either a 1 or a 3.
For example, the valid integers include 111111, 111333, and 311131.
Therefore, the answer is 8.