So I came across the following problem and am having trouble interpreting how to solve. It's a counting problem.
Given a six digit code, how many possible codes are there if the first digit can not be 0, the fourth digit is a 6, and the last digit must be odd. No digit may repeat.
So the thing that is throwing me off is the last statement, that no digit may repeat (I dont think the teacher meant to put this here because, well, ... see below), because if the last digit must be odd, we must look at cases then, for the previous 5 (albeit only 4, since digit #4 is automatically a 6, so we can almost disregard it in the problem).
So, we run through the possibilities below. For the last odd number placement (the 6th position) there could be:
- one odd left,
- two odds left,
- three odds left,
- four odds left,
Now, if there is only one odd number left for the last spot, that means, of the previous four available spots, all must be odd.
$$5\times 4\times 3\times 2\times 1=120$$
Now, if there are two possible odd numbers left for the last spot, that means, of the previous four available spots, 3 must be odd and 1 must be even. Now the first number can't be $0$, so there are $8$ possibilities, ...
At this point, I'm confusing my conditions and am getting lost. WHile I think the question (which was posed to an elementary high school probability class) was posed incorrectly (with replacement would have been appropriate), i find myself in need of a solution, but see things getting harder and I'm getting lost in it. Any help would be wonderful.
Since the fourth digit is already fixed to be 6, I will consider the question as 5-digit code but no digit can be six.
Last digit has to be odd. There are five options: 1,3,5,7,9. Choose one.
First digit cannot be 0, 6 or same as the last digit. There are seven options left. Choose one.
Second, third and fourth digits can be anything aside from 6, first digit and last digit. There are seven options. Choose three. Ordering of these matter, so keep that in mind.
There are ${5 \choose 1}{7 \choose 1}{7 \choose 3} 3!$ codes.