We can define an alphabet as a set of characters to be used in creating strings. Let A = {a,b} be an alphabet. We define A* to be all strings of length 0 or more made up only of letters in the alphabet A. (The length of a string is the number of characters in it.) (a) Write a recursive definition for A*. (b) Write a recursive definition for A* -A, i.e. all strings of length 1 or more that can be made with the letters in A.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

make it more clearly with step on paper please

 

We can define an alphabet as a set of characters to be used in creating strings. Let A = {a,b} be an alphabet.
We define A* to be all strings of length 0 or more made up only of letters in the alphabet A. (The length
of a string is the number of characters in it.)
(a) Write a recursive definition for A*.
(b) Write a recursive definition for A* -A, i.e. all strings of length 1 or more that can be made with the
letters in A.
Transcribed Image Text:We can define an alphabet as a set of characters to be used in creating strings. Let A = {a,b} be an alphabet. We define A* to be all strings of length 0 or more made up only of letters in the alphabet A. (The length of a string is the number of characters in it.) (a) Write a recursive definition for A*. (b) Write a recursive definition for A* -A, i.e. all strings of length 1 or more that can be made with the letters in A.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning