Let f: X→Y be a map with A1, A2⊂X and
B1,B2⊂Y
(A) Prove
f(A1∪A2)=f(A1)∪f(A2).
(B) Prove
f(A1∩A2)⊂f(A1)∩f(A2).
Give an example in which equality fails.
(C) Prove
f−1(B1∪B2)=f−1(B1)∪f−1(B2),
where f−1(B)={x∈X: f(x)∈B}.
(D) Prove
f−1(B1∩B2)=f−1(B1)∩f−1(B2).
(E) Prove
f−1(Y∖B1)=X∖f−1(B1).
(Abstract Algebra)
Let A = {a1, a2, a3, . . . , an} be a nonempty set of n distinct
natural numbers. Prove that there exists a nonempty subset of A for
which the sum of its elements is divisible by n.
Let a1 ≥ a2, . . . , an be a sequence of positive integers whose
sum is 2n − 2. Prove that there exists a tree T on n vertices whose
vertices have degrees a1, a2, . . . , an.
Sketch of solution: Prove that there exist i and j such that ai = 1
and aj ≥ 2. Remove ai, subtract 1 from aj and induct on n.
1. Let A1, A2,..., An be mutually disjoint events. Show that
a) IP(A1UA2U...UAn) = IP(A1) + IP(A2) + ... + IP(An)
b) There exists at least one i with IP(Ai) less than equals to
1/n
2. Define conditional probability IP(E|F). Derive the Law of
total probability and use it to derive Bayes's Formula
Let A1, A2 and A3 be events except with respective probabilities
1/6 , 1/5, and 1/4.Let N be the number of these events that
occur.
a) Write down a formula for N in terms of indicators.
b) Find E(N).
In each of the following cases, calculate Var(N):
c) A1, A2, A3 are disjoint;
d) they are independent;
e) A1 is in A2 is in A3.
Consider the following algorithm, which takes as input a
sequence of ?n integers ?1,?2,…,??a1,a2,…,an and produces as output
a matrix ?={???}M={mij} where ???mij is the minim term in the
sequence of integers ??,??+1,…,??ai,ai+1,…,aj for ?≥?j≥i and
???=0mij=0 otherwise.
for i := 1 to n
for j := 1+1 to n
for k:= i+1 to j
m[i][j] := min(m[i][j], a[k])
end for
end for
end for
return m
a.) Show that this algorithm uses ?(?3)O(n3) comparisons to
compute the matrix M....
2. Write the hexadecimal numbers in the registers of $a0, $a1,
$a2, $a3 after the following codes running:
ori $a0, $0, 11
ori $a1, $0, 19
addi $a1, $a1, -7
slt $t2, $a1, $a0
beq $t2, $0, label
addi $a2, $a1, 0
sub $a3, $a1,$a0
j end_1
label: ori $a2, $a0, 0
add $a3, $a1, $a0
end_1: xor $t2, $a1, $a0
*Values in $a0, $a1, $a2, $a3 after the above instructions are
executed.
Question in graph theory:
1. Let
(a1,a2,a3,...an) be a
sequence of integers.
Given that the sum of all integers = 2(n-1)
Write an algorithm that, starting with a sequence
(a1,a2,a3,...an) of
positive
integers, either constructs a tree with this degree sequence or
concludes that
none is possible.
Present an O(n) algorithm that sorts n positive integer numbers
a1, a2, . . . , an which are known to be bounded by n 2 (so ai ≤ n
2 , for every i = 1, . . . , n. Use the idea of Radix Sort
(discussed in class and presented in Section 8.3 in the textbook).
Illustrate your algorithm by showing on paper similar to Fig. 8.3,
page 198 in the textbook (make sure you indicate clearly...