<p>The term used to describe such a concept is called &quot;string complement&quot;. Your language can be defined as:</p>
<p><span class="math-container">$L=\{ uv | u, v \in \{0,1\}^* \wedge v=u' \}$</span></p>
<p>Or simply:</p>
<p><span class="math-container">$L=\{ uu' | u \in \{0,1\}^* \}$</span></p>

CC BY-SA 4.0
2022-05-17T11:20:20.523Z
Thank you for the answer. This was my initial thought as well.
alyelalwany
CC BY-SA 4.0
2022-05-17T01:04:58.933Z
2022-05-17T01:04:58.933Z
davidbuzatto
<p>I have this question from my Automata class and I am unsure if there's a way to do this.
Assuming u,v ∈ {0,1}* and at every character in the word u, the character at the same position in the word v is the opposite of it.</p>
<h3>Example :</h3>
<p>if u is 0011 , v is 1100</p>
<p>if u is 0011011010 , v is 1100100101</p>
<p>I was first going with L = { uv | u,v ∈ {0,1}* and v=(u')} but I am not sure if this describes what I am saying.</p>
<p>Please help me understand this. Thank you!</p>

<context-free>
CFG - How can I describe a language that dictates a word and its opposite?
alyelalwany
# CFG - How can I describe a language that dictates a word and its opposite?

(Asked by: username_0 on 2022-05-16)

I have this question from my Automata class and I am unsure if there's a way to do this.
Assuming u,v ∈ {0,1}\* and at every character in the word u, the character at the same position in the word v is the opposite of it.

### Example :

if u is 0011 , v is 1100

if u is 0011011010 , v is 1100100101

I was first going with L = { uv | u,v ∈ {0,1}\* and v=(u')} but I am not sure if this describes what I am saying.

Please help me understand this. Thank you!

**Tags:** context-free


---

## 1 answers

### Answer by username_1 on 2022-05-17. Score: 1 | Accepted answer

The term used to describe such a concept is called "string complement". Your language can be defined as:

$L=\{ uv | u, v \in \{0,1\}^\* \wedge v=u' \}$

Or simply:

$L=\{ uu' | u \in \{0,1\}^\* \}$

> **Comments:**
> **username_0**: Thank you for the answer. This was my initial thought as well.  

---

