Title: CS 507
1CS 507 Mathematical Methods in Computer Science
Final Exam
Prof. Sung-Hyuk Cha
Spring of 2004
School of Computer Science Information Systems
2Print Your Name
31. How many bit strings are there of length six
or less?
42. Find the least number of cables required to
connect eight computers to four printers to
guarantee that four computers can directly access
four different printers.
5- How many permutations are there of the set
- a, b, c, d, e, f, g.
64. How many bit strings of length 12 contain at
least three 1s?
75. Find the coefficient of in
86. What is the probability that a card selected
from a deck is an ace or a heart?
97. What is the probability that a five-card
poker hand contains exactly one ace?
108. What is the probability of the event that 1
precedes 3 when we randomly select a permutation
of 1, 2, 3?
119-10. Suppose that we roll a die until a 6 comes
up. 9 What is the probability that we roll the
die n times? 10 What is the expected number
of times we roll the die?
1211. Which of the following (s) is (are) true?
a. The degree of a binary tree can be 0 or 1.
b. A binary search tree(BST) with nodes has
edges.
c. A tree with n nodes has exactly n -1 edges
d. The following postfix expression is true
4 7 3 - / 2 -2
1312. Is this tree a binary search tree?
1413. Build a binary search tree for be not
ashamed of mistakes and thus make them crimes.
1514. Given a binary search tree, draw the final
BST after these 2 operations insert 6 and
next insert 8.
1615. How many vertices and how many leaves does a
complete m-ary tree of height h have?
1716. Given a graph, select all valid topological
sorted lists.
1
2
- (1 3 5 4 6 2)
- (1 4 3 5 6 2)
- (5 1 4 3 6 2)
- (5 3 1 4 6 2)
6
3
4
5
17. Given a graph how many nodes have their
degree 2?
1
2
6
3
4
5
1818. Consider a directed unweighted graph
represented in an adjacent list. Show the graph
with the shortest path where 0 node is the source.
0
5
4
1
1
2
2
3
3
5
6
4
0
3
5
3
6
2
1
19(No Transcript)
2019. Represent adjacency matrix using graph.
a
b
c
d
2120. Consider a directed weighted graph, show the
graph with the shortest path where node is
the source.
3
1
1
10
4
25
2
8
3
2
11
1