0

The question I'm working from is:

Prove whether or not a finite automation exists that recognises the following language:

B = {ww | w ∈ {a,b,c,...,z)*}

EDIT

So I believe this is a non-regular language. My understanding of pumping lemma is not great but this was my solution:

S = apbapb

Where S is a valid string in the language and p is the pumping length.

S = aaaabaaaab for example when p = 4

S = xyz // s can be split into xyz components

| x y | <= p

SO y must be all a's before the first b e.g. a | aaa | baaaab

xy2z = aaaaaaabaaaab

xy2z is not in B

Therefore B is not regular

Apparently though this is wrong, please could someone explain why / how to obtain the right answer?

user44576
  • 11
  • 6
  • 1
    the task can indeed be solved by finding a regular expression for $B$ but maybe it can be solved by proving that $B$ is not regular – phs Jan 07 '16 at 19:46
  • 1
    I don't see a question here. What are you asking? If you want us to solve the exercise for you, that's off-topic. – David Richerby Jan 07 '16 at 19:50
  • I didn't know that was off topic - where would be a more appropriate place to post this? I'm saying I don't know what regular expression produces this language and can anyone show me how to get there or show me what it is? – user44576 Jan 07 '16 at 20:16
  • 1
    We are trying to hint that perhaps the language isn't regular after all. – Yuval Filmus Jan 07 '16 at 20:34
  • 1
    Welcome to [cs.SE]! Your question is a very basic one. Let me direct you towards our reference questions which cover your problem in detail, especially http://cs.stackexchange.com/questions/1031/how-to-prove-that-a-language-is-not-regular. – D.W. Jan 07 '16 at 22:51
  • 1
    We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher. – D.W. Jan 07 '16 at 22:52
  • 1
    Please do check the questions referenced above. This (and similar) question has already been asked hundreds of times, and yet again a dozen times a term. – vonbrand Jan 08 '16 at 00:36
  • As the topic is closed I cannot add a new answer. However, the language is finite and hence regular. Did you note the alphabet? It is ${a,b, \dots, z}$. Hence $w$ is a letter. The requirement $w \in {a,b, \dots, z}^*$ is true, as $w$ is a one letter word over the alphabet. Now the language $B$ consists of a single two-letter word. This reminds me of a joke: computing the product $(a-w)(b-w)(c-w)\cdot\ldots\cdot(z-w)$. – Hendrik Jan Jan 08 '16 at 12:04

1 Answers1

2

Your proof using the pumping lemma is wrong. You choose a pumping lemma constant $p=4$ but what happens if $p=5$ works? The pumping lemma tell us that there exists a constant $p$. Now you have to try all the remaining possible values of $p$.

I recommend you to study carefully the pumping lemma first. It is a bad idea to try using it without understanding it. After that if you want to assimilate it more you can check this answer: https://cs.stackexchange.com/a/50618/31129 where I explain some common mistakes.

Renato Sanhueza
  • 1,335
  • 8
  • 21
  • Oh.. i saw a video https://www.youtube.com/watch?v=g4e2RElzCSQ which seemed to indicate that you could just assume a pumping lemma constant and if you could find a single contradiction, it's not regular.

    Having seen your post you linked to, I can see that's not the case but now I am confused about what values of p to try. How do I know which p is correct? Oh so confused..

    – user44576 Jan 07 '16 at 22:27
  • 1
    Just use a generic constant p. You don't need to give it a numerical value. – Renato Sanhueza Jan 07 '16 at 22:53
  • 1
    For example. Consider the word $\sigma = a^pba^pb$ with $|\sigma|=2p+2 \geq p$. You can say that $xy$ are only letter a's because $|xy|\leq p$. I really can't be more precise without solving the exercise. – Renato Sanhueza Jan 07 '16 at 23:00
  • 1
    @user44576, you can not assume any specific pumping lemma constant, you are trying to show none works. – vonbrand Jan 23 '16 at 01:21