answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
11111nata11111 [884]
2 years ago
11

Let S be the set of all strings from A* in which there is no b before an a. For example, the strings λ, aa, bbb, and aabbbb all

belong to S, but aabab ∉ S. Give a recursive definition for the set S. (Hint: a recursive rule can concatenate characters at the beginning or the end of a string.)
Computers and Technology
1 answer:
alexdok [17]2 years ago
3 0

Answer:

Check the explanation

Explanation:

A recurvsive defintion for A^{*} which contains all possible strings over the alphabet A=\{a,b\}is \lambda\in A^*(contains the null strings) and A^{*}=\{uv:u\in A^*,v\in A\}

A recurvsive defintion for A^{+} which contains all possible strings over the alphabet A=\{a,b\} is a,b\in A^+ (contains the strings of lengths 1) and A^{+}=\{uv:u\in A^+,v\in A\}

c) \lambda \in S and

w\in S\Rightarrow wb \in S

bw\in S\Rightarrow baw \in S and awb\in S

is the required recursive definition for S

For example,a\in S and from w\in S\Rightarrow wa\in S\text{ we get }aa\in S also

Again, as ab\in Sand from wb\in S\Rightarrow wab \in S we get aab\in S

And as aab\in S, from wb\in S\Rightarrow wab \in S and awb\in S we have aaab\in S

You might be interested in
Which feature of Badoo helped members make their profile more prominent?
Tamiku [17]

rise up was correct just finished the test

4 0
2 years ago
A router is involved in ____________ layers of the tcp/ip protocol suite.
GenaCL600 [577]
Network Layer of the TCP/IP protocol
3 0
2 years ago
Ruby is creating a presentation. She wants each slide displayed at intervals of five seconds. Which feature in the presentation
andrew-mc [135]

i believe its transition

6 0
2 years ago
Read 2 more answers
Given three dictionaries, associated with the variables, canadian_capitals, mexican_capitals, and us_capitals, that map province
Nookie1986 [14]

Answer:

The Python code to combine the three dictionaries are is given as follows:

  1. canadian_capital = {
  2.    cash: "SOME VALUES",
  3.    assets: "SOME VALUES"
  4. }
  5. mexican_capital = {
  6.    cash: "SOME VALUES",
  7.    assets: "SOME VALUES"
  8. }
  9. us_capital = {
  10.    cash: "SOME VALUES",
  11.    assets: "SOME VALUES"
  12. }
  13. nafta_capital = {
  14.    canadian: canadian_capital,
  15.    mexican : mexican_capital,
  16.    us: us_capital
  17. }

Explanation:

<u>Line 1 - 14 :</u>

Create three Python dictionaries and name them as <em>canadian_capitals, mexican_capital </em>and<em> us_capitals</em>. Please note a Python dictionaries should be enclosed in curly braces { }.  

We just define two samples of relevant keys (<em>cash </em>and <em>asset</em>) in each of the dictionaries. Python dictionary can map a key to a value.

Since we are not given any capital values from the question,  a dummy string "<em>SOME VALUES</em>" is tentatively set as the value for each of the keys.

In practice, we should replace those dummy strings with the real values of capital. The values can be a number, a string, a list and even a nested dictionary.

<u>Line 16 - 20 : </u>

Create one more Python dictionary and name it as <em>nafta_capital</em>.

Since our aim is to combine the three previous dictionaries (<em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em>) and associate it with <em>nafta_capital</em>, we can define three different keys (<em>canadian, mexican </em>and <em>us</em>) in our dictionary nafta_capital.

As mentioned, a value associated with a key can be a nested dictionary. Hence, we just map <em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em> as the value of the keys (<em>canadian, mexican </em>and<em> us</em>) in dictionary<em> nafta_capital,</em> respectively,

By doing so, we have managed to combine three target dictionaries (<em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em> ) into a single dictionary, <em>nafta_capital</em>.

4 0
2 years ago
Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 the output is
Misha Larkins [42]

Answer:

The program to this question can be given as:

Program:

def swap_values(user_val1, user_val2):  #define function

   return (user_val2, user_val1) #return values

if __name__ == '__main__': #define constructor.

   n1 = int(input('Enter first number :')) #input value form user

   n2 = int(input('Enter second number :')) #input value form user

   (n1,n2) = swap_values(n1,n2) #hold function values.

   print(n1) #print values

   print(n2) #print values

Output:

Enter first number :3

Enter second number :8

8

3

Explanation:

The explanation of the above python program can be given as:

  • In the python program we define a function that is "swap_values". This function takes two integer values that is "user_val1 and user_val2" as a parameters and returns variable values that is "user_val2 and user_val1".
  • Then we use a constructor in this we define two variable that is "n1 and n2" these variable are use to take user-input from the user and pass the value into the function.  
  • To hold the value of the function we use n1 and n2 variable and print these variable value.
4 0
2 years ago
Other questions:
  • On the Picture Tools Layout tab, you can preview results of the numerous styles, borders, effects, and layouts by _______ comman
    7·2 answers
  • Computer hardware had been designed to run a single operating system and a single app, leaving computers vastly underutilized. o
    15·1 answer
  • Jimmy is preparing a slide show to teach the grade three students the importance of cleanliness. which element should he use in
    5·2 answers
  • Prove that f(n) = 20n3 + 10nlogn + 5 is O(n3)
    12·1 answer
  • Question 1 :Which type of unshielded twisted pair (UTP) cable is commonly used for 1000BASE-T Ethernet networks and is often mad
    8·1 answer
  • Which of the following operation is not performed by a mouse 1) left click , middle click , right click, double click​
    15·2 answers
  • Using virtualization comes with many advantages, one of them being performance. Which of these is NOT another realistic advantag
    7·1 answer
  • What are ways to enter a formula in Excel? Check all that apply. Click on the Function Library group and select a function from
    10·2 answers
  • Laura is the first person in her SDLC team to detect and predict security vulnerabilities in the software. In which phase is Lau
    11·1 answer
  • What should businesses do in order to remain competitive under the current Cloud<br> landscape?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!