====================================================================
RomanNumeral Examples
====================================================================

The Roman numeral package was added to FriCAS in MCMLXXXVI for use in
denoting higher order derivatives.

For example, let f be a symbolic operator.

  f := operator 'f
    f
                                  Type: BasicOperator

This is the seventh derivative of f with respect to x.
  D(f x,x,7)
     (vii)
    f     (x)
                                  Type: Expression Integer

You can have integers printed as Roman numerals by declaring variables to
be of type RomanNumeral (abbreviation ROMAN).

  a := roman(1978 - 1965)
    XIII
                                  Type: RomanNumeral

This package now has a small but devoted group of followers that claim
this domain has shown its efficacy in many other contexts.  They claim
that Roman numerals are every bit as useful as ordinary integers.

In a sense, they are correct, because Roman numerals form a ring and you
can therefore construct polynomials with Roman numeral coefficients,
matrices over Roman numerals, etc..

  x : UTS(ROMAN,'x,0) := x
    x
                              Type: UnivariateTaylorSeries(RomanNumeral,x,0)

Was Fibonacci Italian or ROMAN?

  recip(1 - x - x**2)
                 2        3      4         5         6        7          8
     I + x + II x  + III x  + V x  + VIII x  + XIII x  + XXI x  + XXXIV x
   + 
         9           10      11
     LV x  + LXXXIX x   + O(x  )
                    Type: Union(UnivariateTaylorSeries(RomanNumeral,x,0),...)

You can also construct fractions with Roman numeral numerators and
denominators, as this matrix Hilberticus illustrates.

  m : MATRIX FRAC ROMAN
                          Type: Void

  m := matrix [ [1/(i + j) for i in 1..3] for j in 1..3]
        + I    I    I+
        |--   ---  --|
        |II   III  IV|
        |            |
        | I    I   I |
        |---  --   - |
        |III  IV   V |
        |            |
        | I    I    I|
        |--    -   --|
        +IV    V   VI+
                          Type: Matrix Fraction RomanNumeral

Note that the inverse of the matrix has integral ROMAN entries.

  inverse m
        +LXXII   - CCXL    CLXXX +
        |                        |
        |- CCXL    CM     - DCCXX|
        |                        |
        +CLXXX   - DCCXX    DC   +
                          Type: Union(Matrix Fraction RomanNumeral,...)

Unfortunately, the spoil-sports say that the fun stops when the
numbers get big---mostly because the Romans didn't establish
conventions about representing very large numbers.

  y := factorial 10
    3628800
                          Type: PositiveInteger

You work it out!

  roman y
  ((((I))))((((I))))((((I)))) (((I)))(((I)))(((I)))(((I)))(((I)))(((I))) ((I))(
  (I)) MMMMMMMMDCCC
                           Type: RomanNumeral

Issue the system command )show RomanNumeral to display the full
list of operations defined by RomanNumeral.


  a := roman(78)
    LXXVIII
                      Type: RomanNumeral

  b := roman(87)
    LXXXVII
                      Type: RomanNumeral

  a + b 
    CLXV
                      Type: RomanNumeral

  a * b
    MMMMMMDCCLXXXVI
                      Type: RomanNumeral

  b rem a 
    IX
                      Type: RomanNumeral

See Also:
o )help Integer
o )help Complex
o )help Factored
o )help Records
o )help Fraction
o )help RadixExpansion
o )help HexadecimalExpansion
o )help BinaryExpansion
o )help DecimalExpansion
o )help IntegerNumberTheoryFunctions
o )show RomanNumeral

