EXHAUSTIVELY generating a class of combinatorial objects

Size: px
Start display at page:

Download "EXHAUSTIVELY generating a class of combinatorial objects"

Transcription

1 International Conference on Mechanical, Production and Materials Engineering (ICMPME') June 6-7,, Bangkok An Improving Scheme of Unranking t-ary Trees in Gray-code Order Ro Yu Wu, Jou Ming Chang, An Hang Chen, and Chun Liang Liu Abstract A t-ary tree is a rooted tree such that every internal node has exactly t disjoint subtrees. Recently, a concise representation called RD-sequences was introduced to represent t-ary trees and their generalization called non-regular trees. In particular, a loopless algorithm has been proposed by Wu et al. () for generating non-regular trees (and thus of t-ary trees) encoded by RD-sequences in a Gray-code order. In this paper, based on such a Gray-code order, we present an efficient unranking algorithm of t-ary trees with n internal nodes. The time complexity and space requirement in the algorithms are O(max{n, tn}) and O(tn), respectively. As a by-product, we have an improvement on unranking t-ary trees encoded by z- sequences in a Gray-code order. Index Terms Gray-code, ranking algorithms, t-ary trees, unranking algorithm I. INTRODUCTION EXHAUSTIVELY generating a class of combinatorial objects has attracted a lot of research due to the importance for many applications, e.g., searching for the desired object with a certain feature among all candidates, looking for a counterexample to some conjecture, or analyzing the average performance of an algorithm over all possible inputs. As usual, combinatorial objects are encoded as integer sequences so that these sequences can be generated in a particular order such as the lexicographic order [], [], [], [] or a Graycode order [], [5] [], [5], [7], [9]. For efficiency of generation, algorithms to generate objects in the lexicographic order are demanded to run in a constant amortized time. By contrast, algorithms to generate objects in a Gray-code are demanded to run in a constant time for each generation, i.e., a loopless algorithms. Accordingly, a loopless algorithm is implemented non-recursively by using, after the initialization of the first object, only assignment statements and if-thenelse statements. The reader is referred to [] for an excellent survey of generating combinatorial objects in Gray-code orders. Given a specific order on the class of combinatorial objects, a ranking algorithm is a function that determines the rank of a given object in the exhaustive generated list, and an unranking algorithm is one that generates the object (or its Ro-Yu Wu is with the Department of Industrial Management, Lunghwa University of Science and Technology, Taoyuan, Taiwan, ROC. ( eric@mail.lhu.edu.tw) Jou-Ming Chang and An-Hang Chen are with the Institute of Information and Decision Sciences, National Taipei College of Business, Taipei, Taiwan, ROC Chun-Liang Liu is with the Department of Humanity & Social Science, National Taiwan Normal University, Taipei, Taiwan, ROC representation) corresponding to a given rank. Trees are one of the most important and fundamental combinatorial objects in computer science. For t, a t-ary tree is a rooted tree such that every internal node has exactly t disjoint subtrees. Many algorithms have been developed for generating t-ary trees (as well as binary trees) with n internal nodes. Moreover, many ranking algorithms [], [], [], [], [], [], [6], [8], [] and unranking algorithms [], [], [], [], [6], [8] for diverse representations of t-ary trees with n internal nodes have been proposed. Among all representations of t-ary trees, a well-formed representation called z-sequences was first introduced by Zaks []. Roelants van Baronaigien [] and Xiang et al. [9] independently presented a loopless algorithm for generating t-ary trees encoded by z-sequences in a Graycode order. Based on such a Gray-code order, Ahmadi-Adl et al. [] recently presented O(tn )-time ranking and unranking algorithms. To the best of our knowledge, it seems that most of ranking and unranking algorithms for t-ary trees with n internal nodes require O(tn ) time and space. Recently, Wu et al. [8] introduced a new type of integer sequences called RD-sequences to represent t-ary trees and showed that, using such a representation in lexicographic order, both ranking and unranking problems for t-ary trees with n internal nodes can be solved in O(tn) time. Moreover, they showed that there is a complementary relationship between RD-sequences and z- sequences (see Theorem ). Indeed, RD-sequences have been used to represent a wider class of trees called non-regular trees [6], [7], i.e., ordered trees whose internal nodes have a pre-specified degree sequence called branching sequence in preorder. With the help of a coding tree structure, Wu et al. [7] presented a loopless algorithm to generate RDsequences of non-regular trees (and thus of t-ary trees) in a Gray-code order using n+o() space. Later on, Wu et al. [6] dealt with the ranking and unranking problems for non-regular trees encoded by RD-sequences in lexicographic order and showed that, given a prescribed branching sequence (s, s,..., s n ), both ranking and unranking problems can be solved in O(nS) time, where S = n i= (s i ). In this paper, based on the Gray-code order of t-ary trees encoded by RD-sequences in [7], we present an efficient unranking algorithm. The time complexity and space requirement in our algorithms are O(max{n, tn}) and O(tn), respectively. 8

2 International Conference on Mechanical, Production and Materials Engineering (ICMPME') June 6-7,, Bangkok II. PRELIMINARIES A. Representation of t-ary trees Wu et al. [8] defined a concise representation, called rightdistance sequences (abbreviated as RD-sequences), to describe t-ary trees. Let T be a t-ary tree with n internal nodes numbered from to n in preorder (i.e., visit the root and then recursively the subtrees of T from left to right). The rightdistance of an internal node i T, denoted by d i, is defined as follows: { if i = (i.e., the root of T ); d i = d p(i) + t k otherwise, where p(i) stands for the parent of node i and k is the rank of node i among all sons of p(i) (from left to right). Then, denote the sequence rd(t ) = (d, d,..., d n ) as the RD-sequence of T. A characterization has been pointed out in [8] that an integer sequence (d, d,..., d n ) is the RD-sequence of a t- ary tree if and only if d = and d i d i + t for i =,..., n. For example, Figure shows the -ary tree T with rd(t ) = (,,,,, ). T, we denote z i as the visited order of node i when both internal nodes and leaves of T are traversed in preorder. Then, the resulting sequence z(t ) = (z, z,..., z n ) is called the z- sequence of T. Note that every z-sequence satisfies z i < z i t(i ) +. For example, the z-sequence of the - ary tree T shown in Figure is z(t ) = (,, 5, 6,, 6). The following is the complementary relationship between RDsequences and z-sequences. Theorem : [8] If a t-ary tree is encoded as (d i, d,..., d n ) for RD-sequence and (z, z,..., z n ) for z- sequence, then d i + z i = t(i ) + for i =,,..., n. B. Loopless generation and Gray-code order In this section, we give the concept about the loopless Graycode generation algorithm for t-ary trees proposed in [7]. Let T t,n denote the set of all ( t-ary trees with n internal nodes. Recall that T t,n = tn+ ) tn+ n = tn ) (t )n+( n. To describe all t-ary trees in a systematic way, a coding tree called flipflap tree was introduced. A flip-flap tree, denoted by T t,n, is a rooted labeled tree with n levels constructed as follows: Fig.. A -ary tree with 6 internal nodes. Another way of presenting t-ary trees is the so-called z- sequences suggested by Zaks []. For each internal node i (i) The first level contains the only one node (i.e.,the root) with label ; (ii) Every node with label d in the ith level, i < n, has d + t sons labeled by,,..., d + t in the next level, where the sons are arranged in either,,..., d + t, (i.e., an up fragment) or, d + t,...,, (i.e., a down fragment). (iii) If the sons of a node x with label d are arranged in an up fragment, then the sons of its adjacency siblings (i.e., nodes with labels d and d + in the same level as x), if exist, are arranged in a down fragment, and vice versa Fig.. A flip-flap tree T,. 9

3 International Conference on Mechanical, Production and Materials Engineering (ICMPME') June 6-7,, Bangkok Accordingly, nodes on the boundary in every fragment are labeled by either or. And, the full labels along a path from the root to a leaf in T t,n indicate the RD-sequence of a t-ary tree. Moreover, a property showed that any two adjacent RD-sequences in the flip-flap tree differ in exactly one digit. Therefore, this provides the base for designing a loopless Gray-code generation algorithm. For example, Figure shows a flip-flap tree with respect to all -ary tees with internal nodes, where the first fragment in each level is a down fragment. Thus, the first RD-sequence appears in T, is (,,, ). Also, a path with bold lines from the root to a leaf in T, represents the -ary tees with RD-sequence (,,, ). A procedure called NextRD() is designed for generating the next RD-sequence in [7]. For t-ary trees, this procedure needs only n+o() space. Array d[..n] is used to store the current RD-sequence in the Gray-code order. Array c[..n] is for indicating the type of current fragment at level i for i n, where c[i] = indicates an up fragment and c[i] = indicates a down fragment. Array F [..n] is for keeping the track of positions to be processed. Initially, let i = n and for each j =,,..., n, set d[j] =, c[j] = and F [j] = j. When each time NextRD() is invoked, d[i] will be changed by increasing one or decreasing one which depends on the type of c[i] (where arithmetic is taken modulo d[i ] + t). If the current fragment is faced on a boundary, it changes the type of c[i], appoints the next changed position as i = F [n], and performs the updates of F [i], F [i ] and F [n]; otherwise, it merely keeps the next changed position as i = n. The algorithm terminates when the condition i = holds. The reader please refer to the details of the algorithm written by C++ in [7]. III. UNRANKING ALGORITHM We first observe that the largest label for nodes in the ith level of T t,n is (i )(t ). Also, if two nodes have the same label in the same level of T t,n, then they have the same degree (i.e., the number of children). This further implies that the numbers of leaves in the subtrees rooted at each of the two nodes are the same. Let A i,k denote the number of leaves in the subtree rooted at a node with label k in the ith level of T t,n. Obviously, A n,k = for k (n )(t ) and A n,k = t + k for k (n )(t ). In general, we have A i,k = t+k j= A i+,j () where i n and k (i )(t ). For the efficiency of computation, we define the following formula: B i,k = k A i,j () j= where i n and k (i )(t ). That is, the term B i,k indicates the total number of leaves for those subtrees rooted at nodes with labels from to k in the ith level of T t,n. Hence, a table built from Eq. () is named as the accumulation table with respect to T t,n. Wu et al. [8] gave the following closed-form for calculating the accumulation table. For i n and k (i )(t ), B i,k = k + mt + k + ( ) mt + k + where m = n i +. For instance, the accumulation table with respect to T, is shown below. i B i,k k We are now in a position to determine the rank of a t-ary tree in the Gray-code order of [7]. For a given t-ary tree T associated with the RD-sequence rd(t ) = (d, d,..., d n ), let x i denote the node with label d i in the flip-flap tree T t,n such that the full labels along the path x, x,..., x n represent the given RD-sequence. For each i =,,..., n, let R(i) be the rank of x i in the ith level of T t,n. Hereafter, the rank of a node in each level of T t,n is ordered from left to right and a ranking always starts with. Note that R() = and our ranking algorithm is to obtain R(n). Since each level of T t,n begins with a down fragment and the two types of fragments appear alternately, it is easy to check the following property. Proposition : For i < n, if the rank of a node in the ith level of T t,n is even (respectively, odd), then its sons are arranged in a down fragment (respectively, an up fragment). For each i =,..., n, we first set R(i) = and the computation of R(i) requires i updates by means of Eqs. () and (5). If i n and x i+ is not the first node in a fragment, let y i+ be the node with rank R(i + ) in the (i+)th level of T t,n. Then, for each j = i+,..., n, we update R(j) to represent the rank of the rightmost descendant of y i+ in the jth level of T t,n (including y i+ itself if j = i + ). Let l = n j + i +. By Proposition, there are two cases to compute R(j). If R(i) (mod), the sons of x i are arranged in a down fragment. In this case, we have m () R(j) = R(j) + (B l,di+(t ) B l,di+ + B l, ). () On the other hand, if R(i) (mod), the sons of x i are arranged in an up fragment. In this case, we have R(j) = R(j) + (B l,di+ B l, ). (5) The last term of the right hand side in each of Eqs. () and (5) is called the incremental change of R(j) in the update. The meanings of incremental changes are illustrated in Figure and Figure, respectively. We now provide a function called Unranking to convert a positive integer N to its corresponding RD-sequence of a t- ary tree with n internal nodes, where N < T t,n = B,. From Eqs. () and (5) we have known that a down fragment or an up fragment contributes an incremental change to R(j) 5

4 International Conference on Mechanical, Production and Materials Engineering (ICMPME') June 6-7,, Bangkok level x i d i x i a down fragment i+ d i+ + d i+ y i+ x i+ j old R(j) new R(j) n B,di+ B, B,di+(t ) level Fig.. Illustration of Eq. (). x i d i x i an up fragment x i+ i+ d i+ d i+ y i+ j n old R(j) new R(j) B,di+ B, Fig.. Illustration of Eq. (5). and to each of downward levels in T t,n. Thus, the basic ideal of the unranking function is to decompose N into a sequence of incremental changes of R(n). Initially, we set R(j) = for j =,..., n. Then, we determine the largest integer i on which B i, > N and set d j = for j i. Recall that d = is always true. A main loop in Unranking is designed for the decomposition of N, and indeed, it can also be used to compute d i+, d i+,..., d n. For each round of the main loop, according to the parity of R(i), we first check that the arrangement of the sons of x i is a down fragment or an up fragment. Then, we compute the incremental change of R(i + ) for determining the node x i+ in the (i + )th level of T t,n. For the case of a down fragment (respectively, an up fragment), if x i+ is the leftmost child (respectively, rightmost child) of x i, then we set d i+ =. Otherwise, we update N by subtracting the incremental change of R(n) from N, and in the meanwhile the term d i+ is determined. In addition, for j = i +,..., n, we update R(j) by using Eqs. () and (5). Once the main loop has terminated, the function outputs d, d,..., d n. The details of Unranking is shown below. 5

5 International Conference on Mechanical, Production and Materials Engineering (ICMPME') June 6-7,, Bangkok Function Unranking(N) begin for j = to n do R(j) = d j = ; i = n; while B i, N do i = i ; while i n do j = i + ; if R(i) (mod) then // a down fragment k = ; while N < B j,di +(t ) B j,k + B j, and k d i + t do k = k + ; if k = d i + t then // x i+ is the leftmost child of x i d j = ; else d j = k; N = N (B j,di +(t ) B j,k + B j,); for j = i + to n do l = n j + i + ; R(j) = R(j)+(B l,di +(t ) B l,k +B l, ); else // an up fragment k = d i + (t ); while N < B j,k B j, do k = k ; N = N (B j,k B j,); if k = d i + (t ) then // x i+ is the rightmost child of x i d j = ; else d j = k + ; for j = i + to n do l = n j + i + ; R(j) = R(j) + (B l,k B l, ); i = i + ; return d, d,..., d n; Example. Suppose we are given integers N =, n = and t =. We now perform Unranking(N). Initially, R() = R() = R() = R() =. Since B, = < N < B, = 55, we have d = and i = before entering the main loop with condition i n. There are three rounds to do in the main loop. When i = (i.e., j = ), since R() = is even, the sons of x are arranged in a down fragment. We can check N = < B, B, + B, = 55 + = 7 and k d + t = + (when k = ); N = B, B, + B, = = and k d + t = + (when k = ). Thus, d = k = and N = = 9. Moreover, we have R() = R() + B, B, + B, = + + =, R() = R() + B, B, + B, = + + =, R() = R()+B, B, +B, = =. In this case, the incremental change of R() is. When i = (i.e., j = ), since R() = is odd, the sons of x are arranged in an up fragment. We can check N = 9 < B, B, = 5 = (when k = d + ( ) = ); N = 9 B, B, = 8 = 5 (when k = ). Thus, N = 9 5 = and d = k + =. Moreover, we have R() = R() + B, B, = + = 6, R() = R() + B, B, = + 8 = 7. In this case, the incremental change of R() is 8 = 5. When i = (i.e., j = ), since R() = 6 is even, the sons of x are arranged in a down fragment. We can check N = < B,6 B, + B, = 7 + = 6 and k d + t = + (when k = ); N = < B,6 B, + B, = 7 + = 5 and k d + t = + (when k = ); N = B,6 B, + B, = 7 + = and k d + t = + (when k = ). Thus, d = k = and N = =. Moreover, we have R() = R() + B,6 B, + B, = =. In this case, the incremental change of R() is 7 + =. When i =, the main loop stops the running and the function outputs,,,. By using a similar argument as in the previous section, we will show that every element of the accumulation table in Unranking can be accessed in a constant time. For instance, we consider elements of the accumulation table in a statement marked with an upward triangle. Because all accessed elements occur in a set of certain columns and we take elements in a column from bottom to up, this can be done by using the preprocessing table described as before. For accessing elements of the accumulation table in some other place, we need the following two formulae which are easily derived from Eq. (): and B i,k+ = B i,k B i+,k+(t ) = B i,k (k + )(mt + k + ) (k + )(m(t ) + k + ) m(k + t) (k + )(mt + k) where m = n i +. Recall that before entering the main loop of Unranking, the element B i, (and thus all lower elements in the accumulation table) has been calculated and we have d i =. For each round in the main loop, we let j = i +. We claim that the element B j,dj is easy to obtain and it can be used as a reference in the next round if we keep the value. For a down fragment, the following condition in a while loop is tested: N < B j,di+(t ) B j,k + B j,. Thus, if k = d i + t (i.e., x i+ is the leftmost child of x i ), then B j,dj = B j, which is the last term of the right hand side in the condition. Otherwise, B j,dj = B j,k which is the middle term of the right hand side in the condition. For an up fragment, the following condition in a while loop is tested: N < B j,k B j,. Thus, if k = d i + (t ) (i.e., x i+ is the rightmost child of x i ), then B j,dj = B j, which is the last term of the right hand side in the condition. Otherwise, B j,dj = B j,k+ which can (6) (7) 5

6 International Conference on Mechanical, Production and Materials Engineering (ICMPME') June 6-7,, Bangkok be obtained from B j,k (i.e., the first term of the right hand side in the condition) by using Eq. (6). We now show how to access elements of the accumulation table in the statement marked with a rightward triangle. Clearly, there are three terms B j,di+(t ), B j,k and B j, in the statement. From above, we know that the term B j, has been acquired since j > i. Moreover, the term B j,k in the initial stage of the while loop (i.e, k = ) and each of succeeding stages can be obtained from Eq. (6) in a constant time. To access the term B j,di+(t ), it is easy to check Eq. (7) that if B i,di is known, then we can obtain B j,di+(t ) by taking j = i +. Since we have already shown that the element B i,di (i.e., B j,dj in the previous round) has been preserved in advance, the term B j,di+(t ) can be obtained in a constant time. Next, we show how to access elements of the accumulation table in the statement marked with a leftward triangle. Clearly, there are two terms B j,k and B j, in the statement, where k = d i + (t ) initially. Thus, a similar argument as the previous case shows that the two terms can be obtained in a constant time in the initial stage of the while loop. For all succeeding stages of the while loop, the term B j,k can be obtained from B j,k+ by using the transposition of Eq. (6), and thus it needs only a constant time. Accordingly, the unranking algorithm can be run in O(n(n+ t)) time. Again, since building the preprocessing table requires O(tn) time and space, we have the following theorem. Theorem : Given a positive integer N, determining the RD-sequence d, d,..., d n of a t-ary tree whose rank in a Gray-code order is N can be done in O(max{n, tn}) time and O(tn) space. IV. CONCLUSION In this paper, we present an unranking algorithms of t-ary trees with n internal nodes encoded by RD-sequences in a Gray-code order. The algorithm can be run in O(max{n, tn}) time and O(tn) space, respectively. As we have mentioned earlier, Roelants van Baronaigien [] and Xiang et al. [9] independently introduced a loopless Gray-code generation of t-ary trees encoded by z-sequences. Based on such a Graycode order, Ahmadi-Adl et al. [] recently proposed ranking and unranking algorithms that each can be run in O(tn ) time. Although it has been pointed out in [7] that there are at least n different ways to generate Gray-codes of t-ary trees with n internal nodes, we found that z-sequences generated in [], [9] and RD-sequences generated in [7] indeed realize the complementary relationship (as stated in Theorem ) for each generation. As a result, with a slight modification, our algorithm could make an improvement for unranking t-ary trees encoded by z-sequences in a Gray-code order. As a future work, an interesting and challenging problem is how to extend our proposed unranking algorithm for dealing with non-regular trees encoded by RD-sequences in a Graycode order. To the best of our knowledge, so far no such algorithms exists. REFERENCES [] H. Ahrabian and A. Nowzari-Dalini, Generation of t-ary trees with ballotsequences, International Journal of Computer Mathematics 8 () 9. [] A. Ahmadi-Adl, A. Nowzari-Dalini, and H. Ahrabian, Ranking and unranking algorithms for loopless generation of t-ary trees, Logic Journal of IGPL, 9 (). [] M.C. Er, A note on generating well-formed parenthesis strings lexicographically, The Computer Journal 6 (98) 5 7. [] M.C. Er, Lexicographic listing and ranking t-ary trees, The Computer Journal (987) [5] J.F. Korsh. Loopless generation of k-ary tree sequences, Information Processing Letters 5 (99) 7. [6] J.F. Korsh and P. LaFollette, Loopless generation of Gray codes for k-ary trees, Information Processing Letters 7 (999) 7. [7] J.F. Korsh and P. LaFollette, A loopless Gray code for rooted trees, ACM Transactions on Algorithms (6) 5 5. [8] J.F. Korsh and S. Lipschutz, Shift and loopless generation of k-ary trees, Information Processing Letters 65 (998) 5. [9] A. Proskurowski and F. Ruskey, Binary tree Gray codes, Journal of Algorithms 6 (985) 5 8. [] D. Roelants van Baronaigien, A loopless Gray-code algorithm for listing k-ary trees, Journal of Algorithms 5 () 7. [] D. Roelants van Baronaigien and F. Ruskey, Generating t-ary trees in A-order, Information Processing Letters 7 (988) 5. [] F. Ruskey, Generating t-ary trees lexicographically, SIAM Journal on Computing 7 (978) 9. [] C.D. Savage, A survey of combinatorial Gray codes, SIAM Review 9 (997) [] A.E. Trojanowaki, Ranking and listing algorithms for k-ary trees, SIAM Journal on Computing 7 (978) [5] V. Vajnovszki, Generating a Gray code for P-sequences, Journal of Mathematical Modelling and Algorithms (). [6] R.-Y. Wu, J.-M. Chang, and C.-H. Chang, Ranking and unranking of non-regular trees with a prescribed branching sequence, Mathematical and Computer Modelling 5 () 5. [7] R.-Y. Wu, J.-M. Chang, and Y.-L. Wang, Loopless Generation of nonregular trees with a prescribed branching sequence, The Computer Journal 5 () [8] R.-Y. Wu, J.-M. Chang, and Y.-L. Wang, Ranking and unranking of t- ary trees using RD-sequences, IEICE Transactions on Information and Systems, E9-D () 6. [9] L. Xiang, K. Ushijima, and C. Tang, Efficient loopless generation of Gray codes for k-ary trees, Information Processing Letters 76 () [] S. Zaks, Lexicographic generation of ordered trees, Theoretical Computer Science (98) 6 8. [] S. Zaks, Generation and ranking of k-ary trees, Information Processing Letters (98) 8. 5

Exhaustive generation for ballot sequences in lexicographic and Gray code order

Exhaustive generation for ballot sequences in lexicographic and Gray code order Exhaustive generation for ballot sequences in lexicographic and Gray code order Ahmad Sabri Department of Informatics Gunadarma University, Depok, Indonesia sabri@staff.gunadarma.ac.id Vincent Vajnovszki

More information

A fast algorithm to generate necklaces with xed content

A fast algorithm to generate necklaces with xed content Theoretical Computer Science 301 (003) 477 489 www.elsevier.com/locate/tcs Note A fast algorithm to generate necklaces with xed content Joe Sawada 1 Department of Computer Science, University of Toronto,

More information

A loop-free two-close Gray-code algorithm for listing k-ary Dyck words

A loop-free two-close Gray-code algorithm for listing k-ary Dyck words Journal of Discrete Algorithms 4 (2006) 633 648 www.elsevier.com/locate/jda A loop-free two-close Gray-code algorithm for listing k-ary Dyck words Vincent Vajnovszki a, Timothy Walsh b, a LE21 FRE-CNRS

More information

On Detecting Multiple Faults in Baseline Interconnection Networks

On Detecting Multiple Faults in Baseline Interconnection Networks On Detecting Multiple Faults in Baseline Interconnection Networks SHUN-SHII LIN 1 AND SHAN-TAI CHEN 2 1 National Taiwan Normal University, Taipei, Taiwan, ROC 2 Chung Cheng Institute of Technology, Tao-Yuan,

More information

Constant Time Generation of Set Partitions

Constant Time Generation of Set Partitions 930 PAPER Special Section on Selected Papers from the 17th Workshop on Circuits and Systems in Karuizawa Constant Time Generation of Set Partitions Shin-ichiro KAWANO a) and Shin-ichi NAKANO b), Members

More information

ALGORITHMS AND COMBINATORICS OF MAXIMAL COMPACT CODES by. CHRISTOPHER JORDAN DEUGAU B.Sc., Malaspina University-College, 2004

ALGORITHMS AND COMBINATORICS OF MAXIMAL COMPACT CODES by. CHRISTOPHER JORDAN DEUGAU B.Sc., Malaspina University-College, 2004 ALGORITHMS AND COMBINATORICS OF MAXIMAL COMPACT CODES by CHRISTOPHER JORDAN DEUGAU B.Sc., Malaspina University-College, 2004 A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree

More information

Lecture 18 April 26, 2012

Lecture 18 April 26, 2012 6.851: Advanced Data Structures Spring 2012 Prof. Erik Demaine Lecture 18 April 26, 2012 1 Overview In the last lecture we introduced the concept of implicit, succinct, and compact data structures, and

More information

Trees and Meta-Fibonacci Sequences

Trees and Meta-Fibonacci Sequences Trees and Meta-Fibonacci Sequences Abraham Isgur, David Reiss, and Stephen Tanny Department of Mathematics University of Toronto, Ontario, Canada abraham.isgur@utoronto.ca, david.reiss@utoronto.ca, tanny@math.toronto.edu

More information

Classical Complexity and Fixed-Parameter Tractability of Simultaneous Consecutive Ones Submatrix & Editing Problems

Classical Complexity and Fixed-Parameter Tractability of Simultaneous Consecutive Ones Submatrix & Editing Problems Classical Complexity and Fixed-Parameter Tractability of Simultaneous Consecutive Ones Submatrix & Editing Problems Rani M. R, Mohith Jagalmohanan, R. Subashini Binary matrices having simultaneous consecutive

More information

Introduction to Binary Convolutional Codes [1]

Introduction to Binary Convolutional Codes [1] Introduction to Binary Convolutional Codes [1] Yunghsiang S. Han Graduate Institute of Communication Engineering, National Taipei University Taiwan E-mail: yshan@mail.ntpu.edu.tw Y. S. Han Introduction

More information

LOOPLESS GENERATION OF MULTISET PERMUTATIONS BY PREFIX SHIFTS

LOOPLESS GENERATION OF MULTISET PERMUTATIONS BY PREFIX SHIFTS LOOPLESS GENERATION OF MULTISET PERMUTATIONS BY PREFIX SHIFTS AARON WILLIAMS UNIVERSITY OF VICTORIA, CANADA Abstract. This paper answers the following mathematical question: Can multiset permutations be

More information

Combinatorial algorithms

Combinatorial algorithms Combinatorial algorithms computing subset rank and unrank, Gray codes, k-element subset rank and unrank, computing permutation rank and unrank Jiří Vyskočil, Radek Mařík 2012 Combinatorial Generation definition:

More information

arxiv: v1 [math.co] 3 Nov 2014

arxiv: v1 [math.co] 3 Nov 2014 SPARSE MATRICES DESCRIBING ITERATIONS OF INTEGER-VALUED FUNCTIONS BERND C. KELLNER arxiv:1411.0590v1 [math.co] 3 Nov 014 Abstract. We consider iterations of integer-valued functions φ, which have no fixed

More information

CS60007 Algorithm Design and Analysis 2018 Assignment 1

CS60007 Algorithm Design and Analysis 2018 Assignment 1 CS60007 Algorithm Design and Analysis 2018 Assignment 1 Palash Dey and Swagato Sanyal Indian Institute of Technology, Kharagpur Please submit the solutions of the problems 6, 11, 12 and 13 (written in

More information

Quiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts)

Quiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts) Introduction to Algorithms October 13, 2010 Massachusetts Institute of Technology 6.006 Fall 2010 Professors Konstantinos Daskalakis and Patrick Jaillet Quiz 1 Solutions Quiz 1 Solutions Problem 1. We

More information

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Computer Science & Engineering 423/823 Design and Analysis of Algorithms Computer Science & Engineering 423/823 Design and Analysis of s Lecture 09 Dynamic Programming (Chapter 15) Stephen Scott (Adapted from Vinodchandran N. Variyam) 1 / 41 Spring 2010 Dynamic programming

More information

Fixed-Density Necklaces and Lyndon Words in Cool-lex Order

Fixed-Density Necklaces and Lyndon Words in Cool-lex Order Fixed-Density Necklaces and Lyndon Words in Cool-lex Order J. Sawada A. Williams July 6, 2009 Abstract This paper creates a simple Gray code for fixed-density binary necklaces and Lyndon words. The Gray

More information

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Computer Science & Engineering 423/823 Design and Analysis of Algorithms Computer Science & Engineering 423/823 Design and Analysis of Algorithms Lecture 03 Dynamic Programming (Chapter 15) Stephen Scott and Vinodchandran N. Variyam sscott@cse.unl.edu 1/44 Introduction Dynamic

More information

k-protected VERTICES IN BINARY SEARCH TREES

k-protected VERTICES IN BINARY SEARCH TREES k-protected VERTICES IN BINARY SEARCH TREES MIKLÓS BÓNA Abstract. We show that for every k, the probability that a randomly selected vertex of a random binary search tree on n nodes is at distance k from

More information

Math 42, Discrete Mathematics

Math 42, Discrete Mathematics c Fall 2018 last updated 12/05/2018 at 15:47:21 For use by students in this class only; all rights reserved. Note: some prose & some tables are taken directly from Kenneth R. Rosen, and Its Applications,

More information

Partitions and Covers

Partitions and Covers University of California, Los Angeles CS 289A Communication Complexity Instructor: Alexander Sherstov Scribe: Dong Wang Date: January 2, 2012 LECTURE 4 Partitions and Covers In previous lectures, we saw

More information

Notes on Logarithmic Lower Bounds in the Cell Probe Model

Notes on Logarithmic Lower Bounds in the Cell Probe Model Notes on Logarithmic Lower Bounds in the Cell Probe Model Kevin Zatloukal November 10, 2010 1 Overview Paper is by Mihai Pâtraşcu and Erik Demaine. Both were at MIT at the time. (Mihai is now at AT&T Labs.)

More information

Scout, NegaScout and Proof-Number Search

Scout, NegaScout and Proof-Number Search Scout, NegaScout and Proof-Number Search Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Introduction It looks like alpha-beta pruning is the best we can do for a generic searching

More information

The Coolest Way To Generate Combinations

The Coolest Way To Generate Combinations The Coolest Way To Generate Combinations Frank Ruskey and Aaron Williams Dept of Computer Science, University of Victoria Abstract We present a practical and elegant method for generating all (s, t)-combinations

More information

Binary Decision Diagrams. Graphs. Boolean Functions

Binary Decision Diagrams. Graphs. Boolean Functions Binary Decision Diagrams Graphs Binary Decision Diagrams (BDDs) are a class of graphs that can be used as data structure for compactly representing boolean functions. BDDs were introduced by R. Bryant

More information

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations Page 1 Definitions Tuesday, May 8, 2018 12:23 AM Notations " " means "equals, by definition" the set of all real numbers the set of integers Denote a function from a set to a set by Denote the image of

More information

PATH BUNDLES ON n-cubes

PATH BUNDLES ON n-cubes PATH BUNDLES ON n-cubes MATTHEW ELDER Abstract. A path bundle is a set of 2 a paths in an n-cube, denoted Q n, such that every path has the same length, the paths partition the vertices of Q n, the endpoints

More information

arxiv: v1 [math.co] 30 Mar 2013

arxiv: v1 [math.co] 30 Mar 2013 ENUMERATING MAXIMAL TATAMI MAT COVERINGS OF SQUARE GRIDS WITH v VERTICAL DOMINOES arxiv:1304.0070v1 [math.co] 30 Mar 013 ALEJANDRO ERICKSON AND FRANK RUSKEY Abstract. We enumerate a certain class of monomino-domino

More information

Basing Decisions on Sentences in Decision Diagrams

Basing Decisions on Sentences in Decision Diagrams Proceedings of the Twenty-Sixth AAAI Conference on Artificial Intelligence Basing Decisions on Sentences in Decision Diagrams Yexiang Xue Department of Computer Science Cornell University yexiang@cs.cornell.edu

More information

THE COOLEST WAY TO GENERATE COMBINATIONS

THE COOLEST WAY TO GENERATE COMBINATIONS THE COOLEST WAY TO GENERATE COMBINATIONS FRANK RUSKEY AND AARON WILLIAMS Abstract We present a practical and elegant method for generating all (s, t)-combinations (binary strings with s zeros and t ones):

More information

Expected Number of Distinct Subsequences in Randomly Generated Binary Strings

Expected Number of Distinct Subsequences in Randomly Generated Binary Strings Expected Number of Distinct Subsequences in Randomly Generated Binary Strings arxiv:704.0866v [math.co] 4 Mar 08 Yonah Biers-Ariel, Anant Godbole, Elizabeth Kelley March 6, 08 Abstract When considering

More information

Constructing Independent Spanning Trees on Locally Twisted Cubes in Parallel

Constructing Independent Spanning Trees on Locally Twisted Cubes in Parallel Constructing Independent Spanning Trees on Locally Twisted Cubes in Parallel Yu-Huei Chang Jinn-Shyong Yang, Jou-Ming Chang Department of Information Management, National Taipei College of Business, Taipei,

More information

A VLSI Algorithm for Modular Multiplication/Division

A VLSI Algorithm for Modular Multiplication/Division A VLSI Algorithm for Modular Multiplication/Division Marcelo E. Kaihara and Naofumi Takagi Department of Information Engineering Nagoya University Nagoya, 464-8603, Japan mkaihara@takagi.nuie.nagoya-u.ac.jp

More information

Algorithmic Approach to Counting of Certain Types m-ary Partitions

Algorithmic Approach to Counting of Certain Types m-ary Partitions Algorithmic Approach to Counting of Certain Types m-ary Partitions Valentin P. Bakoev Abstract Partitions of integers of the type m n as a sum of powers of m (the so called m-ary partitions) and their

More information

On the Average Path Length of Complete m-ary Trees

On the Average Path Length of Complete m-ary Trees 1 2 3 47 6 23 11 Journal of Integer Sequences, Vol. 17 2014, Article 14.6.3 On the Average Path Length of Complete m-ary Trees M. A. Nyblom School of Mathematics and Geospatial Science RMIT University

More information

An efficient upper bound of the rotation distance of binary trees

An efficient upper bound of the rotation distance of binary trees Information Processing Letters 73 (2000) 87 92 An efficient upper bound of the rotation distance of binary trees Jean Pallo 1 LE2I, Université de Bourgogne, B.P. 47870, F21078 Dijon-Cedex, France Received

More information

1 Basic Definitions. 2 Proof By Contradiction. 3 Exchange Argument

1 Basic Definitions. 2 Proof By Contradiction. 3 Exchange Argument 1 Basic Definitions A Problem is a relation from input to acceptable output. For example, INPUT: A list of integers x 1,..., x n OUTPUT: One of the three smallest numbers in the list An algorithm A solves

More information

Postorder Preimages. arxiv: v3 [math.co] 2 Feb Colin Defant 1. 1 Introduction

Postorder Preimages. arxiv: v3 [math.co] 2 Feb Colin Defant 1. 1 Introduction Discrete Mathematics and Theoretical Computer Science DMTCS vol. 19:1, 2017, #3 Postorder Preimages arxiv:1604.01723v3 [math.co] 2 Feb 2017 1 University of Florida Colin Defant 1 received 7 th Apr. 2016,

More information

arxiv: v1 [cs.ds] 1 Nov 2018

arxiv: v1 [cs.ds] 1 Nov 2018 An O(nlogn) time Algorithm for computing the Path-length Distance between Trees arxiv:1811.00619v1 [cs.ds] 1 Nov 2018 David Bryant Celine Scornavacca November 5, 2018 Abstract Tree comparison metrics have

More information

Two algorithms extending a perfect matching of the hypercube into a Hamiltonian cycle

Two algorithms extending a perfect matching of the hypercube into a Hamiltonian cycle Two algorithms extending a perfect matching of the hypercube into a Hamiltonian cycle Jiří Fink Department of Theoretical Computer Science and Mathematical Logic Faculty of Mathematics and Physics Charles

More information

Dominating Set Counting in Graph Classes

Dominating Set Counting in Graph Classes Dominating Set Counting in Graph Classes Shuji Kijima 1, Yoshio Okamoto 2, and Takeaki Uno 3 1 Graduate School of Information Science and Electrical Engineering, Kyushu University, Japan kijima@inf.kyushu-u.ac.jp

More information

arxiv: v2 [cs.ds] 3 Oct 2017

arxiv: v2 [cs.ds] 3 Oct 2017 Orthogonal Vectors Indexing Isaac Goldstein 1, Moshe Lewenstein 1, and Ely Porat 1 1 Bar-Ilan University, Ramat Gan, Israel {goldshi,moshe,porately}@cs.biu.ac.il arxiv:1710.00586v2 [cs.ds] 3 Oct 2017 Abstract

More information

Discrete Mathematics

Discrete Mathematics Discrete Mathematics Trees H. Turgut Uyar Ayşegül Gençata Yayımlı Emre Harmancı 2001-2016 License You are free to: c 2001-2016 T. Uyar, A. Yayımlı, E. Harmancı Share copy and redistribute the material

More information

Assignment 5: Solutions

Assignment 5: Solutions Comp 21: Algorithms and Data Structures Assignment : Solutions 1. Heaps. (a) First we remove the minimum key 1 (which we know is located at the root of the heap). We then replace it by the key in the position

More information

Binary Decision Diagrams

Binary Decision Diagrams Binary Decision Diagrams Binary Decision Diagrams (BDDs) are a class of graphs that can be used as data structure for compactly representing boolean functions. BDDs were introduced by R. Bryant in 1986.

More information

Nowhere 0 mod p dominating sets in multigraphs

Nowhere 0 mod p dominating sets in multigraphs Nowhere 0 mod p dominating sets in multigraphs Raphael Yuster Department of Mathematics University of Haifa at Oranim Tivon 36006, Israel. e-mail: raphy@research.haifa.ac.il Abstract Let G be a graph with

More information

Scout and NegaScout. Tsan-sheng Hsu.

Scout and NegaScout. Tsan-sheng Hsu. Scout and NegaScout Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Abstract It looks like alpha-beta pruning is the best we can do for an exact generic searching procedure.

More information

Discrete Mathematics

Discrete Mathematics Discrete Mathematics 311 (011) 1646 1657 Contents lists available at ScienceDirect Discrete Mathematics journal homepage: www.elsevier.com/locate/disc Point sets that minimize ( k)-edges, 3-decomposable

More information

Search Trees. Chapter 10. CSE 2011 Prof. J. Elder Last Updated: :52 AM

Search Trees. Chapter 10. CSE 2011 Prof. J. Elder Last Updated: :52 AM Search Trees Chapter 1 < 6 2 > 1 4 = 8 9-1 - Outline Ø Binary Search Trees Ø AVL Trees Ø Splay Trees - 2 - Outline Ø Binary Search Trees Ø AVL Trees Ø Splay Trees - 3 - Binary Search Trees Ø A binary search

More information

Run-length & Entropy Coding. Redundancy Removal. Sampling. Quantization. Perform inverse operations at the receiver EEE

Run-length & Entropy Coding. Redundancy Removal. Sampling. Quantization. Perform inverse operations at the receiver EEE General e Image Coder Structure Motion Video x(s 1,s 2,t) or x(s 1,s 2 ) Natural Image Sampling A form of data compression; usually lossless, but can be lossy Redundancy Removal Lossless compression: predictive

More information

A Formal Model and an Algorithm for Generating the Permutations of a Multiset

A Formal Model and an Algorithm for Generating the Permutations of a Multiset A Formal Mel and an Algorithm for Generating the Permutations of a Multiset VINCENZO DE FLORIO and GEERT DECONINCK Electrical Engineering Department ESAT Katholieke Universiteit Leuven, Kasteelpark Arenberg

More information

Chapter 2 Propositional Logic: Formulas, Models, Tableaux

Chapter 2 Propositional Logic: Formulas, Models, Tableaux Chapter 2 Propositional Logic: Formulas, Models, Tableaux Propositional logic is a simple logical system that is the basis for all others. Propositions are claims like one plus one equals two and one plus

More information

Gap Embedding for Well-Quasi-Orderings 1

Gap Embedding for Well-Quasi-Orderings 1 WoLLIC 2003 Preliminary Version Gap Embedding for Well-Quasi-Orderings 1 Nachum Dershowitz 2 and Iddo Tzameret 3 School of Computer Science, Tel-Aviv University, Tel-Aviv 69978, Israel Abstract Given a

More information

SMT 2013 Power Round Solutions February 2, 2013

SMT 2013 Power Round Solutions February 2, 2013 Introduction This Power Round is an exploration of numerical semigroups, mathematical structures which appear very naturally out of answers to simple questions. For example, suppose McDonald s sells Chicken

More information

Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs

Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs Krishnendu Chatterjee Rasmus Ibsen-Jensen Andreas Pavlogiannis IST Austria Abstract. We consider graphs with n nodes together

More information

Chapter 3 Linear Block Codes

Chapter 3 Linear Block Codes Wireless Information Transmission System Lab. Chapter 3 Linear Block Codes Institute of Communications Engineering National Sun Yat-sen University Outlines Introduction to linear block codes Syndrome and

More information

Evolutionary Tree Analysis. Overview

Evolutionary Tree Analysis. Overview CSI/BINF 5330 Evolutionary Tree Analysis Young-Rae Cho Associate Professor Department of Computer Science Baylor University Overview Backgrounds Distance-Based Evolutionary Tree Reconstruction Character-Based

More information

Dictionary: an abstract data type

Dictionary: an abstract data type 2-3 Trees 1 Dictionary: an abstract data type A container that maps keys to values Dictionary operations Insert Search Delete Several possible implementations Balanced search trees Hash tables 2 2-3 trees

More information

Compute the Fourier transform on the first register to get x {0,1} n x 0.

Compute the Fourier transform on the first register to get x {0,1} n x 0. CS 94 Recursive Fourier Sampling, Simon s Algorithm /5/009 Spring 009 Lecture 3 1 Review Recall that we can write any classical circuit x f(x) as a reversible circuit R f. We can view R f as a unitary

More information

QI/EC Modeling and Entropy Pumps *

QI/EC Modeling and Entropy Pumps * QI/EC Modeling and Entropy Pumps * Ratko V. Tomic 1stWorks Corporation * The QI source code and tech. reports are available at: http://www.1stworks.com/ref/qi.htm We use concepts developed in chapter 4

More information

INF2220: algorithms and data structures Series 1

INF2220: algorithms and data structures Series 1 Universitetet i Oslo Institutt for Informatikk I. Yu, D. Karabeg INF2220: algorithms and data structures Series 1 Topic Function growth & estimation of running time, trees (Exercises with hints for solution)

More information

Santa Claus Schedules Jobs on Unrelated Machines

Santa Claus Schedules Jobs on Unrelated Machines Santa Claus Schedules Jobs on Unrelated Machines Ola Svensson (osven@kth.se) Royal Institute of Technology - KTH Stockholm, Sweden March 22, 2011 arxiv:1011.1168v2 [cs.ds] 21 Mar 2011 Abstract One of the

More information

arxiv: v1 [math.co] 22 Jan 2013

arxiv: v1 [math.co] 22 Jan 2013 NESTED RECURSIONS, SIMULTANEOUS PARAMETERS AND TREE SUPERPOSITIONS ABRAHAM ISGUR, VITALY KUZNETSOV, MUSTAZEE RAHMAN, AND STEPHEN TANNY arxiv:1301.5055v1 [math.co] 22 Jan 2013 Abstract. We apply a tree-based

More information

On Minimal Words With Given Subword Complexity

On Minimal Words With Given Subword Complexity On Minimal Words With Given Subword Complexity Ming-wei Wang Department of Computer Science University of Waterloo Waterloo, Ontario N2L 3G CANADA m2wang@neumann.uwaterloo.ca Jeffrey Shallit Department

More information

We say that the base of the decimal number system is ten, represented by the symbol

We say that the base of the decimal number system is ten, represented by the symbol Introduction to counting and positional notation. In the decimal number system, a typical number, N, looks like... d 3 d 2 d 1 d 0.d -1 d -2 d -3... [N1] where the ellipsis at each end indicates that there

More information

FINITELY-GENERATED ABELIAN GROUPS

FINITELY-GENERATED ABELIAN GROUPS FINITELY-GENERATED ABELIAN GROUPS Structure Theorem for Finitely-Generated Abelian Groups Let G be a finitely-generated abelian group Then there exist a nonnegative integer t and (if t > 0) integers 1

More information

Suppose h maps number and variables to ɛ, and opening parenthesis to 0 and closing parenthesis

Suppose h maps number and variables to ɛ, and opening parenthesis to 0 and closing parenthesis 1 Introduction Parenthesis Matching Problem Describe the set of arithmetic expressions with correctly matched parenthesis. Arithmetic expressions with correctly matched parenthesis cannot be described

More information

Exercises - Solutions

Exercises - Solutions Chapter 1 Exercises - Solutions Exercise 1.1. The first two definitions are equivalent, since we follow in both cases the unique path leading from v to a sink and using only a i -edges leaving x i -nodes.

More information

Read-Once Branching Programs for Tree Evaluation Problems

Read-Once Branching Programs for Tree Evaluation Problems Read-Once Branching Programs for Tree Evaluation Problems Kazuo Iwama 1 and Atsuki Nagao 2 1 Graduate School of Informatics, Kyoto University, Kyoto, Japan iwama@kuis.kyoto-u.ac.jp 2 Graduate School of

More information

Root systems and optimal block designs

Root systems and optimal block designs Root systems and optimal block designs Peter J. Cameron School of Mathematical Sciences Queen Mary, University of London Mile End Road London E1 4NS, UK p.j.cameron@qmul.ac.uk Abstract Motivated by a question

More information

Phylogenetic Networks, Trees, and Clusters

Phylogenetic Networks, Trees, and Clusters Phylogenetic Networks, Trees, and Clusters Luay Nakhleh 1 and Li-San Wang 2 1 Department of Computer Science Rice University Houston, TX 77005, USA nakhleh@cs.rice.edu 2 Department of Biology University

More information

A BIJECTION BETWEEN WELL-LABELLED POSITIVE PATHS AND MATCHINGS

A BIJECTION BETWEEN WELL-LABELLED POSITIVE PATHS AND MATCHINGS Séminaire Lotharingien de Combinatoire 63 (0), Article B63e A BJECTON BETWEEN WELL-LABELLED POSTVE PATHS AND MATCHNGS OLVER BERNARD, BERTRAND DUPLANTER, AND PHLPPE NADEAU Abstract. A well-labelled positive

More information

Integer Programming. Wolfram Wiesemann. December 6, 2007

Integer Programming. Wolfram Wiesemann. December 6, 2007 Integer Programming Wolfram Wiesemann December 6, 2007 Contents of this Lecture Revision: Mixed Integer Programming Problems Branch & Bound Algorithms: The Big Picture Solving MIP s: Complete Enumeration

More information

arxiv: v1 [cs.ds] 21 May 2013

arxiv: v1 [cs.ds] 21 May 2013 Easy identification of generalized common nested intervals Fabien de Montgolfier 1, Mathieu Raffinot 1, and Irena Rusu 2 arxiv:1305.4747v1 [cs.ds] 21 May 2013 1 LIAFA, Univ. Paris Diderot - Paris 7, 75205

More information

Fundamental Algorithms

Fundamental Algorithms Fundamental Algorithms Chapter 5: Searching Michael Bader Winter 2014/15 Chapter 5: Searching, Winter 2014/15 1 Searching Definition (Search Problem) Input: a sequence or set A of n elements (objects)

More information

Ordered trees and the inorder traversal

Ordered trees and the inorder traversal Discrete Mathematics 306 (006) 173 1741 www.elsevier.com/locate/disc Ordered trees and the inorder traversal A. Sapounakis, I. Tasoulas, P. Tsikouras Department of Informatics, University of Piraeus, 18534

More information

On the minimum neighborhood of independent sets in the n-cube

On the minimum neighborhood of independent sets in the n-cube Matemática Contemporânea, Vol. 44, 1 10 c 2015, Sociedade Brasileira de Matemática On the minimum neighborhood of independent sets in the n-cube Moysés da S. Sampaio Júnior Fabiano de S. Oliveira Luérbio

More information

Maximizing the descent statistic

Maximizing the descent statistic Maximizing the descent statistic Richard EHRENBORG and Swapneel MAHAJAN Abstract For a subset S, let the descent statistic β(s) be the number of permutations that have descent set S. We study inequalities

More information

Chapter 5 The Witness Reduction Technique

Chapter 5 The Witness Reduction Technique Outline Chapter 5 The Technique Luke Dalessandro Rahul Krishna December 6, 2006 Outline Part I: Background Material Part II: Chapter 5 Outline of Part I 1 Notes On Our NP Computation Model NP Machines

More information

Slides for CIS 675. Huffman Encoding, 1. Huffman Encoding, 2. Huffman Encoding, 3. Encoding 1. DPV Chapter 5, Part 2. Encoding 2

Slides for CIS 675. Huffman Encoding, 1. Huffman Encoding, 2. Huffman Encoding, 3. Encoding 1. DPV Chapter 5, Part 2. Encoding 2 Huffman Encoding, 1 EECS Slides for CIS 675 DPV Chapter 5, Part 2 Jim Royer October 13, 2009 A toy example: Suppose our alphabet is { A, B, C, D }. Suppose T is a text of 130 million characters. What is

More information

COS597D: Information Theory in Computer Science October 19, Lecture 10

COS597D: Information Theory in Computer Science October 19, Lecture 10 COS597D: Information Theory in Computer Science October 9, 20 Lecture 0 Lecturer: Mark Braverman Scribe: Andrej Risteski Kolmogorov Complexity In the previous lectures, we became acquainted with the concept

More information

Tree-Walking Automata Do Not Recognize All Regular Languages

Tree-Walking Automata Do Not Recognize All Regular Languages Tree-Walking Automata Do Not Recognize All Regular Languages Mikolaj Bojanczyk Warsaw University and LIAFA, Paris 7 bojan@mimuw.edu.pl Thomas Colcombet Warsaw University and IRISA-CNRS colcombe@irisa.fr

More information

Online Sorted Range Reporting and Approximating the Mode

Online Sorted Range Reporting and Approximating the Mode Online Sorted Range Reporting and Approximating the Mode Mark Greve Progress Report Department of Computer Science Aarhus University Denmark January 4, 2010 Supervisor: Gerth Stølting Brodal Online Sorted

More information

Analysis of Algorithms. Outline 1 Introduction Basic Definitions Ordered Trees. Fibonacci Heaps. Andres Mendez-Vazquez. October 29, Notes.

Analysis of Algorithms. Outline 1 Introduction Basic Definitions Ordered Trees. Fibonacci Heaps. Andres Mendez-Vazquez. October 29, Notes. Analysis of Algorithms Fibonacci Heaps Andres Mendez-Vazquez October 29, 2015 1 / 119 Outline 1 Introduction Basic Definitions Ordered Trees 2 Binomial Trees Example 3 Fibonacci Heap Operations Fibonacci

More information

Pattern Popularity in 132-Avoiding Permutations

Pattern Popularity in 132-Avoiding Permutations Pattern Popularity in 132-Avoiding Permutations The MIT Faculty has made this article openly available. Please share how this access benefits you. Your story matters. Citation As Published Publisher Rudolph,

More information

Determinants of Partition Matrices

Determinants of Partition Matrices journal of number theory 56, 283297 (1996) article no. 0018 Determinants of Partition Matrices Georg Martin Reinhart Wellesley College Communicated by A. Hildebrand Received February 14, 1994; revised

More information

EXACT DOUBLE DOMINATION IN GRAPHS

EXACT DOUBLE DOMINATION IN GRAPHS Discussiones Mathematicae Graph Theory 25 (2005 ) 291 302 EXACT DOUBLE DOMINATION IN GRAPHS Mustapha Chellali Department of Mathematics, University of Blida B.P. 270, Blida, Algeria e-mail: mchellali@hotmail.com

More information

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School Basic counting techniques Periklis A. Papakonstantinou Rutgers Business School i LECTURE NOTES IN Elementary counting methods Periklis A. Papakonstantinou MSIS, Rutgers Business School ALL RIGHTS RESERVED

More information

Notes on Paths, Trees and Lagrange Inversion

Notes on Paths, Trees and Lagrange Inversion Notes on Paths, Trees and Lagrange Inversion Today we are going to start with a problem that may seem somewhat unmotivated, and solve it in two ways. From there, we will proceed to discuss applications

More information

CS 410/584, Algorithm Design & Analysis: Lecture Notes 3

CS 410/584, Algorithm Design & Analysis: Lecture Notes 3 CS 410/584, : Lecture Notes 3 Amortized Cost Not an algorithm design mechanism per se For analyzing cost of algorithms - - Example: Exercise 17.3-6 Implement a queue with two stacks Why? 1 enqueue(x, Q)

More information

RMT 2013 Power Round Solutions February 2, 2013

RMT 2013 Power Round Solutions February 2, 2013 RMT 013 Power Round Solutions February, 013 1. (a) (i) {0, 5, 7, 10, 11, 1, 14} {n N 0 : n 15}. (ii) Yes, 5, 7, 11, 16 can be generated by a set of fewer than 4 elements. Specifically, it is generated

More information

CHAPTER 8 Advanced Counting Techniques

CHAPTER 8 Advanced Counting Techniques 96 Chapter 8 Advanced Counting Techniques CHAPTER 8 Advanced Counting Techniques SECTION 8. Applications of Recurrence Relations 2. a) A permutation of a set with n elements consists of a choice of a first

More information

Lecture 2 September 4, 2014

Lecture 2 September 4, 2014 CS 224: Advanced Algorithms Fall 2014 Prof. Jelani Nelson Lecture 2 September 4, 2014 Scribe: David Liu 1 Overview In the last lecture we introduced the word RAM model and covered veb trees to solve the

More information

Alpha-Beta Pruning: Algorithm and Analysis

Alpha-Beta Pruning: Algorithm and Analysis Alpha-Beta Pruning: Algorithm and Analysis Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Introduction Alpha-beta pruning is the standard searching procedure used for 2-person

More information

Functional Data Structures

Functional Data Structures Functional Data Structures with Isabelle/HOL Tobias Nipkow Fakultät für Informatik Technische Universität München 2017-2-3 1 Part II Functional Data Structures 2 Chapter 1 Binary Trees 3 1 Binary Trees

More information

An Approximation Algorithm for Constructing Error Detecting Prefix Codes

An Approximation Algorithm for Constructing Error Detecting Prefix Codes An Approximation Algorithm for Constructing Error Detecting Prefix Codes Artur Alves Pessoa artur@producao.uff.br Production Engineering Department Universidade Federal Fluminense, Brazil September 2,

More information

On the parity of the Wiener index

On the parity of the Wiener index On the parity of the Wiener index Stephan Wagner Department of Mathematical Sciences, Stellenbosch University, Stellenbosch 7602, South Africa Hua Wang Department of Mathematics, University of Florida,

More information

Learning Partial Lexicographic Preference Trees over Combinatorial Domains

Learning Partial Lexicographic Preference Trees over Combinatorial Domains Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence Learning Partial Lexicographic Preference Trees over Combinatorial Domains Xudong Liu and Miroslaw Truszczynski Department of

More information

CS Algorithms and Complexity

CS Algorithms and Complexity CS 50 - Algorithms and Complexity Linear Programming, the Simplex Method, and Hard Problems Sean Anderson 2/15/18 Portland State University Table of contents 1. The Simplex Method 2. The Graph Problem

More information

Bipartite Perfect Matching

Bipartite Perfect Matching Bipartite Perfect Matching We are given a bipartite graph G = (U, V, E). U = {u 1, u 2,..., u n }. V = {v 1, v 2,..., v n }. E U V. We are asked if there is a perfect matching. A permutation π of {1, 2,...,

More information