ITPEC FE Subject B October 2024 Question 14
ITPEC FE Subject B October 2024 — Question 14 of 20
Quantile Calculation (Five-Number Summary) — trace a function that computes quantile values from a sorted array.
Given sortedData = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1} (10 elements, 1-based indexing) and q = {0, 0.25, 0.5, 0.75, 1}:
findRank(sortedData, q) computes:
- j ← floor(q × (n - 1)) where n = 10
- returns sortedData[j + 1]
| q | q × 9 | j = floor(q × 9) | index = j + 1 | value |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0.1 |
| 0.25 | 2.25 | 2 | 3 | 0.3 |
| 0.5 | 4.5 | 4 | 5 | 0.5 |
| 0.75 | 6.75 | 6 | 7 | 0.7 |
| 1 | 9 | 9 | 10 | 1 |
Result: {0.1, 0.3, 0.5, 0.7, 1} → (e)
Why not others:
- (a) {0.1, 0.2, 0.3, 0.4, 0.5} — takes consecutive elements from the start, ignores the quantile formula
- (f) {0.1, 0.3, 0.5, 0.8, 1} — incorrect rounding for q = 0.75 (uses ceiling instead of floor)
- (h) {0.1, 0.3, 0.7, 0.9, 1} — skips the median calculation incorrectly
Key rule: floor always truncates toward zero — floor(2.25) = 2, floor(6.75) = 6. Don't confuse it with rounding.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.