|
Test 3 Study Guide |
Last Updated: 12/08/2011 |
Review for Chapters 9-12:


|
|
|

Isomorphic, corresponding paths:
procedure Dijkstra( c, d, G : weighted connected simple
graphs with all weights positive )
|
Find shortest path from a to z. Give final values for L and S. |
![]()
Path: acdegz length: 5 Cost: 16 |
| Algorithm 1 Depth-First Search procedure DFS(
G : connected graph, vertices: v1, v2,...vn) procedure visit( v : vertex of G) -- visit alphabetically for each vertex w adjacent to v and not yet in T
|
| 13. Start with a
|
| Algorithm 2 Breadth-First Search procedure BFS( G : graph, vertices: v1,v2,...vn) L := empty list put v1 in the list L of unprocessed vertices while L is not empty
|
| 16 #13 Start with a
|
Queue L
|

F(x,y,z) = xyz The sum of one product.
G(x,y,z) = xyz + xyz The sum of two products.
3.

5.

3.
sentence
/
\
noun phrase intransitive verb phrase
/ \
/
\
article noun intransitive verb
adverb
|
| |
|
the hare
runs the
sleepy tortoise
P = { S → 1A, S → 0A, A → 0B, B → 1A, B → 1}
5a. 10101
S
|
1A
\
0B
\
1A
\
0B
\
1
5b.
10110
S
|
1A
\
0B
\
1A
\
fails
24.
P = {S → abS, S → bcS, S → bbS, S → a, S → cb}
bcbba


11. Which of these strings is recognized by the finite-state automaton below?

17. What language is recognized?
0 U 1(0 U 1)(0 U 1)*

23. Construct a deterministic finite-state automaton that recognizes the the set of strings starting with 01.

3. Determine whether 0101 belongs to each of the regular sets.
- 01*0*
- 0(11)*(01)*
- 0(10)*1*
- 0*10(0 U 1)
- (01)*(11)*
- 0*(10 U 11)*
- 0*(10)*11
- 01(01 U 0)1*
5. Express each of these sets using a regular expression.
- 0, 11, 010
- three 0's followed by two or more 0's
- strings of odd length
- strings that contain exactly one 1
- strings not containing 000 and ending in 1
0 U 11 U 110
00000*
(0 U 1)(00 U 01 U 10 U 11)*
0*10*
(1 U 01 U 001)*
14b (HW12) Construct a nondeterministic finite-state automaton that recognizes the language generated by the regular grammar:
G = (V, T, S, P}
T = { 0, 1 }
V = { 0, 1, S, A, B}
P = { S →
λ, S → 1A, S
→ 0,
A
→ 1A, A → 0B, B
→
1B, B → 1}
Dark states are final.
Production Input Transition S → λ λ ss S → 1A 1 ss to sA S → 0 0 ss to sF A → 1A 1 sA to sA A → 0B 0 sA to sB B → 1B 1 sB to sB B → 1 1 sB to sF