Math 213, Midterm Exam 1 Solutions and Comments for Section X1 (Spring 2006), Exams of Discrete Mathematics

Solutions and comments for math 213, midterm exam 1, section x1, which was held in spring 2006. Various mathematical concepts such as sets, power sets, cartesian products, difference sets, functions, summation notation, and binomial theorem. It includes problems with solutions and explanations.

Typology: Exams

Pre 2010

Uploaded on 03/16/2009

koofers-user-eub-3
koofers-user-eub-3 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 213, Section X1 Midterm Exam 1 Solutions and Comments Spring 2006
Problem 1
Let A={0,1}and B={2,3}. Write down the following sets, using proper mathematical
notation (e.g., use parentheses or braces as appropriate).
1. The power set of A:P(A) =
Solution: The power set of Ais the set of all subsets of A, so P(A) = {∅,{0},{1},{0,1}} .
Comments. Note that the elements of P(A) are sets, so the brace notation is needed.
Also, the empty set, , is a subset of any set, so it must be included.
2. The cartesian product of Aand B:A×B=
Solution: The cartesian product of Aand Bis the set of all tuples (a, b) with aA
and bB. Thus, A×B={(0,2),(0,3),(1,2),(1,3)}.
Comments. Note that the elements of A×Bare tuples (a, b) (where the order
matters) rather than subsets {a, b}, so round parentheses, not braces, must be used.
Problem 2
(Multiple choice. Circle the correct answer.) For arbitrary sets Aand B, the difference set
ABis equal to
(a) BA(b) AB(c) BA(d) BA(e) AB(f) None of the above.
Solution: ABis the set of elements which are in A, but not in B, so it is equal to BA.
Also correct is AB. (A Venn diagram shows that the latter is the same as BA.)
Problem 3
(Multiple choice. Circle the correct answer.) How many functions are there from a 5-element
set to a 7-element?
(a) 5 ·7 (b) 57(c) 75(d) 7!/2! (e) 7
5(f) None of the above
Solution: For each of the 5 elements of the first set there are 7 ways assign the value of fat
this element, so the total number of possible assignments is 7 ·7·7·7·7 = 75. Thus, (c) is
the correct answer.
Problem 4
Find a proper subset ANand a surjective function ffrom Ato N, or prove that no
such Aand fexist.
Solution: Aand fwith these properties exist. For example, let A={0,2,4, . . . }, i.e., the
set of even integers in N(obviously a proper subset of N), and let fbe defined by f(n) = n/2.
Then fis a bijection (and thus, in particular, a surjection) from Ato N. Another example
is obtained by taking A={1,2,3, . . . }(which again is a proper subset of Nsince 0 is in N,
but not in A) and f(n) = n1 for n= 1,2, . . . .
Problem 5
1. Express the sum of the first 1000 o dd positive integers, i.e., 1+3+5+· · · +1997 + 1999,
using summation notation, and then evaluate it. (Give a numerical value for this sum.)
Page 1
pf3
pf4
pf5

Partial preview of the text

Download Math 213, Midterm Exam 1 Solutions and Comments for Section X1 (Spring 2006) and more Exams Discrete Mathematics in PDF only on Docsity!

Problem 1

Let A = { 0 , 1 } and B = { 2 , 3 }. Write down the following sets, using proper mathematical notation (e.g., use parentheses or braces as appropriate).

  1. The power set of A: P (A) =

Solution: The power set of A is the set of all subsets of A, so P (A) = {∅, { 0 }, { 1 }, { 0 , 1 }}.

Comments. Note that the elements of P (A) are sets, so the brace notation is needed. Also, the empty set, ∅, is a subset of any set, so it must be included.

  1. The cartesian product of A and B: A × B = Solution: The cartesian product of A and B is the set of all tuples (a, b) with a ∈ A and b ∈ B. Thus, A × B = {(0, 2), (0, 3), (1, 2), (1, 3)}. Comments. Note that the elements of A × B are tuples (a, b) (where the order matters) rather than subsets {a, b}, so round parentheses, not braces, must be used.

Problem 2

(Multiple choice. Circle the correct answer.) For arbitrary sets A and B, the difference set A − B is equal to

(a) B − A (b) A ∪ B (c) B ∪ A (d) B ∩ A (e) A ∪ B (f) None of the above.

Solution: A − B is the set of elements which are in A, but not in B, so it is equal to B ∩ A.

Also correct is A ∪ B. (A Venn diagram shows that the latter is the same as B ∩ A.)

Problem 3

(Multiple choice. Circle the correct answer.) How many functions are there from a 5-element set to a 7-element?

(a) 5 · 7 (b) 5^7 (c) 7^5 (d) 7!/2! (e)

5

(f) None of the above

Solution: For each of the 5 elements of the first set there are 7 ways assign the value of f at

this element, so the total number of possible assignments is 7 · 7 · 7 · 7 · 7 = 7^5. Thus, (c) is the correct answer.

Problem 4

Find a proper subset A ⊂ N and a surjective function f from A to N, or prove that no such A and f exist.

Solution: A and f with these properties exist. For example, let A = { 0 , 2 , 4 ,... }, i.e., the set of even integers in N (obviously a proper subset of N), and let f be defined by f (n) = n/2. Then f is a bijection (and thus, in particular, a surjection) from A to N. Another example is obtained by taking A = { 1 , 2 , 3 ,... } (which again is a proper subset of N since 0 is in N, but not in A) and f (n) = n − 1 for n = 1, 2 ,....

Problem 5

  1. Express the sum of the first 1000 odd positive integers, i.e., 1+3+5+· · ·+1997+1999, using summation notation, and then evaluate it. (Give a numerical value for this sum.)

Solution: The general form of a positive odd integer is 2i − 1, with i a positive integer, so the given sum can be written as

i=1 (2i^ −^ 1). It is equal to (^1000) ∑

i=

(2i − 1) = 2

i=

i −

i=

using the summation formula

∑n i=1 i^ =^ n(n^ + 1)/2.

  1. Find a simple formula for the product

Pn =

∏^ n

i=

i∏+

j=i

j

for a general positive integer n.

Solution: The inner product is equal to

∏i+ j=i j^ =^ i(i^ + 1), so

Pn =

∏^ n

i=

(i(i + 1)) = (1 · 2)(2 · 3)... ((n − 1) · n)(n · (n + 1)).

On the right-hand side, each integer i with 2 ≤ i ≤ n appears exactly twice, and there is an additional factor of n + 1, appearing once. Thus the above simplifies to Pn = (n!)^2 (n + 1) or Pn = n!(n + 1)!.

Problem 6

Determine the number of 5-letter words under the following restrictions:

  1. with at least one repeated letter.

Solution: We use the complement trick: 265 is the total number of 5-letter words, 26!/21! is the number of such words with no repeated letters, so the number of such words with at least one repeated letter is 265 − 26!/21!. Comments. This is a standard birthday-type problem. There is no easy way to directly get the answer (i.e., without resorting to the complement trick).

  1. with all letters distinct and in alphabetical order.

Solution: There are

5

ways to pick the 5 letters for the word, and only one way to

place these in alphabetical order, so the answer is

Comments. The above method is the only practical way to get the answer. Attempts to get the answer by counting the number of choices for the first letter, the second letter, etc., are bound to fail, because of the requirement that the letters have to be in alphabetical order. (The number of choices available for each position depends on how the earlier positions have been filled. For example, if the first letter is an A, there are 25 choices for the second letter, but if the first letter is a B, there are only 24, and if the first letter is a Z, there is none ...)

  1. with exactly two distinct letters. (For example, AAFAFF counts, but not AAFAFX or AAAAA, since the latter two words contain three, respectively one, distinct letters.)

Problem 8

Determine the number of points (x, y, z) with integer coordinates in the first octant (i.e., with x, y, z ≥ 0) for which the sum of all three coordinates is at most 13. (For example, (2, 1 , 3) or (0, 3 , 10) count, but (1, 3 , 10) or (1, − 2 , 6) do not count.)

Solution: The problem amounts to counting solutions of

(∗) x + y + z ≤ 13

with nonnegative integers. With an equality sign instead of an inequality sign, it would be a routine “donut counting” problem, and the answer would be

13

. The given version is one of the variations of the standard problem that was worked out in class. The trick is to introduce a new variable (like a “virtual” donut type), say w, and write (∗) as

(∗∗) x + y + z + w = 13

where x, y, z, w are any nonnegative integers. The latter equation (∗∗) has

solutions. Comments. Breaking the inequality (∗) down into cases x+y+z = n, for n = 0, 1 ,... , 13 and counting the number of solutions for each of these cases leads to a sum involving 14 binomial terms. This, however, does not qualify as a simple answer (see point 3 on the cover sheet), so only partial credit credit was given for an answer in this form. No credit was given for brute force attempts to count solutions by trying to list them all; because of the numbers involved, such attempts were doomed to fail.

Problem 9

Let A = {a 1 ,... , a 10 } be a set of 10 distinct positive two-digit integers (i.e., each ai is at least 10 and at most 99). For each subset B ⊆ A let f (B) denote the sum of all elements in B. (If B = ∅, set f (B) = 0.) Thus, f is a function from the power set P (A) of A to N. Prove that this function is not injective.

Solution: To show that the function is not injective, we need to show that there exist two distinct subsets at which f takes on the same value. To do this, we apply the pigeonhole principle, with the possible values of f as pigeonholes, and the subsets of A as pigeons. Since A is a 10-element set, there are 2^10 such “pigeons”. On the other hand, since each element of A is a nonnegative integer ≤ 99 and A has 10 elements, the sum of the elements of any such subset must be an integer, between 0 and 10 · 99, so there are at most 991 possible values of f , i.e., we have at most 991 pigeonholes. Since 2^10 = 1024 > 991, we have more pigeons than pigeonholes, so some pigeonhole must hold more than one pigeons. By our definition of pigeons and pigeonholes, this means that there exist two (distinct) subsets B 1 , B 2 ⊆ A with f (B 1 ) = f (B 2 ). This is what we wanted to show.

Problem 10

Let

f (n) =

(2n − 1)(2n + 1)

Guess a simple formula for f (n), and then use induction to prove that this formula holds for all positive integers n.

Solution: The values of f for n = 1, 2 , 3 are 1/3, 2/5, 3/7, suggesting the formula

(∗) f (n) =

n 2 n + 1

We prove this by induction. Base step: For n = 1, we have f (1) = 1/(1 · 3) = 1/3, so (∗) holds in this case. Inductive step: Assume (∗) holds for n = k, where k is a positive integer. Then

f (k + 1) =

(2k − 1)(2k + 1)

(2(k + 1) − 1)(2(k + 1) + 1)

= f (k) +

(2(k + 1) − 1)(2(k + 1) + 1)

(by def. of f (k))

k 2 k + 1

(2(k + 1) − 1)(2(k + 1) + 1)

(by ind. hyp.)

k(2k + 3) + 1 (2k + 1)(2k + 3)

(2k + 1)(k + 1) (2k + 1)(2k + 3)

(k + 1) 2(k + 1) + 1)

Thus, (∗) holds for n = k + 1, and the induction is complete.