Questions: Formal Languages and Strings

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

The alphabet Σ = {0, 1}. Which of the following is a formal language over Σ?

AThe single string '01011'
BThe set {ε, 0, 1, 00, 01, 10, 11} — all strings of length 0, 1, or 2
CThe alphabet {0, 1} itself
DThe symbol '0'
Question 2 Multiple Choice

A computer scientist says: 'The language of syntactically valid Python programs is infinite.' Which best explains why this is still a valid formal language?

AA language must be finite, so this statement is incorrect
BA formal language is simply a set of strings, and sets can be infinite — there is no size restriction
CPython programs are not strings, so they cannot form a formal language
DOnly languages defined by regular expressions count as formal languages
Question 3 True / False

The empty language ∅ and the language {ε} are the same thing — both represent languages with no meaningful content.

TTrue
FFalse
Question 4 True / False

Every computational problem can be reformulated as a question of whether an input string belongs to some formal language.

TTrue
FFalse
Question 5 Short Answer

What is the difference between an alphabet, a string, and a language, and why do all three concepts need to be distinct?

Think about your answer, then reveal below.