パスワードの長さが8文字で,各文字に使用できる文字の種類がM種類のとき,設定できるパスワードの総数を表す式はどれか。
平成28年度 秋期 ITパスポート試験 問61
This question's explanation and your answers so far.
問 61
Incorrectア
8×M merely multiplies the 'number of characters' by the 'number of character types', and does not express that each position can be chosen independently. The multiplication rule requires multiplying once per position (M multiplied 8 times), so 8×M greatly underestimates the total.
Incorrectイ
8^M has the base and exponent reversed. The base should be M (the number of choices per position) and the exponent should be 8 (the number of positions); 8^M wrongly uses 8 as the base, which does not fit the meaning.
Incorrectウ
M^8−1 subtracts 1 from the correct total M^8 for no reason. The premise is that all 8 positions are filled with characters, so there is no invalid combination to exclude (e.g., an empty password); therefore the −1 is unnecessary.
- エ
正解 The password is 8 characters long, and for each character you can freely choose 1 out of M types. The 1st character has M choices, the 2nd also has M choices, and so on — each position can independently take M choices, so by the multiplication rule the total is M×M×…×M (M multiplied 8 times) = M to the 8th power = M^8. Therefore the correct answer is 'エ'.
- Multiplication rule: when independently chosen events occur in succession, the total equals the product of the number of options at each stage. Multiplying once per position gives 'the number of character types raised to the power of the number of positions' = M^8.
- Do not confuse the base and exponent of a power. Base = the number of choices per character (M); exponent = the number of characters (8).