Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve all of them 8.9 Structural induction 25: S is a set of strings over the alphabet fa, b) and is defined recursively as

image text in transcribed

Please solve all of them

8.9 Structural induction 25: S is a set of strings over the alphabet fa, b) and is defined recursively as follows: Basis: ES and bES Recursive rules: If x is in S, then bxa E S and axbES. Define the function NumB(x) to be the number of occurrences of the character b in the string x. For example, NumB(baba) 2. Suppose that xES and ubxa. Select the expression that is correct a. NumB(u) NumB(x)+1 b. NumB(u) NumB(x)+2 C. NumB(u)-2-NumB(x) d. NumB(u) 2 NumB(x)+1 26: S is a set of strings over the alphabet fa, b) and is defined recursively as follows: Basis: ES and bES Recursive rules: If x is in S, then bxa E S and axbES. Define the function NumB(x) to be the number of occurrences of the character b in the string x, and NumA(x) to be the number of occurrences of the character a in the string x. For example, NumB(bba)-2 and NumA(bba)1 Page 6 of 9 HW-6 Suppose that XES. Select the fact that must be true about x. a. NumB(x) NumA(x)+1 b. NumB(x) s NumA(x) c. 0 s NumB(x) NumA(x) S1 d. 0 s NumA(x) - NumB(x) s1 8.10 Recursive algorithms 27: The function SuperPower given below receives two inputs, x and n, and should return xn2 x is a real number and n is positive integer SuperPower(x, n) If n1, then Retum(x) ySuperPower(x, n-1) Retum(?) What is the correct value for the algorithm to retum? a. ?. 8.9 Structural induction 25: S is a set of strings over the alphabet fa, b) and is defined recursively as follows: Basis: ES and bES Recursive rules: If x is in S, then bxa E S and axbES. Define the function NumB(x) to be the number of occurrences of the character b in the string x. For example, NumB(baba) 2. Suppose that xES and ubxa. Select the expression that is correct a. NumB(u) NumB(x)+1 b. NumB(u) NumB(x)+2 C. NumB(u)-2-NumB(x) d. NumB(u) 2 NumB(x)+1 26: S is a set of strings over the alphabet fa, b) and is defined recursively as follows: Basis: ES and bES Recursive rules: If x is in S, then bxa E S and axbES. Define the function NumB(x) to be the number of occurrences of the character b in the string x, and NumA(x) to be the number of occurrences of the character a in the string x. For example, NumB(bba)-2 and NumA(bba)1 Page 6 of 9 HW-6 Suppose that XES. Select the fact that must be true about x. a. NumB(x) NumA(x)+1 b. NumB(x) s NumA(x) c. 0 s NumB(x) NumA(x) S1 d. 0 s NumA(x) - NumB(x) s1 8.10 Recursive algorithms 27: The function SuperPower given below receives two inputs, x and n, and should return xn2 x is a real number and n is positive integer SuperPower(x, n) If n1, then Retum(x) ySuperPower(x, n-1) Retum(?) What is the correct value for the algorithm to retum? a

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 Theory And Application Bio Science And Bio Technology International Conferences DTA And BSBT 2011 Held As Part Of The Future Generation In Computer And Information Science 258

Authors: Tai-hoon Kim ,Hojjat Adeli ,Alfredo Cuzzocrea ,Tughrul Arslan ,Yanchun Zhang ,Jianhua Ma ,Kyo-il Chung ,Siti Mariyam ,Xiaofeng Song

2011th Edition

ISBN: 3642271561, 978-3642271564

More Books

Students also viewed these Databases questions

Question

You have

Answered: 1 week ago