Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6613781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:15:34+00:00 2026-05-25T20:15:34+00:00

I want to construct a deterministic finite automata that accepts the following language: {w

  • 0

I want to construct a deterministic finite automata that accepts the following language:

{w ∈ {a,b}* : each a in w is immediately preceded by a b}

So far I’ve got >⨀ —b—> O —a—> O.

‘>’ = initial state

⨀ = final state

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:15:35+00:00Added an answer on May 25, 2026 at 8:15 pm

    A good way to think about FAs is by trying to think about how many different situations you can be in, in terms of how you are going to get to a string in the language. Let’s start with a few small strings and see what I mean.

    Say you start with the empty string. What can you append to this to get a string in the language? Well, the empty string is in the language, so we can append the empty string (i.e., nothing) and also have a string in the language. Additionally, we can append any string in the language we are going for to the empty string, and we will get a string in the language (trivially). We will need at least one state to remember the empty string (and strings like it – strings to which we can append the empty string or any other string in the language and still have a string in the language); this will be the start/initial state, and since the empty string is in the language (we check this easily), we know the start/initial state will be accepting.

    Now let’s consider the string a. This is an example of a string not in the language, and there’s nothing we can add to the end of this string to cause it to be in the language; we’ve already violated the condition that all a’s in the string are preceded by b’s. The set of strings we can add to this to get a string in the language is the empty set, and therefore, we will need a state distinct from the one we’ve already identified to remember this string and strings like it – strings to which we cannot add anything to get a string in the language.

    To recap, we have identified two states: an accepting start/initial state, and what we call a “dead” state – a state that is not accepting and which does not ever lead to an accepting state.

    Let’s try the string b. This string is in the language, and so we can add the empty string to it. We can also trivially add any other string in the language to the end of this string, and get another string in the language. However, we can also add an a followed by any string in the language, and get another string in the language. For instance, we can add the string a followed by bbabb to get babbabb, which is also in the language. The set of strings which we can add is therefore a set we haven’t seen before, and we will need a new state to represent this string – the string b – and strings like it. It will be accepting, since the string b is a string in the language.

    You should try the strings aa, ab, ba, and bb. You should find that the strings aa and ab are both already covered by our dead state (we can’t add any strings to the end of these to get anything in our language), and that the string ba is covered by the start/initial state (we can only add to this strings already in the language to get other strings in the language), and that bb corresponds to the third state we identified (adding any string, or a single a followed by any string, will result in a string also in the language). Since we have exhausted all strings of length 2 and not added any new states, we know that these are all the states that we need in the FA; we could add others, but they’d be unnecessary.

    To get the transitions, all we need to do is to make sure that all the states lead to the correct place. In other words, since the string a is formed by adding the character a to the end of the empty string, we need a transition from the start/initial state (corresponding to the empty string) to the dead state (corresponding to the string a) which occurs when the FA reads the symbol a. Similarly, we need a transition from the start/initial state to the third state on the symbol b. The other transitions are found similarly: on either an a or a b, the dead state transitions to itself, and the third state loops on b and transitions to the start/initial state on an a. Once each state has a transition for each symbol in the alphabet, you have a complete (and correct) FA. Moreoever, by constructing it in this fashion, you guarantee that you have a minimal FA… which is a nice way to solve problems requesting one, instead of coming up with an arbitrary one and minimizing it post-hoc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to realize a construct in MS SQL that would look like this
I want to construct a macro that, given a symbol 'foo , creates a
I have a simple problem: I want to construct a regex that matches a
I want to construct an array of 3 offers that output in a random
Let's say you want to construct an Iterator that spits out File objects. What
I want to construct a regex, that matches either ' or and then matches
I want to construct three different priority_queue 's that hold a class Thing and
I have the following text: <!--:en-->&nbsp; <!--:--> I want to construct a pattern to
I've got a list of datetimes from which I want to construct time segments.
I want to construct a div that has a header with background like that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.