Compatibility relations on codes and free monoids University of - - PowerPoint PPT Presentation

compatibility relations on codes and free monoids
SMART_READER_LITE
LIVE PREVIEW

Compatibility relations on codes and free monoids University of - - PowerPoint PPT Presentation

Tomi Krki Compatibility relations on codes and free monoids University of Turku and Turku Centre for Computer Science (TUCS) Introduction 2 Introduction 2 Introduction 2 Introduction 2 Introduction 2 Outline of Topics Word


slide-1
SLIDE 1

Tomi Kärki

Compatibility relations on codes and free monoids

University of Turku and Turku Centre for Computer Science (TUCS)

slide-2
SLIDE 2

2

Introduction

slide-3
SLIDE 3

2

Introduction

slide-4
SLIDE 4

2

Introduction

slide-5
SLIDE 5

2

Introduction

slide-6
SLIDE 6

2

Introduction

slide-7
SLIDE 7

3

Outline of Topics

  • Word relations
  • Relational codes
  • Minimal and maximal relations
  • Relationally free monoids and stability
  • Hulls
  • Defect effect
slide-8
SLIDE 8

4

Notations

A

an alphabet

ε

empty word

X

a set of words over A∗

R ⊆ X × X

a relation on X

x R y (x, y) ∈ R ιX {(x, x) | x ∈ X} ΩX {(x, y) | x, y ∈ X} R

reflexive and symmetric closure of R

RY R ∩ (Y × Y ) R(X) {u ∈ A∗ | ∃ x ∈ X : x R u}

slide-9
SLIDE 9

5

Word relations

  • compatibility relation = reflexive and symmetric
slide-10
SLIDE 10

5

Word relations

  • compatibility relation = reflexive and symmetric
  • word relation R = compatibility relation and

a1 · · · am R b1 · · · bn ⇔ m = n and ai R bi for all i = 1, 2, . . . , m

where a1, . . . , am, b1, . . . , bn ∈ A

slide-11
SLIDE 11

5

Word relations

  • compatibility relation = reflexive and symmetric
  • word relation R = compatibility relation and

a1 · · · am R b1 · · · bn ⇔ m = n and ai R bi for all i = 1, 2, . . . , m

where a1, . . . , am, b1, . . . , bn ∈ A

  • If u R v, then words u and v are R-compatible
slide-12
SLIDE 12

5

Word relations

  • compatibility relation = reflexive and symmetric
  • word relation R = compatibility relation and

a1 · · · am R b1 · · · bn ⇔ m = n and ai R bi for all i = 1, 2, . . . , m

where a1, . . . , am, b1, . . . , bn ∈ A

  • If u R v, then words u and v are R-compatible
  • multiplicativity:

u R v, u′ R v′ ⇒ uu′ R vv′,

simplifiability:

uu′ R vv′, |u| = |v| ⇒ u R v, u′ R v′

slide-13
SLIDE 13

6

Word relations

Example 1.

A = {a, b, c} R = {(a, b)} = {(a, a), (b, b), (c, c), (a, b), (b, a)}

slide-14
SLIDE 14

6

Word relations

Example 1.

A = {a, b, c} R = {(a, b)} = {(a, a), (b, b), (c, c), (a, b), (b, a)} abba R baab

slide-15
SLIDE 15

6

Word relations

Example 1.

A = {a, b, c} R = {(a, b)} = {(a, a), (b, b), (c, c), (a, b), (b, a)} abba R baab abc R cbc

slide-16
SLIDE 16

6

Word relations

Example 1.

A = {a, b, c} R = {(a, b)} = {(a, a), (b, b), (c, c), (a, b), (b, a)} abba R baab abc R cbc

Example 2.

slide-17
SLIDE 17

6

Word relations

Example 1.

A = {a, b, c} R = {(a, b)} = {(a, a), (b, b), (c, c), (a, b), (b, a)} abba R baab abc R cbc

Example 2. Partial words

slide-18
SLIDE 18

6

Word relations

Example 1.

A = {a, b, c} R = {(a, b)} = {(a, a), (b, b), (c, c), (a, b), (b, a)} abba R baab abc R cbc

Example 2. Partial words

k n♦w l ♦ dg e ♦n o w♦♦dg♦ k n o w l e dg e

slide-19
SLIDE 19

6

Word relations

Example 1.

A = {a, b, c} R = {(a, b)} = {(a, a), (b, b), (c, c), (a, b), (b, a)} abba R baab abc R cbc

Example 2. Partial words

k n♦w l ♦ dg e ♦n o w♦♦dg♦ k n o w l e dg e R↑ = {(♦, a) | a ∈ A}

slide-20
SLIDE 20

7

Relational codes

  • Let R and S be word relations
slide-21
SLIDE 21

7

Relational codes

  • Let R and S be word relations
  • X ⊆ A∗ is an (R, S)-code if for all n, m ≥ 1 and

x1, . . . , xm, y1, . . . , yn ∈ X, we have x1 · · · xm R y1 · · · yn ⇒ n = m and xi S yi for i = 1, 2, . . . , m

slide-22
SLIDE 22

7

Relational codes

  • Let R and S be word relations
  • X ⊆ A∗ is an (R, S)-code if for all n, m ≥ 1 and

x1, . . . , xm, y1, . . . , yn ∈ X, we have x1 · · · xm R y1 · · · yn ⇒ n = m and xi S yi for i = 1, 2, . . . , m

  • (R, S)-code

relational code

(R, ι)-code

strong R-code

(R, R)-code

weak R-code

(ι, ι)-code

code

slide-23
SLIDE 23

8

Relational codes

Example.

A = {a, b, c} X = {ab, c} S = ι R = ι R = {(a, c)} R = {(a, c), (b, c)}

slide-24
SLIDE 24

8

Relational codes

Example.

A = {a, b, c} X = {ab, c} S = ι R = ι

(prefix) code

R = {(a, c)} R = {(a, c), (b, c)}

slide-25
SLIDE 25

8

Relational codes

Example.

A = {a, b, c} X = {ab, c} S = ι R = ι

(prefix) code

R = {(a, c)} (R, ι)-code R = {(a, c), (b, c)}

slide-26
SLIDE 26

8

Relational codes

Example.

A = {a, b, c} X = {ab, c} S = ι R = ι

(prefix) code

R = {(a, c)} (R, ι)-code R = {(a, c), (b, c)} ab R c.c

slide-27
SLIDE 27

9

Relational codes

x1 · · · xm R y1 · · · yn ⇒ n = m and xi S yi for i = 1, 2, . . . , m

slide-28
SLIDE 28

9

Relational codes

x1 · · · xm R y1 · · · yn ⇒ n = m and xi S yi for i = 1, 2, . . . , m

ι . . . R1 R2 . . . Ω ι . . . S1 S2 . . . Ω

slide-29
SLIDE 29

9

Relational codes

x1 · · · xm R y1 · · · yn ⇒ n = m and xi S yi for i = 1, 2, . . . , m

ι . . . R1 R2 . . . Ω ι . . . S1 S2 . . . Ω

Theorem 3. Every (R, S)-code X is a code.

slide-30
SLIDE 30

9

Relational codes

x1 · · · xm R y1 · · · yn ⇒ n = m and xi S yi for i = 1, 2, . . . , m

ι . . . R1 R2 . . . Ω ι . . . S1 S2 . . . Ω

Theorem 3. Every (R, S)-code X is a code. Theorem 4. Let X be a subset of A∗. X is an (R, S)-code ⇔ X is an (R, R)-code and RX ⊆ SX.

slide-31
SLIDE 31

10

Modified Sardinas-Patterson algorithm

slide-32
SLIDE 32

10

Modified Sardinas-Patterson algorithm

  • finite X ⊆ A+
slide-33
SLIDE 33

10

Modified Sardinas-Patterson algorithm

  • finite X ⊆ A+
  • U1 = R(X)−1X \ {ε}
slide-34
SLIDE 34

10

Modified Sardinas-Patterson algorithm

  • finite X ⊆ A+
  • U1 = R(X)−1X \ {ε}
  • Un+1 = R(X)−1Un ∪ R(Un)−1X for n ≥ 1
slide-35
SLIDE 35

10

Modified Sardinas-Patterson algorithm

  • finite X ⊆ A+
  • U1 = R(X)−1X \ {ε}
  • Un+1 = R(X)−1Un ∪ R(Un)−1X for n ≥ 1
  • Let i ≥ 2 satisfy Ui = Ui−t for some t > 0
slide-36
SLIDE 36

10

Modified Sardinas-Patterson algorithm

  • finite X ⊆ A+
  • U1 = R(X)−1X \ {ε}
  • Un+1 = R(X)−1Un ∪ R(Un)−1X for n ≥ 1
  • Let i ≥ 2 satisfy Ui = Ui−t for some t > 0
  • X is a weak R-code if and only if

ε ∈

i−1

  • j=1

Uj

slide-37
SLIDE 37

11

Modified Sardinas-Patterson algorithm

Example.

A = {a, b, c} X = {abb, ca, c} R = {(a, b), (b, c)}

slide-38
SLIDE 38

11

Modified Sardinas-Patterson algorithm

Example.

A = {a, b, c} X = {abb, ca, c} R = {(a, b), (b, c)} U1 = R(X)−1X \ {ε} = {a}

slide-39
SLIDE 39

11

Modified Sardinas-Patterson algorithm

Example.

A = {a, b, c} X = {abb, ca, c} R = {(a, b), (b, c)} U1 = R(X)−1X \ {ε} = {a} U2 = R(X)−1U1 ∪ R(U1)−1X = ∅ ∪ {bb}

slide-40
SLIDE 40

11

Modified Sardinas-Patterson algorithm

Example.

A = {a, b, c} X = {abb, ca, c} R = {(a, b), (b, c)} U1 = R(X)−1X \ {ε} = {a} U2 = R(X)−1U1 ∪ R(U1)−1X = ∅ ∪ {bb} U3 = R(X)−1U2 ∪ R(U2)−1X = {ε, b} ∪ {ε, b}

slide-41
SLIDE 41

11

Modified Sardinas-Patterson algorithm

Example.

A = {a, b, c} X = {abb, ca, c} R = {(a, b), (b, c)} U1 = R(X)−1X \ {ε} = {a} U2 = R(X)−1U1 ∪ R(U1)−1X = ∅ ∪ {bb} U3 = R(X)−1U2 ∪ R(U2)−1X = {ε, b} ∪ {ε, b} = ⇒ X is not an (R, R)-code ca.ca R c.abb

slide-42
SLIDE 42

12

Minimal and maximal relations

S ∈ Smin(X, R) : X is an (R, S)-code ∀S′⊂ S : X is not an (R, S′)-code

slide-43
SLIDE 43

12

Minimal and maximal relations

S ∈ Smin(X, R) : X is an (R, S)-code ∀S′⊂ S : X is not an (R, S′)-code S ∈ Smax(X, R) : X is an (R, S)-code ∀S′⊃ S : X is not an (R, S′)-code R ∈ Rmin(X, S) : X is an (R, S)-code ∀R′⊂ R : X is not an (R′, S)-code R ∈ Rmax(X, S) : X is an (R, S)-code ∀R′⊃ R : X is not an (R′, S)-code

slide-44
SLIDE 44

12

Minimal and maximal relations

S ∈ Smin(X, R) : X is an (R, S)-code ∀S′⊂ S : X is not an (R, S′)-code S ∈ Smax(X, R) : X is an (R, S)-code ∀S′⊃ S : X is not an (R, S′)-code R ∈ Rmin(X, S) : X is an (R, S)-code ∀R′⊂ R : X is not an (R′, S)-code R ∈ Rmax(X, S) : X is an (R, S)-code ∀R′⊃ R : X is not an (R′, S)-code

  • Smax(X, R) = {Ω}
slide-45
SLIDE 45

12

Minimal and maximal relations

S ∈ Smin(X, R) : X is an (R, S)-code ∀S′⊂ S : X is not an (R, S′)-code S ∈ Smax(X, R) : X is an (R, S)-code ∀S′⊃ S : X is not an (R, S′)-code R ∈ Rmin(X, S) : X is an (R, S)-code ∀R′⊂ R : X is not an (R′, S)-code R ∈ Rmax(X, S) : X is an (R, S)-code ∀R′⊃ R : X is not an (R′, S)-code

  • Smax(X, R) = {Ω}
  • Rmin(X, S) = {ι}
slide-46
SLIDE 46

13

Minimal and maximal relations

  • Smin(X, R) is a unique element
slide-47
SLIDE 47

13

Minimal and maximal relations

  • Smin(X, R) is a unique element
  • finding Smin(X, R) easy
slide-48
SLIDE 48

13

Minimal and maximal relations

  • Smin(X, R) is a unique element
  • finding Smin(X, R) easy
  • Rmax(X, S) can contain relations of different size
slide-49
SLIDE 49

13

Minimal and maximal relations

  • Smin(X, R) is a unique element
  • finding Smin(X, R) easy
  • Rmax(X, S) can contain relations of different size
  • finding Rmax(X, S) hard for arbitrary alphabets
slide-50
SLIDE 50

13

Minimal and maximal relations

  • Smin(X, R) is a unique element
  • finding Smin(X, R) easy
  • Rmax(X, S) can contain relations of different size
  • finding Rmax(X, S) hard for arbitrary alphabets

Problem: MAXIMAL RELATION Instance:

X ⊆ A+, relation S, k ∈ N

Question: Is max. size of R ∈ Rmax(X, S) ≥ k?

slide-51
SLIDE 51

13

Minimal and maximal relations

  • Smin(X, R) is a unique element
  • finding Smin(X, R) easy
  • Rmax(X, S) can contain relations of different size
  • finding Rmax(X, S) hard for arbitrary alphabets

Problem: MAXIMAL RELATION Instance:

X ⊆ A+, relation S, k ∈ N

Question: Is max. size of R ∈ Rmax(X, S) ≥ k? NP-complete

slide-52
SLIDE 52

14

Relationally free monoids

A monoid M ⊆ A∗ is (R, S)-free if it has a subset B ⊆ M (called an (R, S)-base of M) such that

(i) M = B∗, (ii) B is an (R, S)-code.

slide-53
SLIDE 53

14

Relationally free monoids

A monoid M ⊆ A∗ is (R, S)-free if it has a subset B ⊆ M (called an (R, S)-base of M) such that

(i) M = B∗, (ii) B is an (R, S)-code.

Theorem 5. X is (R, S)-code ⇔ X∗ is (R, S)-free with minimal generating set X Theorem 6. M is (R, S)-free ⇔ M is (R, R)-free and RB ⊆ SB for the base B

slide-54
SLIDE 54

15

Stability

A monoid M ⊆ A∗ is (R, S)-stable if ∀u, v, w, u′, v′, w′ ∈ A∗:

u w v

  • ∈ M

∈ M u′ w′ v′

  • ∈ M

∈ M R R R

⇒u, w ∈ M, u S u′

slide-55
SLIDE 55

16

Stability

Theorem 7 (Generalized Sch¨ utzenberger’s criterium).

M is (R, S)-free ⇔ M is (R, S)-stable

slide-56
SLIDE 56

16

Stability

Theorem 7 (Generalized Sch¨ utzenberger’s criterium).

M is (R, S)-free ⇔ M is (R, S)-stable

Theorem 8 (Generalized Tilson’s result). Any nonempty intersection of (R, S)-free monoids of A∗ is (R, S)-free.

slide-57
SLIDE 57

17

Hulls

  • F(R,S)(X) = {M | X∗ ⊆ M ⊆ A∗, M is (R, S)-free}
slide-58
SLIDE 58

17

Hulls

  • F(R,S)(X) = {M | X∗ ⊆ M ⊆ A∗, M is (R, S)-free}
  • If F(R,S)(X) = ∅, then there exists

F(R,S)(X) =

  • M∈F(R,S)(X)

M

slide-59
SLIDE 59

17

Hulls

  • F(R,S)(X) = {M | X∗ ⊆ M ⊆ A∗, M is (R, S)-free}
  • If F(R,S)(X) = ∅, then there exists

F(R,S)(X) =

  • M∈F(R,S)(X)

M

  • F(R,S)(X) is the (R, S)-free hull of X
slide-60
SLIDE 60

17

Hulls

  • F(R,S)(X) = {M | X∗ ⊆ M ⊆ A∗, M is (R, S)-free}
  • If F(R,S)(X) = ∅, then there exists

F(R,S)(X) =

  • M∈F(R,S)(X)

M

  • F(R,S)(X) is the (R, S)-free hull of X
  • Theorem 9. Let FR = F(R,R)(X).

F(R,S)(X) exists ⇔ RFR ⊆ SFR. Then F(R,S)(X) = FR.

slide-61
SLIDE 61

18

Hulls

Cf(X) = {(u, v) ∈ X × X | (u, v) ∈ R, uX∗ ∩ R(vX∗) = ∅}.

Algorithm 1 (Base of (R, R)-free hull Af). Input: finite X ⊆ A+. Set X0 = X, and iterate for j ≥ 0.

  • 1. Choose (u, v) ∈ Cf(Xj, R) such that u = u′u′′, where

|u′| = |v| and u′′ ∈ A+. If no such pair exists, then stop and

return Af(X) = Xj.

  • 2. Set R′(u) = {pref|u′|(w) | w ∈ (RXj)+(u)} and set

R′′(u) = {suf|u′′|(w) | w ∈ (RXj)+(u)}, where (RXj)+ is

the transitive closure of RXj.

  • 3. Set Xj+1 =
  • Xj \ (RXj)+(u)
  • ∪ R′(u) ∪ R′′(u).
slide-62
SLIDE 62

19

Defect effect

Theorem (Defect theorem). Let X ⊆ A+ be a finite set and let B be the base of the free hull of X. Then |B| ≤ |X|, and the equality holds if and only if X is a code.

slide-63
SLIDE 63

19

Defect effect

Theorem (Defect theorem). Let X ⊆ A+ be a finite set and let B be the base of the free hull of X. Then |B| ≤ |X|, and the equality holds if and only if X is a code.

  • GR(X) = (V, E): V = X, (u, v) ∈ E ⇔ u R v
  • c(X, R) = the number of connected components of GR(X).
slide-64
SLIDE 64

19

Defect effect

Theorem (Defect theorem). Let X ⊆ A+ be a finite set and let B be the base of the free hull of X. Then |B| ≤ |X|, and the equality holds if and only if X is a code.

  • GR(X) = (V, E): V = X, (u, v) ∈ E ⇔ u R v
  • c(X, R) = the number of connected components of GR(X).

Theorem 11 (Generalized defect theorem). Let X be a finite subset of A∗ and let B be the base of the (R, R)-free hull of X. Then c(B, R) ≤ c(X, R), and the equality holds if and only if X is an (R, R)-code.

slide-65
SLIDE 65

20

Defect effect

  • pcodes: (R↑, ι)-codes over A♦
slide-66
SLIDE 66

20

Defect effect

  • pcodes: (R↑, ι)-codes over A♦
  • pfree: monoid is generated by a pcode
slide-67
SLIDE 67

20

Defect effect

  • pcodes: (R↑, ι)-codes over A♦
  • pfree: monoid is generated by a pcode

Corollary 1 (Defect theorem of partial words). Let X be a finite set

  • f partial words, i.e., a set of words over the alphabet A♦. Suppose

that pfree hull of X exists and let B be its base. Then |B| ≤ |X|, and the equality holds if and only if X is a pcode.

slide-68
SLIDE 68

21

References

[1] J. Berstel and L. Boasson, Partial words and a theorem of Fine and Wilf. Theoret.

  • Comput. Sci. 218, 135–141, 1999.

[2] J. Berstel and D. Perrin, Theory of Codes. Academic press, New York, 1985. [3] J. Berstel, D. Perrin, J.F . Perrot and A. Restivo, Sur le théorème du défaut. J. Algebra 60, 169–180, 1979. [4] F . Blanchet-Sadri, Codes, orderings, and partial words. Theoret. Comput. Sci. 329, 177–202, 2004. [5] F . Blanchet-Sadri and M. Moorefield, Pcodes of partial words. Manuscript, 2005. [6] M. Crochemore and W. Rytter, Jewels of Stringology. World Scientific Publishing, 2002.

slide-69
SLIDE 69

22

References

[7] M.R. Garey and D.S. Johnson, Computer and Intractability: A Guide to the Theory

  • f NP-Completeness. Freeman, New York, 1979.

[8] V. Halava, T. Harju and T. Kärki, Relational codes of words, TUCS Tech. Rep. 767, Turku Centre for Computer Science, Finland, 1–16, April 2006. [9] V. Halava, T. Harju and T. Kärki, Defect theorems with compatibility relations, TUCS Tech. Rep. 778, Turku Centre for Computer Science, Finland, 1–26, August 2006. [10] T. Harju and J. Karhumäki, Many aspects of Defect Theorems. Theor. Comput.

  • Sci. 324, 35–54, 2004.

[11] A.A. Sardinas and G.W. Patterson, A necessary and sufficient condition for the unique decomposition of coded messages. IRE Internat. Conv. Rec. 8, 104–108, 1953. [12] B. Tilson, The intersection of free submonoids of free monoids is free. Semigroup forum 4, 345–350, 1972.