Rules of concatenation

652 Views Asked by At

I am studying for an exam, and have stumbled across the following statement which is marked as false: abab ∈ {a, b}{a, b}

My textbook defines concatenation as: "joining two input lists or strings of length m and n into one of length m+n by putting elements of the second list or string after those of the first."

How is this example false/not an example of proper concatenation? To me it seems perfectly legal.

For clarity, here is the information we are given to define concatenation/the notation used. + Continued explanation

2

There are 2 best solutions below

3
On

Assuming I have understood your definition, given two sets of strings $S$, $T$ we have $$ST := \{ st \mid s \in S, t \in T\}.$$ Note that $st$ denotes concatenation of the strings $s$ and $t$. For instance, if $s=apple$ and $t=pie$, $st=applepie$. In particular, $\{a,b\}\{a,b\}=\{aa,ab,ba,bb\}$. You cannot get a string of length $4$ from two strings of length $1$.

2
On

The definition says that if $S = \{a,b,c,d\}$ and $T=\{a,b,x,y\}$ then $ST:= abcdabxy$.

Or if $s = "rubbie", t="duckie"$ then $st = rubbieduckie$.

So $abab = \{a,b\}\{a,b\}$.

So $abab \in \{a,b\}\{a,b\}$ is false. $\{a,b\}\{a,b\}$ is not a set or a list and $abab = \{a,b\}\{a,b\}$ is not an element $abab = \{a,b\}\{a,b\}$.

It is NOT the case that $abab \in abab$.