A customer forgets a four-digits code for an Automatic Teller Machine (ATM) in a bank.
Question:

A customer forgets a four-digits code for an Automatic Teller Machine (ATM) in a bank. However, he remembers that this code consists of digits 3, 5, 6 and 9. Find the largest possible number of trials necessary to obtain the correct code.

Solution:

Assuming that the code of an ATM  has all distinct digits.

Number of ways for selecting the first digit = 4

Number of ways for selecting the second digit = 3

Number of ways for selecting the third digit = 2

Number of ways for selecting the fourth digit = 1

Total number of possible codes for the ATM $=4 \times 3 \times 2 \times 1=24$