Question: 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

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
Get step-by-step solutions from verified subject matter experts
