How many eight digits numbers are odd

combinatorics

So this is the exercise:

Let A be a set of numbers consisting of 8 digits: five digits 1 and
three digits 2. For instance 11221211 is in A.

How many number in A are odd?

How many number in A are odd or start with the digit 1 (or both)?

Now here's what I thought for the first answer:
If we try a number of eight digits in which the last one is odd, say 2*2*2*1*1*1*1*1 we get 8. Now there are still many combinations we would have to calculate and I think the best way would be 7 choose 3, where seven is the number of digits minus one (since the last digit that makes the number odd is excluded) and three is the number of twos. The result is 35.
Now we can do 34 x 8, since 34 is the number of combination excluded the one we tried, and get the result 272. So have 272 odd numbers.

Now, I have no idea whether this is right or not, but I do know that it seems overly tricky. I also have no idea about the second question.

I hope my explanation is clear enough.

Can anybody help me out?

Thanks in advance guys!

Best Answer

How many number in A are odd?

In order to produce an odd number, the last digit must be $1$. In this case, we have seven available slots to place the remaining digits, four $1$s and three $2$s. Observe that through symmetry, we have $$\binom73=\binom74=35.$$

How many number in A begin are odd or begin with the digit $1$?

Just like the previous question, we can fix the first digit to be $1$ (just like how we fixed the last digit to be $1$) and we get the same $35$ as we did before, but now we have to discount the overlap by the inclusion-exclusion principle. To get that number, we fix the first and last digits to be $1$, and now we want to arrange three $1$s and three $2$s among six slots. In total, we'll have $$35+35-\binom63=50.$$