Lesson 4.12.1.4
4.12.1.4 Partial function application and composition of functions Quiz: AQA Computer Science, Unit 12
20 questions
In partnership with Revision Ninja
Lesson 4.12.1.4, Partial function application and composition of functions: 20 multiple choice questions for the AQA Computer Science (7517), Unit 12: Fundamentals of functional programming, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
What does partial function application return when fewer arguments than required are supplied?
- A new function
- The final result
- A syntax error
- A boolean value
-
For add: integer -> integer -> integer, what is returned by the expression add 4?
- A function
- A tuple
- The number 4
- An integer
-
If inc is add 4, what is the result of inc applied to 5?
- 20
- 9
- 4
- 5
-
In curried notation, what is the type of add that takes two integers?
- integer x integer -> integer
- integer -> integer -> integer
- integer -> integer x integer
- integer -> integer
-
In the composite function expression (g o f)(x), which function is applied first?
- Neither
- f
- Both simultaneously
- g
-
For functions f: A -> B and g: B -> C, what is the domain of g o f?
- C
- A -> C
- A
- B
-
For f(x) = x + 2 and g(y) = y^3, what is g o f?
- (x + 2)^3
- (x^3) + 2 in every case
- x^3 + 2
- x + 8
-
Using f(x) = x + 2 and g(y) = y^3, what is (g o f)(1)?
- 27
- 5
- 9
- 7
-
Using f(x) = x + 2 and g(y) = y^3, what is (f o g)(1)?
- 27
- 3
- 4
- 5
-
Given inc x = x + 1 and double x = 2 * x, what is double (inc 3)?
- 6
- 7
- 8
- 10
-
Given a three-argument function f, which expression partially applies f using arguments a and b?
- f o g
- f a b
- f(a + b)
- f(a, b, c)
-
What process transforms a multi-argument function into a chain of single-argument functions?
- Memoisation
- Currying
- Vectorisation
- Composition
-
What is the primary benefit of using partial function application in programming?
- Faster execution speed
- Automatic type conversion
- Reduced memory usage
- Function specialisation
-
For functions f: A -> B and g: B -> C, what is the co-domain of g o f?
- C
- A
- A -> C
- B
-
If f(x) = x + 2 and g(y) = y^3, what is the value of (g o f)(2)?
- 10
- 12
- 16
- 64
-
f: integer -> boolean and g: boolean -> string are functions. What is the type of g o f?
- integer -> string
- integer x boolean -> string
- boolean -> integer
- string -> integer
-
What term describes combining two functions so the output of one becomes the input of another?
- Type inference
- Function composition
- Partial application
- Currying
-
Is function composition commutative, meaning (g o f) always equals (f o g)?
- Only in Haskell
- No
- Only for integers
- Yes
-
What does partial application of a two-argument function return?
- A single integer
- A tuple list
- A new function
- A boolean value
-
What function results from partially applying a multiplication function to 3?
- Adds 3
- Divides by 3
- Subtracts 3
- Multiplies by 3
Related quizzes
- Function types and first-class objects Quiz · 4.12.1.1 · 20 questions
- Writing functional programs Quiz · 4.12.2.1 · 20 questions
- List processing Quiz · 4.12.3.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions
- Entity relationship modelling Quiz · 4.10.1.1 · 20 questions
- Big Data Quiz · 4.11.1.1 · 20 questions
- Analysis Quiz · 4.13.1.1 · 20 questions
- Data structures and abstract data types Quiz · 4.2.1.1 · 20 questions
- Breadth-first and depth-first search Quiz · 4.3.1.1 · 20 questions
- Problem-solving and algorithms Quiz · 4.4.1.1 · 20 questions