Parameter word

Last updated

In the mathematical study of combinatorics on words, a parameter word is a string over a given alphabet having some number of wildcard characters. [1] The set of strings matching a given parameter word is called a parameter set or combinatorial cube. Parameter words can be composed, to produce smaller subcubes of a given combinatorial cube. They have applications in Ramsey theory and in computer science in the detection of duplicate code.

Contents

Definitions and notation

Formally, a -parameter word of length , over a given alphabet , is a sequence of characters, some of which may be drawn from and the others of which are distinct wildcard characters . Each wildcard character is required to appear at least once, but may appear multiple times, and the wildcard characters must appear in the order given by their indexes: the first wildcard character in the word must be , the next one that is different from must be , etc. As a special case, a word over the given alphabet, without any wildcard characters, is said to be a 0-parameter word. For 1-parameter words, the subscripts may be omitted, as there is no ambiguity between different wildcard characters. The set of all -parameter words over , of length , is denoted . [1]

A -parameter word represents a set of strings (0-parameter words), obtained by substituting a symbol of for each wildcard character. This set of strings is called a parameter set of combinatorial cube, and is called its dimension. A one-dimensional combinatorial cube may be called a combinatorial line. [1]

In a combinatorial cube, each copy of a particular wildcard character must have the same replacement. A generalization of parameter words allows different copies of the same wildcard character to be replaced by different characters from the alphabet, in a controlled way. If is an alphabet and is a group with an action on , then a -labeled parameter word is a -parameter word together with an assignment of a group element to each wildcard character in the word. The first occurrence of each wildcard character must be assigned the identity element of the group. Then, the strings represented by a labeled parameter word are obtained by choosing a character of for each wildcard character, and substituting the result of combining that character with the group element labeling each copy of that character. The set of all -labeled-parameter words over , of length , is denoted . [1]

Example

In the game of tic-tac-toe, the cells of the game board can be given two integer coordinates from the alphabet . Concatenating these two coordinates produces a string representing each cell, one of the nine strings or . There are seven one-parameter words of length two over this alphabet, the words and . The corresponding combinatorial lines form seven of the eight lines of three cells in a row of the tic-tac-toe board; for instance, the one-parameter word corresponds to the combinatorial line , and the one-parameter word corresponds to the combinatorial line . [2]

However, one of the eight winning lines of the tic-tac-toe game is missing from this set of combinatorial lines: the antidiagonal line . It is possible to obtain this line as a combinatorial line (without including any other combinations of cells that would be invalid for tic-tac-toe) by using a group with two elements, and an action in which the non-identity element swaps the alphabet letters and while leaving the element in place. There are eight labeled one-parameter words of length two for this action, seven of which are obtained from the unlabeled one-parameter words by using the identity label for all wildcards. These seven have the same combinatorial lines as before. The eighth labeled word consists of the word labeled by the identity element for its first and the reversing non-identity element for the second ; its combinatorial line is the final winning line of the tic-tac-toe board, . [2]

Composition

For three given integer parameters , it is possible to combine two parameter words, and , to produce another parameter word . To do so, simply replace each copy of the th wildcard symbol in by the th character in . This will necessarily produce a word of length that uses each of the wildcard symbols in at least once, in ascending order, so it produces a valid -parameter word of length . This notion of composition can also be extended to composition of labeled parameter words (both using the same alphabet and group action), by applying the group action to the non-wildcard substituted characters and composing the group labels for the wildcard substituted characters. A subset of a combinatorial cube is a smaller combinatorial cube if it can be obtained by a composition in this way. [1]

Combinatorial enumeration

The number of parameter words in for an alphabet of size is an -Stirling number of the second kind . These numbers count the number of partitions of the integers in the range into non-empty subsets such that the first integers belong to distinct subsets. Partitions of this type can be placed into a bijective equivalence with the parameter words, by creating a word with a character for each of the integers in the range , setting this character value to be either an integer in belonging to the same subset of the partition, or a wildcard character for each subset of the partition that does not contain an integer in . The -Stirling numbers obey a simple recurrence relation by which they may easily be calculated. [3] [4]

Applications

In Ramsey theory, parameter words and combinatorial cubes may be used to formulate the Graham–Rothschild theorem, according to which, for every finite alphabet and group action, and every combination of integer values , , and , there exists a sufficiently large number such that if each -dimensional combinatorial cube over strings of length is assigned one of colors, then there exists a -dimensional combinatorial cube all of whose -dimensional subcubes have the same color. This result is a key foundation for structural Ramsey theory, and is used to define Graham's number, an enormous number used to estimate the value of for a certain combination of values. [1]

In computer science, in the problem of searching for duplicate code, the source code for a given routine or module may be transformed into a parameter word by converting it into a sequence of tokens, and for each variable or subroutine name, replacing each copy of the same name with the same wildcard character. If code is duplicated, the resulting parameter words will remain equal even if some of the variables or subroutines have been renamed. More sophisticated searching algorithms can find long duplicate code sections that form substrings of larger source code repositories, by allowing the wildcard characters to be substituted for each other. [5]

An important special case of parameter words, well-studied in the combinatorics of words, is given by the partial words. These are strings with wildcard characters that may be substituted independently of each other, without requiring that some of the substituted characters be equal or controlled by a group action. In the language of parameter words, a partial word may be described as a parameter word in which each wildcard symbol appears exactly once. However, because there is no repetition of wildcard symbols, partial words may be written more simply by omitting the subscripts on the wildcard symbols. [6]

See also

Related Research Articles

Binomial coefficient Number of subsets of a given size

In mathematics, the binomial coefficients are the positive integers that occur as coefficients in the binomial theorem. Commonly, a binomial coefficient is indexed by a pair of integers nk ≥ 0 and is written It is the coefficient of the xk term in the polynomial expansion of the binomial power (1 + x)n, and is given by the formula

In elementary algebra, the binomial theorem describes the algebraic expansion of powers of a binomial. According to the theorem, it is possible to expand the polynomial (x + y)n into a sum involving terms of the form axbyc, where the exponents b and c are nonnegative integers with b + c = n, and the coefficient a of each term is a specific positive integer depending on n and b. For example, for n = 4,

In mathematics, a combination is a selection of items from a set that has distinct members, such that the order of selection does not matter. For example, given three fruits, say an apple, an orange and a pear, there are three combinations of two that can be drawn from this set: an apple and a pear; an apple and an orange; or a pear and an orange. More formally, a k-combination of a set S is a subset of k distinct elements of S. So, two combinations are identical if and only if each combination has the same members. If the set has n elements, the number of k-combinations, denoted as , is equal to the binomial coefficient

Steiner system Block design in combinatorial mathematics

In combinatorial mathematics, a Steiner system is a type of block design, specifically a t-design with λ = 1 and t = 2 or (recently) t ≥ 2.

In mathematics, a presentation is one method of specifying a group. A presentation of a group G comprises a set S of generators—so that every element of the group can be written as a product of powers of some of these generators—and a set R of relations among those generators. We then say G has presentation

In combinatorial mathematics, Ramsey's theorem, in one of its graph-theoretic forms, states that one will find monochromatic cliques in any edge labelling of a sufficiently large complete graph. To demonstrate the theorem for two colours, let r and s be any two positive integers. Ramsey's theorem states that there exists a least positive integer R(r, s) for which every blue-red edge colouring of the complete graph on R(r, s) vertices contains a blue clique on r vertices or a red clique on s vertices.

In abstract algebra, the free monoid on a set is the monoid whose elements are all the finite sequences of zero or more elements from that set, with string concatenation as the monoid operation and with the unique sequence of zero elements, often called the empty string and denoted by ε or λ, as the identity element. The free monoid on a set A is usually denoted A. The free semigroup on A is the subsemigroup of A containing all elements except the empty string. It is usually denoted A+.

In mathematics, the lexicographic or lexicographical order is a generalization of the alphabetical order of the dictionaries to sequences of ordered symbols or, more generally, of elements of a totally ordered set.

In mathematics, the Hales–Jewett theorem is a fundamental combinatorial result of Ramsey theory named after Alfred W. Hales and Robert I. Jewett, concerning the degree to which high-dimensional objects must necessarily exhibit some combinatorial structure; it is impossible for such objects to be "completely random".

In combinatorics, bijective proof is a proof technique for proving that two sets have equally many elements, or that the sets in two combinatorial classes have equal size, by finding a bijective function that maps one set one-to-one onto the other. This technique can be useful as a way of finding a formula for the number of elements of certain sets, by corresponding them with other sets that are easier to count. Additionally, the nature of the bijection itself often provides powerful insights into each or both of the sets.

In mathematics, and in particular in combinatorics, the combinatorial number system of degree k, also referred to as combinadics, or the Macaulay representation of an integer, is a correspondence between natural numbers N and k-combinations, represented as strictly decreasing sequences ck > ... > c2 > c1 ≥ 0. Distinct numbers correspond to distinct k-combinations, and produce them in lexicographic order; moreover the numbers less than correspond to all k-combinations of {0, 1, ..., n − 1}. The correspondence does not depend on the size n of the set that the k-combinations are taken from, so it can be interpreted as a map from N to the k-combinations taken from N; in this view the correspondence is a bijection.

In mathematics and computer science, in the field of coding theory, the Hamming bound is a limit on the parameters of an arbitrary block code: it is also known as the sphere-packing bound or the volume bound from an interpretation in terms of packing balls in the Hamming metric into the space of all possible words. It gives an important limitation on the efficiency with which any error-correcting code can utilize the space in which its code words are embedded. A code that attains the Hamming bound is said to be a perfect code.

In mathematics, Pascal's rule is a combinatorial identity about binomial coefficients. It states that for positive natural numbers n and k,

A Post canonical system, also known as a Post production system, as created by Emil Post, is a string-manipulation system that starts with finitely-many strings and repeatedly transforms them by applying a finite set j of specified rules of a certain form, thus generating a formal language. Today they are mainly of historical relevance because every Post canonical system can be reduced to a string rewriting system, which is a simpler formulation. Both formalisms are Turing complete.

In computer science and the study of combinatorics on words, a partial word is a string that may contain a number of "do not know" or "do not care" symbols i.e. placeholders in the string where the symbol value is not known or not specified. More formally, a partial word is a partial function where is some finite alphabet. If u(k) is not defined for some then the unknown element at place k in the string is called a "hole". In regular expressions a hole is represented by the metacharacter ".". For example, aab.ab.b is a partial word of length 8 over the alphabet A ={a,b} in which the fourth and seventh characters are holes.

Odd graph

In the mathematical field of graph theory, the odd graphsOn are a family of symmetric graphs with high odd girth, defined from certain set systems. They include and generalize the Petersen graph.

A strong positional game is a kind of positional game. Like most positional games, it is described by its set of positions and its family of winning-sets. It is played by two players, called First and Second, who alternately take previously-untaken positions.

Locally linear graph Graph where every edge is in one triangle

In graph theory, a locally linear graph is an undirected graph in which every edge belongs to exactly one triangle. Equivalently, for each vertex of the graph, its neighbors are each adjacent to exactly one other neighbor, so the neighbors can be paired up into an induced matching. Locally linear graphs have also been called locally matched graphs.

In mathematics, structural Ramsey theory is a categorical generalisation of Ramsey theory, rooted in the idea that many important results of Ramsey theory have "similar" logical structure. The key observation is noting that these Ramsey-type theorems can be expressed as the assertion that a certain category has the Ramsey property.

In mathematics, the Graham–Rothschild theorem is a theorem that applies Ramsey theory to combinatorics on words and combinatorial cubes. It is named after Ronald Graham and Bruce Lee Rothschild, who published its proof in 1971. Through the work of Graham, Rothschild, and Klaus Leeb in 1972, it became part of the foundations of structural Ramsey theory. A special case of the Graham–Rothschild theorem motivates the definition of Graham's number, a number that was popularized by Martin Gardner in Scientific American and listed in the Guinness Book of World Records as the largest number ever appearing in a mathematical proof.

References

  1. 1 2 3 4 5 6 Prömel, Hans Jürgen (2002), "Large numbers, Knuth's arrow notation, and Ramsey theory", Synthese , 133 (1–2): 87–105, doi:10.1023/A:1020879709125, JSTOR   20117296, MR   1950045
  2. 1 2 Prömel, Hans Jürgen (2013), "Hales–Jewett's Theorem", Ramsey Theory for Discrete Structures, Springer International Publishing, pp. 41–51, doi:10.1007/978-3-319-01315-2_4
  3. Broder, Andrei Z. (1984), "The -Stirling numbers", Discrete Mathematics , 49 (3): 241–259, doi: 10.1016/0012-365X(84)90161-4 , MR   0743795
  4. Benzait, A.; Voigt, B. (1989), "A combinatorial interpretation of ", Proceedings of the Oberwolfach Meeting "Kombinatorik" (1986), Discrete Mathematics , 73 (1–2): 27–35, doi: 10.1016/0012-365X(88)90130-6 , MR   0974810
  5. Baker, Brenda S. (1997), "Parameterized duplication in strings: algorithms and an application to software maintenance", SIAM Journal on Computing , 26 (5): 1343–1362, doi:10.1137/S0097539793246707, MR   1471985
  6. Blanchet-Sadri, Francine (2008), Algorithmic Combinatorics on Partial Words, Discrete Mathematics and its Applications, Boca Raton, Florida: Chapman & Hall/CRC, ISBN   978-1-4200-6092-8, MR   2384993