IPA FE Subject B 2025 Question 5
A question IPA Japan published in 令和7年度 基本情報技術者試験 科目B 公開問題 問5, translated into English. ITPEC is based on the same exams.
From the answer group below, select the correct combination of answers to be inserted into A and B in the description. Here, the array index starts at 1.
Based on the tabulated results of data collected to investigate the preventive effect of a vaccination against disease X, the number of persons is calculated on the assumption that whether a person contracts disease X is not affected by whether or not the person received the vaccination. This number of persons is called the theoretical frequency. Table 1 shows an example of the tabulated results, and Table 2 shows the theoretical frequencies calculated based on Table 1.
The function f returns the theoretical frequencies calculated based on the tabulated results received in the argument data. The argument and the return value are two-dimensional arrays, whose rows correspond to the rows of the table and whose columns correspond to the columns of the table.
Table 1 Example of tabulated results
Unit: persons
Table 2 Theoretical frequencies calculated based on Table 1
Answer group
Explanation
A: 80, B: 6 — the theoretical (expected) frequency of a cell is its row total × its column total ÷ the grand total, which is what f computes for every cell.
From Table 1, t = 82 + 6 + 58 + 8 = 154. The row totals are 88 (vaccinated) and 66 (not vaccinated), and the column totals are 140 (did not contract disease X) and 14 (contracted it).
- •A, row 1 and column 1: 88 × 140 ÷ 154 = 80
- •B, row 2 and column 2: 66 × 14 ÷ 154 = 6
Running f on Table 1 returns {{80, 8}, {60, 6}}. Its rows and columns add up to the same totals as Table 1, and the share who contract disease X is 1 in 11 in both rows (8 of 88, 6 of 66), as the assumption that the vaccination makes no difference requires.
Answer (e)
Why not others:
- •(b) 58, 8 and (g) 82, 6 — copy observed counts from Table 1 instead of computing theoretical ones
- •(f) 80, 8 — A is right, but 8 is the result for row 1, column 2 (the shaded cell beside A) and the observed count in B’s cell; the theoretical value for B is 6
- •(a) 44, 33 — halves each row total (88 ÷ 2, 66 ÷ 2), as if both columns were equally likely
- •(c) 70, 7 — halves each column total (140 ÷ 2, 14 ÷ 2), as if both rows were the same size
- •(d) 75, 2 — matches no step of the calculation; 75 and 2 are not row total × column total ÷ 154 for any cell
Key rule: In a contingency table, the expected frequency of a cell under independence is row total × column total ÷ grand total, the figure the chi-square test compares the observed counts with.
Math & Data Science · AI-written, may contain errors
This question comes from the past questions IPA Japan publishes, translated into English by ITPEC Practice. ITPEC Practice is an independent study tool and is not affiliated with IPA or ITPEC. See the original paper (PDF) or Report an issue.