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.

Host this setFree Play

The 20 questions

  1. 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
  2. For add: integer -> integer -> integer, what is returned by the expression add 4?

    • A function
    • A tuple
    • The number 4
    • An integer
  3. If inc is add 4, what is the result of inc applied to 5?

    • 20
    • 9
    • 4
    • 5
  4. 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
  5. In the composite function expression (g o f)(x), which function is applied first?

    • Neither
    • f
    • Both simultaneously
    • g
  6. For functions f: A -> B and g: B -> C, what is the domain of g o f?

    • C
    • A -> C
    • A
    • B
  7. 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
  8. Using f(x) = x + 2 and g(y) = y^3, what is (g o f)(1)?

    • 27
    • 5
    • 9
    • 7
  9. Using f(x) = x + 2 and g(y) = y^3, what is (f o g)(1)?

    • 27
    • 3
    • 4
    • 5
  10. Given inc x = x + 1 and double x = 2 * x, what is double (inc 3)?

    • 6
    • 7
    • 8
    • 10
  11. 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)
  12. What process transforms a multi-argument function into a chain of single-argument functions?

    • Memoisation
    • Currying
    • Vectorisation
    • Composition
  13. What is the primary benefit of using partial function application in programming?

    • Faster execution speed
    • Automatic type conversion
    • Reduced memory usage
    • Function specialisation
  14. For functions f: A -> B and g: B -> C, what is the co-domain of g o f?

    • C
    • A
    • A -> C
    • B
  15. If f(x) = x + 2 and g(y) = y^3, what is the value of (g o f)(2)?

    • 10
    • 12
    • 16
    • 64
  16. 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
  17. What term describes combining two functions so the output of one becomes the input of another?

    • Type inference
    • Function composition
    • Partial application
    • Currying
  18. Is function composition commutative, meaning (g o f) always equals (f o g)?

    • Only in Haskell
    • No
    • Only for integers
    • Yes
  19. What does partial application of a two-argument function return?

    • A single integer
    • A tuple list
    • A new function
    • A boolean value
  20. What function results from partially applying a multiplication function to 3?

    • Adds 3
    • Divides by 3
    • Subtracts 3
    • Multiplies by 3

All AQA Computer Science quizzes