Permutations and Combinations: Question 8
Syllabus 5.2
A -digit security code is formed by arranging of the digits in a row, with no digit used more than once.
(a) Find the number of different -digit sequences of distinct digits that can be formed, with no other restriction. [1]
(b) A valid code cannot start with the digit . Find the number of different valid codes. [3]
(c) Find the number of different valid codes (still with distinct digits and not starting with ) that are even, that is, the last digit is , , , or . [4]
Show worked solution Hide worked solution
Worked solution
Part (a): No restriction other than distinct digits
Choosing and arranging of the digits, with none repeated, is a permutation:
Part (b): Codes not starting with 0
Direct method: the first digit must come from ( choices, excluding ). Once the first digit is fixed, the remaining positions are filled from the digits still unused (which now includes ), arranged in order:
Check (complement): the codes that do start with have their first digit fixed as , and the remaining positions filled from the other digits: . Subtracting from the total in part (a):
Both methods agree: .
Part (c): Valid codes (not starting with 0) that are even
Split into cases according to the last digit, since whether is “used up” by the last digit changes how many choices remain for the first digit.
Case 1: last digit is . The last digit is fixed as . The first digit must be nonzero, and since is already placed at the end, the first digit can be any of the remaining digits : choices. The middle two positions are then filled from the remaining digits, in order: .
Case 2: last digit is , , or ( choices of value). For each such value, the last digit is fixed (nonzero). The first digit must avoid both and the chosen last digit, so from the digits other than the last digit, (namely ) is excluded, leaving choices. The middle two positions are filled from the remaining digits (after removing the last digit and the first digit): .
Total:
Check (via the odd case and part (b)‘s total): by the same casework, codes with an odd last digit (, all nonzero) each give first-digit choices (excluding and the last digit) and ways for the middle positions, so . Since every valid code from part (b) is either even or odd: which matches part (b) exactly, confirming .
Final answers
- (a) No restriction
- (b) Not starting with
- (c) Not starting with and even