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 7868895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:08:29+00:00 2026-06-03T01:08:29+00:00

Is the following language context free? L = {a^i b^k c^r d^s | i+s

  • 0

Is the following language context free?

L = {a^i b^k c^r d^s | i+s = k+r, i,k,r,s >= 0}

I’ve tried to come up with a context free grammar to generate this but I can not, so I’m assuming its not context free. As for my proof through contradiction:

Assume that L is context free,

Let p be the constant given by the pumping lemma,

Choose string S = a^p b^p c^p d^p where S = uvwxy

As |vwx| <= p, then at most vwx can contain two distinct symbols:

case a) vwx contains only a single type of symbol, therefore uv^2wx^2y will result in i+s != k+r

case b) vwx contains two types of symbols:

i) vwx is composed of b’s and c’s, therefore uv^2wx^2y will result in i+s != k+r

Now my problem is that if vwx is composed of either a’s and b’s, or c’s and d’s, then pumping them won’t necessary break the language as i and k or s and r could increase in unison resulting in i+s == k+r.

Am I doing something wrong or is this a context free language?

  • 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-06-03T01:08:30+00:00Added an answer on June 3, 2026 at 1:08 am

    I can’t come up with a CFG to generate that particular language at the top of my head either, but we know that a language is context free iff some pushdown automata recognizes it.

    Designing such a PDA won’t be too difficult. Some ideas to get you started:
    we know i+s=k+r. Equivalently, i-k-r+s = 0 (I wrote it in that order since that is the order in they appear). The crux of the problem is deciding what to do with the stack if (k+r)>i.

    If you aren’t familiar with PDA’s or cannot use them to answer the problem, at least you know now that it is Context Free.

    Good luck!

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

Sidebar

Related Questions

How can I convert some regular language to its equivalent Context Free Grammar? Is
I have a problem with the following language: I must write a context-free grammar:
I have the following route: {language}/{controller}.mvc/{action}/{id} Once a user has choosen the language it
Consider following script: SET LANGUAGE 'German' GO SET DATEFIRST 1 GO DECLARE @FullDate DATETIME
I wish to define the following typeclass Mapping : {-# LANGUAGE MultiParamTypeClasses #-} class
How is a language construct with the following properties called? It has a beginning
What's C# language specification for the following behavior. The values of the attributes are
Given the following xml: <language>en-US</language> <provider>VenturesLLC</provider> <video> <original_spoken_locale>en-US</original_spoken_locale> <vendor_offer_code>TEST_VENDOR</vendor_offer_code> <release_date>2011-01-15</release_date> <title>Moving Forward</title> <vendor_id>ASDF_ING_2012</vendor_id> </video>
When using english the following URL should apply: http://example.org/services/myservice/ When using another language, the
I need a language lawyer with authoritative sources. Take a look at the following

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.