Programming Languages (Quiz 1-4) Flashcards
The mathematical models are called machines and the types of inputs on which they operate successfully call the language of the machine.
True
A finite set of fundamental units out of which we build structures is called
Alphabet
Λ is a word with no letter.
True
The language which has no words is denoted by
ɸ (phi)
The set of words is always finite but alphabets can be infinite.
False. (Set of words is infinite, the alphabet is finite)
Given an alphabet Σ, the closure of Σ (or Kleene star), denoted by Σ+, is the language containing all words made up of finite sequences of letters from Σ, including the empty string Λ.
False. Σ*, not Σ+.
Which of the following is true for Σ = {x}? (What will the Kleene-Star contain?)
It will contain Λ and finite sequences of letters in the alphabet. Σ * = { Λ, x, xx, xxx, …} .
If S = {xx, xxx},
and xxxxxxx Є S*,
then which of the following is the factor of S:
xx|xx|xxx and xx|xxx|xx.
The Kleene closure of a language S always produces an infinite language unless S = ɸ or S = {Λ}.
True
If S = {a, b, Λ } than S+ = { Λ, a, b, aa, bb, ab, ba, …}.
True, Kleene-Star contains Λ while Positive Closure does not.
A recursive definition is characteristically a three-step process.
True.
- Specify the basic words
- Rules for constructing new words from ones already known
- Declare that no word except those constructed by following rules 1 and 2 are in the language
∑ = {x}
Rule 1 Λ is in L1.
Rule 2 if w is any word in L1, then xw is also in L1.
What is this L1 = ?
x*
Rule 1 x is in L1.
Rule 2 if w is any word in L1, then xxw is also in L1.
What is this L1 = ?
X odd
language(ab) ≠ language(ab)*
True.
(ab) = ab, aabb, aaabbb, …
(ab)* = ab, abab, ababab, …
Consider the language T (language whose words are constructed from either a or c followed by some b’s) defined over the alphabet Σ whereas Σ = {a, b, c}
Which of the following is true for language T? (define language T)
T = language((a+c)b*) T = {a, c, ab, cb, abb, cbb, abbb, cbbb, …}