On recognizing words that are squares for the shuffle product - - PowerPoint PPT Presentation
On recognizing words that are squares for the shuffle product - - PowerPoint PPT Presentation
On recognizing words that are squares for the shuffle product Laboratoire dInformatique Gaspard-Monge Universit e Paris-Est Marne-la-Vall ee UMR CNRS 8049 Romeo Rizzi & St ephane Vialette Technische Universit at Berlin
Shuffle
Shuffle
The shuffle u ✁ v of words u and v over A is the finite set of all words obtainable from merging the words u and v from left to right, but choosing the next symbol arbitrarily from u or v. ab ✁ cd = {abcd, acbd, acdb, cabd, cadb, cdab}
Shuffle: Concurrent Execution - Single Processor
Shuffle
A large literature is devoted to this matter:
◮ counting shuffles of two words, ◮ shuffle algebras, ◮ automata theory, ◮ . . .
Iterated shuffle
The iterated shuffle of u is the language ǫ ∪ u ∪ (u ✁ u) ∪ (u ✁ u ✁ u) ∪ . . .
Shuffle
There are basically two kinds of questions that can be addressed depending on whether or not the shuffled element is given as a part of the input:
◮ ”Given u, v ∈ A∗, is u in the iterated shuffle of v?”, and ◮ ”Given u ∈ A∗, is u in the iterated shuffle of some v ∈ A∗?”
For one application of the shuffle product, we obtain:
◮ ”Given u, v ∈ A∗, is u ∈ v ✁ v?”, and ◮ ”Given u ∈ A∗, does there exist v ∈ A∗ such that
u ∈ v ✁ v?”
Dynamic programming for “u ∈ x ✁ y”?
class String # @return [String] the last character of this string. def last self[-1,1] end # @return [String] all but the last character of this string. def init chop end # @return [Boolean] true if this string is in the shuffle # of x and y, and false otherwise. def shuffle_of?(x, y) # base cases return y == self if x.length.zero? return x == self if y.length.zero? (x.last == last and init.shuffle_of?(x.init, y)) or \ (y.last == last and init.shuffle_of?(x, y.init)) end end
Dynamic programming
$ irb 2.0.0-p247 :001 > require ’./shuffle’ => true 2.0.0-p247 :002 > "".shuffle_of?("", "") => true 2.0.0-p247 :003 > "abc".shuffle_of?("abc", "") => true 2.0.0-p247 :004 > "abc".shuffle_of?("ab", "c") => true 2.0.0-p247 :005 > "abc".shuffle_of?("a", "bc") => true 2.0.0-p247 :006 > "abc".shuffle_of?("b", "ac") => true 2.0.0-p247 :007 > "abc".shuffle_of?("", "abc") => true 2.0.0-p247 :008 > "abc".shuffle_of?("ba", "c") => false 2.0.0-p247 :009 > "abc".shuffle_of?("a", "cb") => false 2.0.0-p247 :010 > "abc".shuffle_of?("ca", "b") => false 2.0.0-p247 :011 > $
Some good news
◮ Given words u, v1 and v2, it can be tested in
O
|u|2/ log(|u|) time whether or not u ∈ v1 ✁ v2 1.
◮ The shuffle u ✁ v of words u and v can be computed in
O
- (|u| + |v|)
|u|+|v|
|u|
- time 2.
◮ Given words u1, u2, . . . , uk, the shuffle ✁k i=1ui can be
computed in O
|u1|+|u2|+...+|uk|
|u1|,|u2|,...,|uk|
- time 3.
- 1J. van Leeuwen and M. Nivat (1982). In: Information Processing
Letters 14.1
2J.-C. Spehner (1986). In: Theoretical Computer Science
- 3C. Allauzen (2000). Tech. rep. Institut Gaspard Monge, Universit´
e Marne-la-Vall´ ee
Some bad news
◮ Given words u, v1, v2, . . . , vn ∈ A∗, it is NP-complete to
decide whether or not u ∈ ✁k
i=1vi 4.
This remains true even if the alphabet has size 3.
◮ For two words u and v, it is NP-complete to decide
whether or not u is in the iterated shuffle of v 5. This remains true even if the alphabet has size 3.
- 4A. Mansfield (1983). In: Discrete Applied Mathematics 5
5M.K. Warmuth and D. Haussler (1984). In: Journal of Computer and
System Sciences 28.3
Our main result
Theorem
Given u ∈ A∗, it is NP-complete to decide whether or not u is the shuffle of some word v ∈ A∗ with itself (i.e., does there exist some v ∈ A∗ such that u ∈ v ✁ v?).
◮ This result was first claimed by K. Iwama 6but it turns out
that the proof has a serious flaw.
◮ This result was recently proved independently by Buss and
Soltys 7.
- 6K. Iwama (1983). In: Proc. 15th Annual ACM Symposium on Theory
- f Computing (STOC), Boston, Massachusetts, USA
- 7S. Buss and M. Soltys (2013). In: Journal of Computer and System
Sciences
Stack Exchange discussion board
Turning words into (linear) graphs
Let u = u1 u2 . . . un ∈ An be a word on some alphabet A.
◮ The graph associated to u, denoted V(Gu), is defined by
V(Gu) = {u1, u2, . . . , un}, and E(Gu) = {{ui, uj} : i = j ∧ ui = uj}. We write (ui, uj) for an edge of E(Gu) if it is clear from the context that i < j.
◮ The structure of this underlying graph is linear, i.e., the
set of vertices is equipped with a natural total order < defined by ui < uj if and only if i < j. In other words, the vertices of Gu correspond to the letters
- f u in the left to right order and there is an edge between
any two identical distinct letter of u.
◮ Clearly, Gu is the disjoint union of cliques, one clique for
each distinct letter of u.
Turning words into (linear) graphs
u = ababbbaa Gu a b a b b b a a
Words, linear graphs, and inclusion-free matchings
Let u = u1 u2 . . . un ∈ An be a word on some alphabet A, and let Gu be the linear graph associated to u.
◮ A matching is perfect if it covers all the vertices of the
graph.
◮ In case the set of vertices is equipped with a total order, a
matching M is said to be inclusion-free if there do not exist (independent) edges (ui, uj) and (uk, uℓ) in M such that ui < uk < uℓ < uj or uk < ui < uj < uℓ.
Lemma
Let u ∈ A∗ for some alphabet A, and Gu be the corresponding linear graph. Then, there exists v ∈ A∗ such that u ∈ v ✁ v if and only if there exists an inclusion-free perfect matching in Gu.
Words, linear graphs, and inclusion-free matchings
Let u = u1 u2 . . . un ∈ An be a word on some alphabet A, and let Gu be the linear graph associated to u.
◮ A matching is perfect if it covers all the vertices of the
graph.
◮ In case the set of vertices is equipped with a total order, a
matching M is said to be inclusion-free if there do not exist (independent) edges (ui, uj) and (uk, uℓ) in M such that ui < uk < uℓ < uj or uk < ui < uj < uℓ.
Lemma
Let u ∈ A∗ for some alphabet A, and Gu be the corresponding linear graph. Then, there exists v ∈ A∗ such that u ∈ v ✁ v if and only if there exists an inclusion-free perfect matching in Gu.
Linear graph and inclusion-free perfect matching
u = a b b a a b b a Gu a b a b b b a a M a b a b b b a a
A direct consequence
Theorem
Let u ∈ A∗ be such that |u|a ≤ 4 for every letter a ∈ A. It can be decided in polynomial-time whether or not u is the shuffle of some word v ∈ A∗ with itself.
A direct consequence
Theorem
Let u ∈ A∗ be such that |u|a ≤ 4 for every letter a ∈ A. It can be decided in polynomial-time whether or not u is the shuffle of some word v ∈ A∗ with itself.
A direct consequence
Theorem
Let u ∈ A∗ be such that |u|a ≤ 4 for every letter a ∈ A. It can be decided in polynomial-time whether or not u is the shuffle of some word v ∈ A∗ with itself.
Being a square for the shuffle product
Theorem
Given u ∈ A∗, it is NP-complete to decide whether or not u is the shuffle of some word v ∈ A∗ with itself.
◮ We propose a polynomial-time reduction from the
NP-complete Longest Common Subsequence for binary words8: ”Given a collection of words U = {u1, u2, . . . , um} such that ui ∈ {0, 1}∗ for 1 ≤ i ≤ m, and a positive integer k, decide whether there exists a subsequence of size k common to all sequences of U? ”
◮ Without loss of generality, we may assume that |ui| = |uj|
for 1 ≤ i < j ≤ m, and that that we are looking for a common subsequence with p letters 0 and q letters 1, k = p + q.
- 8D. Maier (1978). In: Journal of the ACM 25.2
2-interval pattern matching 9
|
SIGN IN SIGN UP
On two open problems of 2-interval patterns
Authors: Shuai Cheng Li David R. Cheriton School of Computer Science, University of
Waterloo, Waterloo ON N2L 3G1, Canada
Ming Li
David R. Cheriton School of Computer Science, University of Waterloo, Waterloo ON N2L 3G1, Canada
Published in: · Journal Theoretical Computer Science archive Volume 410 Issue 24-25, May, 2009 Pages 2410-2423
Elsevier Science Publishers Ltd. Essex, UK table of contents doi>10.1016/j.tcs.2009.02.033
2009 Article Bibliometrics
· Downloads (6 Weeks): n/a · Downloads (12 Months): n/a · Downloads (cumulative): n/a · Citation Count: 2
Tools and Resources
TOC Service: Email RSS Save to Binder Export Formats: BibTeX EndNote ACM Ref Share:
Tags:
2-interval pattern bioinformatics contact map np-hard
Feedback | Switch to single page view (no tabs)
Abstract Authors References Cited By Index Terms Publication Reviews Comments Table of Contents
The 2-interval pattern problem, introduced in [Stephane Vialette, On the computational complexity of 2-interval pattern matching problems Theoret. Comput. Sci. 312 (2-3) (2004) 223-249], models general problems with biological structures such as protein contact maps and macroscopic describers of secondary structures of ribonucleic acids. Given a set of 2-intervals D and a model R, the problem is to find a maximum cardinality subset D^' of D such that any two 2-intervals in D^' satisfy R, where R is a subset of relations on disjoint 2-intervals: precedence (<), nest (@?), and cross (@?). The problem left unanswered at present is that of whether there is a polynomial time solution for the 2-interval pattern problem, when R={<,@?} and all the support intervals of D are disjoint. In this paper, we present a reduction from the clique problem to show that, in this case, the problem is NP-hard. The disjoint 2-interval pattern matching problem is to decide whether a disjoint 2-interval pattern (called the pattern) is a substructure of another disjoint 2-interval pattern (called the target). In general, the problem is NP-hard, but when there are restrictions on the form of the pattern, the problem can, in some cases, be solved in polynomial time. In particular, a polynomial time algorithm has been proposed (Gramm, WABI 2004 and IEEE/ACM TCBB 2004) for the case where the patterns are so-called crossing contact maps. In this paper we show that the problem is actually NP-hard and point out an error in the analysis of the above algorithm.
9S.C. Li and M. Li (2009). In: Theoretical Computer Science 410.24-25
Lossless transmission
It will convenient to see the reduction as a flow-like procedure, where some piece of information (the common subsequence) emitted from gadget Ws (the source) propagates lossless to gadget Wt (the sink) going through all gadgets Wi, 1 ≤ i ≤ m (every such gadget being associated to an input word
- f our input instance of 01-LCS).
Being a square for the shuffle product - the big picture
SOURCE TARGET LOSSLESS TRANSMISSION
Being a square for the shuffle product - the big picture
TARGET Second word Last word First word SOURCE Emit word Transmit word Transmit word Transmit word Transmit word
LOSSLESS TRANSMISSION LINE
Construction
The string of interest is defined by: w = Ws W1 W2 . . . Wm Wt, where Ws, W1, W2, . . ., Wm and Wt are words in A∗.
◮ Ws is the source. ◮ Each Wi is associated to an input binary string. ◮ Wt is the target.
Designing the source and the target
◮ Source
Ws = s′ 0pq s′ s (0p 1)q 0p s
◮ Target
Wt = t (0p 1)q 0q t t′ 0pq t′
◮ Recall that we are looking for a common subsequence of
lenth k with p letters 0 and q letters 1, k = p + q.
◮ Letters s, s′, t and t′ do not occur in any other gadget
word.
Designing the source : the big picture
Designing a string gadget
For any input binary string ui = ui,1ui,2 . . . ui,n, define Wi = xi W ′
i xi
yi W ′
i yi,
where W ′
i = ui,1 zi ui,2 zi . . . ui,n−1 zi ui,n. ◮ Letters xi, yi and zi only occur in the gadget word Wi.
Designing a string gadget: the big picture
Forward direction
◮ Suppose that there exists a common subsequence v of the
words u1, u2, . . . , um with p occurrences of the letter 0 and q occurrence of the letter 1.
◮ The solution v propagates lossless from source gadget Ws
to target gadget Wt going through all string gadgets Wi, 1 ≤ i ≤ m (every such gadget being associated to an input word of our input instance of 01-LCS).
Reverse direction
◮ Suppose that w is a square for the shuffle product. ◮ According to our previous lemma, this amount to saying
that Gw has an inclusion-free perfect matching M.
Reverse direction: Easy observations for the source
Reverse direction: Transmitting from the source
Reverse direction: Internal transmission
Reverse direction: Internal transmission
Iterated shuffle
Theorem
It is NP-complete to decide whether or not a word u ∈ A∗ is in the iterated shuffle of some word v ∈ A∗ with u = v.
Proof.
◮ In the previous reduction, some letters occur exactly two
times in the constructed word w.
◮ In this case, w cannot be the shuffle of k ≥ 3 identical
copies of some word v ∈ A∗.
◮ In other words, if w is in the iterated shuffle of some
distinct word v ∈ A∗, then w is a square for the shuffle product.
Turning the problem into an optimisation task
Let u ∈ A∗. Find the largest v u that is a square for the shuffle product. Define f (u) := max{|v| : v u and ∃w v such that v ∈ w ✁ w} g(n, k) := min{f (u) : u ∈ An and |A| = k}
Theorem (10)
g(n, 2) = n − o(n).
◮ Any binary word of length n can be split into two
identical subwords and, perhaps, a remaining subword of length o(n).
- 10M. Axenovich, Y. Person, and S. Puzynina (2013). In: J. Comb.
Theory, Ser. A 120.4
Turning the problem into an optimisation task
Let u ∈ A∗. Find the largest v u that is a square for the shuffle product. Define f (u) := max{|v| : v u and ∃w v such that v ∈ w ✁ w} g(n, k) := min{f (u) : u ∈ An and |A| = k}
Theorem (11)
There is polynomial-time approximation scheme (PTAS) for computing f (u).
- 11M. Jiang (2007). In: 1st Annual International Conference on
Combinatorial Optimization and Applications (COCOA’07), Xi’an, Shaanxi, China. Vol. 4616. Lecture Notes in Computer Science
Being the shuffle of a word with its reverse
Given u ∈ A∗, does there exist v ∈ A∗ such that u ∈ v ✁ v?
Theorem (12)
Let u be some word over some binary alphabet A. It is polynomial-time solvable to determine whether or not there exists v ∈ A∗ such that u ∈ v ✁ v.
- 12D. Henshall N. Rampersad and J. Shallit (2011).
Being the shuffle of a word with its reverse
Given u ∈ A∗, does there exist v ∈ A∗ such that u ∈ v ✁ v?
Key facts
◮ If there exists v ∈ A∗ such that u ∈ v ✁
v, then u is an Abelian square (i.e., u = v v′, where v′ is a permutation
- f v).
◮ If u is a binary abelian square, then there exists v ∈ A∗
such that u ∈ v ✁ v.
◮ Notice that the equivalence is no longer true for larger
alphabets. The word 012012 is an example of a ternary Abelian square that cannot be written as an element of v ✁ v for any word v.
Words and linear graphs
Let u = u1 u2 . . . un ∈ An be a word on some alphabet A, and let Gu be the linear graph associated to u.
◮ A matching is perfect if it covers all the vertices of the
graph.
◮ In case the set of vertices is equipped with a total order, a
matching M is said to be 2-nested if the following two conditions hold:
◮ For every edge (u, v) in M, one endpoint is in the first half
- f the nodes of Gu and the other is in the second half;
◮ M can be partitioned into two disjoint matchings M1 and
M2 such that both M1 and M2 are nested matchings
Lemma
Let u ∈ A∗ for some alphabet A, and Gu be the corresponding linear graph. Then, there exists v ∈ A∗ such that u ∈ v ✁ v if and only if there exists a 2-nested perfect matching in Gu.
Words and linear graphs
Let u = u1 u2 . . . un ∈ An be a word on some alphabet A, and let Gu be the linear graph associated to u.
◮ A matching is perfect if it covers all the vertices of the
graph.
◮ In case the set of vertices is equipped with a total order, a
matching M is said to be 2-nested if the following two conditions hold:
◮ For every edge (u, v) in M, one endpoint is in the first half
- f the nodes of Gu and the other is in the second half;
◮ M can be partitioned into two disjoint matchings M1 and
M2 such that both M1 and M2 are nested matchings
Lemma
Let u ∈ A∗ for some alphabet A, and Gu be the corresponding linear graph. Then, there exists v ∈ A∗ such that u ∈ v ✁ v if and only if there exists a 2-nested perfect matching in Gu.
Being the shuffle of a word with its reverse
ABACBACA ∈ ABCA ✁ ABCD
Hardness
Theorem
Given u ∈ A∗, it is NP-complete to decide whether or not u is the shuffle of some word v ∈ A∗ with its reverse. (i.e., does there exist some v ∈ A∗ such that u ∈ v ✁ v?).
◮ Reduction from our 01-LCS problem. ◮ The snail reduction is, however, much more complicated.
A pattern avoidance point of view
Pattern containment / involvement / avoidance:
◮ A permutation π is said to contain another permutation
σ, in symbols σ π, if there exists a subsequence of entries
- f π that has the same relative order as σ, and in this case
σ is said to be a pattern of π.
◮ Otherwise, π is said to avoid the permutation σ. ◮ The subsequence of π need not consist of consecutive
entries. For example, permutation π = 391867452 (written in one-line notation) contains the pattern σ = 51342, as can be seen by considering the subsequence 91672.
A pattern avoidance point of view
Theorem
Let u ∈ A2n. The two following statements are equivalent.
- 1. There exists v ∈ An such that u ∈ v ✁
v.
- 2. There exist v, w ∈ A∗ such that u ∈ (v ✁ w) (
v ✁ w).
- 3. There exist v ∈ An and 123-avoiding permutation π ∈ Sn
such that u = v π(v).
A pattern avoidance point of view
Theorem
Let u ∈ A2n be an Abelian square. The following statements are equivalent.
- 1. There exist v, w ∈ A∗ such that u ∈ (v ✁ w) (v ✁ w).
- 2. There exist v ∈ An and a 321-avoiding permutation π ∈ Sn
such that u = v π(v).
A pattern avoidance point of view
Theorem
Let u ∈ A2n. The two following statements are equivalent.
- 1. There exists v ∈ An such that u ∈ v ✁ v.
- 2. There exist v, w ∈ An, |v| + |w| = k, and π ∈ Sk such that
u ∈ (vw ✁ v) (π(v) ✁ w π(v)).
(So many) Problems left open
How hard is the problem of detecting squares for the shuffle product for bounded alphabet words?
◮ It is proved in 13 that the problem is NP-complete for an
alphabet with 9 letters (it is claimed that this can be improved to 7 letters).
◮ It is claimed without proof in 14 (Fact 2 Subsection 2.2)
that detecting squares for the shuffle product is NP-complete for binary words! This result – that would be an important improvement
- ver Buss and Soltys’ proof – is yet to be confirmed.
- 13S. Buss and M. Soltys (2013). In: Journal of Computer and System
Sciences
- 14H. Aoki, R. Uehara, and K. Yamazaki (2001). Tech. rep. 1185. RIMS
Kokyuroku
(So many) Problems left open
Determine a simple closed form for ak(n) := #
- u∈{0,1...,k−1}n
u ✁ u
.
From Henshall, Rampersad and Shallit:
n 1 2 3 4 5 6 7 8 9 a2(n) 1 2 6 22 82 320 1268 5102 20632 83972 a3(n) 1 3 15 93 621 4425 32703 258901 a4(n) 1 4 28 244 2332 23848 254416 a5(n) 1 5 45 505 6265 83225 a6(n) 1 6 66 906 13806 225336
- 15D. Henshall N. Rampersad and J. Shallit (2011).
(So many) Problems left open
Determine a simple closed form for ak(n) := #
- u∈{0,1...,k−1}n
u ✁ u
.
Conjecture:15 ai(n) =
2n
n
- n + 1in −
- 2n − 1
n + 1
- in−1 + O(in−2).
(Fun) Fact: #(ιn ✁ ιn) is the n-th Catalan number.
- 15D. Henshall N. Rampersad and J. Shallit (2011).
(So many) Problems left open
Determine a simple closed form for ak(n) := #
- u∈{0,1...,k−1}n
u ✁ u
.
Conjecture: Let u ∈ {0, 1}2n, n ≥ 4 with |u|0 = 2k, k ∈ N. If k < n − k and |u|0110 + |u|1001 < (2n − 2k − 1)
k+1
2
, the u is a
square for the shuffle product. Fact: 0k−110k+112n−2k−1 is a not a square for the shuffle product.
- 15D. Henshall N. Rampersad and J. Shallit (2011).
(So many) Problems left open
Let u, v1, v2, . . . , vk ∈ A∗. Decide whether or not u ∈ ✁k
i=1vi. Where does fall the problem of deciding
whether or not u ∈ ✁k
i=1vi in the W-hierarchy for
parameter k?
◮ Parameterized complexity.
In particular, what about the (parameterized) complexity
- f deciding whether or not u ∈ ✁k
i=1vi for parameter k? ◮ Given words u, v1, v2, . . . , vk ∈ A∗, it is NP-complete to
decide whether or not u ∈ ✁k
i=1vi 16 and 17. ◮ The question which lies at the heart of this is: How hard is
this problem compared to LCS?
- 16A. Mansfield (1983). In: Discrete Applied Mathematics 5
17M.K. Warmuth and D. Haussler (1984). In: Journal of Computer and
System Sciences 28.3
(So many) Problems left open
How to extend recognition of squares for the shuffle product to larger permutation classes?
(So many) Problems left open
How to extend recognition of squares for the shuffle product to larger permutation classes? Gu a b a b b b a a M a b a b b b a a u ∈ abba ✁ abba
(So many) Problems left open
How to extend recognition of squares for the shuffle product to larger permutation classes? Gu a b a b b b a a M a b a b b b a a u ∈ baba ✁ abba
(So many) Problems left open
How to extend recognition of squares for the shuffle product to larger permutation classes? Let u ∈ A2n. Does there exist a characterization of some X ⊂ Sn such that the two following statements are equivalent:
- 1. There exists v ∈ An such that u ∈ v ✁ v.
- 2. There exists v ∈ An and π ∈ X such that u ∈ v ✁ π(v)
Remarks
◮ Statement 1. may be rephrased as follows:
There exists v ∈ An such that u ∈ v ✁ ι(v).
◮ Let u ∈ A2n for some alphabet Σ and π ∈ Sn There exists
v ∈ An such that u ∈ v ✁ π(v) if and only if there exists w ∈ An such that u ∈ w ✁ π−1(w).
(So many) Problems left open
Let u ∈ A2n and M a perfect crossing-free matching in
- Gu. What can be said about u?
◮ If there exists a perfect crossing-free matching in Gu, then
there exist v ∈ An and a (2413, 3142, 3412)-avoiding permutation π ∈ Sn such that u ∈ v ✁ π(v).
◮ (2413, 3142)-avoiding permutations form the class of
separable permutations.
Allauzen, C. (2000). Calcul efficace du shuffle de k mots.
- Tech. rep. Institut Gaspard Monge,
Universit´ e Marne-la-Vall´ ee. Aoki, H., R. Uehara, and K. Yamazaki (2001). Expected Length of Longest Common Subsequences of Two Biased Random Strings and Its Application.
- Tech. rep. 1185. RIMS
Kokyuroku, pp. 1–10. Axenovich, M., Y. Person, and S. Puzynina (2013). “A regularity lemma and twins in words”. In: J. Comb. Theory, Ser. A 120.4, pp. 733–743. Buss, S. and M. Soltys (2013). “Unshuffling a Square is NP-Hard”. In: Journal of Computer and System Sciences. To appear. Iwama, K. (1983). “Unique Decomposability of Shuffled Strings: A Formal Treatment of Asynchronous Time-Multiplexed Communication”. In: Proc. 15th Annual ACM Symposium
- n Theory of Computing (STOC), Boston, Massachusetts, USA. ACM, pp. 374–381.
Jiang, M. (2007). “A PTAS for the weighted 2-interval pattern problem over the preceding-and-crossing model”. In: 1st Annual International Conference on Combinatorial Optimization and Applications (COCOA’07), Xi’an, Shaanxi, China. Ed. by A. Dress, Y. Xu, and B. Zhu. Vol. 4616. Lecture Notes in Computer Science, pp. 378–387. Leeuwen, J. van and M. Nivat (1982). “Efficient Recognition of Rational Relations”. In: Information Processing Letters 14.1, pp. 34–38. Li, S.C. and M. Li (2009). “On two open problems of 2-interval patterns”. In: Theoretical Computer Science 410.24-25, pp. 2410–2423. Maier, D. (1978). “The Complexity of Some Problems on Subsequences and Supersequences”. In: Journal of the ACM 25.2, pp. 322–336. Mansfield, A. (1983). “On the computational complexity of a merge recognition problem”. In: Discrete Applied Mathematics 5, pp. 119–122. Rampersad, D. Henshall N. and J. Shallit (2011). “Shuffling and Unshuffling”. http://arxiv.org/abs/1106.5767.
Spehner, J.-C. (1986). “Le Calcul Rapide des Melanges de Deux Mots”. In: Theoretical Computer Science, pp. 171–203. Warmuth, M.K. and D. Haussler (1984). “On the complexity of iterated shuffle”. In: Journal of Computer and System Sciences 28.3, pp. 345–358.
Lemma
Let u ∈ {0, 1}2n be a binary string of length 2n with 2k
- ccurrences of 0 for some 0 ≤ k ≤ n. If
|u|0110 + |u|1001 < k(n − k) (k + 1)(n − k + 1)
2k
k
- 2k−2
k−1
- 2n−2k
n−k
- 2n−2k−2
n−k−1
- the u is a square for the shuffle product.