How to encode binomial coefficients in MathML
Axel Drefahl - June 2014 Tweet
A binomial coefficient
,
read n choose k, defines a number
as follows:
For example,
.
A binomial coefficient symbol
looks like a parentheses-enclosed fraction with a missing
horizontal fraction line,
also termed
fraction bar or
fraction stroke.
This is “how MathML sees it.”
Once you know how to encode fractions, you know how to
encode binomial coefficients: setting the value of the
linethickness
attribute inside MathML's
mfrag
tag
does the trick.
We illustrate the markup of binomial coefficients in MathML
with the absorption idendity
(see page 157 in [CoMa1994]),
for which we are using the following
MathML code:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> <mrow> <mo>(</mo> <mfrac linethickness="0"> <mi>r</mi> <mi>k</mi> </mfrac> <mo>)</mo> <mo>=</mo> <mfrac> <mi>r</mi> <mi>k<mi> </mfrac> <mo>⁢</mo> <mo>(</mo> <mfrac linethickness="0"> <mrow> <mi>r</mi><mo>-</mo><mn>1</mn> </mrow> <mrow> <mi>k</mi><mo>-</mo><mn>1</mn> </mrow> </mfrac> <mo>)</mo> </mrow> </math>
Note:
The default linethickness
value is medium .
Setting the value to 0
shrinks the fraction bar out of display. |
Reference
[CoMa1994] | Ronald L. Graham, Donald E. Knuth and Oren Patashnik: Concrete Mathematics. Second Edition. Addison-Wesley Publishing Company, Reading, Massachussetts, 1994. |
Axeleratio Home | |
ThermoML Scout | |
ChemRange | CurlySMILES |
Curiosity & Learning
>> Chemical trails>> Alumin(i)um
>> 2-D solid electrolytes
>> Mushroom hunting
>> Rare Oenothera xylocarpa
>> Culturomics
>> The Loomis legacy
>> Gardner about history
>> Don't dig trenches!