combstruct - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Combinatorics : Combinatorial Structures : combstruct/gfseries

combstruct

  

gfseries

  

return the series of the generating functions associated with a grammar

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

gfseries(spec, typ, var, tags)

Parameters

spec

-

combinatorial specification

typ

-

labeling type; 'labeled' or 'unlabeled'

var

-

variable to use in the generating functions

tags

-

(optional) list of lists; each list contains a variable tag followed by the Epsilon nonterminal name(s) associated with that tag

Description

• 

The gfseries function returns a table containing the generating functions, in series form, that count the objects associated with each production in the grammar.

  

Each nonterminal has an associated equation which uses the nonterminal name as the name of the equation. For example, Az would be the generating function for A.

• 

If the objects are labeled, exponential generating functions are produced. If the objects are unlabeled, ordinary generating functions are used.

• 

Objects can be marked (tagged) by forming the product of that object with a named Epsilon and associating a tag with that Epsilon.

  

If the tag is a variable name, the resulting series has an extra variable that marks the object. The same tag can be associated with more than one Epsilon name. The tag does not need to be a variable.

• 

The gfseries function uses the series command to generate the series. Thus, the order of the result is controlled by the Order environment variable.

• 

For information on how to write specifications, see combstruct and combstruct[specification].

Examples

withcombstruct:

An example of a labeled binary tree.

treeT=UnionL,ProdN,T,T,L=Atom,N=Atom:

gfseriestree,labeled,z

tableLz=z,Tz=z+z3+2z5+Oz7,Nz=z

(1)

Mark the leaf nodes of an unlabeled general tree.

tree1T=UnionL,ProdN,SetT,L=Prodleaf,Atom,leaf=Ε,N=Atom:

gfseriestree1,unlabeled,z,u,leaf

tableNz,u=z,Lz,u=uz,Tz,u=u+1z+u+1z2+u2+2u+2z3+u3+3u2+5u+4z4+u4+4u3+10u2+13u+9z5+Oz6,leafz,u=u

(2)

Order10

Order:=10

(3)

gfseriestree,unlabeled,z

tableLz=z,Tz=z+z3+2z5+5z7+14z9+Oz11,Nz=z

(4)

See Also

combstruct

combstruct[gfeqns]

combstruct[gfsolve]

combstruct[specification]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam