A q-matrix Encoding Extending the Parikh Matrix Mapping

Similar documents
Independence of certain quantities indicating subword occurrences

On Stateless Multicounter Machines

Multitape NFA: Weak Synchronization of the Input Heads

International Journal of Foundations of Computer Science Two-dimensional Digitized Picture Arrays and Parikh Matrices

Parikh s theorem. Håkan Lindqvist

Hierarchy Results on Stateless Multicounter 5 3 Watson-Crick Automata

A note on the decidability of subword inequalities

Characterizations of Catalytic Membrane Computing Systems

F. Blanchet-Sadri and F.D. Gaddis, "On a Product of Finite Monoids." Semigroup Forum, Vol. 57, 1998, pp DOI: 10.

Substitutions, Trajectories and Noisy Channels

Some decision problems on integer matrices

Decision Problems Concerning. Prime Words and Languages of the

Automata on linear orderings

Restricted ambiguity of erasing morphisms

Weak Synchronization & Synchronizability. Multi-tape Automata and Machines

Characterizations of Catalytic Membrane Computing Systems?

Note On Parikh slender context-free languages

q-counting hypercubes in Lucas cubes

Insertion operations: closure properties

A Survey of Results on Stateless Multicounter Automata

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

Monomial orderings, rewriting systems, and Gröbner bases for the commutator ideal of a free algebra

Matrix Arithmetic. j=1

Composability of Infinite-State Activity Automata

On P Systems with Active Membranes

ON STATELESS AUTOMATA AND P SYSTEMS

On the Simplification of HD0L Power Series

Note Watson Crick D0L systems with regular triggers

Automata with modulo counters and nondeterministic counter bounds

Invertible insertion and deletion operations

New Complexity Results for Some Linear Counting Problems Using Minimal Solutions to Linear Diophantine Equations

The commutation with ternary sets of words

State Complexity of Neighbourhoods and Approximate Pattern Matching

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Aperiodic languages and generalizations

DESCRIPTIONAL COMPLEXITY OF NFA OF DIFFERENT AMBIGUITY

ON HIGHLY PALINDROMIC WORDS

Rings, Integral Domains, and Fields

9. Integral Ring Extensions

Morphically Primitive Words (Extended Abstract)

The Parikh image of languages and linear constraints

P Finite Automata and Regular Languages over Countably Infinite Alphabets

Harvard CS 121 and CSCI E-207 Lecture 6: Regular Languages and Countability

Descriptional Complexity of Formal Systems (Draft) Deadline for submissions: April 20, 2009 Final versions: June 18, 2009

THREE LECTURES ON QUASIDETERMINANTS

Results on Transforming NFA into DFCA

TOPOLOGICAL COMPLEXITY OF 2-TORSION LENS SPACES AND ku-(co)homology

Identities in upper triangular tropical matrix semigroups and the bicyclic monoid

P systems based on tag operations

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

Complexity of Reachability, Mortality and Freeness Problems for Matrix Semigroups

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

The exact complexity of the infinite Post Correspondence Problem

Finite Automata, Palindromes, Powers, and Patterns

A shrinking lemma for random forbidding context languages

P Systems with Symport/Antiport of Rules

Scalar ambiguity and freeness in matrix semigroups over bounded languages

Notes on the Matrix-Tree theorem and Cayley s tree enumerator

ON THE STAR-HEIGHT OF SUBWORD COUNTING LANGUAGES AND THEIR RELATIONSHIP TO REES ZERO-MATRIX SEMIGROUPS

Theory of Computation 4 Non-Deterministic Finite Automata

Groups. 3.1 Definition of a Group. Introduction. Definition 3.1 Group

Theory of Computation 8 Deterministic Membership Testing

Reverse mathematics of some topics from algorithmic graph theory

Valence automata as a generalization of automata with storage

Matrix Operations. Linear Combination Vector Algebra Angle Between Vectors Projections and Reflections Equality of matrices, Augmented Matrix

Mathematical Reasoning & Proofs

Some constructions of integral graphs

Section Summary. Relations and Functions Properties of Relations. Combining Relations

Probabilistic Aspects of Computer Science: Probabilistic Automata

22m:033 Notes: 3.1 Introduction to Determinants

ON PARTITIONS SEPARATING WORDS. Formal languages; finite automata; separation by closed sets.

Hierarchy among Automata on Linear Orderings

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

1 Matrices and matrix algebra

Linear Systems and Matrices

Binary Image Reconstruction Based on Prescribed Numerical Information

Recognition of Deterministic ETOL Languages in Logarithmic Space

Congruence Boolean Lifting Property

On Stateless Automata and P Systems

Deletion operations: closure properties

MATH 433 Applied Algebra Lecture 22: Semigroups. Rings.

On closures of lexicographic star-free languages. E. Ochmański and K. Stawikowska

Reversal-Bounded Counter Machines Revisited

Powers and Products of Monomial Ideals

1. Introduction. Let C be a Waldhausen category (the precise definition

Determinants of Partition Matrices

JORDAN NORMAL FORM. Contents Introduction 1 Jordan Normal Form 1 Conclusion 5 References 5

Incompleteness Theorems, Large Cardinals, and Automata ov

Reversal of Regular Languages and State Complexity

Nondeterministic Finite Automata

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

A hyperfactorial divisibility Darij Grinberg *long version*

Words generated by cellular automata

Words with the Smallest Number of Closed Factors

Section-A. Short Questions

Avoiding Large Squares in Infinite Binary Words

Mergible States in Large NFA

DERIVATIONS. Introduction to non-associative algebra. Playing havoc with the product rule? BERNARD RUSSO University of California, Irvine

Automata Theory and Formal Grammars: Lecture 1

The Accepting Power of Finite. Faculty of Mathematics, University of Bucharest. Str. Academiei 14, 70109, Bucharest, ROMANIA

Transcription:

Proceedings of ICCC 2004, Băile Felix Spa-Oradea, Romania pp 147-153, 2004 A q-matrix Encoding Extending the Parikh Matrix Mapping Ömer Eğecioğlu Abstract: We introduce a generalization of the Parikh mapping called the Parikh q-matrix encoding, which takes its values in matrices with polynomial entries The encoding represents a word w over a k-letter alphabet as a (k +1)-dimensional upper-triangular matrix with entries that are nonnegative integral polynomials in variable q Putting q =1, we obtain the morphism introduced by Mateescu, Salomaa, Salomaa, and Yu [6] which extends the Parikh mapping to (k +1)-dimensional (numerical) matrices The Parikh q-matrix encoding however, produces matrices that carry more information about w than the numerical Parikh matrix In fact it is injective The entries of the q-matrix image of w under this encoding is constructed by q-counting the number of occurrences of certain words as scattered subwords of w This construction is distinct from the Parikh q-matrix mapping into k-dimensional upper-triangular matrices with integral polynomial entries introduced by Eğecioğlu and Ibarra [2] Keywords: Parikh mapping, Parikh matrix mapping, scattered subword, q-analogue 1 Introduction By Parikh s theorem [7], the commutative image of any context-free language is a semilinear set, and is therefore also the commutative image of some regular set Consider the (ordered) alphabet Σ k = {a 1 < a 2 < < a k } and for w Σ, define by w ai the number of occurrences of a i in w The Parikh mapping is a morphism Ψ : Σ IN k where IN is the set of nonnegative integers and Ψ(w) =( w a1, w a2,, w ak ) is the Parikh vector The Parikh mapping is an important concept in the theory of formal languages Various languages accepted by automata that are more powerful than pushdown automata have been shown to have effectively computable semilinear sets For example, it is known that every language accepted by a pushdown automaton augmented with reversal-bounded counters has a semilinear Parikh map [4] The fact that the emptiness problem for semilinear sets is decidable implies that the emptiness problem for these automata is decidable This fact has a number of applications in formal languages (eg, [3]) and formal verification (eg, [5]) The Parikh matrix mapping introduced in [6] is a morphism Ψ Mk : Σ M k+1 where M k+1 is a collection of (k +1)-dimensional upper-triangular matrices with nonnegative integral entries and unit diagonal The classical Parikh vector Ψ(w) appears in the image matrix as the second diagonal In [2] the Parikh q-matrix mapping was introduced It is a morphism Ψ k q : Σ M k (q) where M k (q) is a collection of k-dimensional upper-triangular matrices with nonnegative integral polynomials in q as entries The diagonal entries of Ψ k q(w) are (q w a 1,q w a2,,q w ak ) which readily encodes the Parikh vector In addition, it can be shown [2] that viewing w Σ k as a word in Σ k+1 with w ak+1 =0, the Parikh q-matrix Ψ k+1 q (w) evaluated at q =1is precisely the (k +1)-dimensional numerical Parikh matrix Ψ Mk (w) It is a basic property of the Parikh matrix mapping that two words with the same Parikh matrix have the same Parikh vector, but two words with the same Parikh vector in many cases have different Parikh matrices [1] Thus, the Parikh matrix gives more information about a word than a Parikh vector Similarly, two words with the same Parikh q-matrix have the same Parikh matrix (and therefore the same Parikh vector), but there are cases in which two words with the same Parikh matrix have different q-matrices Thus the Parikh q-matrix gives more information about a word than the Parikh matrix We show that the Parikh q-matrix encoding introduced here is injective, and for q =1, it also reduces to the (k +1)-dimensional numerical Parikh matrix mapping The basic idea in the construction of the entries of the Parikh q-matrix encoding of w is q-counting the number of occurrences of certain words as scattered subwords of w This is done by keeping track of the indices (positions) of the letters of the scattered subword in w as exponents of monomials in q

148 Ömer Eğecioğlu The structure of this paper is as follows Sections 2 gives some basic notation and definitions Section 3 recalls the notion of a Parikh matrix mapping introduced in [6] and the fundamental theorem concerning these mappings Section 4 presents the polynomials which generalize the count of scattered subwords Section 5 presents our Parikh q-matrix encoding and the main results, including Theorem 2, which gives the main properties of the encoding Section 6 looks at properties such as injectivity and gives an interpretation of the inverse matrix in terms of mirror images 2 Definitions We start with some basic notation and definitions Most of these are as they appear in references [6, 1, 2] The set of all nonnegative integers is denoted by IN We denote by IN[q] the collection of polynomials in the variable q with coefficients from IN Z denotes integers, and Z[q] denotes the ring of polynomials in the variable q with integral coefficients For an alphabet Σ, we denote the set of all words over Σ by Σ and the empty word by λ We use ordered alphabets An ordered alphabet is an alphabet Σ={a 1, a 2,,a k } with a relation of order ( < ) on it If for instance a 1 <a 2 < <a k, then we use the notation Σ={a 1 < a 2 < < a k } If w Σ then w denotes the length of w Fora i Σ and w Σ the number of occurrences of the letter a i in w is denoted by w ai Let v, w be words over Σ As defined in [6], the word v is called a scattered subword of w if there exists a word u such that w u v, where denotes the shuffle operation If v, w Σ, then the number of occurrences of v in w as a scattered subword is denoted by w scatt v Partially overlapping occurrences of a word as a scattered subword of a word are counted as distinct occurrences For example, acbb scatt ab =2, acba scatt ab =1 Notation We also use the symbol P w,v to denote w scatt v Using this notation, P acbb,ab =2, P acba,ab =1, and P w,ai = w ai for any letter a i Σ Notation Consider the ordered alphabet {a 1 <a 2 < <a k } where k 1 As in [6], we denote by the symbol a i,j the word a i a i+1 a j where 1 i j k For motivation and further issues about the Parikh mapping as well as language-theoretic notions not considered here, we refer the reader to [8] 3 Parikh matrix mapping We first describe the extension of the Parikh mapping to matrices as originally defined in [6] The extension involves special types of triangular matrices These are square matrices m =(m i,j ) 1 i,j k such that m i,j IN, for all 1 i, j k, m i,j =0, for all 1 j<i k, and moreover, m i,i =1, for all 1 i k The set of all these matrices of dimension k is denoted by M k Thus M k is the collection k k upper-triangular matrices with entries from IN and unit diagonal The set M k is a monoid with respect to multiplication of matrices and has a unit which is the identity matrix I k The main notion introduced in [6] is as follows: Definition 3 Let Σ={a 1 < a 2 < < a k } be an ordered alphabet, where k 1 The Parikh matrix mapping, denoted by Ψ Mk, is the morphism: Ψ Mk : Σ M k+1, defined as follows: If Ψ Mk (a l )=(m i,j ) 1 i,j (k+1), then for each 1 i k +1, m i,i =1, m l,l+1 =1and all other elements of the matrix Ψ Mk (a l ) are zero Example 31 Let Σ be the ordered alphabet {a <b<c} Then the Parikh matrix mapping Ψ M3 represents each word over Σ as a 4 4 upper triangular matrix with unit diagonal with nonnegative integral entries As an example Ψ M3 (ab 2 )=Ψ M3 (a)ψ M3 (b)ψ M3 (b) Thus Ψ M3 (ab 2 )= 1 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 = 1 1 2 0 0 1 2 0

A q-matrix Encoding Extending the Parikh Matrix Mapping 149 Furthermore Ψ M3 (ab 2 ac 2 a)= 1 1 2 0 0 1 2 0 Ψ M 3 (a)ψ M3 (c)ψ M3 (c)ψ M3 (a) = The main property of the Parikh matrix mapping is the following theorem: 1 3 2 4 0 1 2 4 0 0 1 2 (1) Theorem 1 ([6], Theorem 31) Let Σ={a 1 < a 2 < < a k } be an ordered alphabet, where k 1 and assume that w Σ The matrix Ψ Mk (w) =(m i,j ) 1 i,j (k+1), has the following properties 1 m i,j =0, for all 1 j<i k +1, 2 m i,i =1, for all 1 i k +1, 3 m i,j+1 = P w,ai,j, for all 1 i j k As a corollary Corollary 1 ([6], Corollary 31) Let Σ={a 1 < a 2 < < a k } The matrix Ψ Mk (w) has as its the second diagonal the Parikh vector of w, ie, (m 1,2,m 2,3,,m k,k+1 )=Ψ(w) =( w a1, w a2,, w ak ) 4 Index enumerator of scattered subwords Next we introduce a collection of polynomials P w,ai,j (q) indexed by w Σ, and a i,j = a i a i+1 a j, with 1 i j k These polynomials will q-count the numbers P w,ai,j defined above for general v and w To construct P w,ai,j (q), we consider a factorization with u s Σ for i s j +1 The numbers w = u i a i u i+1 a i+1 u j a j u j+1 (2) I i = u i +1,I i+1 = u i + u i+1 +2,, I j = u i + u i+1 + + u j + j i +1 (3) are simply the indices (positions) in w where the letters a i,a i+1,a j appear respectively, in the factorization (2) To construct the polynomial P w,ai,j (q), we form the monomial Ii+Ii+1 +Ij q (4) in IN[q] corresponding to each such factorization, and add up the resulting monomials Thus P w,ai,j (q) = w=u ia iu i+1 u ja ju j +1 q Ii+Ii+1+ +Ij where the exponents are the indices of a i,a i+1,a j in w as given in (3) (5) Example 41 Suppose Σ={a < b < c} and w = ab 2 ac 2 a If i =1,j =3, then a i,j = abc and writing the indices and underlining the positions of a, b and c for each appearance of abc as a scattered subword of w, we obtain Consequently 1 2 3 4 5 6 7 P ositions Contribution Factorization : a b b a c c a 1, 2, 5 q 8 Factorization : a b b a c c a 1, 2, 6 q 9 Factorization : a b b a c c a 1, 3, 5 q 9 Factorization : a b b a c c a 1, 3, 6 q 10 Similarly, we find that P w,abc (q) =q 8 +2q 9 + q 10 P w,a (q) = q + q 4 + q 7 P w,ab (q) = q 3 + q 4 P w,b (q) = q 2 + q 3 P w,ac (q) = q 7 + q 8 P w,c (q) = q 5 + q 6 P w,bc (q) = q 7 +2q 8 + q 9

150 Ömer Eğecioğlu Since the summation in the definition (5) of P w,ai,j (q) is over all occurrences of a i,j in w as a scattered subword, the following proposition is immediate: Proposition 1 Let Σ={a 1 < a 2 < < a k } and 1 i j k Then P w,ai,j (1) = P w,ai,j (= w scatt ai,j ) Thus the polynomials P w,ai,j (q) q-count the number of occurrences of a i a i+1 a j as a scattered subword of w 5 The Parikh q-matrix encoding We denote by M k (q) the collection of k-dimensional upper-triangular matrices with entries in IN[q] Let I k denote the identity matrix of dimension k We define a mapping Ψ:Σ IN M k+1 (q) as follows The matrix Ψ(a l,j) corresponding to a pair a l Σ={a 1 < a 2 < < a k } and j IN, is defined as the matrix obtained from I k+1 by changing the (l, l+1)-st entry in I k+1 to q j Thus if Ψ(a l,j)=(m i,j ) 1 i,j k+1, then m i,i =1for 1 i k +1, m l,l+1 = q j, and all other entries of the matrix Ψ(a l,j) are zero Example 51 When the alphabet is Σ={a < b < c}, 1 q j 0 0 Ψ(a, j) = 0 1 0 0, Ψ(b, j) = 0 1 q j 0, Ψ(c, j) = 0 1 0 0 0 0 1 q j Remark 2 The matrix Ψ(a l,j) differs from the matrix Ψ(a l ) introduced in [6] in the definition of the Parikh matrix mapping only in the (l, l +1)-st entry: In Ψ(a l ) this entry is 1, whereas in Ψ(a l,j) it is q j We note that the matrices Ψ(a l,j) specialize to Ψ(a l ) for q =1, for any value of j We now define a mapping (which we again denote by Ψ ) from Σ to M k+1 (q) by setting Ψ(λ) =I k+1 and Ψ(w 1 w 2 w n )=Ψ(w 1, 1)Ψ(w 2, 2) Ψ(w n,n), w i Σ, 1 i n We refer to Ψ as the Parikh q-matrix encoding Example 52 Let Σ be the ordered alphabet {a <b<c} Then Ψ(ab 2 )=Ψ(a, 1)Ψ(b, 2)Ψ(b, 3) Thus 1 q 0 0 1 q q 3 + q 4 0 Ψ(ab 2 )= 0 1 0 0 0 1 q 2 0 0 1 q 3 0 = 0 1 q 2 + q 3 0 Furthermore Ψ(ab 2 ac 2 a) = = 1 q q 3 + q 4 0 0 1 q 2 + q 3 0 Ψ(a, 4)Ψ(c, 5)Ψ(c, 6)Ψ(a, 7) 1 q + q 4 + q 7 q 3 + q 4 q 8 +2q 9 + q 10 0 1 q 2 + q 3 q 7 +2q 8 + q 9 0 0 1 q 5 + q 6 Note that for q =1, this is the matrix Ψ M3 (ab 2 ac 2 a) displayed as (1) Remark 3 The Parikh q-matrix encoding is not a morphism for arbitrary q For example over Σ={a < b} Ψ(ab) =Ψ(a, 1)Ψ(b, 2) Ψ(a, 1)Ψ(b, 1) = Ψ(a)Ψ(b)

A q-matrix Encoding Extending the Parikh Matrix Mapping 151 Remark 4 Neither the Parikh matrix mapping of [6] nor the Parikh q-matrix mapping of [2] is injective We will later show that the Parikh q-matrix encoding Ψ is injective On the other hand, both Parikh matrix mapping and the Parikh q-matrix mapping are morphisms, whereas Parikh q-matrix encoding is not Remark 5 Just as in the case of the Parikh matrix mapping and the Parikh q-matrix mapping, it is not true for the Parikh q-matrix encoding that if L is a context-free language, then its image is some suitable extension of the notion of semilinearity to matrices over IN[q] This is a direct consequence of Theorem 3 and the similar negative result concerning the Parikh matrix mapping ([6], Remark 32) Now we give a characterization of the entries of the matrix Ψ(w) in terms of the polynomials P w,ai,j (q) introduced in section 4 Theorem 2 Let Σ={a 1 < a 2 < < a k } be an ordered alphabet, where k 1 and assume that w Σ The matrix Ψ(w) =(m i,j (q)) 1 i,j k+1, has the following properties 1 m i,j =0, for all 1 j<i k +1, 2 m i,i =1, for all 1 i k +1, 3 m i,j+1 = P w,ai,j (q), for all 1 i j<k+1 Proof The proof of the parts 1 and 2 are immediate We now prove property 3 Assume that w = n The proof is by induction on n Ifn 1, the assertion holds Assume now that part 3 holds for all words of length n and let w be of length n +1 Write w = w a j where w = n and a j Σ Then Assume that Ψ(w )= Ψ(w) =Ψ(w )Ψ(a j,n+1) 1 m 1,2 m 1,k+1 0 1 m 2,k+1 = M 1 m k,k+1 0 0 1 By the inductive hypothesis the matrix M = Ψ(w ) has property 3 We have 1 0 0 Ψ(a j,n+1)= 0 1 q n+1 0 0 0 1 where the matrix differs from I k+1 only in the entry in position (j, j +1)where it is q n+1 instead of 0 Let M = Ψ(w) Then 1 m 1,2 m 1,k+1 1 0 0 0 1 m 2,k+1 M = 0 1 q n+1 0 1 m k,k+1 0 0 1 0 0 1 If M =(m r,s ) 1 r,s k+1, then m i,j+1 = m i,j+1 + m i,j q n+1 for all 1 i j, (6) and for all other indices, m r,s = m r,s But these are immediate from the definition of the polynomials P w,ai,j (q) which satisfy P w a j,a i,j (q) =P w,a i,j (q)+p w,a i,j 1 (q) q n+1 for 1 i j k, (7) and the proof follows by induction

152 Ömer Eğecioğlu Theorem 3 Suppose Σ={a 1 < a 2 < < a k } and w Σ Let Ψ(w) be the Parikh q-matrix encoding by (k +1)-dimensional matrices over IN[q] Then Ψ(w) evaluated at q =1is the Parikh matrix Ψ Mk (w) Proof Combine Theorem 2, Theorem 1, and Proposition 1 Corollary 6 Let Σ={a 1 < a 2 < < a k } and w Σ Suppose the vector of second diagonal entries of the matrix Ψ(w) is (m 1,2 (q),m 2,3 (q),,m k,k+1 (q)) IN[q] k Then (m 1,2 (q),m 2,3 (q),,m k,k+1 (q)) = (P w,a1 (q),p w,a2 (q),,p w,ak (q)) and at q =1, this vector evaluates to the Parikh vector ( w a1, w a2,, w ak ) IN k 6 Injectivity and matrix inverses The Parikh matrix mapping and the Parikh q-matrix mapping are not injective mappings For instance over the ordered alphabet {a <b<c} one has Ψ(acb) =Ψ(cab) [6] as well as Ψ q (acb) =Ψ q (cab) [2] Injectivity properties of the Parikh matrix mapping was studied for the binary alphabet in [1] Note that by Theorem 2, the polynomials which form the second diagonal of the matrix Ψ(w) completely determine w This is because the (i, i +1)-st entry in Ψ(w) is P w,ai (q), which encodes the positions of the letter a i in w Clearly, knowing the positions of each letter a i in w for 1 i k is equivalent to knowing w completely Thus we have Theorem 4 The Parikh q-matrix encoding is injective: ie Ψ(u) =Ψ(v) implies u = v The notion of the alternate (signed) Parikh matrix was developed in [6] It has the nice property that the inverse of the matrix Ψ Mk (w) is the alternate Parikh matrix of the mirror image mi(w) of w Suppose that Σ={a 1 < a 2 < < a k } and w Σ with Parikh matrix M =(m i,j ) 1 i,j k+1 Then the alternate Parikh matrix of w is the matrix M =(m i,j ) 1 i,j k+1 where m i,j =( 1)i+j m i,j for all 1 i j k +1 Then the following interesting result holds Theorem 5 (Restatement of [6], Theorem 32) Suppose Σ={a 1 < a 2 < < a k } and w = w 1 w 2 w n Σ Then the matrix inverse of the Parikh matrix of mi(w) =w n w 2 w 1 is the alternate Parikh matrix of w It can also be shown that there is a similar identity involving the k-dimensional matrices for w and mi(w) for the Parikh q-matrix mapping (See [2], Theorem 4) We define the alternate Parikh q-matrix encoding Ψ on Σ as follows: Suppose Ψ(w) =(m i,j (q)) 1 i,j k+1 Then Ψ (w) =(m i,j (q)) 1 i,j k+1 where m i,j (q) =( 1)i+j m i,j (q) for all 1 i j k +1 Then Theorem 6 Given w = w 1 w 2 w n Σ, the matrix inverse of is the alternate Parikh matrix encoding of w Proof Omitted Ψ(w n,n)ψ(w n 1,n 1) Ψ(w 1, 1) (8) Thus not only we need to reverse the order of the letters as in mi(w), but also their indices For q =1, however, the indices do not matter, and from Theorem 6, we obtain Theorem 32 of [6] for the Parikh matrix as a special case Example 61 For w = ab 2 ac 2 a, the matrix product displayed in (8) evaluates to with inverse 1 q + q 4 + q 7 q 6 +q 7 +q 9 +q 10 0 0 1 q 2 + q 3 0 0 0 1 q 5 +q 6 1 q q 4 q 7 q 3 + q 4 q 8 2q 9 q 10 0 1 q 2 q 3 q 7 +2q 8 + q 9 0 0 1 q 5 q 6 The latter matrix is obtained from the matrix Ψ(w) in (6) by changing the signs of the entries in a checkerboard fashion as required by the definition of the alternate Parikh q-matrix encoding of w

A q-matrix Encoding Extending the Parikh Matrix Mapping 153 Remark 7 The Parikh matrix mapping and the Parikh q-matrix mapping are non-injective morphisms, and the latter is a refinement of the former [2] The Parikh q-matrix encoding introduced in the present paper is injective, and reduces to the (numerical) Parikh matrix mapping of [6] It is possible to construct weaker and non-injective versions of the Parikh q-matrix encoding in a number of ways One is to set q p+1 = q for some p IN and keep track of the positions of the letters in w modulo p only The encoding is then with upper-triangular matrices with entries over the quotient ring Z[q]/<q p+1 q> References [1] Atanasiu, A, Martin-Vide, C, Mateescu, A: On the injectivity of the Parikh matrix mapping Fundamenta Informaticae, 49 (2002) 289-299 [2] Eğecioğlu, Ö, and Ibarra, O: A Matrix q-analogue of the Parikh Map UCSB Technical Report, TR 2004-06, February 2004 [3] Harju, T, Ibarra, O, Karhumaki, J, Salomaa, A: Some decision problems concerning semilinearity and commutation J Computer and System Sciences, 65 (2002), 278-294 [4] Ibarra, O: Reversal-bounded multicounter machines and their decision problems J Assoc Comput Mach, 24 (1978) 123-137 [5] Ibarra, O, Su, J, Dang, Z, Bultan, T, Kemmerer, R: Counter machines and verification problems Theoretical Computer Science, 289 (2002) 165-189 [6] Mateescu, A, Salomaa, A, Salomaa K, Yu, S: A sharpening of the Parikh mapping Theoretical Informatics and Applications, 35 (2001) 551-564 [7] Parikh, RJ: On context-free languages J Assoc Comput Mach, 13 (1966) 570-581 [8] Rozenberg, G, Salomaa, A (eds): Handbook of Formal Languages Springer, Berlin, 1997 Sabanci University Faculty of Engineering and Natural Sciences Tuzla, 34956 Istanbul, Turkey E-mail: omer@csucsbedu On sabbatical leave from Department of Computer Science, University of California, Santa Barbara, CA 93106, USA