CS 4110 Flashcards

1
Q

Regular Expressions/Regular Languages

A

(a+b)a(a+b)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Recursive Definitions

A

For positive integers:
Rule 1: 1 is in INTEGERS
Rule 2: If x is in INTEGERS, so is x+1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

FA

A

Finite Automaton

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A finite automaton is a collection of three

things

A

–A finite set of states, including one start state, and
zero or more final states(accepting states).
–An alphabet of possible input letters
–A finite set of transitions that tell for each state
and for each letter of the input alphabet which
state to go to next: nextState = f(input,
currentState)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

(FA) start and stop states

A

“-” to represent start state

•“+” to represent final state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Deterministic

A

each move is completely
defined by the current spot and the input, no
context information is needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Halting Problem

A

The Halting Problem is the problem of deciding or concluding based on a given arbitrary computer program and its input, whether that program will stop executing or run-in an infinite loop for the given input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

CFG

A

Context Free Grammar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Grammar

A

•A grammar is the set of rules by which the
valid sentences in a language are constructed.
•Syntax are the rules that do not involve the
meanings of words.
•Using syntax as a way of defining a language in
addition to using RE, FA, and TG.
•Using a grammar to generate strings in the
language as well as to determine whether a
string is in a language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Nonterminals and Terminals

A

•Terminals: the words that cannot be replace by
anything (designated by lowercase letters)
•Nonterminals: the words that must be replaced by
other things (designated by CAPITAL LETTERS).
•The sequence of applications of the rules that produces
the finished string of terminals from the starting
symbol is called a derivation or a generation of the
word. The grammatical rules are often referred to as
productions.
•The job of sentence production is not complete until all
the nonterminals have been replaced with terminals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

PDA

A

Push Down Automaton

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

PDA input

A

•Inputis presented on a tape rather than being
magically supplied by a user.
–The tape is divided into cellswith one input per
cell.
–A blank(∆) marks the end of the input. Blank is
not the same as the space character.
–The tape is read-only and we cannot go back
and re-read a cell.
•We have some new types of state – mostly to
formalize the notion of accepting and rejecting
input:
•We also have a Read state, drawn as a
diamond. From a read state we can have
multiple arrows representing transitions to
take if particular inputs have been read.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Pushdown stack

A
•Add a stack and two new 
actions POP and PUSH. 
–POP is like READ in that we 
branch according to the item 
popped.
–PUSH just specifies the item to 
be pushed
•Pushdown Automata (PDA) = 
FA + stack + POP + PUSH
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

READ state

A

consumes the next input symbol, possibly blank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

POP state

A

pops the top stack item (also possibly blank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

READ state

A

will have out-edges with labels from Σ

17
Q

POP state

A

will have out-edges with labels from Γ

18
Q

CNF

A

Chomsky Normal Form

19
Q

TM

A

Turing Machine

20
Q

Turing Machine Alphabet

A

An input alphabet ∑from which the initial tape contents are drawn

21
Q

Turing Machine Tape

A

The tape which usually contains the input. (∆ is the symbol for a
blank or empty cell and is not a legal character in an alphabet)

22
Q

Turing Machine Tape Head

A

The Tape Head which is initially positioned at the leftmost square
on the tape. It can in one step read the contents of a cell on the TAPE,
replace it with some other character, and reposition itself to the next
cell to the right or to the left of the one it has just read

23
Q

Turing Machine Start/Halt states

A

which includes exactly one START state and a

number, possible zero, of HALT states

24
Q

Turing Machine Program

A

A program as a set of rules to tell how to do a series of actions given
the current state and the input letter (quintuples: Qi Sr Sw Qj D,
Where the quintuple is interpreted as “if the machine is in state Qi and
the current tape symbol is Sr then write symbol Sw, go to state Qj and
move one square in direction D along the tape”

25
Q

Relationship between TM and Recursively Enumerable Language

A

A language (L) is recursively enumerable if there is a
TM that
–Accepts every word in L
–Crashes or loops for every word in L’

26
Q

2PDA

A

2PDA: a deterministic PDA with 2 stacks

27
Q

Relationship between 2PDA and TM

A

•2PDA = TM

–All operations of 2PDA can be simulated by a TM.

28
Q

How can you solve the halting problem?

A

Humans can’t solve the halting problem

29
Q

When is a grammar in Chomsky Normal Form?

A

a context-free grammar, G, is said to be in Chomsky normal form if all of its production rules are of the form: A → BC, or A → a, or S → ε, where A, B, and C are nonterminal symbols, the letter a is a terminal symbol, S is the start symbol, and ε denotes the empty string