solve the system of generating functions associated with a grammar - Maple Help

Online Help

All Products    Maple    MapleSim


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

combstruct[gfsolve] - solve the system of generating functions associated with a grammar

Calling Sequence

gfsolve(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 gfsolve function returns a set containing the generating functions which count the objects described in the specification.

  

Each nonterminal A, has an associated generating function Az, found by solving the system of generating function equations associated with the specification. If it cannot solve the system, it returns FAIL.

  

For more information, see combstruct[gfeqns].

• 

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 generating function has an extra variable that marks that object. The same tag can be associated with more than one Epsilon name. The tag does not need to be a variable.

• 

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

Examples

withcombstruct:

An example of a labeled binary tree.

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

gfsolvetree,labeled,z

Lz=z,Nz=z,Tz=121+4z2+1z

(1)

Nonplane ternary trees.  Mark the leaf nodes of an unlabeled general tree.

ternary_tree:=G=UnionZ,ProdZ,SetG,card=3,labeled:

gfsolveternary_tree,x

Gx=123x+9x38xx21/3x13x+9x38xx21/312I33x+9x38xx21/3x23x+9x38xx21/3,Zx=x

(2)

Mark the leaf nodes of an labeled general tree.

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

gfsolvetree1,labeled,z,u,leaf

Lz,u=uz,Nz,u=z,Tz,u=uzLambertWzⅇuz,leafz,u=u

(3)

See Also

combstruct, combstruct[gfeqns], combstruct[gfseries], 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