# Third Midterm Exam

### Directions:

• Answer the problems on the exam pages.
• There are four problems on pages 2-6, for 100 total points. Probable scale is A=93, C=63
• If you need extra space use the back of a page.
• No books, notes, calculators, or collaboration.

```  Q1: 30 points
Q2: 20 points
Q3: 30 points
Q4: 20 points
Total: 100 points
```

• Question 1 (30): One kind of Roman dice, called tali, had four sides numbered 1, 3, 4, and 6 (well, I, III, IV, and VI, but never mind). This problem will deal with both fair tali, where each of the four sides has an equal probability of coming up, and unfair tali, where 1 and 4 each have probability 0.2 and 3 and 6 each have probability 0.3 -- we assume that different throws are independent. Four tali were thrown at once (we might call this throwing 4D4).

• (a,10) A Venus throw is where each of the four dice have a different number. What is the probability of a Venus throw with four fair tali? What is the probability with four unfair tali?

• (b,10) What is the expected value of the sum of the numbers on the four tali? Again, answer for both fair and unfair tali.

• (c,10) A senio was a throw of four tali that has at least one six, is not a Venus, and does not have all four sixes. Compute the number of possible senio throws and the probability (with fair tali only) of throwing a senio.

• Question 2 (20): In a strand of DNA, a codon is a sequence f three bases that causes some amino acid to be added to a protein. For our purposes, a codon is a three-letter string in the language (A + C + G + T)*.

• (a,5) How many possible codons are there?

• (b,5) How many of these codons have three different bases (three different letters)?

• (c,5) How many different sets of bases might occur in a codon? (For example, the set of bases occurring in the codon ACA is {A, C}.)

• (d,5) How many different multisets of bases might occur in a codon? (For example, the multiset of bases occurring in the codon ACA is {A, A, C}.)

• Question 3 (30): Here is a directed graph G with three vertices and five edges. Each edge is labeled by a letter (for example, edge d is a loop at vertex 3). We define the language L to be those strings in (a + b + c + d + e)* that represent paths in G.

``````
a
(1) ------------->(2)
^<--------------/ |
|       b         |
|                 |
|  e              | c
\               /
\             /
\---(3)<----/
^ \
\/
``````
• (a,15) Prove that every string in the language X = (ab + ace)* is also in L. Use induction on the definition of this language -- λ is in X, if w is in X then so are wab and wace, and no other strings are in X. (Hint: Prove that if w is in X, then there is a path labeled by w from vertex 1 to itself.)
• (b,15) For each value of k in the set {0, 1, 2, 3, 4}, determine how many strings of length k are in L. (For positive k, this is the number of paths of length k in G, counting all possible start points and end points. For k = 0, look carefully at the number of strings.)

• Question 4 (20): Angelina and Brad are two students in the same discussion section of a computer science course. Every week, their professor divides the eleven students in their section into four groups, three of three students each and one of two students. He does this by taking eleven cards (two 2's, three jacks, three queens, and three kings) and dealing one to each of the students. The students getting cards of the same rank become a group. Assume that each of the 11! different assignments of cards to students is equally likely.

• (a,5) Of these 11! assignments, how many put Angelina in the two-person group? What is the probability that she will be in the two-person group?

• (b,5) How many of the assignments create a two-person group consisting of Angelina and Brad? What is the probability that this happens?

• (c,10) What is the total probability that Angelina and Brad will be in the same group (that is, that they form a two-person group or are two members of some three-person group)? (Hint: There are several equally valid ways to solve this problem. It may help to think of Angelina first being dealt one of the eleven cards, with Brad then getting one of the ten remaining cards.)