CpSc 421
Homework 7
Solutions
1. (10 points) Let A1 = cfw_D1 #D2 | D1 and D2 describe DFAs and L(D1 ) L(D2 ). In English, D1 #D2 A1
iff D1 and D2 describe DFAs and every string that is recognized by the DFA described by D1 is also recognized
by the DFA de
HOMEWORK #4, CPSC 421/501, FALL 2017
JOEL FRIEDMAN
Copyright: Copyright Joel Friedman 2017. Not to be copied, used, or revised
without explicit written permission from the copyright owner.
Please note:
(1) Proofs should be written out formally.
(2) Homewo
Homework 1 Solutions, CPSC 421/501, 2017W1
N. Bayless, R. Stiyer, and S. Yang
Question A.1.3:
Compute Fn Fn+3 Fn+1 Fn+2 for n = 1, . . . , 5; guess a simple formula for this expression, and prove
that your guess is correct.
Solution:
Let Hn = Fn Fn+3 Fn+1
Homework 2 Solutions, CPSC 421/501, 2017W1
N. Bayless, R. Stiyer, and S. Yang (Edited by J. Friedman)
Question A.8a:
Find the asymptotic ratio of cfw_an where an = 5n .
Solution:
an+1
an
n+1
5
= lim
n 5n
5(5n )
= lim
n 5n
= lim 5
lim
n
n
=5
Question A.8b
r7, (,0, m) :1 LO, [7] U ibuco]
b wzob on ~iLet-Ajc
$0 1. :1 j gme Ab _+S Quays,
a, G b
5mm eat-3 4 \BU)
\ t w L:
* at S h x L:
a b 7 J h C,
E: ate) 8/ A 3 gm 6
k I 11.4,(3 CD
< S \aLt)\@ 0L1; + 18 _
a c a. I (octbbl)
Emu?» Em,L :; mom Leta) 04m: RED? S
CpSc 421
Homework 6
Solutions
1. (50 points) For each language below, determine whether or not the language is context-free, and justify your
answer. For example, if the language is context-free, you can give a CFG or PDA for the language. If it is not
co
CpSc 421
Homework 8
Extra Credit
Solutions
Attempt up to three of the problems below.
1. (15 points) Let G = (V, , R, Expr ) be a CFG with variables V = cfw_Expr , Factor , Term, and terminals
= cfw_CONSTANT, IDENTIFIER, PLUS, TIMES, LPAREN, RPAREN and r
HOMEWORK #3, CPSC 421/501, FALL 2017
JOEL FRIEDMAN
Copyright: Copyright Joel Friedman 2017. Not to be copied, used, or revised
without explicit written permission from the copyright owner.
Please note:
(1) Proofs should be written out formally.
(2) Homewo