Computer algebra systems, mathematical representation, and the …fateman/talks/nist.pdf · 2000....

31
Computer algebra systems, Computer algebra systems, mathematical representation, and the mathematical representation, and the DLMF DLMF Richard Fateman, Bruce Char, Jeremy Johnson University of California, Berkeley Drexel University, Philadelphia National Institute of Standards and Technology DLMF Seminar Series, November 6, 2000

Transcript of Computer algebra systems, mathematical representation, and the …fateman/talks/nist.pdf · 2000....

  • Computer algebra systems, Computer algebra systems, mathematical representation, and the mathematical representation, and the DLMFDLMF

    Richard Fateman, Bruce Char, Jeremy JohnsonUniversity of California, BerkeleyDrexel University, PhiladelphiaNational Institute of Standards and Technology

    DLMF Seminar Series, November 6, 2000

  • Computer Algebra and DLMF 2

    Desiderata for the Digital Library of Desiderata for the Digital Library of Mathematical FunctionsMathematical Functions

    l Traditional usagel New modes of interaction

    – Examples

    l New ambitions

  • Computer Algebra and DLMF 3

    NonNon--digital tradition: Finding Out Stuffdigital tradition: Finding Out Stuff

    l Individually owned reference worksl Access to libraries’ references worksl Access to colleagues by letter, phone,

    emaill Paper and pencil explorationl Numerical experimentation

  • Computer Algebra and DLMF 4

    Wolfram Research’s Special Functions Wolfram Research’s Special Functions site: 3 versionssite: 3 versions

    l Huge postersl Interactive web site/ Mathematica

    notebooksl Printed form (or the equivalent PDF)

  • Computer Algebra and DLMF 5

    The postersThe posters

  • Computer Algebra and DLMF 6

    The web site (here, the Arcsin page)The web site (here, the Arcsin page)

  • Computer Algebra and DLMF 7

    WRI’s Categories/ Some SubcategoriesWRI’s Categories/ Some Subcategoriesprimary definitionspecific valuesgeneral characteristicsseries representations

    generalized power series at various pointsq-seriesexponential fourier seriesdirichlet seriesasymptotic seriesother series

    integral reprsentationson the real axiscontour integralsmultiple integral representationanalytic continuationsproduct representationslimit representations

    continued fractionsgenerating functionsgroup representationsdifferential equationsdifference equationstransformationsaddition formulas etcoperationsintegral transformsidentitiesrepresentations through more general functionsrelations with other functionszerosinequalitiestheorems other informationhistory and applicationsreferences

  • Computer Algebra and DLMF 8

    Click on “Series Representations”…Click on “Series Representations”…

  • Computer Algebra and DLMF 9

    This is not very usefulThis is not very useful

    l These are blurry pictures of math formulas.l The most plausible next step seems to be to copy

    them down on paper and check by hand.l There is a possibility of making typos or fresh algebra

    mistakes.l The notation might be different from what you are

    using.l Sparse (or no) info on singularities, regions of

    validity.l To run some numbers through, you need to write a

    computer program (Fortran? Matlab? C++?)

  • Computer Algebra and DLMF 10

    Notebook form (I)Notebook form (I)

    ArcSin[z] == z^3/6 + z + (3*z^5)/40 + \[Ellipsis] ==

    Sum[(Pochhammer[1/2, k]*z^(2*k + 1))/((2*k + 1)*k!),

    {k, 0, Infinity}] ==

    z*Hypergeometric2F1[1/2, 1/2, 3/2, z^2] /; Abs[z] < 1

    Input form

    One could imagine that a “system independent” language such as proposed by the OpenMath consortium would replace this language. Note however that agreement on the semantics of \[Ellipsis] would be difficult.

  • Computer Algebra and DLMF 11

    Notebook form (II)Notebook form (II)Displayed form (one version)

    In reality, Mathematica does not look quite as good as this in the interactive mode.

  • Computer Algebra and DLMF 12

    Notebook form (III)Notebook form (III)TeX form

    {Condition}(\arcsin (z) =

    {\frac{{{\Mfunction{z}}^3}}{6}} + z +

    {\frac{3\,{z^5}}{40}} + \ldots =

    \Mfunction{\sum}_{k = 0}^{\infty }

    {\frac{\Mfunction{Pochhammer}({\frac{1}{2}},k)\,

    {{\Mfunction{z}}^{2\,k + 1}}}{\left( 2\,k + 1

    \right) \,k!}} =

    \Mfunction{z}\,\Mfunction{Hypergeometric2F1}(

    {\frac{1}{2}},{\frac{1}{2}},{\frac{3}{2}},{z^2}),

    \Mfunction{Abs}(z) < 1))

    Useful in case you wanted to paste/edit this into another paper, using Mathematica TeX macros.

  • Computer Algebra and DLMF 13

    Computing Inside the NotebookComputing Inside the NotebookHow good is the 3-term approximation at z= ½ ?

    ArcSin[z] == z + z^3/6 + (3*z^5)/40 + ... /. z -> 1/2 Í

    Pi/6 == 2009/3840 + ... Surprised?

    N[ Pi/6 == 2009/3840 + ...] Í 0.523599 == 0.523177 + ...

    N[ Pi/6 == 2009/3840 + ..., 30] Í 0.523599 == 0.523177 + ...

    N[ Pi/6 == 2009/3840 + ..., 30] Í0.52359877559829887307710723055 == 0.52317708333333333333333333333 + ...

  • Computer Algebra and DLMF 14

    Simplification Inside the NotebookSimplification Inside the Notebook

    In[30] := z* Hypergeometric2F1[1/2, 1/2, 3/2, z^2]

    Note: this is how Mathematica interactive output looks.

    This should be the same as ArcSin[z] for |z|

  • Computer Algebra and DLMF 15

    All commercial computer algebra All commercial computer algebra systems (CAS) have essentially the same systems (CAS) have essentially the same notebook paradigmnotebook paradigml Macsymal Maplel Mathematical Axioml MuPadl Scientific Word / Maplel Derive

  • Computer Algebra and DLMF 16

    Advice on coding a reference chapterAdvice on coding a reference chapter

  • Computer Algebra and DLMF 17

    What about legacy “knowledge”? Can What about legacy “knowledge”? Can we convert from scanned text?we convert from scanned text?

    Example from integral table

    l In practice, we can do some parsing using OCR if we know about the domains.

    l But in general, we cannot read “with understanding”.

  • Computer Algebra and DLMF 18

    What about using LaTeX as source and What about using LaTeX as source and then converting to OpenMath/ CAS?then converting to OpenMath/ CAS?

    Generally speaking: not automatically TeX does not distinguish semantically between 1*2*3 and 123. Or between x cos x and xfoox.It has no notion of precedence of operators

    Gradshteyn and Rhyzik, Table of Integrals and Series (Academic Press) was re-typeset completely in TeX TWICE, because the first version did not reflect semantics. MathML, XML, and OpenMath are inadequate.

  • Computer Algebra and DLMF 19

    Using OpenMath as original source is Using OpenMath as original source is pretty much out of the question.pretty much out of the question.

    Intent is to code:

    x cos x

  • Computer Algebra and DLMF 20

    Using MathML as original source is Using MathML as original source is pretty much out of the question, too.pretty much out of the question, too.

    2πκ

    1−β

    2

    /2

  • Computer Algebra and DLMF 21

    What can a CAS do better?What can a CAS do better?

    •Semantics for what makes sense to the CAS is immediate.

    •Presentation for what doesn’t make sense to the CAS

    •Advantage: There is an immediate computational ontology

    •Immediate syntactic disambiguation

    •Easy translation into MathML for display•Easy translation into OpenMath, if anyone else cares.

  • Computer Algebra and DLMF 22

    What about using Java Applets?What about using Java Applets?

    l Pro: – an applet provides more intimate interaction with a user.

    • Examples from Math Forum …

    l Con: – Only Java-enabled clients can use such applets.– Java standardization is problematical– High quality numerical software in Java?– Symbolic computation in Java?– Poor access to underlying computer.

  • Computer Algebra and DLMF 23

    What about Server Side software?What about Server Side software?

    l Pro: – arbitrarily powerful – could be huge database

    and super-fast computer– always up-to-date– controlled by validation team? – Can collect / re-distribute new data

  • Computer Algebra and DLMF 24

    What about Server Side software?What about Server Side software?

    l Con: – Risk/cost of computation at server – Communication requirement

    • Cost• Connection reliability

  • Computer Algebra and DLMF 25

    What about no software?What about no software?

    l Pro: – You can “run” DLMF without a computer – You can work on a desert island

    l Con: – Anyone with a computer or electricity will be

    disappointed

  • Computer Algebra and DLMF 26

    What about only browser software?What about only browser software?

    l Pro: – You can “run” DLMF on an appliance ($300)

    l Con: – Loss in the marketplace of ideas

    • In some respects it will suffer from comparison with software, some of which is free today

    • Students who are used to (say) Mathematica will use other resources, even if less authoritative

  • Computer Algebra and DLMF 27

    What about numericWhat about numeric--only software?only software?

    l Pro: – You print numeric tables as needed

    l Con: – Symbolic data is endlessly tabulated instead.

    etc

  • Computer Algebra and DLMF 28

    What about symbolic softwareWhat about symbolic software

    l Now we can consider including algorithms for – trig(n/m p)– Indefinite integrals (replacing 10-20,000)– Summation, Limits– Definite integrals (a challenge still)– Implicit application of identities, reduction of argument

    or order by recursion, etc.– Generation of any number of terms in series– Expansion in Chebyshev or other polynomials– Exact arithmetic or “bigfloat” arithmetic

  • Computer Algebra and DLMF 29

    A challenge: Include a CAS in DLMFA challenge: Include a CAS in DLMF

    l Free Macsyma (c. 1982)l (buy) Commercial system

    – Macsyma, Maple, Mathematica, Axiom …alternatively

    l Require the user to have a CAS separately (like requiring a Fortran compiler to use GAMS)

  • Computer Algebra and DLMF 30

    What do we want? What can we What do we want? What can we attempt?attempt?l Exhaustive hierarchical hyperlinks to everything

    knownl Human readable forml Computer usable form + ALGORITHMSl Searchable form /Unique identifiers for formulasl Provenance of informationl Annotations from other usersl Corrections current or pastl Cross-reference hyperlinks to all of mathematicsl Applicationsl A bridge across paper/pencil ÄÅcomputer gapl A tireless, accurate and efficient robot to help us

  • Computer Algebra and DLMF 31

    Computers do more than arithmeticComputers do more than arithmetic

    Many persons who are not conversant with mathematical studies imaginethat because the business of [Babbage’s Analytical Engine] is to giveits results in numerical notation, the nature of its processes mustconsequently be arithmetical and numerical, rather than algebraical andanalytical. This is an error. The engine can arrange and combine itsnumerical quantities exactly as if they were letters or any othergeneral symbols; and in fact it might bring out its results inalgebraic notation, were provisions made accordingly.

    -- Ada Augusta, Countess of Lovelace, (1844)