doc

advertisement
CSCI 2670
HW 1 Solutions
8/31/2004
0.4 A×B contains ab elements. For every element in A, there are b elements in A×B.
0.5 The power set of C contains 2c elements. Let C = {x1, x2, …, xc} … i.e., each element
of c is associated with a unique positive integer between 1 and c. Represent each
subset of C by a binary number containing c bits – the ith bit will be a 1 if and only if
xi is in the subset. Clearly, each subset of c is represented by exactly one c-length
binary number. Also, every such binary number represents exactly one subset of C.
Therefore, the size of the power set of C is equal to the number of c-length binary
numbers – namely, 2c.
0.7a “Works in the same building” is reflexive and symmetric, but not transitive.
Clearly, everyone works in the same building as him- or herself. Also, if person a
works in the same building as person b, then person b works in the same building as
person a. However, if person b has two jobs, then it is possible for b to work in the
same building as both a and c, even though a and c do not work in the same building.
0.10 In the step where you divide by (a-b), you will be dividing by zero if a = b.
Therefore, the proof is only correct when a  b.
1.1a
q1
1.1b {q2}
1.1f
No. aabb ends up at state q1, which is not an accept state.
1.1g Yes. Since the start state is a member of the set of accepting states, the empty
string is accepted.
1.2 Q = {q1, q2, q3, q4}
 = {a, b}

q1
q2
q3
q4
q0 = q1
F = {q1, q4}
a
q1
q3
q2
q3
b
q2
q4
q1
q4
1.4b
0
0
0
1
0,1
1
1
1.4d
0,1
0,1
0,1
0
0,1
1
1.4f
0
0
1
1
0,1
1
0
1.4h
0,1
1
1
1
0
0
0
0
1.4j
0
1
0
1
1
0
1
0
0
1
1
0,1
0,1
Download