Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Random generation of words with fixed occurrences of symbols in regular languages A. Bertoni P. Massazza R. Radicioni 1 Università degli Studi di Milano,

Similar presentations


Presentation on theme: "1 Random generation of words with fixed occurrences of symbols in regular languages A. Bertoni P. Massazza R. Radicioni 1 Università degli Studi di Milano,"— Presentation transcript:

1

2 1 Random generation of words with fixed occurrences of symbols in regular languages A. Bertoni P. Massazza R. Radicioni 1 Università degli Studi di Milano, Dipartimento di Scienze dell'Informazione, via Comelico 39, 20135 Milano, Italy. 2 Università dell’Insubria, Dipartimento di Informatica e Comunicazione, via Mazzini 5, 21100 Varese, Italy 1 1 2 MIUR-COFIN: Ravello, september 19-21

3 2 Fix a language INPUT: Integers OUTPUT: A random word with occurrences of APPLICATIONS: Approximate counting Testing and complexity analysis Statistical analysis of biological sequences THE RGFO L PROBLEM

4 3 Deep correlation with counting [Flajolet, Van Cutsem, Zimmermann 1994] Best algorithm for regular languages working in time [Denise, Roques, Termier 2000] Is there an algorithm ? OUR CONTRIBUTION Answer is YES for L regular, M = 2 RANDOM GENERATION AND COUNTING

5 4 STANDARD TECHNIQUE Minimal automaton for L Language recognized by arithmetical operations (due to the precomputation of all )

6 5 STANDARD TECHNIQUE: Arithmetical ops, minimal automaton has one state (1) (2) 1 1 A VERY SIMPLE EXAMPLE 1 1 1 0 4 3 2 11 3 6 4 111 ALTERNATIVE SOLUTION: Arithmetical ops 011111 6 21 (1’)

7 6 Standard technique uses equations of type RECURRENCES WITH 1-dim SHIFTS Alternative solution uses equations of type Theorem: If L is regular, then there exist polynomials s.t. verifies recurrences of type (2).

8 7 Def.: Move(, s, sense) computes a matrix of coefficients from M by means of recurrences of type (2), depending on direction s and on sense sense. Example: M=2, Move(, 1, forward) An Forward (Backward) move in the direction s uses THE FUNCTION “MOVE”

9 8 Given, we first compute (GB Bases) do not vanish in for Then, an algorithm holds if the coefficients A FIRST ATTEMPT Phase 1: Computation of Phase 2: Random generation

10 9 SOLUTION for M=2: Consider the recurrence equation (with constant coefficients) directly associated with a rational function and define a procedure SmartMove(M,dir) that smartly uses recurrence (3) whenever it is not possible to compute from by means of recurrences of type (2). Fact: A matrix of coefficients M can be computed by (3) if are known. Examples: SSW W S W S W What if the leading and the least coefficients vanish?

11 10 Fact 1 In the grid there are O(n 1 +n 2 ) points where the coefficients of recurrences of type (2) vanish. Fact 3 The cost (time and space) of a call SmartMove (M(x,y),dir) that occurs inside RandomGen(n 1,n 2 ) is O(n 1 +n 2 ) Fact 4 The cost (time and space) of h calls SmartMove(M(x h,y h ),dir h ) that occur inside RandomGen(n 1,n 2 ) is O(max(h, n 1 +n 2 )) Fact 2 RandomGen(n 1,n 2 ) calls SmartMove() O(n 1 +n 2 ) times Theorem RandomGen(n 1,n 2 ) runs in time (and space) O(n 1 +n 2 )

12 11 There exists an O( n 1 +n 2 ) algorithm for the RGFO L problem (under uniform cost criterion) when is regular. Future Works Extension of the general case to arbitrary alphabets (M>2). Extension to unambiguous context-free languages. Deep investigation on the nature of recurrences Complexity analysis under log. cost criterion. CONCLUSIONS


Download ppt "1 Random generation of words with fixed occurrences of symbols in regular languages A. Bertoni P. Massazza R. Radicioni 1 Università degli Studi di Milano,"

Similar presentations


Ads by Google