Question: Define the language B { a , b } as follows: A string w is in B if: R 1 : w = . R
Define the language B a b as follows:
A string w is in B if:
R : w
R : w avb, where v in B
R : w uv where u v in B and u v
Let Naw be the number of as in string w
Let Nbw be the number of bs in string w
Let w Naw Nbw be the total number of characters in w
Prove by induction that, for all strings w in B Naw Nbw
We will ask you to prove this in two different ways. The first is by strong induction on
the naturals. The second is by structural induction.
For both, we will be checking the correctness of the formulations of your logical statement.
i For every natural n set the inductive hypothesis P n to be the statement that For
every string w in B satisfying w n Naw Nbw Prove correctness of P n for
all naturals n
a What is the base case for induction using P n Show that the base case is
correct.
b Prove the correctness of the inductive step that P n P n
ii For every string w in B set the inductive hypothesis P w to be the statement that
Naw Nbw
a What is the base case for induction using P w Show that the base case is
correct.
b Given w in B and w not the base case show that P w is correct if we assume
that every string in B used in the recursive definition of w satisfies P w
A string w is in B if:
R : w
R : w avb, where v in B
R : w uv where u v in B and u v
Let Naw be the number of as in string w
Let Nbw be the number of bs in string w
Let w Naw Nbw be the total number of characters in w
Prove by induction that, for all strings w in B Naw Nbw
We will ask you to prove this in two different ways. The first is by strong induction on
the naturals. The second is by structural induction.
For both, we will be checking the correctness of the formulations of your logical statement.
i For every natural n set the inductive hypothesis P n to be the statement that For
every string w in B satisfying w n Naw Nbw Prove correctness of P n for
all naturals n
a What is the base case for induction using P n Show that the base case is
correct.
b Prove the correctness of the inductive step that P n P n
ii For every string w in B set the inductive hypothesis P w to be the statement that
Naw Nbw
a What is the base case for induction using P w Show that the base case is
correct.
b Given w in B and w not the base case show that P w is correct if we assume
that every string in B used in the recursive definition of w satisfies P w
and xyz xyz
Hint: The question asks you to prove two facts. The first fact will be true for all naturals.
To prove the second fact, try replacing x by the natural xy in the first fact.
possible solution. It will be useful to have a recursive definition of the state space.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
