# First Midterm Exam

### Directions:

• Answer the problems on the exam pages.
• There are seven problems on pages 2-7, for 100 total points. Probable scale is A=90, C=60.
• If you need extra space use the back of a page.
• No books, notes, calculators, or collaboration.
• The first five questions are true/false, with five points for the correct boolean answer and up to five for a correct justification.
• Question 6 has numerical answers -- you may give your answer in the form of an expression using arithmetic operations, powers, falling powers, or the factorial function. If you give your answer using the "choose" notation, also give it using only operations on this list.

```  Q1: 10 points
Q2: 10 points
Q3: 10 points
Q4: 10 points
Q5: 10 points
Q6: 30 points
Q7: 20 points
Total: 100 points
```

• Question 1 (10): True or false with justification: If A, B, and C are any three finite sets, and A∩B∩C = ∅, then |A∪B∪C| ≤ |A| + |B| + |C|.

• Question 2 (10): True or false with justification: No function can be both O(n2) and O(n3).

• Question 3 (10): True or false with justification: Let n be any natural number. The sum for i from 0 to n of (n choose i) is exactly half the sum for j from 0 to n+1 of (n+1 choose j).

• Question 4 (10): True or false with justification: Consider the set of four-letter strings over the alphabet {a,b,c}. A majority of these strings have two or more c's.

• Question 5 (10): True or false with justification: Consider the set of three-letter strings over the alphabet {a,b,c,d}. A majority of these strings have no letter occurring more than once.

• Question 6 (30): A conference is being held over five days, Monday through Friday. The conference chair must choose which topics will be discussed on which days. (It is not possible to discuss more than one topic on the same day.) There are eight possible topics, which we will call A, B, C, D, E, F, G, and H.

• (a,5) In how many ways can the chair pick one topic for each day, if no topic is discussed on more than one day?

• (b,5) In how many ways can the chair choose a set of five topics to be discussed?

• (c,5) Now suppose that any topic may be discussed on more than one day. In how many ways can the chair schedule one topic for each day?

• (d,5) In how many ways can the number of days for each topic be assigned? (For example, one of these ways is "two days for B, one day for F, and two days for H".)

• (e,5) How many of the answers to (a) discuss B on Wednesday and don't discuss G at all?

• (f,5) How many of the answers to (c) discuss B on Wednesday and don't discuss G at all?

• Question 7 (20): Let g be a function such that g = θ(n). This was a mistake, it should have said that g = θ(1) to match the following definition. (Remember that this means that there exist a natural number n0 and positive real numbers c and d such that for all n with n ≥ n0, d < g(n) < c. Let the function f be defined by the recurrence f(n+1) = f(n) + g(n) for all natural numbers n, with the initial condition f(0) = 0. Prove that f(n) = θ(n). Which of course it isn't if g = θ(n), in that case f would be θ(n2).

(Hint: Use ordinary induction on all n with n ≥ n0 to show that for those n, f(n) is between two linear functions.)