Fall2023 Assignment
Fall2023 Assignment
ASSIGNMENT
Deadline: 30/10/2023
1
QUESTION:
b) f(m, n) = m2 − n2
c) f(m, n) = m + n + 1
2. Determine whether each of these functions is a bijection from R to R.
a) f (x) = −3x + 4
b) f (x) = 3x2 + 5
3. Let S = {−1, 0, 2, 4, 7}. Find f(S) if
a) f(x) = 1
b) f(x) = 2x + 1
𝑥
c) 𝑓(𝑥) = ⌈ ⌉
5
a) f −1({1})
a) c ≡ a2 + b2 (mod 13).
3
b) c ≡ a3 − b3 (mod 13).
13. Given k mod 4 = 1. Find (17k2+7k+7) mod 4? Find each of these values
integer n.
a) What is the statement P(1)?
b) Show that P(1) is true, completing the basis step of the proof.
c) What is the inductive hypothesis?
d) What do you need to prove in the inductive step?
e) Complete the inductive step, identifying where you use the inductive hypothesis.
19. Let P(n) be the statement that a postage of n cents can be formed using just 3-cent stamps
and 5-cent stamps. The parts of this exercise outline a strong induction proof that P(n) is
true for n ≥ 8
a) Show that the statements P(8), P(9), and P(10) are true, completing the basis step of
the proof.
b) What is the inductive hypothesis of the proof?
c) What do you need to prove in the inductive step?
d) Complete the inductive step for k ≥ 10.
4
20. Find f (2), f (3), f (4), and f (5) if f is defined recursively by f(0) = −1, f(1) = 2, and for
n = 1, 2, . . .
a) an = 1 + (−1)n
b) an = n(n + 1)
22. Give a recursive definition of each of these sets.
a) A = {2, 5, 8, 11, 14, …}
b) B = {…, -5, -1, 3, 7, 11, …}
c) C = {3, 12, 48, 192, 768, …}
d) D = {1, 2, 4, 7, 11, 16, …}
23. Consider an recursive algorithm to compute the nth Fibonacci number:
procedure Fibo(n : positive integer)
if n = 1 return 1
else if n = 2 return 1
else return Fibo(n – 1) + Fibo(n – 2)
How many additions (+) are used to find Fibo(6) by the algorithm above
24. Consider the following algorithm:
procedure F(a1, a2, a3, ...,an : integers)
if n = 1 return 0
else return an + F(a1, a2, a3, ...,an-1)
Find
a) F(1,3,5) b) F(1,2,3,5,9)
25. How many different bit strings of length seven are there?
26. How many different license plates can be made if each plate contains a sequence of
three uppercase English letters followed by three digits (and no sequences of letters are
prohibited, even if they are obscene)?
27. Counting Functions: How many functions are there from a set with m elements to a
set with n elements?
5
28. Counting One-to-One Functions: How many one-to-one functions are there from a
set with m elements to one with n elements?
29. Counting bijection Functions: How many one-to-one functions are there from a set
with m elements to one with n elements?
30. How many bit strings of length four do not have two consecutive 1s?
31. How many positive integers between 5 and 31
a) are divisible by 3?
b) are divisible by 4?
c) are divisible by 3 and by 4?
32. How many one-to-one functions are there from a set with five elements to sets with
the following number of elements?
a) 4
b) 5
c) 6
d) 7
33. How many comparisons are needed for a binary search in a set of 64 elements
34. For which values of n are these graphs bipartite?
a) Kn
b) Cn
c) Wn
d) Qn
35. How many vertices and how many edges do these graphs have?
a) Kn
b) Cn
c) Wn
d) Km,n
e) Qn
36. Represent each of these graphs with an adjacency matrix.
a) K4
b) K1,4
c) K2,3
6