Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions