You are on page 1of 2

Stanford University

Computer Science 154 Problem Set 0 Due Monday June 27, 2011 at 4:15pm. Look at syllabus for late policy All problem sets should be emailed to cs154-sum1011-sta@lists.stanford.edu, dropped o before lecture, or placed in the CS154 box on the rst oor of Gates. See syllabus for collaboration policy. This problem set is graded out of 2 points.

PROBLEM 1 Let A be the set {x, y, z}, B be the set {x, y} and P (S) be the power set of set S. No explanations are necessary. (A) Is A a subset of B? (B) Is B a subset of A? (C) Is P (B) a subset of P (A) (D) What is A B? (E) What is A B? (F) Is a member of P (B)?

PROBLEM 2 String x overlaps string y if the end of string x is the same as the beginning of string y. For simplicity, overlaps itself, but no other string overlaps or is overlapped by . For instance, abdef overlaps def df ddddd, and m overlaps mc, but b does not overlap abc. (A) Give a formal denition of what it means for one string to overlap another. (Note that this need not be an inductive denition. In fact, a correct denition might take less than one line of text.) (B) Prove that the overlap relation is reexive. (C) Is the overlap relation symmetric? If so, prove it. If not, provide a counterexample. (D) Is the overlap relation transitive? If so, prove it. If not, provide a counterexample. (E) Let x and y be strings. Dene a binary relation, R, as follows: xRy either x overlaps y or y overlaps x. Is R an equivalence relation? If so, prove it. If not, provide a counterexample.

PROBLEM 3 For a string x, let xR be the reverse of the string and xi be the string concatinated i times (e.g. (abc)R = cba and (abc)2 = abcabc). Prove by induction that (xR )i = (xi )R . (Hint: Use the fact that (xy)R = y R xR ).

PROBLEM 4 Let Ai be the set of all nonempty strings of over = {0, 1} where each string in Ai has length not exceeding i. Give a formula for the cardinality of Ai . Justify your answer.

PROBLEM 5 Is the class of nite languages closed under intersection? Complement? Concatenation? For each, support your answer with a short proof or counterexample.

PROBLEM 6 Show that in any group of n people, at least two of them know the same number of other people within the group. (Assume that the relation knowing is symmetric but not reexive.)

You might also like