{
  "translations": {
    "en": {
      "anbn": {
        "type": "multiple",
        "description": "Suppose we have $G = (\\{S\\}, \\{a,b\\}, S, P)$ with production rules:<br/>$S \\rightarrow aSb\\ |\\ ab$",
        "question": "What is the language $L(G)$ for this grammar?",
        "answer": "$a^nb^n$ for $n\\geq1$",
        "choices": ["$a^nb^n$ for $n\\geq1$", "$ab^n$ for $n\\geq1$","$a^nb$ for $n\\geq1$", "$a^*b^*$"],
        "correctFeedback": ["Wow! That is an amazingly simple grammar!"]
      },
      "anbnreg": {
        "type": "multiple",
        "description": "Suppose we have $G = (\\{S\\}, \\{a,b\\}, S, P)$ with production rules:<br/>$S \\rightarrow aSb\\ |\\ ab$",
        "question": "Is the language $L(G)$ regular?",
        "answer": "No",
        "choices": ["Yes", "No"]
    },
      "grammartype": {
        "type": "select",
        "description": "Suppose we have $G = (\\{S\\}, \\{a,b\\}, S, P)$ with production rules:<br/>$S \\rightarrow aSb\\ |\\ ab$",
        "question": "What type of grammar is this?",
        "answer": ["Context-Free Grammar", "Linear Grammar"],
        "choices": ["Regular Grammar", "Context-Free Grammar", "Linear Grammar"],
        "correctFeedback": ["A grammar is linear if it is context free and has at most a single variable on the RHS of any production rule."],
        "incorrectFeedback": ["Remember that to be regular, a grammar has to be left linear or right linear. But a grammar is linear if it is context free and has at most a single variable on the RHS of any production rule."]
      },
      "derivation": {
        "type": "multiple",
        "description": "Suppose we have $G = (\\{S\\}, \\{a,b\\}, S, P)$ with production rules:<br/>$S \\rightarrow aSb\\ |\\ ab$<br/><br/>Here is a derivation for $aaabbb$:<br/> $S \\Rightarrow aSb \\Rightarrow aaSbb \\Rightarrow aaabbb$",
        "question": "What do we mean by the derivation of string $aaabbb$?",
        "answer": "Begin with the start variable of the grammar and do replacements until we reach the string $aaabbb$.",
        "choices": ["Begin with the start variable of the grammar and do replacements until we reach the string $aaabbb$.", "Describe the string $aaabbb$"]
      },
      "sentential": {
        "type": "select",
        "description": "Suppose we have $G = (\\{S\\}, \\{a,b\\}, S, P)$ with production rules:<br/>$S \\rightarrow aSb\\ |\\ ab$<br/><br/>Here is a derivation for $aaabbb$:<br/> $S \\Rightarrow aSb \\Rightarrow aaSbb \\Rightarrow aaabbb$<br/><br/>Every step in the derivation process yields what is called a <b>Sentential form</b>. A Sentential form is just a string of variables and terminals that can be derived from the start variable.",
        "question": "Based on the derivation of the sting $aaabbb$, select all sentential forms.",
        "answer": ["$S$", "$aSb$", "$aaSbb$", "$aaabbb$"],
        "choices": ["$S$", "$aSb$", "$aaSbb$", "$aaabbb$", "$aabbb$"]
      },
      "palen":{
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "What is the langauge $L(G)$ for this grammar?",
        "answer": "$w = w^R$",
        "choices": ["$\\{a, b\\}^*$", "$w = w^R$", "$w = ww^R$", "$w = ww$"],
        "correctFeedback": ["This is the palindrones on alphabet $\\{a, b\\}$."]
      },
      "palenreg": {
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "Is this a regular language?",
        "answer": "No, we proved that using Pumping Lemma",
        "choices": ["No, we proved that using Pumping Lemma", "Yes"]
      },
      "palentype":{
        "type": "select",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "What is the type of this grammar?",
        "answer": ["Context-Free Grammar", "Linear Grammar"],
        "choices": ["Regular Grammar", "Context-Free Grammar", "Linear Grammar"]
      },
      "palenex": {
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "Is the string $ababa$ in $L(G)$?",
        "answer": "Yes",
        "choices": ["Yes", "No"]
      },
      "palender1": {
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "Let us derive the sting $ababa$. Which production should we use first?",
        "answer": "$S \\rightarrow aSa$",
        "choices": ["$S \\rightarrow aSa$", "$S \\rightarrow bSb$", "$S \\rightarrow a$", "$S \\rightarrow b$", "$S \\rightarrow \\lambda$"]
      },
      "palensent1": {
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "Substituting $S$ with $aSa$ will give which sentential form?",
        "answer": "$aSa$",
        "choices": ["$aSa$", "$aaSaa$","$a$", "$b$", "$abSba$", "$abaSaba$", "$bbSbb$"]
      },
      "palender2": {
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "Currently we have $S\\Rightarrow aSa$. What is the next production rule we will use to derive the string $ababa$?",
        "answer": "$S \\rightarrow bSb$",
        "choices": ["$S \\rightarrow aSa$", "$S \\rightarrow bSb$", "$S \\rightarrow a$", "$S \\rightarrow b$", "$S \\rightarrow \\lambda$"]
      },
      "palensent2": {
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "Currently we have $S\\Rightarrow aSa \\Rightarrow $ ?. Select the new sentential form that we will get after substituting $S$ with $bSb$",
        "answer": "$abSba$",
        "choices": ["$aSa$", "$aaSaa$","$a$", "$b$", "$abSba$", "$abaSaba$", "$bbSbb$"]
      },
      "palender3": {
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$",
        "question": "Currently we have $S\\Rightarrow aSa \\Rightarrow abSba$. What is the next production rule we will use to derive the string $ababa$?",
        "answer": "$S \\rightarrow a$",
        "choices": ["$S \\rightarrow aSa$", "$S \\rightarrow bSb$", "$S \\rightarrow a$", "$S \\rightarrow b$", "$S \\rightarrow \\lambda$"]
      },
      "palensent3": {
        "type": "multiple",
        "description": "Suppose $G = (\\{S\\}, \\Sigma, S, P)$ <br>$\\Sigma = \\{a,b\\}$<br>$P = \\{S \\rightarrow aSa\\ |\\ bSb\\ |\\ a\\ |\\ b\\ |\\ \\lambda\\}$<br/><br/>Derivation of $ababa$:<br/>$S \\Rightarrow aSA \\Rightarrow abSba \\Rightarrow ababa$",
        "question": "Currently we have $S\\Rightarrow aSa \\Rightarrow abSba \\Rightarrow$. Select the new sentential form that we will get after substituting $S$ with $b$",
        "answer": "$ababa$",
        "choices": ["$aSa$", "$aaSaa$","$a$", "$b$", "$abSba$", "$abaSaba$", "$bbSbb$", "$ababa$"]
      },
      "multiex": {
        "type": "multiple",
        "description": "Consider the grammar $G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$",
        "question": "What is the type for this grammar?",
        "answer": "Context-Free Grammar (but it happens to be a Regular Language)",
        "choices": ["Context-Free Grammar (but it happens to be a Regular Language)", "Context-Free Grammar for a non-regular language", "Linear Grammar"]
      },
      "whatlang": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$",
        "question": "What is $L(G)$?",
        "answer": "$L(G) = \\{a^{2n}cb^{2m} | n, m \\ge 0\\}$",
        "choices": ["$L(G) = \\{a^{2n}cb^{2m} | n, m \\ge 0\\}$", "$L(G) = \\{a^{2n}cb^{2n} | n \\ge 0\\}$", "$L(G) = \\{a^{n}cb^{m} | n, m \\ge 0\\}$", "$L(G) = \\{a^{n}cb^{n} | n \\ge 0\\}$"]
      },
      "aacbb": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$",
        "question": "Is the string $aacbb$ in $L$?",
        "answer": "Yes",
        "choices": ["Yes", "No"]
      },
      "aacbbder1": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$",
        "question": "Let us derive $aacbb$. What variable do we start with?",
        "answer": "$S$",
        "choices": ["$S$", "$A$", "$B$"]
      },
      "aacbbsent1": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$",
        "question": "What will be the sentential form after we substitute $S$?",
        "answer": "$AcB$",
        "choices": ["$AcB$", "$aAacB$", "$aacB$", "$AcBbb$", "$Acbb$", "$aacBbb$", "$aacbb$"]
      },
      "aacbborder": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$",
        "question": "Since we have a sentential form with multiple variables, which variable should be replaced?",
        "answer": "We will need some order to be able to write an algorithm to perform replacements.",
        "choices": ["A", "B", "We will need some order to be able to write an algorithm to perform replacements."],
        "correctFeedback": ["We have two variables to choose from, so two possible orders to perform replacements."]
      },
      "aacbbleft": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow AcB$. Following the Leftmost derivation order, which variable should be replaced?",
        "answer": "A as it is the leftmost variable",
        "choices": ["A as it is the leftmost variable", "B as it is the rightmost variable"]
      },
      "aacbbder2": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow \\underline{A}cB$. Following the Leftmost derivation order, which production should we use to replace $A$?",
        "answer": "$A \\rightarrow aAa$",
        "choices": ["$S \\rightarrow AcB$", "$A \\rightarrow aAa$", "$A \\rightarrow \\lambda$", "$B \\rightarrow Bbb$", "$B \\rightarrow \\lambda$"]
      },
      "aacbbsent2": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow \\underline{A}cB$. What will be the sentential form after we substitute $A$ with $aAa$",
        "answer": "$aAacB$",
        "choices": ["$AcB$", "$aAacB$", "$aacB$", "$AcBbb$", "$Acbb$", "$aacBbb$", "$aacbb$"]
      },
      "aacbbvar3": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow \\underline{A}cB \\Rightarrow aAacB$. Following the Leftmost derivation order, which variable should be replaced?",
        "answer": "A as it is the leftmost variable",
        "choices": ["A as it is the leftmost variable", "B as it is the rightmost variable"]
      },
      "aacbbder3": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow \\underline{A}cB \\Rightarrow a\\underline{A}acB$. Following the Leftmost derivation order, which production should we use to replace $A$?",
        "answer": "$A \\rightarrow \\lambda$",
        "choices": ["$S \\rightarrow AcB$", "$A \\rightarrow aAa$", "$A \\rightarrow \\lambda$", "$B \\rightarrow Bbb$", "$B \\rightarrow \\lambda$"]
      },
      "aacbbsent3": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow \\underline{A}cB \\Rightarrow a\\underline{A}acB$. What will be the sentential form after we substitute $A$ with $\\lambda$?",
        "answer": "$aacB$",
        "choices": ["$AcB$", "$aAacB$", "$aacB$", "$AcBbb$", "$Acbb$", "$aacBbb$", "$aacbb$"]
      },
      "aacbbvar4": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow \\underline{A}cB \\Rightarrow a\\underline{A}acB \\Rightarrow aacB$. Following the Leftmost derivation order, which variable should be replaced?",
        "answer": "B as it is the only variable we have",
        "choices": ["We are finished as there are no leftmost variables", "B as it is the only variable we have"]
      },
      "aacbbder4": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow \\underline{A}cB \\Rightarrow a\\underline{A}acB \\Rightarrow aac\\underline{B}$. Following the Leftmost derivation order, which production should we use to replace $B$?",
        "answer": "$B \\rightarrow Bbb$",
        "choices": ["$S \\rightarrow AcB$", "$A \\rightarrow aAa$", "$A \\rightarrow \\lambda$", "$B \\rightarrow Bbb$", "$B \\rightarrow \\lambda$"]
      },
      "aacbbsent4": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have $S \\Rightarrow \\underline{A}cB \\Rightarrow a\\underline{A}acB \\Rightarrow aac\\underline{B}$. What will be the sentential form after we substitute $B$ with $Bbb$?",
        "answer": "$aacBbb$",
        "choices": ["$AcB$", "$aAacB$", "$aacB$", "$AcBbb$", "$Acbb$", "$aacBbb$", "$aacbb$"]
      },
      "aacbbvar5": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have<br/>$S \\Rightarrow \\underline{A}cB \\Rightarrow a\\underline{A}acB \\Rightarrow aac\\underline{B} \\Rightarrow aacBbb$. Following the Leftmost derivation order, which variable should be replaced?",
        "answer": "B as it is the only variable we have",
        "choices": ["We are finished as there are no leftmost variables", "B as it is the only variable we have"]
      },
      "aacbbder5": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb$ | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have<br/>$S \\Rightarrow \\underline{A}cB \\Rightarrow a\\underline{A}acB \\Rightarrow aac\\underline{B}\\Rightarrow aac\\underline{B}bb$. Following the Leftmost derivation order, which production should we use to replace $B$?",
        "answer": "$B \\rightarrow \\lambda$",
        "choices": ["$S \\rightarrow AcB$", "$A \\rightarrow aAa$", "$A \\rightarrow \\lambda$", "$B \\rightarrow Bbb$", "$B \\rightarrow \\lambda$"]
      },
      "aacbbsent5": {
        "type": "multiple",
        "description": "$G$ =($\\{S,A,B\\}$,$\\{a,b,c\\}$,S,P) <br>$S\\rightarrow AcB$<br> $A\\rightarrow aAa$ | $\\lambda$<br> $B\\rightarrow Bbb | $\\lambda$<br>$\\textbf {Definition}$: Leftmost derivation: in each step of a derivation, replace the leftmost variable.",
        "question": "Currently, we have<br/>$S \\Rightarrow \\underline{A}cB \\Rightarrow a\\underline{A}acB \\Rightarrow aac\\underline{B}\\Rightarrow aac\\underline{B}bb$. What will be the sentential form after we substitute $B$ with $\\lambda$?",
        "answer": "$aacbb$",
        "choices": ["$AcB$", "$aAacB$", "$aacB$", "$AcBbb$", "$Acbb$", "$aacBbb$", "$aacbb$"]
      }
    }
  }
}
