Auxiliary.hpp File Reference

Plans regarding helper functions with number-theoretical character. More...

Go to the source code of this file.

Detailed Description

Plans regarding helper functions with number-theoretical character.

Floors of logarithms
  • Currently we have fld, which is a special case of floorlog, can only handle integers, and which is also slower, but which can handle arguments of arbitrary size.
  • Should "floorlog" be changed to "flog"?
  • floorlog could be made excepting arbitrary large inputs if arbitrary precision would be used --- perhaps a case distinction should be performed?
  • The use of numeric logarithms will always involve a risk of false results, so precise algorithms are sought.
Positional (polyadic) representations of numbers
  • Complete the tests.
  • We duplicated some Maxima functionality (see "ibase" and "obase"), and we should comment on that.
    1. For example that it's quite confusing --- if one doesn't know what obase is, it's a bit hard to find out, and to change ibase we need to know its current value!
    2. So one better uses it only locally, but this is also not completely trivial:
      (%i6) block([obase : 16], print(16));
      Evaluation took 0.0000 seconds (0.0004 elapsed) using 1,016 bytes.
      (%o6) 16
  • DONE The whole current system is a bad hack --- strings are not appropriate mathematical objects, but lists of integers!
    1. Strings should only result from converting lists of integers.
    2. DONE So all these functions need to be rewritten.
    3. DONE We also need better names than "base_n".
  • DONE Currently, integer conversion functions don't handle negative numbers.
    1. Example : "int2base_n(-10,3);" errors.
    Likely this limitation should be removed.
  • DONE (polyadicstr2int(str,0) equals the rightmost digit) Should base_n2int("SOMETHING",0) = 0 ?
  • That Maxima yields "integer_partitions(0) = {}" is a bug:
    1. DONE Tell the Maxima mailing list, and report the bug.
    2. The documentation states "Thus 0 has no partitions."; this is false (since [] is a partition of 0).
    3. Accordingly, also "integer_partitions(0,0) = {}" is false; it must be {[]}.
    4. Furthermore the documentation states that n can be an integer, but for example "integer_partitions(-1) = int_partitions(-1)".
  • We should also correct "integer_partitions(0,0)", but how to overload ext_integer_partitions on the number of arguments?
  • If the Maxima function would be corrected, then our function ext_integer_partitions shall be eliminated.
  • See "Document important programming techniques" in ComputerAlgebra/plans/Maxima.hpp.
Unordered integer partitions
  • Is there a more direct way of computing unordered integer partitions? (without using integer partitions)?
    1. Given the proposed formula below, it should be possible to convert the subsets of {1,...,n-1} into unordered integer partitions.
  • The Maxima-function permutations is very inefficient for example for lists like create_list(1,i,1,n) --- are there better algorithms?
  • The number of unordered partitions of n seems to be 2^(n-1) --- is this correct?

Definition in file Auxiliary.hpp.