Midterm review problems
Midterm review problems
3. Find all strings over the alphabet {a, b, c, d} with length 2 and no repeated letter.
4. Find all strings over the alphabet {A, B, C} with length 3 and no AB, BC, or CA substring.
5. Find all strings over the alphabet {0, 1, 2} of length 4 that have 22 as a substring
V = {1, 2, 3, 4, 5, 6} and E = {{1, 3}, {1, 5}, {2, 6}, {3, 4}, {3, 5}, {5, 6}}.
7. Find all graphs with vertex set {1, 2, 3, 4} that have {1, 2} and {3, 4} as edges, and have exactly two
more edges in addition to these.
8. A restaurant has a special deal on a 3-course dinner consisting of an appetizer, an entree, and a dessert.
If there are 3 possible appetizers, 4 entrees, and 2 desserts, how many ways can you choose a different
dinner?
(a) How many ways are there to put the balls into the bins?
(b) How many are there if each bin must receive at most one ball?
14. How many strings over the alphabet {A, B, C, D} of length 2n have the property that D does not appear
in any odd position?
1
MACM 201 Midterm 1 Practice Problems
15. (a) How many permutations over {A, B, C, D, E, F, G, H} start with A and do not end with H?
(b) How many permutations over this alphabet start with a letter other than A and end with a letter
other than H?
16. A club with 16 people must select a leadership committee with a president, secretary, and treasurer.
Assuming no person can have more than one such position, how many ways are there to select this
committee?
17. At a summer camp, the campers are divided into 10 cabins with 8 campers in each cabin. How many
ways are there to choose a set of 13 campers S with the property that 2 cabins have exactly 3 campers
in S, 3 cabins have exactly 2 campers in S, and 1 cabin has exactly 1 camper in S?
18. How many ways are there to put 9 indistinguishable balls into four (distinguishable) containers num-
bered 1, 2, 3, 4 with the following added constraint:
19. A bookcase has four shelves and we wish to put 30 (distinguishable) books on these four shelves.
For this problem we consider two arrangements of the books to be the same only when they have
exactly the same books on each shelf in exactly the same order. Under these assumptions, how many
arrangements of the books are possible?
20. A binary string has k runs if it can be divided into k (but not more) substrings so that each substring
either has all entries 0 or all entries 1. For instance, the string 0011110100010111 has 8 runs since it
divides into the substrings
00 1111 0 1 000 1 0 111
How many binary strings of length n have exactly k runs?
21. How many binary strings of length n have exactly one occurrence of the substring 10?
x1 + x2 + x3 + x4 + x5 = 30.
For each part below, determine how many solutions there are to the above equation satisfying the
additional constraint.
2
MACM 201 Midterm 1 Practice Problems
27. Draw two non-isomorphic graphs with 6 vertices where each vertex has degree 2.
28. Let n ≥ 3 and let Pn be a graph with vertex set {x1 , . . . , xn } ∪ {y1 , . . . , yn } and the following edges:
29. Let n ≥ 4 and let Rn be a graph with vertex set {x1 , . . . , xn } ∪ {y, y 0 } and the following edges:
30. Let G be a graph with m edges and the property that every vertex is adjacent to d other vertices. If G
has no cycle of length 3, how many 4 vertex paths does G have? Hint: try choosing the middle edge.
31. For positive integers a, b we let Ga,b be a graph with vertex set consisting of all ordered pairs of integers
(x, y) with 1 ≤ x ≤ a and 1 ≤ y ≤ b, and edge set consisting of the following:
3
MACM 201 Midterm 1 Practice Problems
Draw the graph G3,4 . Determine for all a, b how many cycles of length 6 there are in Ga,b .
32. Let 2 ≤ b ≤ a ≤ n. Define Ka−b to be a graph obtained from Ka by choosing b vertices and deleting all
edges between chosen vertices. How many subgraphs of Kn are isomorphic to Ka−b ?
33. If two integers are selected, at random and without replacement, from {1, 2, 3, . . . , 100}, what is the
probability their sum is even?
34. If two binary strings, x and y, of length n are selected, at random and without replacement, what is
the probability that the total number of ones in x and y combined is even?
35. What is the minimum number of times we must toss a fair coin so that the probability of getting two
or more heads is at least 0.8?
36. Using the axioms of probability (and any theorems we proved in class from these axioms if needed),
prove that P r(∅) = 0.
37. There are two boxes. The first contains two green balls and seven red balls; the second contains four
green balls and three red balls. Alice selects a ball by first choosing one of the two boxes at random.
She then selects one of the balls in this box at random. If Alice has selected a red ball, what is the
probability that she selected a ball from the first box?
38. There are two bags. The first contains two green balls and seven red balls; the second contains four
green balls and three red balls. Bob reaches in and selects one ball from the first bag and places it in
the second bag. Then Alice selects one ball from the second bag.
(a) If a cyclist is taking Z the probability that they test positive is 0.99.
(b) If they are not taking Z the probability that they test positive is 0.05.
Question: If a randomly chosen cyclist tests positive for Z, what is the probability they are taking
steroid Z?
We showed in class that the probability is 0.6875 which is very low. This is because the probability 0.05
in property 2 is high. A person who satisfies property 2 is called a false positive. Redo the calculation
using 0.01 instead of 0.05 for property 2.
40. Jar A has 800 red candies and jar B has 600 green candies. If we do the following...
1. Move one cup of red candies from jar A to jar B and mix.
2. Move one cup of mixed candies from jar B to jar A and mix.
3. Move one cup of candies from each of jar A and jar B to the bowl and mix.
4. Randomly select one candy from the bowl.
4
MACM 201 Midterm 1 Practice Problems
41. Suppose that m (distinguishable) balls are thrown in n (distinguishable) bins. What is the expected
number of bins with exactly 1 ball?
42. Suppose we roll a biased six sided dice. Rolling a 1, 2, 3, 4 or 5 are equally likely, and rolling a 6 is twice
as likely as each of the other values. If we roll the dice 49 times, let X be the random variable for the
number of 6’s that appear.
43. A program is designed to generate binary strings of any length such that in any position a 1 is three
times as likely to appear than a 0. What is the probability that a string of length 10 contains at least
eight 0’s. (Reduce your answer to a fraction: a/b.)
44. How many times would we expect to roll a 4-sided (fair) die (also called a tetrahedral die) to get all 4
outcomes to appear.
45. A bin contains five balls numbered 1,2,3,4, and 5. When two balls are drawn (without replacement)
from the bin, the random variable X records the higher value. Find E(X).
46. A carnival game costs $3 to play. The player selects one card from a standard deck of 52 cards. If the
player selects an ace or king the player wins $8. If the player selects a four or seven the players wins
$4. Otherwise the player loses their $3. What is the expected amount the player will win?