# Difficult Maths Question?

Banks issue their customers with personal identification numbers (PIN codes) which are four digits long. They are used with cards to withdraw money from their automatic teller machines (ATMs). It is important that these codes be kept secret and can't be easily guessed. So Timworth Bank and Georgeville Bank do not issue PIN codes with more than two consecutive digits the same (for example, 6777 and 3333 are not allowed but 0050) is acceptable.

1) How many different PIN codes are possible?

2) How many of these PIN codes have 8 as their first digit.

3) The banks have found out that people find it easier to remember a PIN code with a pair of repeated digits in it (for example, 4491 or 0885 but not 3953). Timworth Bank decides to only issue PIN codes with at least one pair of consecutive digits the same but not with more than two consecutive digits the same (for example, 4491 or 0885 or 2288, but not 4445 or 3333). How many different PIN codes of this type can it issue?

4) Georgeville Bank decides to use the fourth digit of each PIN code as a check: the fourth digit is always the last digit of the sum of the first three digits. For example, 3452 is a valid PIN code (the last digit of 3 + 4 + 5 = 12 is 2) and 5544 is valid but 3459 is not. Georgeville Bank does not have PIN codes with more than two consecutive digits the same. How many PIN codes of this type can it issue?

Show all working.

### 1 Answer

- PuzzlingLv 71 decade agoBest Answer
PART 1:

The total number of PINs of any sort would be 10 x 10 x 10 x 10 = 1000 pins (0000 to 9999).

Eliminate the cases of all the same digit:

--> C(10,1) = 10 ways

Eliminate the cases with 3 digits the same at the front:

--> C(10, 1) * C(9, 1) = 90 ways

Eliminate the cases with 3 digits the same at the end:

--> C(10, 1) * C(9, 1) = 90 ways

Answer:

9,810 valid pins

PART 2:

Clearly the first digit has equal likelihood of being any of the digits 0 to 9. So 1/10 will start will 8.

Answer:

981 pins starting with 8

PART 3:

Valid patterns are:

ABAA --> 10 choices for A, 9 choices for B = 90 ways

BAAB --> 10 choices for A, 9 choices for B = 90 ways

AABA --> 10 choices for A, 9 choices for B = 90 ways

AABB --> 10 choices for A, 9 choices for B = 90 ways

AABC --> 10 choices for A, 9 for B, 8 for C = 720 ways

BAAC --> 10 choices for A, 9 for B, 8 for C = 720 ways

BCAA --> 10 choices for A, 9 for B, 8 for C = 720 ways

4 * 90 + 3 * 720

= 360 + 2160

= 2520

Answer:

2520 PINs.

PART 4:

First there are only 1000 combinations of the first 3 digits. The last digit is computed. We have to eliminate the cases that are bad.

Obviously the cases that start 000, 111, 222, etc. are bad. That's 10 cases:

Then we have the following cases:

1999, 2888, 3777, 4666, 6444, 7333, 8222, 9111

That's a total of 18 bad cases out of 1000.

Answer:

982 PINs