کد مقاله کد نشریه سال انتشار مقاله انگلیسی نسخه تمام متن
4649189 1342445 2009 16 صفحه PDF دانلود رایگان
عنوان انگلیسی مقاله ISI
The coolest way to generate combinations
موضوعات مرتبط
مهندسی و علوم پایه ریاضیات ریاضیات گسسته و ترکیبات
پیش نمایش صفحه اول مقاله
The coolest way to generate combinations
چکیده انگلیسی

We present a practical and elegant method for generating all (s,t)(s,t)-combinations (binary strings with ss zeros and tt ones): Identify the shortest prefix ending in 010 or 011 (or the entire string if no such prefix exists), and rotate it by one position to the right. This iterative rule gives an order to (s,t)(s,t)-combinations that is circular and genlex. Moreover, the rotated portion of the string always contains at most four contiguous runs of zeros and ones, so every iteration can be achieved by transposing at most two pairs of bits. This leads to an efficient loopless and branchless implementation that consists only of two variables and six assignment statements. The order also has a number of striking similarities to colex order, especially its recursive definition and ranking algorithm. In the light of these similarities we have named our order cool-lex!

ناشر
Database: Elsevier - ScienceDirect (ساینس دایرکت)
Journal: Discrete Mathematics - Volume 309, Issue 17, 6 September 2009, Pages 5305–5320
نویسندگان
, ,