Skip to content

平成22年度 春期 ITパスポート試験 問67

This question's explanation and your answers so far.

問67
頻出度★★☆

表のA列とB列に0から9までの数字のすべての組合せが入っており,全部で100行ある。表からA列の値がB列の値以下である行をすべて取り除く。残りは何行あるか。

AB
00
01
02
⋮⋮
98
99
出典 平成22年度 春期 ITパスポート試験 問67
解説

問 67

  • Incorrectア

    40 comes from halving the 100 rows to get 50 and then subtracting the 10 rows with A = B on top of that. Those 10 rows are already included in A ≦ B and are on the removed side, so the correct order is to first take the 10 rows out of the 100, leaving 90, and then halve that: 90 ÷ 2 = 45. The 10 rows must not be subtracted twice.

  • イ

    正解 Columns A and B each take 10 values, 0 through 9, so all combinations amount to 10×10 = 100 rows. The rows removed are those where the value of column A is less than or equal to the value of column B, that is A ≦ B, so only the rows with A > B remain. Split the 100 rows into three groups: the rows with A = B are the 10 rows from (0,0) to (9,9). Among the other 90 rows, swapping (A,B) into (B,A) always turns one of the pair into a row with A > B and the other into a row with A < B, so the A > B rows and the A < B rows are exactly equal in number, 90 ÷ 2 = 45 rows each. Therefore 45 rows remain, and イ is correct. Counting directly gives the same result: for A = 1 there is 1 case (B = 0), for A = 2 there are 2 cases (B = 0, 1), ..., for A = 9 there are 9 cases, and 1 + 2 + ... + 9 = 45.

  • Incorrectウ

    50 assumes that the 100 rows split exactly in half between A > B and A ≦ B. Because there are 10 rows with A = B, the rows with A > B and those with A < B add up to only 90, giving 45 each. Failing to count the rows where the two values are equal leads to 50.

  • Incorrectエ

    55 is the number of rows on the removed side (A ≦ B = 45 + 10 = 55 rows) given as the answer. The same value also appears if the condition is misread as the value of column A being less than the value of column B (A < B), which would leave the 55 rows with A ≧ B. The question says less than or equal to, so equality is included and the 10 rows with A = B are removed as well, and are not part of what remains.

ここがポイント
  • Less than or equal to (≦) includes equality, while less than (<) does not. Whether the 10 rows with A = B are removed or kept swings the answer between 45 and 55, so reading the condition correctly is the biggest point being tested.
  • The symmetry approach: split all 10×10 = 100 combinations into the rows with A = B (10 rows) and the rows with A > B and A < B (symmetric, equal in number), then compute 90 ÷ 2 = 45. Counting one by one, 1 + 2 + ... + 9 = 45 confirms it.
用語

Your answers