Find the number of positive integers that satisfy both the following conditions:
Each digit is a 1 or a 2
The sum of the digits is 8
We can solve this problem using stars and bars. We have 8 stars, representing the digits of the number, and we need to divide them into 2 groups, representing the 2s and the 1s. We can do this in (2−18+2−1)=36 ways.