logo

AQA A-Level Computer Science practice

Explain what is meant by the composition of two functions. In your answer, describe the domain and co-domain of g ○ f when f: A → B and g: B → C, and state the order in which the functions are applied.

Try the question first, then check the answer and practise the same topic again.

At a glance

Question

Type

practice

Style

Topic

Functional programming paradigm

Exam-style question

Try this first

Explain what is meant by the composition of two functions. In your answer, describe the domain and co-domain of g ○ f when f: A → B and g: B → C, and state the order in which the functions are applied.

Answer and explanation

Concise answer

Function composition combines two functions to form a new function.

Why this is correct

The intermediate co-domain of f must match the domain of g so that the result returned by f can be used by g. The order is read from right to left: f first, followed by g.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions