Arsdigita University Month 2: Discrete Mathematics - Professor Shai Simonson Problem Set 2 - Sets, Functions, Big-O, Rates of Growth
Arsdigita University Month 2: Discrete Mathematics - Professor Shai Simonson Problem Set 2 - Sets, Functions, Big-O, Rates of Growth
2. Generalize De Morgan’s laws for n sets and prove the laws by induction.
3. Prove by induction on the size of the set, that the power set P(A) has cardinality 2|A|.
6. The Inclusion/Exclusion Theorem for three sets says that if there are three sets, A,
B and C, then |A B C | = |A| + |B| + |C| - |A B| - |A C| - |B C| + |A
B C|. Note that the converse of this theorem is not true. Given a set of 29
students, where 8 need housing and financial aid; 12 need housing, financial aid,
and an e-mail account; 17 need an e-mail account and financial aid; 23 need
housing, 20 need financial aid, 19 need e-mail accounts, and 4 students don’t need
anything.
a. How many students need both housing and e-mail?
b. Change the numbers to 57, 8, 3, 21, 21, 32, 31, 8. What is your answer
now?
c. Which answer is bogus and why?
7. How many numbers are there between 1 and 10000, which are either even, end in
0, or have the sum of its digits divisible by 9? Hint: Use inclusion/exclusion.
a. Using the identity 1/((k)(k+1)) = 1/k – 1/(k+1), find the value of the
infinite sum 1/(1*2) + 1/(2*3) + 1/(3*4) + ….
b. The nth triangle number is defined to be the sum of the first n positive
integers. What is the value of the infinite sum of the reciprocals of the
triangle numbers.
a. Prove that the positive odd numbers have the same cardinality as the
positive even numbers.
b. Prove that the set of all integer points in the positive quadrant of 3-
dimensional space are countable.
c. Prove by induction that the set of all vectors in k dimensions with positive
integer values is countable.
d. Prove that the number of Scheme programs is countable. Hint: Order
them by the number of characters each contains.
14. The following is a version of Russell’s Paradox for sets, described in your text
(Rosen) in problem 26, on page 45. Consider any computer program that takes
other programs as input, and outputs yes or no based on some criterion. (A
compiler or interpreter, for example). It is possible for such a program to be fed
back into itself, and depending on the program it might either say yes (a Scheme
interpreter written in Scheme) or no (a Scheme interpreter written in Java). Call
the programs that say no to themselves self-hating programs. Now assume that
there is a computer program that takes other programs as input and says yes to all
the self-hating programs, and no otherwise.
a. Find the largest valued card in the deck by shuffling through one card at a
time extracting a card if it is the largest one seen so far, and swapping the
previously largest card back into the deck. When the largest has been
found, place this card face down in a new pile and repeat the previous
process until no cars in the original pile are left. Explain your answer.
b. This time we assume that the largest number on any of the n cards is n2.
We sort the cards by placing a set of n2 plates numbered from 1 to n2 on a
table. Then one by one, place each card on top of the numbered plate
equal to it on the desk. The sorted list can be extracted by looking through
the piles on all n2 plates in order.
c. This method can be improved to work in linear time. Explain how. Hint:
This is not easy. Use division, to try turn each number into a pair of
numbers, each with a value between 1 and n.