0
$\begingroup$

Given the language $L = \{ a^n | \text{n is odd} \}$

I'm looking for a word $w$ using $p \in \mathbb(N)$. For example, if it would be even, instead of odd I'd choose $w = a^{2p}$.

But with odd, I'm really struggling to find a word. What do I do? Define a variable $j$ and say $\text{j is odd}$ so $a^j \in L$

I know the language is regular but I still want to know how to handle the $odd$.

$\endgroup$

1 Answer 1

4
$\begingroup$

I have no idea what exactly you're asking, but if you consider $w = a^{2p}$ to be a valid answer for even-sized words, I assume $w = a^{2p+1}$ would be fine for odd words.

$\endgroup$
2
  • $\begingroup$ lol, thats exactly what I needed. $\endgroup$
    – Robert
    Commented Feb 13 at 13:21
  • 1
    $\begingroup$ @Robert I agree with this answer but I'd put more emphasis on the "I have no idea what you're asking" part. For some reason it seems you are unhappy about using the words "n is odd" in the notation for the language definition, as opposed to writing "2p + 1" without words. You should probably examine the reasons for this; words are fine; the only purpose of notation is to be understood. We often write "2p+1" because it's somewhat more concise than "n, where n is odd", but really, "n is odd" is fine and there is nothing wrong with using words to express things. $\endgroup$
    – Stef
    Commented Feb 13 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.