Number of words

The function number_of_words can be used to compute the number of words over an alphabet with a given number of letters.

number_of_words(n: int, min: int, max: int) int

Returns the number of words over a given alphabet in some range.

Parameters
  • n (int) -- the number of letter

  • min (int) -- the minimum length of a word

  • max (int) -- one greater than the maximum length of a word

Returns

The number words over an alphabet with n with length in the range [min, max).

>>> from libsemigroups_pybind11 import number_of_words
>>> number_of_words(2, 0, 10)
1023