Conjugate - Maple Help

Iterator[Trees]

 Conjugate
 compute the conjugate of a tree

 Calling Sequence Conjugate(tree, format=fmt)

Parameters

 tree - seq(rtable) fmt - (optional) A,C,D,E,LR,P,S,Z

Options

 • format = A,C,D,E,LR,P,S,Z
 Specifies the format of the tree. The default is LR. See Iterator[Trees] for a description of the formats.

Description

 • The Conjugate command computes the conjugate of a tree. The conjugate of a forest consists of its left-to-right mirror reflection. The conjugate of a tree of a given format is computed by converting it to a forest, reflecting, then converting back to the specified format.
 • The tree parameter is the tree.

Examples

 > $\mathrm{with}\left(\mathrm{Iterator}:-\mathrm{Trees}\right):$

Generate a random tree with four internal nodes in LR format.

 > $L,R≔\mathrm{Random}\left(4,\mathrm{format}=\mathrm{LR}\right)$
 ${L}{,}{R}{≔}\left[\begin{array}{cccc}{2}& {3}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{cccc}{4}& {0}& {0}& {0}\end{array}\right]$ (1)

Compute its conjugate.

 > $\mathrm{Conjugate}\left(L,R\right)$
 $\left[\begin{array}{cccc}{0}& {3}& {4}& {0}\end{array}\right]{,}\left[\begin{array}{cccc}{2}& {0}& {0}& {0}\end{array}\right]$ (2)

References

 Knuth, Donald Ervin. The Art of Computer Programming, volume 4, fascicle 4; generating all trees, sec. 7.2.1.6, generating all trees, exercise 11, p. 33.

Compatibility

 • The Iterator[Trees][Conjugate] command was introduced in Maple 2016.