edited by
278 views
1 votes
1 votes
A context-free grammar is in Chomsky Normal Form if every rule is of the form
\[
\begin{array}{l}
A \longrightarrow B C \\
A \longrightarrow a
\end{array}
\]
where $a$ is a terminal, $A, B$ and $C$ are variables except $B$ and $C$ cannot be start variables. We only permit rule $S \longrightarrow \varepsilon$ if $S$ is a start variable.

Given the following grammar, convert it to Chomsky Normal Form.
\[
\begin{array}{l}
S \longrightarrow A S B \mid a B \\
A \longrightarrow B \mid S \\
B \longrightarrow b \mid \varepsilon
\end{array}
\]
edited by

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
1
admin asked Dec 15, 2022
815 views
Assume when encrypting $3$-bit plaintext with a block cipher with key $\text{K},$ the following ciphertext is obtained:$$\begin{array}{|c|c|}\hline \text{Plaintext} & \te...
1 votes
1 votes
1 answer
2
admin asked Dec 15, 2022
440 views
A transposition cipher (but not a rail-fence cipher) was used to produce the following ciphertext:$\text{X 2! H M E S S S E 2 Y T A 2 I I A}$The key used was: $5 \; 2 \; ...
1 votes
1 votes
0 answers
3
admin asked Dec 15, 2022
175 views
Derangements are permutations $\pi$ of the set $\{1,2, \ldots, n\}$ such that $\pi(i) \neq i.$ Compute the number of derangements on the set $1,2, \ldots, n$.
1 votes
1 votes
0 answers
4
admin asked Dec 15, 2022
241 views
Given a truth table of the full adder for three inputs. Draw a full adder circuit with a decoder and two $\text{OR}$ gates.$$\begin{array}{|c|c|c|c|c|}\hline \mathrm{X} &...