shuffle of languages

shuffle of languages

Let

Σ

be an

alphabet

and

u

,

v

words over

Σ

. A

shuffle

w

of

u

and

v

can be loosely defined as a word that is obtained by first decomposing

u

and

v

into

individual

pieces, and then combining (by

concatenation

) the pieces to form

w

, in a way that the order of the pieces in each of

u

and

v

is preserved.

More precisely, a

shuffle

of

u

and

v

is a word of the form

u

1

⁢

v

1

⁢

⋯

⁢

u

k

⁢

v

k

where

u

=

u

1

⁢

⋯

⁢

u

n

and

v

=

v

1

⁢

⋯

⁢

v

n

. In other words, a shuffle of

u

and

v

is either a

k

-

insertion

of either

u

into

v

or

v

into

u

, for some positive integer

k

.

The set of all shuffles of

u

and

v

is called

the

shuffle of

u

and

v

, and is denoted by

u

⋄

v

.

The shuffle

operation

can be more generally applied to

languages

. If

L

1

,

L

2

are languages, the shuffle of

L

1

and

L

2

, denoted by

L

1

⋄

L

2

, is the set of all shuffles of words in

L

1

and

L

2

. In short,

L

1

⋄

L

2

=

⋃

{

u

⋄

v

∣

u

∈

L

1

,

v

∈

L

2

}

.

Clearly,

u

⋄

v

=

{

u

}

⋄

{

v

}

. We shall also identify

L

⋄

u

and

u

⋄

L

with

L

⋄

{

u

}

and

{

u

}

⋄

L

respectively.

A language

L

is said to be

shuffle closed

if

L

⋄

L

⊆

L

. Clearly

Σ

*

is shuffle closed, and arbitrary

intersections

shuffle closed languages are shuffle closed. Given any language

L

, the smallest shuffle closed containing

L

is called the

shuffle

closure

of

L

, and is denoted by

L

⋄

.

It is easy to see that

⋄

is a

commutative

operation:

u

⋄

v

=

v

⋄

u

. It is also not hard to see that

⋄

is

associative

:

(

u

⋄

v

)

⋄

w

=

u

⋄

(

v

⋄

w

)

.

In

addition

, the shuffle operation has the following

recursive

property

: for any

u

,

v

over

Σ

, and any

a

,

b

∈

Σ

:

1.

u

⋄

λ

=

{

u

}

,

2.

λ

⋄

v

=

{

v

}

,

3.

u

⁢

a

⋄

v

⁢

b

=

(

u

⁢

a

⋄

v

)

⁢

{

b

}

∪

(

u

⋄

v

⁢

b

)

⁢

{

a

}

.

For example, suppose

u

=

a

⁢

b

⁢

a

,

v

=

b

⁢

a

⁢

b

. Then

u

⋄

v

=

[

a

⁢

b

⁢

a

⋄

b

⁢

a

]

⁢

{

b

}

∪

[

a

⁢

b

⋄

b

⁢

a

⁢

b

]

⁢

{

a

}

=

[

(

a

⁢

b

⁢

a

⋄

b

)

∪

(

a

⁢

b

⋄

b

⁢

a

)

]

⁢

{

a

⁢

b

}

∪

[

(

a

⁢

b

⋄

b

⁢

a

)

∪

(

a

⋄

b

⁢

a

⁢

b

)

]

⁢

{

b

⁢

a

}

=

(

a

⁢

b

⋄

b

⁢

a

)

⁢

{

a

⁢

b

,

b

⁢

a

}

∪

(

a

⁢

b

⁢

a

⋄

b

)

⁢

{

a

⁢

b

}

∪

(

a

⋄

b

⁢

a

⁢

b

)

⁢

{

b

⁢

a

}

=

{

a

b

b

a

,

b

a

a

b

,

a

b

a

b

,

b

a

b

a

}

{

a

b

,

b

a

}

∪

{

b

a

b

a

,

a

b

b

a

,

a

b

a

b

}

{

a

b

}

∪

{

a

b

a

b

,

b

a

a

b

,

b

a

b

a

}

{

b

a

}

=

{

a

b

b

a

,

b

a

a

b

,

a

b

a

b

,

b

a

b

a

}

{

a

b

,

b

a

}

=

{

a

b

b

a

a

b

,

b

a

a

b

a

b

,

a

b

a

b

a

b

,

b

a

b

a

a

b

,

a

b

b

a

b

a

,

b

a

a

b

b

a

,

a

b

a

b

b

a

,

b

a

b

a

b

a

}

Remark

. Some closure properties with respect to the shuffle operation: let

ℛ

be the family of

regular languages

, and

ℱ

the family of

context-free languages

. Then

ℛ

is closed under

⋄

.

ℱ

is not closed under

⋄

. However, if

L

1

∈

ℛ

and

L

2

∈

ℱ

, then

L

1

⋄

L

2

∈

ℱ

. The proofs of these closure properties can be found in the reference.

References

1

M. Ito,

Algebraic Theory of

Automata

and Languages

, World Scientific, Singapore (2004).

Title

shuffle of languages

Canonical

name

ShuffleOfLanguages

Date of creation

2013-03-22 18:56:16

Last modified on

2013-03-22 18:56:16

Owner

CWoo (3771)

Last modified by

CWoo (3771)

Numerical id

11

Author

CWoo (3771)

Entry type

Definition

Classification

msc 68Q70

Classification

msc 68Q45

Synonym

shuffle product

Synonym

shuffle-closed

Synonym

shuffle-closure

Related topic

PqShuffle

Related topic

DeletionOperationOnLanguages

Related topic

InsertionOperationOnLanguages

Defines

shuffle

Defines

shuffle closed

Defines

shuffle closure

Generated on Sat Feb 10 12:49:26 2018 by

LaTeXML