Let f : N → N and g : N → N be the functions defined as ∀k ∈ N
f(k) = 2k and g(k) = (k/2 if k is even, (k + 1) /2 if k is
odd).
(1) Are the functions f and g injective? surjective? bijective?
Justify your answers.
(2) Give the expressions of the functions g ◦ f and f ◦ g?
(3) Are the functions g ◦ f and f ◦ g injective? surjective?
bijective?...
Let function F(n, m) outputs n if m = 0 and F(n, m − 1) + 1
otherwise.
1. Evaluate F(10, 6).
2. Write a recursion of the running time and solve it
. 3. What does F(n, m) compute? Express it in terms of n and
m.
Consider the relation R defined on the set Z as follows: ∀m, n ∈
Z, (m, n) ∈ R if and only if m + n = 2k for some integer k. For
example, (3, 11) is in R because 3 + 11 = 14 = 2(7).
(a) Is the relation reflexive? Prove or disprove.
(b) Is the relation symmetric? Prove or disprove.
(c) Is the relation transitive? Prove or disprove.
(d) Is it an equivalence relation? Explain.
Let M be defined as follows M = (K, Σ, s, ∆, F ) for K = {q0,
q1, q2, q3, }, s = q0, Σ = {a, b, c}, F = {q0, q2, q3} and ∆ =
{(q0, abc, q0), (q0, a, q1), (q0, e, q3), (q1, bc, q1), (q1, b,
q2), (q2, a, q2), (q2, b, q3), (q3, a, q3)}.
1. (1pts) Draw the diagram of M
2. (6pts ) DRAW a diagram of an automata M0 such...
The curried version of let f (x,y,z) = (x,(y,z)) is
let f (x,(y,z)) = (x,(y,z))
Just f (because f is already curried)
let f x y z = (x,(y,z))
let f x y z = x (y z)
Let ∼ be the relation on P(Z) defined by A ∼ B if and only if
there is a bijection f : A → B. (a) Prove or disprove: ∼ is
reflexive. (b) Prove or disprove: ∼ is irreflexive. (c) Prove or
disprove: ∼ is symmetric. (d) Prove or disprove: ∼ is
antisymmetric. (e) Prove or disprove: ∼ is transitive. (f) Is ∼ an
equivalence relation? A partial order?
Let A be some m*n matrix. Consider the set S = {z : Az = 0}.
First show that this is a vector space. Now show that n = p+q where
p = rank(A) and q = dim(S). Here is how to do it. Let the vectors
x1, . . . , xp be such that Ax1, .
. . ,Axp form a basis of the column space of A (thus
each x can be chosen to be some unit...