For each case below, draw a TM that computes the indicated function. In the first five parts, the function is from N to N. In each of these parts, assume that the TM uses unary notation—i.e., the natural number n is represented by the string 1^n.
a. f(x) = x + 2
b. f(x) = 2x
c. f(x) = x^2
d. f(x) = the smallest integer greater than or equal to log_2(x + 1) (i.e., f(0) = 0, f(1) = 1, f(2) = f(3) = 2, f(4) = ... = f(7) = 3, and so on).
e. E: {a, b}* x {a, b}* → {0, 1} defined by E(x, y) = 1 if x = y, E(x, y) = 0 otherwise.
f. p_l: {a, b}* x {a, b}* → {0, 1} defined by p_l(x, y) = 1 if x < y, p_l(x, y) = 0 otherwise. Here < means with respect to "lexicographic," or alphabetical, order. For example, a < aa, abab < abb, etc.
g. p_c, the same function as in the previous part except this time < refers to canonical order. That is, a shorter string precedes a longer one, and the order of two strings of the same length is alphabetical.