StringTools - Maple Help

Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Combinatorics on Words : StringTools/IsDerangement

StringTools

 IsDerangement
 test whether a string is a derangement of another string

 Calling Sequence IsDerangement( s, t )

Parameters

 s - string t - string

Description

 • The IsDerangement( s, t ) command returns the value true if the string s is a derangement of the string t, and returns the value false otherwise. The strings s and t are derangements of one another if they differ at the $i$th position, for each index $i$.
 • Note that no string with a repeated character can be a derangement of another string; therefore, each of the strings s and t must be permutations.  See StringTools[IsPermutation].

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{IsDerangement}\left("foo","oof"\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{IsDerangement}\left("edit","tide"\right)$
 ${\mathrm{true}}$ (2)

Compatibility

 • The StringTools[IsDerangement] command was introduced in Maple 18.