表のA列とB列に0から9までの数字のすべての組合せが入っており,全部で100行ある。表からA列の値がB列の値以下である行をすべて取り除く。残りは何行あるか。
| A | B |
|---|---|
| 0 | 0 |
| 0 | 1 |
| 0 | 2 |
| ⋮ | ⋮ |
| 9 | 8 |
| 9 | 9 |
This question's explanation and your answers so far.
表のA列とB列に0から9までの数字のすべての組合せが入っており,全部で100行ある。表からA列の値がB列の値以下である行をすべて取り除く。残りは何行あるか。
| A | B |
|---|---|
| 0 | 0 |
| 0 | 1 |
| 0 | 2 |
| ⋮ | ⋮ |
| 9 | 8 |
| 9 | 9 |
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.
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.
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.