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

  • Home
  • SEARCH
  • 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 6680799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:31:02+00:00 2026-05-26T04:31:02+00:00

In calculate if two arbitrary regular expressions have any overlapping solutions (assuming it’s possible).

  • 0

In calculate if two arbitrary regular expressions have any overlapping solutions (assuming it’s possible).

For example these two regular expressions can be shown to have no intersections by brute force because the two solution sets are calculable because it’s finite.

^1(11){0,1000}$ ∩     ^(11){0,1000}$        = {}
{1,111, ..., ..111} ∩ {11,1111, ..., ...11} = {}
{}                                          = {}

But replacing the {0,1000} by * remove the possibility for a brute force solution, so a smarter algorithm must be created.

^1(11)*$ ∩ ^(11)*$ = {}
{1,^1(11)*$} ∩ {^(11)*$} = {}
{1,^1(11)*$} ∩ {11,^11(11)*$} = {}
{1,111,^111(11)*$} ∩ {11,^(11)*$} = {}
.....

In another similar question one answer was to calculate the intersection regex. Is that possible to do? If so how would one write an algorithm to do such a thing?

I think this problem might be domain of the halting problem.

EDIT:

I’ve used the accepted solution to create the DFAs for the example problem. It’s fairly easy to see how you can use a BFS or DFS on the graph of states for M_3 to determine if a final state from M_3 is reachable.

DFA solution

  • 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-26T04:31:02+00:00Added an answer on May 26, 2026 at 4:31 am

    It is not in the domain of the halting problem; deciding whether the intersection of regular languages is empty or not can be solved as follows:

    1. Construct a DFA M1 for the first language.
    2. Construct a DFA M2 for the second language. Hint: Kleene’s Theorem and Power Set machine construction
    3. Construct a DFA M3 for M1 intersect M2. Hint: Cartesian Product Machine construction
    4. Determine whether L(M3) is empty. Hint: If M3 has n states, and M3 doesn’t accept any strings of length no greater than n, then L(M3) is empty… why?

    Each of those things can be algorithmically done and/or checked. Also, naturally, once you have a DFA recognizing the intersection of your languages, you can construct a regex to match the language. And if you start out with a regex, you can make a DFA. This is definitely computable.

    EDIT:

    So to build a Cartesian Product Machine, you need two DFAs. Let M1 = (E, q0, Q1, A1, f1) and M2 = (E, q0′, Q2, A2, f2). In both cases, E is the input alphabet, q0 is the start state, Q is the set of all states, A is the set of accepting states, and f is the transition function. Construct M3 where…

    1. E3 = E
    2. Q3 = Q1 x Q2 (ordered pairs)
    3. q0” = (q0, q0′)
    4. A3 = {(x, y) | x in A1 and y in A2}
    5. f3(s, (x, y)) = (f1(s, x), f2(s, y))

    Provided I didn’t make any mistakes, L(M3) = L(M1) intersect L(M2). Neat, huh?

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

Sidebar

Related Questions

I wanted to calculate the angle between two vectors but I have seen these
I have two dates in string formate i want to calculate these things from
I have two PHP functions to calculate the relation between two texts. They both
I have two fields which calculate a total, but I have a radio button
How can I calculate the number of work days between two dates in SQL
Given two colors and n steps, how can one calculate n colors including the
I have two system calls GetSystemTime() and GetThreadTimes() that I need to calculate the
How can I calculate the minimum distance between two rectangles? It is easy for
Possible Duplicate: how to calculate difference between two dates using java I'm trying something
How can I create Turing Machine which will calculate sum of two binary digits

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.