ITPEC FE Subject B October 2024 Question 5

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

ITPEC FE Subject B October 2024 — Question 5 of 20

Computing the geometric mean using pow(x, y).

The geometric mean of n values is defined as:

geomean = (a1 × a2 × … × an)^(1/n)

The loop multiplies all elements into product. To extract the n-th root we raise product to the power 1 ÷ n:

geomean ← pow(product, 1 ÷ n)

So A = `product`, B = `1 ÷ n` → answer (b).

Why not others:
- (a) `1 ÷ n`, `product` — arguments are swapped: this computes (1/n)^product, which is meaningless.

- (c) `product`, `n` — computes product^n, which raises the product to the n-th power instead of taking the n-th root.

- (d) `n`, `product` — computes n^product, which is unrelated to the geometric mean.

Key rule: The n-th root of a value equals raising it to the power 1/npow(value, 1 ÷ n).

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.