Main Page: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
No edit summary
No edit summary
 
(334 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
In [[mathematics]], the '''Iverson bracket''', named after [[Kenneth E. Iverson]]<!-- mentioned here so it's clear that it's an upper-case 'i' not an 'l'. -->, is a notation that denotes a number that is 1 if the condition in square brackets is satisfied, and 0 otherwise. More exactly,
This is a preview for the new '''MathML rendering mode''' (with SVG fallback), which is availble in production for registered users.
:<math>[P] = \begin{cases} 1 & \text{if } P \text{ is true;} \\ 0 & \text{otherwise.} \end{cases}</math>
where {{math|''P''}} is a [[statement (logic)|statement]] that can be true or false. This notation was introduced by [[Kenneth E. Iverson]] in his programming language [[APL (programming language)|APL]],<ref>[[Ronald Graham]], [[Donald Knuth]], and [[Oren Patashnik]]. ''[[Concrete Mathematics]]'', Section 2.2: Sums and Recurrences.</ref> while the specific restriction to square brackets was advocated by [[Donald Knuth]] to avoid ambiguity in parenthesized logical expressions.<ref>Knuth 1992.</ref>


==Uses==
If you would like use the '''MathML''' rendering mode, you need a wikipedia user account that can be registered here [[https://en.wikipedia.org/wiki/Special:UserLogin/signup]]
The Iverson bracket converts a [[Boolean data type|Boolean value]] to an integer value through the natural map <math>\textbf{false}\mapsto 0;  \textbf{true}\mapsto1</math>, which allows counting to be represented as summation. For instance, the [[Euler phi function]] that counts the number of integers less than ''n'' and [[coprime]] to it can be expressed by
* Only registered users will be able to execute this rendering mode.
: <math> \phi(n)=\sum_{i=0}^{n-1}[\gcd(i,n)=1],\qquad\text{for }n\in\mathbb N.</math>
* Note: you need not enter a email address (nor any other private information). Please do not use a password that you use elsewhere.
More generally the notation allows moving boundary conditions of summations (or integrals) as a separate factor into the summand, freeing up space around the summation operator, but more importantly allowing it to be manipulated algebraically. For example
: <math>\sum_{1\le i \le 10} i^2 = \sum_{i} i^2[1 \le i \le 10].</math>
In the first sum, the index <math>i</math> is limited to be in the range 1 to 10. The second sum is allowed to range over all integers, but where ''i'' is strictly less than 1 or strictly greater than 10, the summand is 0, contributing nothing to the sum. Such use of the Iverson bracket can permit easier manipulation of these expressions.  
<!-- add an example of such a manipulation -->


Another use of the Iverson bracket is to simplify equations with special cases. For example, the formula
Registered users will be able to choose between the following three rendering modes:  
:<math>\sum_{1\le k\le n \atop \gcd(k,n)=1}\!\!k = \frac{1}{2}n\varphi(n)</math>


which is valid for {{math|''n'' &gt; 1}} but which is off by {{sfrac|1|2}} for {{math|''n'' {{=}} 1}}. To get an identity valid for all positive integers ''n'' (i.e., all values for which <math>\phi(n)</math> is defined), a correction term involving the Iverson bracket may be added:
'''MathML'''
:<math forcemathmode="mathml">E=mc^2</math>


:<math>\sum_{1\le k\le n \atop \gcd(k,n)=1}\!\!k = \frac{1}{2}n(\varphi(n)+[n=1])</math>
<!--'''PNG'''  (currently default in production)
:<math forcemathmode="png">E=mc^2</math>


==Special cases==
'''source'''
The [[Kronecker delta]] notation is a specific case of Iverson notation when the condition is equality. That is,
:<math forcemathmode="source">E=mc^2</math> -->
: <math>\delta_{ij} = [i=j].\,</math>


The [[indicator function]], another specific case, has set membership as its condition:
<span style="color: red">Follow this [https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering link] to change your Math rendering settings.</span> You can also add a [https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering-skin Custom CSS] to force the MathML/SVG rendering or select different font families. See [https://www.mediawiki.org/wiki/Extension:Math#CSS_for_the_MathML_with_SVG_fallback_mode these examples].
: <math>\mathbf{I}_A(x) = [x\in A].</math>


The [[sign function]] and [[Heaviside step function]] are also easily expressed in this notation:
==Demos==
: <math> \sgn(x) = [x > 0] - [x < 0] \,</math>
: <math> H(x) = [x > 0].</math>


And the [[Trichotomy (mathematics)|trichotomy]] of the reals can be expressed:
Here are some [https://commons.wikimedia.org/w/index.php?title=Special:ListFiles/Frederic.wang demos]:
:<math>[a < b] + [a = b] + [a > b] = 1. \, </math>


== Notes ==
{{reflist}}


== References ==
* accessibility:
* Donald Knuth, "Two Notes on Notation", ''[[American Mathematical Monthly]]'', Volume 99, Number 5, May 1992, pp.&nbsp;403–422. ([http://www-cs-faculty.stanford.edu/~knuth/papers/tnn.tex.gz {{TeX}}], {{arxiv|math/9205211}})
** Safari + VoiceOver: [https://commons.wikimedia.org/wiki/File:VoiceOver-Mac-Safari.ogv video only], [[File:Voiceover-mathml-example-1.wav|thumb|Voiceover-mathml-example-1]], [[File:Voiceover-mathml-example-2.wav|thumb|Voiceover-mathml-example-2]], [[File:Voiceover-mathml-example-3.wav|thumb|Voiceover-mathml-example-3]], [[File:Voiceover-mathml-example-4.wav|thumb|Voiceover-mathml-example-4]], [[File:Voiceover-mathml-example-5.wav|thumb|Voiceover-mathml-example-5]], [[File:Voiceover-mathml-example-6.wav|thumb|Voiceover-mathml-example-6]], [[File:Voiceover-mathml-example-7.wav|thumb|Voiceover-mathml-example-7]]
* Kenneth E. Iverson, ''A Programming Language'', New York: Wiley, p.&nbsp;11, 1962.
** [https://commons.wikimedia.org/wiki/File:MathPlayer-Audio-Windows7-InternetExplorer.ogg Internet Explorer + MathPlayer (audio)]
** [https://commons.wikimedia.org/wiki/File:MathPlayer-SynchronizedHighlighting-WIndows7-InternetExplorer.png Internet Explorer + MathPlayer (synchronized highlighting)]
** [https://commons.wikimedia.org/wiki/File:MathPlayer-Braille-Windows7-InternetExplorer.png Internet Explorer + MathPlayer (braille)]
** NVDA+MathPlayer: [[File:Nvda-mathml-example-1.wav|thumb|Nvda-mathml-example-1]], [[File:Nvda-mathml-example-2.wav|thumb|Nvda-mathml-example-2]], [[File:Nvda-mathml-example-3.wav|thumb|Nvda-mathml-example-3]], [[File:Nvda-mathml-example-4.wav|thumb|Nvda-mathml-example-4]], [[File:Nvda-mathml-example-5.wav|thumb|Nvda-mathml-example-5]], [[File:Nvda-mathml-example-6.wav|thumb|Nvda-mathml-example-6]], [[File:Nvda-mathml-example-7.wav|thumb|Nvda-mathml-example-7]].
** Orca: There is ongoing work, but no support at all at the moment [[File:Orca-mathml-example-1.wav|thumb|Orca-mathml-example-1]], [[File:Orca-mathml-example-2.wav|thumb|Orca-mathml-example-2]], [[File:Orca-mathml-example-3.wav|thumb|Orca-mathml-example-3]], [[File:Orca-mathml-example-4.wav|thumb|Orca-mathml-example-4]], [[File:Orca-mathml-example-5.wav|thumb|Orca-mathml-example-5]], [[File:Orca-mathml-example-6.wav|thumb|Orca-mathml-example-6]], [[File:Orca-mathml-example-7.wav|thumb|Orca-mathml-example-7]].
** From our testing, ChromeVox and JAWS are not able to read the formulas generated by the MathML mode.


[[Category:Mathematical notation]]
==Test pages ==


[[de:Prädikatabbildung]]
To test the '''MathML''', '''PNG''', and '''source''' rendering modes, please go to one of the following test pages:
[[fr:Crochet_de_Iverson]]
*[[Displaystyle]]
[[it:Parentesi di Iverson]]
*[[MathAxisAlignment]]
[[ja:アイバーソンの記法]]
*[[Styling]]
[[pt:Colchetes de Iverson]]
*[[Linebreaking]]
[[ru:Нотация Айверсона]]
*[[Unique Ids]]
[[sv:Iversonklammer]]
*[[Help:Formula]]
 
*[[Inputtypes|Inputtypes (private Wikis only)]]
*[[Url2Image|Url2Image (private Wikis only)]]
==Bug reporting==
If you find any bugs, please report them at [https://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki%20extensions&component=Math&version=master&short_desc=Math-preview%20rendering%20problem Bugzilla], or write an email to math_bugs (at) ckurs (dot) de .

Latest revision as of 23:52, 15 September 2019

This is a preview for the new MathML rendering mode (with SVG fallback), which is availble in production for registered users.

If you would like use the MathML rendering mode, you need a wikipedia user account that can be registered here [[1]]

  • Only registered users will be able to execute this rendering mode.
  • Note: you need not enter a email address (nor any other private information). Please do not use a password that you use elsewhere.

Registered users will be able to choose between the following three rendering modes:

MathML


Follow this link to change your Math rendering settings. You can also add a Custom CSS to force the MathML/SVG rendering or select different font families. See these examples.

Demos

Here are some demos:


Test pages

To test the MathML, PNG, and source rendering modes, please go to one of the following test pages:

Bug reporting

If you find any bugs, please report them at Bugzilla, or write an email to math_bugs (at) ckurs (dot) de .