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
Andreas93 [3]
3 years ago
6

Create a C language program that can be used to construct any arbitrary Deterministic Finite Automaton corresponding to the FDA

definition above. a. Create structs for the: automaton, a state, and a transition. For example, the automaton should have a "states" field, which captures its set of states as a linked list.
Engineering
1 answer:
otez555 [7]3 years ago
5 0

Answer:

see the explanation

Explanation:

/* C Program to construct Deterministic Finite Automaton */

#include <stdio.h>

#include <DFA.h>

#include <stdlib.h>

#include <math.h>

#include <string.h>

#include <stdbool.h>

struct node{

struct node *initialStateID0;

struct node *presentStateID1;

};

printf("Please enter the total number of states:");

scanf("%d",&count);

//To create the Deterministic Finite Automata

DFA* create_dfa DFA(){

  q=(struct node *)malloc(sizeof(struct node)*count);

  dfa->initialStateID = -1;

  dfa->presentStateID = -1;

  dfa->totalNumOfStates = 0;

  return dfa;

}

//To make the next transition

void NextTransition(DFA* dfa, char c)

{

  int tID;

  for (tID = 0; tID < pPresentState->numOfTransitions; tID++){

       if (pPresentState->transitions[tID].condition(c))

      {

          dfa->presentStateID = pPresentState->transitions[tID].toStateID;

          return;

      }

  }

  dfa->presentStateID = pPresentState->defaultToStateID;

}

//To Add the state to DFA by using number of states

void State_add (DFA* pDFA, DFAState* newState)

{  

  newState->ID = pDFA->numOfStates;

  pDFA->states[pDFA->numOfStates] = newState;

  pDFA->numOfStates++;

}

void transition_Add (DFA* dfa, int fromStateID, int(*condition)(char), int toStateID)

{

  DFAState* state = dfa->states[fromStateID];

  state->transitions[state->numOfTransitions].toStateID = toStateID;

  state->numOfTransitions++;

}

void reset(DFA* dfa)

{

  dfa->presentStateID = dfa->initialStateID;

}

You might be interested in
Assume the following LTI system where the input signal is an impulse train (i.e.,x(t)=∑????(t−nT0)[infinity]n=−[infinity].a)Find
Igoryamba

Answer:

See explaination

Explanation:

The Fourier transform of y(t) = x(t - to) is Y(w) = e- jwto X(w) . Therefore the magnitude spectrum of y(t) is given by

|Y(w)| = |X(w)|

The phase spectrum of y(t) is given by

<Y(w) = -wto + <X(w)

please kindly see attachment for the step by step solution of the given problem.

4 0
3 years ago
the tire restraining device or barrier shall be removed immediately from service for any of these defects except
lora16 [44]

Restraining devices and barriers shall be visually inspected on the rim wheel components or sudden release of contained air.

Restraining device means an apparatus such as a <em>cage, rack, assemblage of bars and other components</em> that will constrain all rim wheel components.

Restraining devices and barriers shall be visually inspected on the rim wheel components or sudden release of contained air. Any restraining device or barrier exhibiting damage such as the following defects shall be immediately removed from service.

Find out more on Restraining devices at: brainly.com/question/24647450

5 0
2 years ago
"A communication between two devices is over the maximum limit of an ethernet frame size. The Transmission Control Protocol (TCP
Sliva [168]

COmmunication Devices

Explanation:

  • TCP/IP, or the Transmission Control Protocol/Internet Protocol, is a suite of communication protocols used to interconnect network devices on the internet. TCP/IP can also be used as a communications protocol in a private network (an intranet or an extranet).

  • The sequence number in a header is used to keep track of which segment out of many this particular segment might be. The next field, the acknowledgment number, is a lot like the sequence number. The acknowledgment number is the number of the next expected segment.

  • The 32 bit sequence number field defines the number assigned to the first byte of data contained in this segment. TCP is a stream transport protocol. To ensure connectivity, each byte to be transmitted is numbered.
3 0
3 years ago
"At 195 miles long, and with 7,325 miles of coastline, the Chesapeake Bay is the largest and most complex estuary in the United
Paraphin [41]

Answer:

see explaination

Explanation:

Part a) Width of bay at Potomac River:

Given Data:

· Actual Width at Potomac River = 30 miles

· Bay Model Length Ratio Lr = 1/1000

In fluid mechanics models of real structures are prepared in simulation so that they can be analyzed accurately. A model is known to have simulation if model carries same geometric, kinematic and dynamic properties at a small scale.

Length of any part in model = Actual length x Lr

Hence,

Model Width of bay at Potomac River = 30 x 1/1000 = 0.03 miles

Since 1 mile = 5280 ft

Model Width of bay at Potomac River = 0.03 x 5280 = 158.4 ft

Part b) Model Length of bay bridge in model:

Given Data:

· Actual Length of bay bridge = 4.3 miles

· Bay Model Length Ratio Lr = 1/1000

Model Length = Actual Length x Lr = 4.3 x 1/1000 = 0.0043 miles

Since 1 mile = 5280 ft

Model Length in feet = 0.0043 x 5280 = 22.704 ft

Part c) Model Length of bay bridge in model:

Given Data:

· Model Area = 8 acre

· Bay Model Length Ratio Lr = 1/1000

Model Area = Actual Area x Lr x Lr

8 Model Area :: Actual Area =- (Lp)2 2 = 8,000,000 acre 1000

Since 1 square mile = 640 acre,

Actual Area in square miles = 8,000,000/640 = 12,500 square miles

Part d) Average and maximum depth of model:

Given Data:

· Actual Average depth = 28 ft

· Actual Maximum depth = 174 ft

· Bay Model Length Ratio Lr = 1/1000

Model average depth = Actual average depth x Lr = 28 x 1/1000 = 0.028 feet

Since 1 ft = 12 inch

Model average depth in inch = 0.028 x 12 = 0.336 in

Model maximum depth = Actual maximum depth x Lr = 174 x 1/1000 = 0.174 feet

Since 1 ft = 12 inch

Model maximum depth in inch = 0.174 x 12 = 2.088 in

4 0
3 years ago
A 50-kN hydraulic press performs pressing and clamping actions. The clamping cylinder force is 4 kN. The pressing cylinder strok
galben [10]

Answer:

The attached figure shows the hydraulic circuit using one sequence valve to control two simultaneous operations performed in proper sequence in one direction only. In the other direction, both the operations are simultaneous.

When we keep the 4/2 DCV in crossed arrow position, oil under pressure is supplied to the inlet port of the sequence valve. It directly flows to Head end port-1. Hence Cylinder 'C1' extends first.

By the end of the extension of cylinder 'C1', pressure in the line increases and hence poppet of sequence valve is lifted off from its seat and allows oil to flow to port-2 and hence, Cylinder 'C2 extends completing the pressing operation.

In the straight-arrow position of 4/2 DCV the oil under pressure reaches the rod end of both the cylinders C1 and C2 simultaneously through port-3. This causes both the cylinders to retract simultaneously.

Also, a Flow control valve is provided tho control the velocity of clamping

Explanation:

find attached the figure

4 0
3 years ago
Other questions:
  • Water at 20oC, with a free-stream velocity of 1.5 m/s, flows over a circular pipe with diameter of 2.0 cm and surface temperatur
    13·1 answer
  • Plot the absorbance, A, versus the FeSCN2 concentration of the standard solutions (the values from your Pre-lab assignment). Fro
    7·1 answer
  • The fluid-conditioning components of hydraulic-powered equipment provide fluid that is clean and maintained at an acceptable ope
    6·1 answer
  • Lately, you have noticed some repetitive stress in your wrist. Which sign is most likely the cause of that stress and pain?
    7·1 answer
  • Who is the best musician in Nigeria<br>​
    11·2 answers
  • A Gaussian random voltage X volts is input to a half-wave rectifier and the output voltage is Y = Xu (X) Volts were u (x) is the
    9·1 answer
  • Tech A says that coolant circulates through some intake manifolds to help warm them up. Tech B says that some intake manifolds u
    13·1 answer
  • Which is an alloy made up of iron and carbon and has high compressive and tensile strength?
    6·1 answer
  • 1. If a Gear with a 3 inch Diameter is being turned by a Gear with a 6 inch Diameter, which Gear will rotate at a higher Rate?
    12·1 answer
  • Select the correct answer. Which of the following devices is a simple machine? A.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!