Question: A language E of arithmetic expressions is defined recursively from variables {a, b}, operators {+, -} and parentheses as follows: BASE CASES : aE and

A language E of arithmetic expressions is defined recursively from variables {a, b}, operators {+, -} and parentheses as follows:

BASE CASES: aE and bE.

RECURSIVE STEP: If u and v are in E, then (u + v), (u v), and (-v) are in E.

CLOSURE: A string is in E if and only if it can be obtained from the base cases by a finite number of applications of the recursive step.

For example, the string (a + (b (-a))) is obtained from three base cases and three applications of recursive rules.

Prove by induction:

wE ((number of parentheses in w) = 2*(number operators in w))

Note: Induction is usually based on some number related to the statement we are trying to prove. In this case, there are multiple possibilities for the number that we could use.

While induction on the length of the string w is doable, I believe that it is easier to use induction on the number of applications of the recursive rule that are used to obtain w from the base cases.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!