Design and Analysis of Algorithms Neal Young

Computer Science 45

Due: in class Friday, April 25, 1997

Problem Set 3

  1. In class you figured out that the number of 5-digit decimal numbers with their digits summing to 27 was

    displaymath45

    (Recall that tex2html_wrap_inline47 denotes the coefficient of tex2html_wrap_inline49 in f(z).)

    Figure out the actual number.gif

  2. Let S be the set of binary strings not containing ``011'' as a substring.

    (a) Give a deterministic finite automata accepting S.

    (b) Derive a generating function tex2html_wrap_inline59 for S, where tex2html_wrap_inline63 is the number of strings in S of size n.gif

    (c) Use your generating function to obtain the best estimates you can for tex2html_wrap_inline63 .

  3. The goal of this problem is to derive a closed form for the generating function tex2html_wrap_inline81 .

    Let W be the set of binary strings with with equal numbers of 0's and 1's.

    (a) Why are there exactly tex2html_wrap_inline85 strings of length 2n in W?

    Let P be the subset of W such that every prefix of the string has as many 0's as 1's (essentially this is balanced parens).

    Let Q be the subset of P such that every proper prefix of the string has more 0's than 1's.

    (b) Argue that tex2html_wrap_inline99 .

    (c) Argue that tex2html_wrap_inline101 .

    (d) Argue that tex2html_wrap_inline103 .

    (e) Use (b,c,d) to derive a generating function for W.

  4. Exercise 33.7-2.

About this document ...

This document was generated using the LaTeX2HTML translator Version 96.1 (Feb 5, 1996) Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.

The command line arguments were:
latex2html -no_navigation -split 0 hw3.

The translation was initiated by Neal Young on Fri Apr 18 15:39:32 EDT 1997

...number.
HINT: Use 4#4.

...n.
HINT: for each state q of your DFA, let 7#7 denote the set of strings taking the DFA from the start state to q. Set up an unambiguous context free grammar for the sets 7#7, from this obtain a set of equations relating the generating functions for the 7#7's. Solve the equations.

 


Neal Young
Fri Apr 18 15:39:32 EDT 1997