Thread: [SOLVED] finding the possible PIN codes

1. [SOLVED] finding the possible PIN codes

In a bank, it doesn't issue the PIN code with more than 2 consecutive digits the same.(For example, 7666 and 2222 are not allow but 0040 is allowed)
i)how many different PIN codes are possible?
ii)how many different PIN codes have 8 as their first digits?
I don't really know how to solve this question, is there a easy way to solve it? can anyone helped me?Thank you very much!!

2. Originally Posted by taipei166
In a bank, it doesn't issue the PIN code with more than 2 consecutive digits the same.(For example, 7666 and 2222 are not allow but 0040 is allowed)
i)how many different PIN codes are possible?
ii)how many different PIN codes have 8 as their first digits?
I don't really know how to solve this question, is there a easy way to solve it? can anyone helped me?Thank you very much!!
Hi taipei,

i) If there were no restrictions, the number of possible PIN codes would be $\displaystyle 10^4$.

The invalid codes come in 3 forms.

Codes like xxxy: There are 10 ways to choose x and then there are 9 ways to choose y, so there are $\displaystyle 10 \times 9$ possibilities.

Codes like yxxx: Similarly, there are $\displaystyle 10 \times 9$ possibilities.

Codes like xxxx: There are 10 of these.

So the number of allowable codes is $\displaystyle 10^4 - 2 \times 10 \times 9 - 10$.

Maybe you can work out ii) from this.