Question
Consider the following sets where the domain is the set of positive integers less than equal to 100. Answer the questions. A={x | x is
Consider the following sets where the domain is the set of positive integers less than equal to 100. Answer the questions.
A={x | x is a prime number}= | is a prime number
B={x | x is a even number}= | is a even number
C={x | x is a power of 2}= | is a power of 2
Find a truth set of
BC
.
Find a truth set of
AC
.
Find
ABC-
.
Find
|BC|
.
Consider
(AB)(BA)=(AB)(AB)=()
. Is it true?
P((AB)(AC))
What is
|P((CA)(CB))|
?
[5 pts] Consider two matrices
A=[3172]=3712
and
B=[2173]=2713
and answer the following questions.
Find
A+B+
.
Find
AB
.
Consider
BA
. Is it equal to
AB
?
Find the inverse matrix of
A
?
[4 pts] Consider
Z=011001100=001100110
and find
n
which makes
Z[n] []
consists of all positive integers.
Z[2][]
Z[3]
Find
n
which makes
Z[n] []
consists of all positive integers
[4 pts] Consider a function
f:ZZ:
and
f(x)=x.=.
Answer the following questions.
Is
f(x)
injective? Justify your answer.
Is
f(x)
surjective? Justify your answer.
Is there an inverse function of
f(x)
? Justify your answer.
[6 pts] Determine whether each of these functions is
O(x2)(2)
.
f(x)=152x+11=152+11
f(x)=3x2+13126=32+13126
f(x)=6x43/=643
f(x)=2x=2
f(x)=xx=
[4 pts] Consider the following sets and answer the following questions.
{1,2,3,4,, 97,98,99,100},,,,, ,,,
{1,3,5,7,,97,99},,,,,,
{2,4,6,8,,96,98,100}{,,,,,,,}
[BONUS QUESTION: 3 pts] Consider two sorting algorithms and a sequence
A
below Sort the sequence
A
using insertion sorting and show every change in
A
.
A={24,37,11,21,99,52,53,74}={24,37,11,21,99,52,53,74}
[ALGORITH: INSERTION-SORT(
A
)]
1 for
j = 2 =
to
A.length.
2
key = A[j] = []
3 // insert
A[j][]
into the sorted sequence
A[1 j1][ ]
4
i = j1 =
5 while
i > 0 >
and
A[i] > key[] >
6
A[i+1]= A[i][+]= []
7
i=i1=
8
A[i+1]=key[+]=
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started