0% found this document useful (0 votes)
30 views6 pages

Fall2023 Assignment

This document contains 35 questions related to discrete mathematics concepts such as functions, relations, recursion, counting, graphs, and algorithms. The questions cover a range of topics including determining if functions are one-to-one, onto, or bijections; writing recursive definitions; analyzing algorithm complexities; counting combinations and permutations; identifying properties of graphs like being bipartite; and representing graphs with adjacency matrices.

Uploaded by

huynt1910
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
30 views6 pages

Fall2023 Assignment

This document contains 35 questions related to discrete mathematics concepts such as functions, relations, recursion, counting, graphs, and algorithms. The questions cover a range of topics including determining if functions are one-to-one, onto, or bijections; writing recursive definitions; analyzing algorithm complexities; counting combinations and permutations; identifying properties of graphs like being bipartite; and representing graphs with adjacency matrices.

Uploaded by

huynt1910
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

FALL 2023

Discrete Mathematics and Its Applications


MAD101

ASSIGNMENT

Deadline: 30/10/2023

1
QUESTION:

1. Determine whether f : Z × Z → Z is onto if


a ) f(m, n) = 2m − n

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

4. Let f be the function from R to R defined by f(x) = x2. Find

a) f −1({1})

b) f −1({x | 0 < x < 1})

c) f −1({x | x > 4})


5. Find the solution to each of these recurrence relations and initial conditions.
a) an = −an−1, a0 = 5
b) an = 2nan−1, a0 = 3
c) an = 5an−1 − 6an−2, a0 = 2, a1 = −1
6. Consider the Linear search algorithm:
procedure linear search(x: integer, a1,a2,...,an: distinct integers)
i := 1
while (i ≤ n and x≠ai )
i := i + 1
if i ≤ n then location := i
else location := 0
return location
2
7. Find the least integer n such that f(x) is O(x n) for each of these
functions.
a) f(x) = 2x3 + x2log x
b) f(x) = 3x3 + (logx)4
c) f(x) = (x4 + x2 + 1)/(x3 + 1)
d) f(x) = (x4 + 5logx)/(x4 + 1)
8. Give as good a big-O estimate as possible for each of these functions
a) (n2 + 8)(n + 1)
b) (nlogn + n2)(n3 + 2)
9. Consider the algorithm:
procedure giaithuat (a1, a2, …, an : integers)
count:= 0
for i:= 1 to n do
if ai > 0 then count: = count + 1
print(count)
Give the best big-O complexity for the algorithm above.
10. Consider the algorithm:
procedure GT (n : positive integer)
F:=1
for i:= 1 to n do
F: = F * i
Print(F)
Give the best big-O complexity for the algorithm above.
11. Consider the algorithm:
procedure max(𝑎1 , 𝑎2 , . . . . . , 𝑎𝑛 : reals )
max:=𝑎1
for i:=2 to n
if max < 𝑎𝑖 then max:= 𝑎𝑖
Give the best big-O complexity for the algorithm above.
12. Suppose that a and b are integers, a ≡ 4 (mod 13), and b ≡ 9 (mod 13). Find the integer c
with 0 ≤ c ≤ 12 such that

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

a) (992 mod 32)3 mod 15

b) (34 mod 17)2 mod 11

c) (193 mod 23)2 mod 31

d) (893 mod 79)4 mod 26


14. Suppose a mod 3 = 2 and b mod 6 = 4, find ab mod 3.
15. Which positive integers less than 12 are relatively prime to 12?
16. Which positive integers less than 30 are relatively prime to 30?
17. Find these values of the Euler φ-function: φ(4), φ(10) , φ(13).
𝜑: ℕ∗ → ℕ∗
𝑛 ↦ 𝜑(𝑛)
φ(n) = the number of positive integers less than or equal to n that are relatively prime to n..
𝑛(𝑛+1)(2𝑛+1)
18. Let P(n) be the statement that 12 + 22 + 32 +. . . . +𝑛2 = for the positive
6

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) f(n + 1) = f(n) + 3f(n − 1) b) f(n + 1) = [f(n)]2f(n − 1)

c) f(n + 1) = 3[f(n)]2 – 4[f(n − 1)]2 d) f(n + 1) = f(n − 1)/f(n)


21. Give a recursive definition of the sequence {an}, n = 1, 2, 3, . . . if

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

You might also like