Code/password formation

A question is this type if and only if it involves forming codes or passwords from letters and/or digits with repetition constraints.

5 questions

CAIE S1 2021 November Q5
5 A security code consists of 2 letters followed by a 4-digit number. The letters are chosen from \(\{ \mathrm { A } , \mathrm { B } , \mathrm { C } , \mathrm { D } , \mathrm { E } \}\) and the digits are chosen from \(\{ 1,2,3,4,5,6,7 \}\). No letter or digit may appear more than once. An example of a code is BE 3216 .
  1. How many different codes can be formed?
  2. Find the number of different codes that include the letter A or the digit 5 or both.
    A security code is formed at random.
  3. Find the probability that the code is DE followed by a number between 4500 and 5000 .
CAIE S1 2002 November Q4
4 In a certain hotel, the lock on the door to each room can be opened by inserting a key card. The key card can be inserted only one way round. The card has a pattern of holes punched in it. The card has 4 columns, and each column can have either 1 hole, 2 holes, 3 holes or 4 holes punched in it. Each column has 8 different positions for the holes. The diagram illustrates one particular key card with 3 holes punched in the first column, 3 in the second, 1 in the third and 2 in the fourth.
\includegraphics[max width=\textwidth, alt={}, center]{2bcbd4d3-0d41-48fa-8f70-192b158c0bbe-2_410_214_1811_968}
  1. Show that the number of different ways in which a column could have exactly 2 holes is 28 .
  2. Find how many different patterns of holes can be punched in a column.
  3. How many different possible key cards are there?
OCR MEI S1 2008 January Q2
2 Codes of three letters are made up using only the letters A, C, T, G. Find how many different codes are possible
  1. if all three letters used must be different,
  2. if letters may be repeated.
OCR MEI S1 Q5
5 My credit card has a 4-digit code called a PIN. You should assume that any 4-digit number from 0000 to 9999 can be a PIN.
  1. If I cannot remember any digits and guess my number, find the probability that I guess it correctly. In fact my PIN consists of four different digits. I can remember all four digits, but cannot remember the correct order.
  2. If I now guess my number, find the probability that I guess it correctly.
Edexcel FP2 2023 June Q5
    1. A security code is made up of 4 numerical digits followed by 3 distinct uppercase letters.
Given that the digits must be from the set \(\{ 1,2,3,4,5 \}\) and the letters from the set \{A, B, C, D\}
  1. determine the total number of possible codes using this system. To enable more codes to be generated, the system is adapted so that the 3 letters can appear anywhere in the code but no letter can be next to another letter.
  2. Determine the increase in the number of codes using this adapted system.
    (ii) A combination lock code consists of four distinct digits that can be read as a positive integer, \(N = a b c d\), satisfying
    • all the digits are odd
    • \(\quad N\) is divisible by 9
    • the digits appear in either ascending or descending order
    • \(\quad N \equiv e ( \bmod a b )\) where \(a b\) is read as a two-digit number and \(e\) is the odd digit that is not used in the code
    • Use the first two properties to determine the four digits used in the code.
    • Hence determine the code on the lock.