Re: What is the language of this grammar?
- From: torbenm@xxxxxxxxxxxxx (Torben Ægidius Mogensen)
- Date: Mon, 30 Apr 2007 14:31:07 +0200
surmoi@xxxxxxxxx writes:
S-> xSS | y
L(G) = ?
I only know the number of y is 1 more than the number of x, and y is
the ending character.
How do I describe it?
If you delete the last y, you can read x as opening bracket and y as
closing bracket and what you get is the set of balanced bracket
sequences.
You can prove this by induction:
Base case: S => y, delete y, empty string is balanced.
Induction step: Assume true for S=>v, S=>w. xv is then balanced, as
x matches the y at the end of v. Hence, xvw is balanced after
removing the y at end of w.
Torben
.
- References:
- What is the language of this grammar?
- From: surmoi
- What is the language of this grammar?
- Prev by Date: Re: NP-Complete Definition
- Next by Date: Re: NP-Complete Definition
- Previous by thread: What is the language of this grammar?
- Next by thread: Secretary Problem, Regression, Decision Trees, and Neural Networks
- Index(es):
Relevant Pages
|