CSE 130 Sample Solutions: Individual Assignment 2 PROBLEM 1 (a) f1: - A mapping strings to integers. - Associative array. f2: - A mapping from integers to strings. - Array. f3: - A mapping from records consisting of an Integer and a String to a boolean value. - A set of pairs (Integer, String), or a binary predicate. (b) f: - f is a function that takes an argument of type a and then returns another function that takes an argument of type b and returns an argument of type c. - if we think of f as integer addtion (a = b = c = Integer) then: example type value f 17 3 Integer 20 f 17 Integer->Integer (increment by 17) g: - function that maps a function (that maps type a to type b) and an argument of type c to type d. - thinking of "map", the types that make sense are c = [a] d = [b] PROBLEM 2 (a) |A| * |B| = n * m (b) |B|^|A| = m^n (c) f::A1 -> A2 ->A3->....->AK -> Bool or f::(A1, A2, ... , Ak) -> Bool