Try the fastest way to create flashcards
Question

# Let $L$ be the set of all strings, including the null string, that can be constructed by repeated application of the following rules: If $\alpha\in L$, then $a\alpha b\in L$ and $b\alpha a\in L$. If $\alpha\in L$ and $\beta\in L$, then $\alpha\beta\in L$.Prove that if $\alpha$ has equal number of $a$'s and $b$'s, then $\alpha\in L$.

Solution

Verified
Step 1
1 of 3

Given:

$L$=set of all strings including null string that can be constructed as follows:

$\bullet$ If $\alpha \in L$, then $a\alpha b\in L$ and $b\alpha a\in L$ (1)

$\bullet$ If $\alpha \in L$ and $\beta \in L$, then $\alpha \beta\in L$ (2)

To proof: If $\alpha$ has an equal number of $a$'s and $b$'s, then $\alpha\in L$.

$\textbf{PROOF BY STRONG INDUCTION}$

Let $P(n)$ be the statement "If $\alpha$ has an equal number of $a$'s and $b$'s and of length $2n$, then $\alpha\in L$".

$\textbf{Basis step}$ $n=0$

$\lambda$ is the only string of length 0.

$\lambda$ has an equal number of $a$'s and $b$'s (as it contains 0 $a$'s and 0 $b$'s).

However, $\lambda\in L$ by definition of $L$ and thus $P(0)$ is true.

$\textbf{Inductive step}$ Let $P(0),P(1),...,P(k)$ be true.

$\text{If \alpha has an equal number of a's and b's and of length 2i, then \alpha\in L}$

$\text{ for }i=0,1,...,k$

## Recommended textbook solutions

#### Discrete Mathematics and Its Applications

7th EditionISBN: 9780073383095 (8 more)Kenneth Rosen
4,283 solutions

#### Discrete Mathematics

8th EditionISBN: 9780321964687Richard Johnsonbaugh
4,246 solutions

#### Discrete Mathematics and Its Applications

8th EditionISBN: 9781259676512 (3 more)Kenneth Rosen
4,397 solutions

#### Discrete Mathematics with Applications

5th EditionISBN: 9781337694193Susanna S. Epp
2,641 solutions