ITPEC FE Subject B October 2024 Question 14

Source exam: ITPEC FE Subject B October 2024Topic: Math & Numbers

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]

qq × 9j = floor(q × 9)index = j + 1value
00010.1
0.252.25230.3
0.54.5450.5
0.756.75670.7
199101

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.