OpenMath Content Dictionary: combinat1
Canonical URL:
http://www.openmath.org/cd/combinat1.ocd
CD Base:
http://www.openmath.org/cd
CD File:
combinat1.ocd
CD as XML Encoded OpenMath:
combinat1.omcd
Defines:
Bell , Fibonacci , Stirling1 , Stirling2 , binomial , multinomial
Date:
2004-03-30
Version:
3
(Revision 1)
Review Date:
2017-12-31
Status:
experimental
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The copyright holder grants you permission to redistribute this
document freely as a verbatim copy. Furthermore, the copyright
holder permits you to develop any derived work from this document
provided that the following conditions are met.
a) The derived work acknowledges the fact that it is derived from
this document, and maintains a prominent reference in the
work to the original source.
b) The fact that the derived work is not the original OpenMath
document is stated prominently in the derived work. Moreover if
both this document and the derived work are Content Dictionaries
then the derived work must include a different CDName element,
chosen so that it cannot be confused with any works adopted by
the OpenMath Society. In particular, if there is a Content
Dictionary Group whose name is, for example, `math' containing
Content Dictionaries named `math1', `math2' etc., then you should
not name a derived Content Dictionary `mathN' where N is an integer.
However you are free to name it `private_mathN' or some such. This
is because the names `mathN' may be used by the OpenMath Society
for future extensions.
c) The derived work is distributed under terms that allow the
compilation of derived works, but keep paragraphs a) and b)
intact. The simplest way to do this is to distribute the derived
work under the OpenMath license, but this is not a requirement.
If you have questions about this license please contact the OpenMath
society at http://www.openmath.org .
Author: OpenMath Consortium
SourceURL: https://github.com/OpenMath/CDs
This CD defines some basic combinatorics definitions.
Written by S. Dalmas (INRIA Sophia Antipolis) for the Esprit OpenMath
project.
Role:
application
Description:
The binomial coefficients. binomial(n, m) is the number of ways of choosing m
objects from a collection of n distinct objects without regard to the order.
Commented Mathematical property (CMP):
binomial(n,m) = n!/(m!*(n-m)!)
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="binomial"/>
<OMV name="n"/>
<OMV name="m"/>
</OMA>
<OMA>
<OMS cd="arith1" name="divide"/>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMV name="n"/>
</OMA>
<OMA>
<OMS cd="arith1" name="times"/>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMV name="m"/>
</OMA>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMV name="n"/>
<OMV name="m"/>
</OMA>
</OMA>
</OMA>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">binomial</csymbol><ci>n</ci><ci>m</ci></apply>
<apply><csymbol cd="arith1">divide</csymbol>
<apply><csymbol cd="integer1">factorial</csymbol><ci>n</ci></apply>
<apply><csymbol cd="arith1">times</csymbol>
<apply><csymbol cd="integer1">factorial</csymbol><ci>m</ci></apply>
<apply><csymbol cd="integer1">factorial</csymbol>
<apply><csymbol cd="arith1">minus</csymbol><ci>n</ci><ci>m</ci></apply>
</apply>
</apply>
</apply>
</apply>
</math>
Prefix
Popcorn
combinat1.binomial($n, $m) = integer1.factorial($n) / (integer1.factorial($m) * integer1.factorial($n - $m))
Rendered Presentation MathML
n
m
=
n
!
m
!
(
n
-
m
)
!
Example:
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="binomial"/>
<OMI> 4 </OMI>
<OMI> 2 </OMI>
</OMA>
<OMI> 6 </OMI>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">binomial</csymbol>
<cn type="integer">4</cn>
<cn type="integer">2</cn>
</apply>
<cn type="integer">6</cn>
</apply>
</math>
Prefix
Popcorn
combinat1.binomial(4, 2) = 6
Rendered Presentation MathML
Signatures:
sts
Role:
application
Description:
The multinomial coefficient, multinomial(n, n1, ... nk) is the number of
ways of choosing ni objects of type i (i from 1 to k) without regard to
order, in such a way that the total number of objects chosen is n.
multinomial(n, n1, ... nk) is equal to n!/(n1!*n2! ...*nk!).
Commented Mathematical property (CMP):
multinomial(n, n1, ... nk) is equal to n!/(n1!*n2! ...*nk!) where n=n1+...+nk
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="logic1" name="and"/>
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="fns2" name="apply_to_list"/>
<OMS cd="combinat1" name="multinomial"/>
<OMA>
<OMS cd="list2" name="cons"/>
<OMV name="n"/>
<OMV name="nList"/>
</OMA>
</OMA>
<OMA>
<OMS cd="arith1" name="divide"/>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMV name="n"/>
</OMA>
<OMA>
<OMS cd="fns2" name="apply_to_list"/>
<OMS cd="arith1" name="times"/>
<OMV name="nList2"/>
</OMA>
</OMA>
</OMA>
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="linalg1" name="vector_selector"/>
<OMV name="i"/>
<OMA>
<OMS cd="fns2" name="apply_to_list"/>
<OMS cd="linalg2" name="vector"/>
<OMV name="nlist2"/>
</OMA>
</OMA>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMA>
<OMS cd="linalg1" name="vector_selector"/>
<OMV name="i"/>
<OMA>
<OMS cd="fns2" name="apply_to_list"/>
<OMS cd="linalg2" name="vector"/>
<OMV name="nList"/>
</OMA>
</OMA>
</OMA>
</OMA>
<OMA>
<OMS cd="relation1" name="eq"/>
<OMV name="n"/>
<OMA>
<OMS cd="fns2" name="apply_to_list"/>
<OMS cd="arith1" name="plus"/>
<OMV name="nList"/>
</OMA>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="logic1">and</csymbol>
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="fns2">apply_to_list</csymbol>
<csymbol cd="combinat1">multinomial</csymbol>
<apply><csymbol cd="list2">cons</csymbol><ci>n</ci><ci>nList</ci></apply>
</apply>
<apply><csymbol cd="arith1">divide</csymbol>
<apply><csymbol cd="integer1">factorial</csymbol><ci>n</ci></apply>
<apply><csymbol cd="fns2">apply_to_list</csymbol><csymbol cd="arith1">times</csymbol><ci>nList2</ci></apply>
</apply>
</apply>
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="linalg1">vector_selector</csymbol>
<ci>i</ci>
<apply><csymbol cd="fns2">apply_to_list</csymbol><csymbol cd="linalg2">vector</csymbol><ci>nlist2</ci></apply>
</apply>
<apply><csymbol cd="integer1">factorial</csymbol>
<apply><csymbol cd="linalg1">vector_selector</csymbol>
<ci>i</ci>
<apply><csymbol cd="fns2">apply_to_list</csymbol><csymbol cd="linalg2">vector</csymbol><ci>nList</ci></apply>
</apply>
</apply>
</apply>
<apply><csymbol cd="relation1">eq</csymbol>
<ci>n</ci>
<apply><csymbol cd="fns2">apply_to_list</csymbol><csymbol cd="arith1">plus</csymbol><ci>nList</ci></apply>
</apply>
</apply>
</math>
Prefix
and
(
eq
(
apply_to_list
(
multinomial ,
cons
(
n ,
nList )
)
,
divide
(
factorial
(
n )
,
apply_to_list
(
times ,
nList2 )
)
)
,
eq
(
vector_selector
(
i ,
apply_to_list
(
vector ,
nlist2 )
)
,
factorial
(
vector_selector
(
i ,
apply_to_list
(
vector ,
nList )
)
)
)
,
eq
(
n ,
apply_to_list
(
plus ,
nList )
)
)
Popcorn
fns2.apply_to_list(combinat1.multinomial, list2.cons($n, $nList)) = integer1.factorial($n) / fns2.apply_to_list(arith1.times, $nList2) and linalg1.vector_selector($i, fns2.apply_to_list(linalg2.vector, $nlist2)) = integer1.factorial(linalg1.vector_selector($i, fns2.apply_to_list(linalg2.vector, $nList))) and $n = fns2.apply_to_list(arith1.plus, $nList)
Rendered Presentation MathML
apply_to_list
(
cons
(
n
,
nList
)
,
cons
(
n
,
nList
)
)
=
n
!
apply_to_list
(
×
,
nList
2
)
∧
apply_to_list
(
vector
,
nlist
2
)
i
=
apply_to_list
(
vector
,
nList
)
i
!
∧
n
=
apply_to_list
(
+
,
nList
)
Example:
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="multinomial"/>
<OMI> 8 </OMI>
<OMI> 2 </OMI>
<OMI> 3 </OMI>
<OMI> 3 </OMI>
</OMA>
<OMI> 560 </OMI>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">multinomial</csymbol>
<cn type="integer">8</cn>
<cn type="integer">2</cn>
<cn type="integer">3</cn>
<cn type="integer">3</cn>
</apply>
<cn type="integer">560</cn>
</apply>
</math>
Prefix
Popcorn
combinat1.multinomial(8, 2, 3, 3) = 560
Rendered Presentation MathML
Signatures:
sts
Role:
application
Description:
The Stirling numbers of the first kind. (-1)^(n-m)*Stirling1(n,m) is the
number of permutations of n symbols which have exactly m cycles.
Note that there are a few slightly different definitions of these numbers.
Commented Mathematical property (CMP):
Stirling1(n,m) = the sum k=0 to n-m of (-1)^k * binomial(n-1+k, n-m+k) *
binomial(2n-m,n-m-k) * Stirling2(n,m)
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Stirling1"/>
<OMV name="n"/>
<OMV name="m"/>
</OMA>
<OMA>
<OMS cd="arith1" name="sum"/>
<OMA>
<OMS cd="interval1" name="integer_interval"/>
<OMS cd="alg1" name="zero"/>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMV name="n"/>
<OMV name="m"/>
</OMA>
</OMA>
<OMBIND>
<OMS cd="fns1" name="lambda"/>
<OMBVAR>
<OMV name="k"/>
</OMBVAR>
<OMA>
<OMS cd="arith1" name="times"/>
<OMA>
<OMS cd="arith1" name="power"/>
<OMA>
<OMS cd="arith1" name="unary_minus"/>
<OMS cd="alg1" name="one"/>
</OMA>
<OMV name="k"/>
</OMA>
<OMA>
<OMS cd="combinat1" name="binomial"/>
<OMA>
<OMS cd="arith1" name="plus"/>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMV name="n"/>
<OMS cd="alg1" name="one"/>
</OMA>
<OMV name="k"/>
</OMA>
<OMA>
<OMS cd="arith1" name="plus"/>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMV name="n"/>
<OMV name="m"/>
</OMA>
<OMV name="k"/>
</OMA>
</OMA>
<OMA>
<OMS cd="combinat1" name="binomial"/>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMA>
<OMS cd="arith1" name="times"/>
<OMI> 2 </OMI>
<OMV name="n"/>
</OMA>
<OMV name="m"/>
</OMA>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMV name="n"/>
<OMV name="m"/>
</OMA>
<OMV name="k"/>
</OMA>
</OMA>
<OMA>
<OMS cd="combinat1" name="Stirling2"/>
<OMV name="n"/>
<OMV name="m"/>
</OMA>
</OMA>
</OMBIND>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Stirling1</csymbol><ci>n</ci><ci>m</ci></apply>
<apply><csymbol cd="arith1">sum</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol>
<csymbol cd="alg1">zero</csymbol>
<apply><csymbol cd="arith1">minus</csymbol><ci>n</ci><ci>m</ci></apply>
</apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>k</ci></bvar>
<apply><csymbol cd="arith1">times</csymbol>
<apply><csymbol cd="arith1">power</csymbol>
<apply><csymbol cd="arith1">unary_minus</csymbol><csymbol cd="alg1">one</csymbol></apply>
<ci>k</ci>
</apply>
<apply><csymbol cd="combinat1">binomial</csymbol>
<apply><csymbol cd="arith1">plus</csymbol>
<apply><csymbol cd="arith1">minus</csymbol><ci>n</ci><csymbol cd="alg1">one</csymbol></apply>
<ci>k</ci>
</apply>
<apply><csymbol cd="arith1">plus</csymbol>
<apply><csymbol cd="arith1">minus</csymbol><ci>n</ci><ci>m</ci></apply>
<ci>k</ci>
</apply>
</apply>
<apply><csymbol cd="combinat1">binomial</csymbol>
<apply><csymbol cd="arith1">minus</csymbol>
<apply><csymbol cd="arith1">times</csymbol><cn type="integer">2</cn><ci>n</ci></apply>
<ci>m</ci>
</apply>
<apply><csymbol cd="arith1">minus</csymbol>
<apply><csymbol cd="arith1">minus</csymbol><ci>n</ci><ci>m</ci></apply>
<ci>k</ci>
</apply>
</apply>
<apply><csymbol cd="combinat1">Stirling2</csymbol><ci>n</ci><ci>m</ci></apply>
</apply>
</bind>
</apply>
</apply>
</math>
Prefix
eq
(
Stirling1
(
n ,
m )
,
sum
(
integer_interval
(
zero ,
minus
(
n ,
m )
)
,
lambda
[
k
] .
(
times
(
power
(
unary_minus
(
one )
,
k )
,
binomial
(
plus
(
minus
(
n ,
one )
,
k )
,
plus
(
minus
(
n ,
m )
,
k )
)
,
binomial
(
minus
(
times
( 2 ,
n )
,
m )
,
minus
(
minus
(
n ,
m )
,
k )
)
,
Stirling2
(
n ,
m )
)
)
)
)
Popcorn
combinat1.Stirling1($n, $m) = arith1.sum(interval1.integer_interval(alg1.zero, $n - $m), fns1.lambda[$k -> -(alg1.one) ^ $k * combinat1.binomial($n - alg1.one + $k, $n - $m + $k) * combinat1.binomial(2 * $n - $m, $n - $m - $k) * combinat1.Stirling2($n, $m)])
Rendered Presentation MathML
Stirling1
(
n
,
m
)
=
∑
k
=
0
n
-
m
-
1
k
n
-
1
+
k
n
-
m
+
k
2
n
-
m
n
-
m
-
k
Stirling2
(
n
,
m
)
Example:
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Stirling1"/>
<OMI> 10 </OMI>
<OMI> 7 </OMI>
</OMA>
<OMI> -9450 </OMI>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Stirling1</csymbol>
<cn type="integer">10</cn>
<cn type="integer">7</cn>
</apply>
<cn type="integer">-9450</cn>
</apply>
</math>
Prefix
Popcorn
combinat1.Stirling1(10, 7) = -9450
Rendered Presentation MathML
Stirling1
(
10
,
7
)
=
-9450
Signatures:
sts
Role:
application
Description:
The Stirling numbers of the second kind. Stirling2(n, m) is the number of
partitions of a set with n elements into m non empty subsets.
Note that there are a few slightly different definitions of these numbers.
Commented Mathematical property (CMP):
Stirling2(n,m) = 1/m! * the sum from k=0 to m of (-1)^(m-k) *
binomial(m,k) * k^n
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Stirling2"/>
<OMV name="n"/>
<OMV name="m"/>
</OMA>
<OMA>
<OMS cd="arith1" name="times"/>
<OMA>
<OMS cd="arith1" name="divide"/>
<OMS cd="alg1" name="one"/>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMV name="m"/>
</OMA>
</OMA>
<OMA>
<OMS cd="arith1" name="sum"/>
<OMA>
<OMS cd="interval1" name="integer_interval"/>
<OMS cd="alg1" name="zero"/>
<OMV name="m"/>
</OMA>
<OMBIND>
<OMS cd="fns1" name="lambda"/>
<OMBVAR>
<OMV name="k"/>
</OMBVAR>
<OMA>
<OMS cd="arith1" name="times"/>
<OMA>
<OMS cd="arith1" name="power"/>
<OMA>
<OMS cd="arith1" name="unary_minus"/>
<OMS cd="alg1" name="one"/>
</OMA>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMV name="m"/>
<OMV name="k"/>
</OMA>
</OMA>
<OMA>
<OMS cd="combinat1" name="binomial"/>
<OMV name="m"/>
<OMV name="k"/>
</OMA>
<OMA>
<OMS cd="arith1" name="power"/>
<OMV name="k"/>
<OMV name="n"/>
</OMA>
</OMA>
</OMBIND>
</OMA>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Stirling2</csymbol><ci>n</ci><ci>m</ci></apply>
<apply><csymbol cd="arith1">times</csymbol>
<apply><csymbol cd="arith1">divide</csymbol>
<csymbol cd="alg1">one</csymbol>
<apply><csymbol cd="integer1">factorial</csymbol><ci>m</ci></apply>
</apply>
<apply><csymbol cd="arith1">sum</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol><csymbol cd="alg1">zero</csymbol><ci>m</ci></apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>k</ci></bvar>
<apply><csymbol cd="arith1">times</csymbol>
<apply><csymbol cd="arith1">power</csymbol>
<apply><csymbol cd="arith1">unary_minus</csymbol><csymbol cd="alg1">one</csymbol></apply>
<apply><csymbol cd="arith1">minus</csymbol><ci>m</ci><ci>k</ci></apply>
</apply>
<apply><csymbol cd="combinat1">binomial</csymbol><ci>m</ci><ci>k</ci></apply>
<apply><csymbol cd="arith1">power</csymbol><ci>k</ci><ci>n</ci></apply>
</apply>
</bind>
</apply>
</apply>
</apply>
</math>
Prefix
eq
(
Stirling2
(
n ,
m )
,
times
(
divide
(
one ,
factorial
(
m )
)
,
sum
(
integer_interval
(
zero ,
m )
,
lambda
[
k
] .
(
times
(
power
(
unary_minus
(
one )
,
minus
(
m ,
k )
)
,
binomial
(
m ,
k )
,
power
(
k ,
n )
)
)
)
)
)
Popcorn
combinat1.Stirling2($n, $m) = alg1.one / integer1.factorial($m) * arith1.sum(interval1.integer_interval(alg1.zero, $m), fns1.lambda[$k -> -(alg1.one) ^ ($m - $k) * combinat1.binomial($m, $k) * $k ^ $n])
Rendered Presentation MathML
Stirling2
(
n
,
m
)
=
1
m
!
∑
k
=
0
m
-
1
(
m
-
k
)
m
k
k
n
Example:
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Stirling2"/>
<OMI> 7 </OMI>
<OMI> 3 </OMI>
</OMA>
<OMI> 301 </OMI>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Stirling2</csymbol>
<cn type="integer">7</cn>
<cn type="integer">3</cn>
</apply>
<cn type="integer">301</cn>
</apply>
</math>
Prefix
Popcorn
combinat1.Stirling2(7, 3) = 301
Rendered Presentation MathML
Stirling2
(
7
,
3
)
=
301
Signatures:
sts
Role:
application
Description:
The Fibonacci numbers, defined by the linear recurrence:
Fibonacci(0) = 0, Fibonacci(1) = 1, and
Fibonacci(n + 1) = Fibonacci(n) + Fibonacci(n - 1).
Note that some authors define Fibonacci(0) = 1.
Commented Mathematical property (CMP):
Fibonacci(0) = 0, Fibonacci(1) = 1, and
Fibonacci(n + 1) = Fibonacci(n) + Fibonacci(n - 1)
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="logic1" name="and"/>
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Fibonacci"/>
<OMS cd="alg1" name="zero"/>
</OMA>
<OMS cd="alg1" name="zero"/>
</OMA>
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Fibonacci"/>
<OMS cd="alg1" name="one"/>
</OMA>
<OMS cd="alg1" name="one"/>
</OMA>
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Fibonacci"/>
<OMA>
<OMS cd="arith1" name="plus"/>
<OMV name="n"/>
<OMS cd="alg1" name="one"/>
</OMA>
</OMA>
<OMA>
<OMS cd="arith1" name="plus"/>
<OMA>
<OMS cd="combinat1" name="Fibonacci"/>
<OMV name="n"/>
</OMA>
<OMA>
<OMS cd="combinat1" name="Fibonacci"/>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMV name="n"/>
<OMS cd="alg1" name="one"/>
</OMA>
</OMA>
</OMA>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="logic1">and</csymbol>
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Fibonacci</csymbol><csymbol cd="alg1">zero</csymbol></apply>
<csymbol cd="alg1">zero</csymbol>
</apply>
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Fibonacci</csymbol><csymbol cd="alg1">one</csymbol></apply>
<csymbol cd="alg1">one</csymbol>
</apply>
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Fibonacci</csymbol>
<apply><csymbol cd="arith1">plus</csymbol><ci>n</ci><csymbol cd="alg1">one</csymbol></apply>
</apply>
<apply><csymbol cd="arith1">plus</csymbol>
<apply><csymbol cd="combinat1">Fibonacci</csymbol><ci>n</ci></apply>
<apply><csymbol cd="combinat1">Fibonacci</csymbol>
<apply><csymbol cd="arith1">minus</csymbol><ci>n</ci><csymbol cd="alg1">one</csymbol></apply>
</apply>
</apply>
</apply>
</apply>
</math>
Prefix
Popcorn
combinat1.Fibonacci(alg1.zero) = alg1.zero and combinat1.Fibonacci(alg1.one) = alg1.one and combinat1.Fibonacci($n + alg1.one) = combinat1.Fibonacci($n) + combinat1.Fibonacci($n - alg1.one)
Rendered Presentation MathML
Fibonacci
(
0
)
=
0
∧
Fibonacci
(
1
)
=
1
∧
Fibonacci
(
n
+
1
)
=
Fibonacci
(
n
)
+
Fibonacci
(
n
-
1
)
Example:
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Fibonacci"/>
<OMI> 10 </OMI>
</OMA>
<OMI> 55 </OMI>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Fibonacci</csymbol><cn type="integer">10</cn></apply>
<cn type="integer">55</cn>
</apply>
</math>
Prefix
Popcorn
combinat1.Fibonacci(10) = 55
Rendered Presentation MathML
Signatures:
sts
Role:
application
Description:
The Bell numbers: Bell(n) is the total number of possible partitions of a set
of n elements.
Commented Mathematical property (CMP):
Bell(n) = the sum from k=0 to n of Stirling2(n,k)
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Bell"/>
<OMV name="n"/>
</OMA>
<OMA>
<OMS cd="arith1" name="sum"/>
<OMA>
<OMS cd="interval1" name="integer_interval"/>
<OMS cd="alg1" name="zero"/>
<OMV name="n"/>
</OMA>
<OMBIND>
<OMS cd="fns1" name="lambda"/>
<OMBVAR>
<OMV name="k"/>
</OMBVAR>
<OMA>
<OMS cd="combinat1" name="Stirling2"/>
<OMV name="n"/>
<OMV name="k"/>
</OMA>
</OMBIND>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Bell</csymbol><ci>n</ci></apply>
<apply><csymbol cd="arith1">sum</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol><csymbol cd="alg1">zero</csymbol><ci>n</ci></apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>k</ci></bvar>
<apply><csymbol cd="combinat1">Stirling2</csymbol><ci>n</ci><ci>k</ci></apply>
</bind>
</apply>
</apply>
</math>
Prefix
Popcorn
combinat1.Bell($n) = arith1.sum(interval1.integer_interval(alg1.zero, $n), fns1.lambda[$k -> combinat1.Stirling2($n, $k)])
Rendered Presentation MathML
Bell
(
n
)
=
∑
k
=
0
n
Stirling2
(
n
,
k
)
Example:
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="combinat1" name="Bell"/>
<OMI> 7 </OMI>
</OMA>
<OMI> 877 </OMI>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="combinat1">Bell</csymbol><cn type="integer">7</cn></apply>
<cn type="integer">877</cn>
</apply>
</math>
Prefix
Popcorn
combinat1.Bell(7) = 877
Rendered Presentation MathML
Signatures:
sts