LMU ☀️ CMSI 3801
THEORIES OF COMPUTER AND HUMAN LANGUAGES
Quiz 2 Answers
  1. For each of the four main theories of computation, state their primary concern in five words or less each.
    Language Theory expression of computation
    Automata Theory execution of computations
    Computability Theory limits of computation
    Complexity Theory efficiency of computation
    
  2. Write a Lambda Calculus expression for the function that raises its argument to itself.
    $ \lambda x. x^x $
  3. Evaluate $|\varepsilon|$.
    $ 0 $
  4. The concatenation of two languages $L_1$ and $L_2$ is $L_1L_2 = \{xy \;|\; x \in L_1 \wedge y \in L_2\}$. Repeated concatenation uses superscripts: $L^0 = \{\varepsilon\}$, $L^1 = L$, $L^2 = LL$, $...$, $L^{k+1} = LL^k$. Let $L = \{ w \in \{0,1\}^* \mid w = w^R \}$. Check all that are true:
    • $\varepsilon \in L$
    • $101 \in L$
    • $101 \in L^2$
    • $1010 \in L^2$
    • $01101101110 \in L^*$
  5. Given the grammar with one rule $s \longrightarrow (\texttt{"("}\;s\;\texttt{")"})^*$, give a derivation for the string ()().
    $s \Longrightarrow (\texttt{(}\;s\;\texttt{)})^* \Longrightarrow \texttt{(}\;s\;\texttt{)}\texttt{(}\;s\;\texttt{)} \Longrightarrow \texttt{(}\;\varepsilon\;\texttt{)}\texttt{(}\;\varepsilon\;\texttt{)} = \texttt{()()}$
  6. Given the grammar with one rule $s \longrightarrow (\texttt{"("}\;s\;\texttt{")"})^*$, give a derivation tree for the string ()().
                        s
                        │
         ┌─────┬─────┬──┴──┬─────┬─────┐
         │     │     │     │     │     │
         (     s     )     (     s     )
               │                 │
               ε                 ε
    
  7. What does it mean for a grammar to be ambiguous? Choose the only correct answer.
    • A language that is Type-2 or Type-3
    • A string in the language accepted by the grammar can be derived multiple ways
    • A string in the language accepted by the grammar has multiple parse trees
    • The grammar has nested * operations.
  8. Draw a “nested circles” diagram (showing set containment) for the following language families: REG, RE, FD, CF, CS. These stand for regular, recursively enumerable, finitely describable, context-free, and context-sensitive languages, respectively.
    FD
    RE
    CS
    CF
    REG