Lexicographic Generation Contents 1 Introduction to Generation And

Lexicographic Generation Contents 1 Introduction to Generation And

faculty of science MATH 895-4 Fall 2010 department of mathematics Course Schedule LECTURE 8 Lexicographic generation Lexicographic generation Week Date Sections Part/ References Topic/Sections Notes/Speaker from FS2009 Contents1 Sept 7 I.1, I.2, I.3 Combinatorial Symbolic methods Structures 2 14 I.4, I.5, I.6 FS: Part A.1, A.2 Unlabelled structures 1 Introduction to generationComtet74 and random generation 1 3 21 II.1, II.2, II.3 Labelled structures I 1.1 Features we mightHandout want#1 in an exhaustive generation algorithm . .1 4 1.228 WhatII.4, aboutII.5, II.6 random(self study) generation?Labelled . structures . II . .1 Combinatorial Combinatorial 5 Oct 5 III.1, III.2 Asst #1 Due 2 Lexicographic rankingparameters and unrankingParameters 2 FS A.III 6 2.112 BinaryIV.1, IV.2 strings(self-study) . .Multivariable . .GFs . .3 2.2 Bijection to subsets . .3 7 19 IV.3, IV.4 Analytic Methods Complex Analysis 2.3 k-subsets . .FS: . .Part . B: . IV, . .V, VI . .3 8 26 Appendix B4 Singularity Analysis IV.5 V.1 Stanley 99: Ch. 6 9 Nov 2 Asst #2 Due Handout #1 Asymptotic methods 1 Introduction9 VI.1 (self-study) to generation andSophie random generation 10 12 A.3/ C Introduction to Prob. Mariolys Two things we might want to do given a combinatorial class A would be to generate all elements of An or to generate18 IX.1 a random element of AnLimit. Laws and Comb Marni 11 What20 doesIX.2 it meanRandom to generate Structures somethingDiscrete Limit Laws at random?Sophie For a combinatorial class A, we want to describe a process (e.g.and algorithm) Limit Laws that takes as input n, and outputs an object α from A such that any FS: Part C Combinatorial 23 IX.3 1 Mariolys (rotating element12 has probability A of being generated.instances of discrete We call this Uniform generation. presentations)n 25 IX.4 Continuous Limit Laws Marni 1.1 Features we might wantQuasi-Powers in an and exhaustive generation algorithm 13 30 IX.5 Sophie Gaussian limit laws • We might want to be able to generate the elements of An sequentially, so that we can step from 14 Dec 10 Presentations Asst #3 Due one to the next. That is we might want a successor function which takes one element of An and gives the next one in the order. This is useful if we want to iterate through all elements of An and do something with each one. • Given an object in An we might want to be able to determine the position of this object in the order, that is we might want a ranking function. We also might want to be able to determine the element in position i, that is we might want an unranking function We would want to be able to do these things efficiently. Dr. Marni MISHNA, Department of Mathematics, SIMON FRASER UNIVERSITY VersionDefinition. of: 11-Dec-09Let S be a finite set. A rank function is a bijection rank : S ! f0; 1;:::; jSj − 1g The corresponding unrank function is the inverse bijection unrank : f0; 1;:::; jSj − 1g ! S So rank(s) = i if and only if unrank(i) = s. If we have a good unranking function we can generate a random element by first generating a random element of f0;:::; kSj − 1g and then unranking. If we have a good ranking and unranking function we can generate a successor function by successor(c) = unrank(rank(c) + 1). In both cases other approaches might be more efficient. 1.2 What about random generation? Why would we want to do random generation? • To get a sense of what the objects in a given class “look” like on average: estimate parameters like average depth of a tree; average number of cycles in a permutation etc. • To test a hypothesis about the class using an experimental method; MARNI MISHNA,SPRING 2011; KAREN YEATS,SPRING 2013 MATH343:APPLIED DISCRETE MATHEMATICS PAGE 1/5 faculty of science MATH 895-4 Fall 2010 department of mathematics Course Schedule LECTURE 8 Lexicographic generation Week Date Sections Part/ References Topic/Sections Notes/Speaker • To feedfrom as FS2009 input into an algorithm to test the algorithm. 1 A randomSept 7 I.1,labelled I.2, I.3 Combinatorial binary tree on 200Symbolic nodes: methods Structures 2 14 I.4, I.5, I.6 FS: Part A.1, A.2 Unlabelled structures Comtet74 3 21 II.1, II.2, II.3 Labelled structures I Handout #1 4 28 II.4, II.5, II.6 (self study) Labelled structures II Combinatorial Combinatorial 5 Oct 5 III.1, III.2 Asst #1 Due parameters Parameters FS A.III 6 12 IV.1, IV.2 (self-study) Multivariable GFs 7 19 IV.3, IV.4 Analytic Methods Complex Analysis FS: Part B: IV, V, VI 8 26 Appendix B4 Singularity Analysis IV.5 V.1 Stanley 99: Ch. 6 9 Nov 2 Asst #2 Due Handout #1 Asymptotic methods 9 VI.1 (self-study) Sophie Hallmarks10 of a good random generation scheme 12 A.3/ C Introduction to Prob. Mariolys Correct Each element of size n is generated with equal probability. 18 IX.1 Limit Laws and Comb Marni 11 Efficient20 HowIX.2 long doesRandom it Structures take to generateDiscrete Limit an Laws elementSophie of size n as a function of n? and Limit Laws FS: Part C Combinatorial Space23 EfficiencyIX.3 How much space does it take to generateMariolys an element (rotating 12 instances of discrete presentations) Ease of25 implementationIX.4 How long wouldContinuous it Limit take Laws toMarni actually code the algorithm? Quasi-Powers and Re-usability13 30 IX.5 Are there optimizations possible if I amSophie going to run the algorithm multiple times? Gaussian limit laws Generalizability14 Dec 10 Is this partPresentations of a wider framework, orAsst simply #3 Due an adhoc solution applicable to a single problem? Strategies 1. Consider simple models like binary strings, and make a direct argument; 2. Reduce the random generation to a very simple model via a bijection; 3. Surjective method: Find a simpler class that is in a k to one correspondence– uniform generation is still preserved; Dr. Marni MISHNA, Department of Mathematics, SIMON FRASER UNIVERSITY Version of: 11-Dec-09 4. Ranking/unranking: Order all An elements. Generate uniformly a random number k between 1 and An, and determine the k-th element. 5. Rejection method: Generate a larger set and then filter the output; 6. Recursive method: Decompose the object by the counting probabilities 7. Markov method: use Markov chains; 8. ... 2 Lexicographic ranking and unranking (see Donald Kreher and Douglas Stinson, Combinatorial Algorithms, chapter 2 for a reference on this material) Definition. Let A = (a1; a2; : : : ; an) and B = (b1; b2; : : : ; bm) be distinct lists of integers. A < B in lexicographic order, if a1 = b1; : : : ; ak−1 = bk−1 and either ak < bk or n = k − 1 and m ≥ k. For example (1; 2; 2) < (2; 1), (1; 2; 2) < (1; 3; 1), (1; 2; 2) < (1; 2; 2; 1). This is the usual dictionary ordering on words using alphabetical order on the letters (hence the name). If we can represent our combinatorial objects as lists, then we can use lexicographic order to order them, and from that get successor, rank, and unrank functions. MARNI MISHNA,SPRING 2011; KAREN YEATS,SPRING 2013 MATH343:APPLIED DISCRETE MATHEMATICS PAGE 2/5 faculty of science MATH 895-4 Fall 2010 department of mathematics Course Schedule LECTURE 8 Lexicographic generation Week Date Sections Part/ References Topic/Sections Notes/Speaker 2.1 Binaryfrom FS2009 strings Binary1 Sept strings 7 I.1, I.2, are I.3 simpleCombinatorial enough to directlySymbolic methods do random generation. Let us represent a binary string of Structures length2 14n by anI.4, I.5, array I.6 ofFS: length Part A.1, A.2n with entriesUnlabelled structures 0 or 1. Assume we have a random number generator. Comtet74 Maple 3 21 II.1, II.2, II.3 Labelled structures I > R:=rand(0..1); #Handout picks #1 a random integer in the range 0..1, i.e. picks 0 or 1 >4 Bin:=28 proc(n)II.4, II.5, II.6 (self study) Labelled structures II > for i from 1 toCombinatorial n do : Combinatorial 5 Oct 5 III.1, III.2 Asst #1 Due > A[i]:= R();parameters Parameters FS A.III >6 12 od; IV.1, IV.2 (self-study) Multivariable GFs > return (seq(A[i], i=1..10)); >7 end19 proc;IV.3, IV.4 Analytic Methods Complex Analysis FS: Part B: IV, V, VI 8 26 Appendix B4 Singularity Analysis IV.5 V.1 Stanley 99: Ch. 6 n 9 EachNov 2 string has probability (0:5) of being generated,Asst #2 soDue it is uniform. There is one call made for Handout #1 Asymptotic methods each n9, so weVI.1 say that(self-study) it is linear in n. It is quite easySophie to implement, as we see. 10Binary strings can also be lexicographically ordered since they are lists of 0s and 1s. It will be handiest12 if weA.3/ C do reverse lexicographicIntroduction order to (so Prob. startMariolys at the right), because then lexicographic order corresponds18 IX.1 exactly to the order givenLimit by interpretingLaws and Comb Marni the binary string as a binary number. Conceptu- 11 ally ranking20 IX.2 and unrankingRandom Structures is just convertingDiscrete Limit from Laws a binarySophie string to a binary number and back. and Limit Laws So we have FS: Part C Combinatorial 23 IX.3 Mariolys (rotating Algorithm: RankBin 12 instances of discrete input: n (length ofpresentations) word), w (word) r = 025 IX.4 Continuous Limit Laws Marni for i from 1 to n Quasi-Powers and 13 30 IX.5 Sophie if w(i) = 1 Gaussian limit laws 14 rDec = 10 r+2ˆi Presentations Asst #3 Due output: r Algorithm: UnrankBin input: n (length of word), r (rank) for i from 1 to n if r is congruent to 1 mod 2 b(i) = 1 r = floor(r/2) output: b Dr.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us