1answer.
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
Alex73 [517]
3 years ago
7

Let CFG G be the following grammar.

Engineering
2 answers:
adoni [48]3 years ago
6 0

Answer:

See Explanation Below

Explanation:

Given

S → aSb | bY | Y a

Y → bY | aY | ε

Giving a simple description of L(G) in English. The description is as follows;

This means that L(G) contains a string of a's and b's such that the following are true;

1. the string starts with n a’s and m b’s, where n and m can be zero, but not at the same time,and at least one of option 2 and option 3

2. and has any number of a’s or b’s followed by an a

3. ab followed by any number of a’s and b’s

Note that n and m represent numerical digits

Using the description to give a CFG for L(G), the complement of L(G) is written as L'(G)

L'G are elements not in L(G) and they are

L'(G) =a^n b (a∪b) * b^n ∪ a^n (a∪b) * ab^n

valentinak56 [21]3 years ago
4 0

Answer:

The answer in the explanation section

Explanation:

The context free grammar is equal to:

S → aSb|bY|Ya

Y → bY|aY|ε

The language L(G) is equal to:

Y → bY

Y → aY

Y → ε

S → aSb

S → bY

S → Ya

If S → Ya, thus:

S → ∈a

S → a

If S → bY:

S → ∈b

S → b

If S → aSb:

S → abYb

S → abbYb

If S → bY:

S → bbY

S → bb∈

S → bb

From all this cases, the languaje is the follow:

L(G)=[a,b,abbb,bb...]

The description of L(G) is:

-strings made up of a consecutive number of a length a, that can vary from 1 to infinity.

-strings made up of a consecutive number of a length b, that can vary from 1 to infinity.

-strings whose start symbol a is followed by number b

-strings whose start symbol b is followed by number a

-strings beginning with the symbol a and ending with the symbol b

-strings beginning with the symbol b and ending with the symbol a

The grammar for L(G) is equal to a^{i} b^{i} if i\geq 0\\

The CFG for L(G) is equal to:

S → aSb|∈

S → abb∈b

S → abbb

You might be interested in
Let's model this housing price data! Before we can do this, however, we need to split the data into training and test sets. Reme
Lilit [14]

The program reads in a dataset into a pandas dataframe, and uses the train_test_split function in the sklearn library to split the data into <em>training and test sets</em>. The code goes thus :

import pandas as pd

<em>#import</em><em> </em><em>the</em><em> </em><em>pandas</em><em> </em><em>dataframe</em><em> </em><em>and</em><em> </em><em>alias</em><em> </em><em>it</em><em> </em><em>as</em><em> </em><em>pd</em>

from sklearn.model_selection import train_test_split

<em>#import</em><em> </em><em>the</em><em> </em><em>train_test_split</em><em> </em><em>function</em><em> </em>

housing_df = pd.read_csv('housing price.csv')

<em>#read</em><em> </em><em>in</em><em> </em><em>the</em><em> </em><em>housing</em><em> </em><em>data</em><em> </em>

features_df = df.iloc[:,1:]

<em>#seperate</em><em> </em><em>the</em><em> </em><em>features</em><em> </em><em>from</em><em> </em><em>the</em><em> </em><em>label</em><em> </em><em>;</em>

target_df = df.iloc[:,0]

<em>#put</em><em> </em><em>the</em><em> </em><em>label</em><em> </em><em>into</em><em> </em><em>a</em><em> </em><em>seperate</em><em> </em><em>dataframe</em><em> </em><em>as</em><em> </em><em>well</em><em>.</em><em> </em>

X_train, X_test, Y_train, Y_test = train_test_split(features_df, target_df, test_size = 0.1, random_state = 1)

<em>#uses</em><em> </em><em>tuple</em><em> </em><em>unpacking</em><em> </em><em>to</em><em> </em><em>randomly</em><em> </em><em>assign</em><em> </em><em>the</em><em> </em><em>data</em><em> </em><em>each</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>4</em><em> </em><em>variables</em><em>.</em><em> </em>

<em>#</em><em>Test</em><em> </em><em>size</em><em> </em><em>is</em><em> </em><em>test</em><em> </em><em>percent</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>entire</em><em> </em><em>dataset</em><em> </em>

Learn more :brainly.com/question/4257657?referrer=searchResults

3 0
2 years ago
Which of the following is NOT true about hydraulic systems?
Dmitry [639]

Answer: The answer is D

D.In hydraulic systems, the operating temperatures must be kept between 170�F and 180°F 

Explanation:

The operating temperature for hydraulic systems is 140°F and below. Anything above this temperature is too high and will reduce the useful life of hydraulic fluid.

Most often problems associated with hydraulic systems are caused by fluid contaminated with particulate matter.

7 0
3 years ago
Four race cars are traveling on a 2.5-mile tri-oval track. The four cars are traveling at constant speeds of 195 mi/h, 190 mi/h,
Snezhnost [94]

Answer:

Explanation:

1) The number of times, the car with the speed of  195 mph will cross the given point is equal to 30 minutes divided by the time taken by car to cross the 2.5 miles.

0 .5*195/2.5 = 39

Likewise, the car with the speed of 190 mph crosses the point 38 times; the car with the speed of 185 mph crosses the point 37 times

and car with the speed of 180 mph crosses it 36 times

here, the time-mean speed, vt is given below,

vt = (39*195 +38*190+37*185+36*180)/(39+38+37+38)

= 186.433 mph

and space mean speed is given by,

= (39+38+37+36)/(39/195+38/190+37/1850+36/180)

1) The number of times, the car with the speed of  195 mph will cross the given point is equal to 30 minutes divided by the time taken by car to cross the 2.5 miles.

0 .5*195/2.5 = 39

Likewise, the car with the speed of 190 mph crosses the point 38 times; the car with the speed of 185 mph crosses the point 37 times

and car with the speed of 180 mph crosses it 36 times

here, the time-mean speed, vt is given below,

vt = (39*195 +38*190+37*185+36*180)/(39+38+37+38)

= 186.433 mph

and space mean speed is given by,

= (39+38+37+36)/(39/195+38/190+37/1850+36/180)

=187.5 mph

2)  There would be only four number of observations when the aerial photo is given, therefore time mean speed, vt in that condition will be calculated as

Vt = 195+190+185+180/4

  = 187.5

Vs= 4/(1/195+1/190+1/185+1/180)

= 188.36 mph

2)  There would be only four number of observations when the aerial photo is given, therefore time mean speed, vt, in that condition will be calculated as

Vt = 195+190+185+180/4

  = 187.5

Vs= 4/(1/195+1/190+1/185+1/180)

= 188.36 mph

4 0
3 years ago
1) (35 pts) For the curved lifting bar, calculate the stresses at A, B, and the centroid of the section.
Juliette [100K]

I know the Answer but first you should add me as Brainliest and I Will edit this to Answer.

3 0
2 years ago
Discuss the difference between a dual split and a diagonal split master cylinder.
Anvisha [2.4K]

Answer:

The difference between the dual split Master cylinder and diagonal split Master cylinder is dual split it makes power brakes less prone to failure while diagonal split is when the left rear and right front brakes are on one hydraulic line while the right front and left rear brakes are on another.

7 0
2 years ago
Other questions:
  • Consider the following program:
    15·1 answer
  • Heat in the amount of 100 kJ is transferred directly from a hot reservoir at 1200 K to a cold reservoir at 600 K. Calculate the
    15·1 answer
  • Valves on steam lines are commonly encountered and you should know how they work. For most valves, the change in velocity of the
    10·1 answer
  • Here you go!!!!!!!!!!!!!!!!!1
    8·1 answer
  • The amount of time an activity can be delayed and yet not delay the project is termed:_________
    14·1 answer
  • The 10mm diameter rod is made of Kevlar 49. Determine the change in
    7·1 answer
  • A hollow, spherical shell with mass 2.00kg rolls without slipping down a slope angled at 38.0?.
    15·1 answer
  • ¿Cómo nos podría ayudar una hoja de cálculo en nuestro estudio?
    11·1 answer
  • Given below are the measured streamflows in cfs from a storm of 6-hour duration on a stream having a drainage area of 185 mi^2.
    11·1 answer
  • The toggle (t) flip-flop has one input, clk, and one output, q. on each rising edge of clk, q toggles to the complement of its p
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!