<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mathematics on David Hamann</title><link>https://davidhamann.de/tags/mathematics/</link><description>Recent content in Mathematics on David Hamann</description><generator>Hugo</generator><language>en</language><copyright>&amp;copy; David Hamann</copyright><lastBuildDate>Tue, 06 Feb 2018 00:00:00 +0000</lastBuildDate><atom:link href="https://davidhamann.de/tags/mathematics/feed.xml" rel="self" type="application/rss+xml"/><item><title>The basics of Logarithms – with examples</title><link>https://davidhamann.de/2018/02/06/basics-of-logarithms-examples-python/</link><pubDate>Tue, 06 Feb 2018 00:00:00 +0000</pubDate><guid>https://davidhamann.de/2018/02/06/basics-of-logarithms-examples-python/</guid><description>&lt;p&gt;Logarithms are widely used in computer science (e.g. for algorithm analyses, floating point number limitations, scaling data, feature transformations). Not coming from a mathematics background (I don&amp;rsquo;t!) logarithms can seem confusing at first.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s look at the very basics of logarithms to get an understanding of how they can be broken apart, some of the properties that can be utilized, and why they work.&lt;/p&gt;
&lt;h2 id="what-is-a-logarithm"&gt;What is a Logarithm?&lt;/h2&gt;
$$\log_{b}(x)$$&lt;p&gt;The logarithm is defined as the inverse operation to exponentiation. To get the logarithm of a number, we need to find out, to what exponent another number, called the base, needs to be raised to produce that first number.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s look at an example:&lt;/p&gt;
$$\log_{10} 100$$&lt;p&gt;To rephrase the last sentence again: To get the logarithm of a number &lt;strong&gt;100&lt;/strong&gt;, we need to find out, to what exponent another number, &lt;strong&gt;10&lt;/strong&gt;, called the base, needs to be raised to produce that first number &lt;strong&gt;100&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Since \(10^2 = 100\), the logarithm of 100, base 10, is 2:&lt;/p&gt;
$$\log_{10} 100 = 2$$&lt;p&gt;In Python we would write this as:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="c1"&gt;# &amp;#34;reverse&amp;#34; the operation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And to bring it into a general form:&lt;/p&gt;
$$\log_{b} x = y$$$$b^y = x$$&lt;div class="notice notice-info"&gt;
 Note that \(\log_{b} x\) only returns real numbers for x &amp;gt;0 (as we will also see on the graph further down).
&lt;/div&gt;

&lt;p&gt;Now let&amp;rsquo;s come back to the first sentence of this section: The logarithm is the inverse operation to exponentiation. In other words, it &lt;em&gt;undoes&lt;/em&gt; the exponentiation operation.&lt;/p&gt;
&lt;p&gt;We can write some code to see this with sample numbers (&lt;code&gt;math.exp(x)&lt;/code&gt; returns &lt;em&gt;e&lt;/em&gt; to the power of x, &lt;code&gt;math.log(x)&lt;/code&gt; returns the logarithm of x in base &lt;em&gt;e&lt;/em&gt;).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.6931471805599453&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# ==&amp;gt; log(exp(x)) = x&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When we plot the two functions, we can see that \(\log (x)\) (i.e. \(\log_{e}x\)) is reflecting \(exp(x)\) (i.e. \(e^x\)).&lt;/p&gt;
&lt;p&gt;&lt;img alt="Log2x vs 2^x" loading="lazy" src="https://davidhamann.de/images/log_vs_exp.png"&gt;&lt;/p&gt;
&lt;h2 id="the-base"&gt;The base&lt;/h2&gt;
&lt;p&gt;You will most often see logarithms with base &lt;em&gt;e&lt;/em&gt;, base &lt;em&gt;10&lt;/em&gt; or base &lt;em&gt;2&lt;/em&gt;, but the base can be any positive number not equal to 1.&lt;/p&gt;
&lt;p&gt;In Python, the most common log bases are available as a function of the math module:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# base 10&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# base e, or natural log, or ln&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;4.605170185988092&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# base 2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;6.643856189774724&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# base 5, or any desired base as second argument&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mf"&gt;2.8613531161467867&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;p&gt;One important property is, that the logarithm of 1 is zero for any base. We can understand this by taking a log apart like in the first section:&lt;/p&gt;
$$\log_{10} 1 $$&lt;p&gt;10 raised to what power is 1? Only \(10^0\) will equal 1, and the same is true for any other base number. If we plot the ln (log e), log10 and log2, it becomes more clear: for all bases, y is 0 where x is 1.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;np&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;linspace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;y_e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;y_10&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;y_2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y_2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;legend&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;ln&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;log10&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;log2&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;lower right&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xticks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axhline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;black&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;linewidth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;0.5&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;axvline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;black&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;linewidth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;0.5&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img alt="log plot" loading="lazy" src="https://davidhamann.de/images/log_plot.png"&gt;&lt;/p&gt;
&lt;p&gt;Another visible attribute is that when base and argument are the same number, the result is always 1. Here is the same graph zoomed in a little bit and with grid lines. You can see that for log2 at x = 2, y equals 1, and for the natural log with base e (~ 2.7) and x at e, y also equals 1.&lt;/p&gt;
&lt;p&gt;&lt;img alt="log plot zoomed" loading="lazy" src="https://davidhamann.de/images/log_plot_zoomed.png"&gt;&lt;/p&gt;
&lt;p&gt;Going to the left side on the x axis, log(x) becomes negative for x &amp;lt; 1 for any base, and diverges towards negative infinity as x approaches zero. The formal way of writing this is:&lt;/p&gt;
$$\lim_{x \to 0} \log_{b} x = - \infty$$&lt;p&gt;In the other direction, as x approaches infinity, log(x) diverges towards positive infinity for any base:&lt;/p&gt;
$$\lim_{x \to \infty} \log_{b} x = \infty$$&lt;div class="notice notice-info"&gt;
 &lt;strong&gt;Note:&lt;/strong&gt; When log is written without a base, it usually refers to \(\log_{2}(x)\) in computer science algorithms. In programming/mathematics/machine learning it generally refers to the natural logarithm (e.g. Python &lt;code&gt;math.log&lt;/code&gt; or &lt;code&gt;numpy.log&lt;/code&gt;), i.e. base e. Base 10 is also commonly implied when you just have \(\log (x)\). 🤔 This is kind of confusing and often just depends on the context. See Wikipedia for more info on &lt;a href="https://en.wikipedia.org/wiki/Logarithm#Particular_bases"&gt;particular bases&lt;/a&gt;.
&lt;/div&gt;

&lt;h2 id="logarithmic-rules"&gt;Logarithmic rules&lt;/h2&gt;
&lt;p&gt;Logarithms have important properties, or laws, that one should be familiar with and make computations easier. Let&amp;rsquo;s have a look at three of them and also understand why they work:&lt;/p&gt;
&lt;h3 id="product-rule"&gt;Product rule&lt;/h3&gt;
$$\log_{b}(x \cdot y) = \log_{b}(x) + \log_{b}(y)$$&lt;p&gt;The logarithm of a product (multiplication of x and y), can be broken apart and rewritten as the sum of the logarithm of x and the logarithm of y (addition). To see why this formula works, we need to know a property of exponents. Let&amp;rsquo;s take a look at an example:&lt;/p&gt;
$$\log_{2}(8 \cdot 16) = \log_{2}(8) + \log_{2}(16)$$&lt;p&gt;We can substitute 8 and 16 as powers of the base, 2.&lt;/p&gt;
$$\log_{2}(2^3 \cdot 2^4)$$&lt;p&gt;Using a property of exponents, that says \(a^m \cdot a^n = a^{m+n}\), we can rewrite this as:&lt;/p&gt;
$$\log_{2}(2^{3+4})$$&lt;p&gt;Now we need to find the power to which we need to raise 2, the base, to get \(2^{3+4}\). This is obviously 3 + 4 itself. So let&amp;rsquo;s write this down:&lt;/p&gt;
$$3+4$$&lt;p&gt;Turning this back into logarithmic form, we get:&lt;/p&gt;
$$\log_{2}(8 \cdot 16) = \log_{2}(8) + \log_{2}(16)$$&lt;h3 id="power-rule-"&gt;Power rule 🚀&lt;/h3&gt;
$$\log_{b}(x^y) = y \cdot \log_{b}(x)$$&lt;p&gt;With that name it better be good 🤓. And it is. When we have the log of a number raised to a power (here: \(x^y\)), we can bring the exponent down and in front of the log. So for the above equation, it means that the logarithm of x raised to the power of y is equal to y times the logarithm of x. Let&amp;rsquo;s see why this works by looking at an example:&lt;/p&gt;
$$\log_{10}(2^6) = 6 \cdot \log_{10}(2)$$&lt;p&gt;Another way of looking at this problem is:&lt;/p&gt;
$$\log_{10}(2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 2)$$&lt;p&gt;From above (product rule) we know that we can turn multiplication into addition. So let&amp;rsquo;s do that:&lt;/p&gt;
$$\log_{10}(2) + \log_{10}(2) + \log_{10}(2) + \log_{10}(2) + \log_{10}(2) + \log_{10}(2)$$&lt;p&gt;And this in turn can be simplified to:&lt;/p&gt;
$$\log_{10}(2^6) = 6 \cdot \log_{10}(2)$$&lt;h3 id="quotient-rule"&gt;Quotient Rule&lt;/h3&gt;
$$\log_{b}(\frac{x}{y}) = \log_{b}(x) - \log_{b}(y)$$&lt;p&gt;Just like with the multiplication to addition (product rule), we can turn devision into subtraction.&lt;/p&gt;
&lt;p&gt;We will make up an example and see why this works:&lt;/p&gt;
$$\log_{10}(\frac{5}{10}) = \log_{10}(5) - \log_{10}(10)$$&lt;p&gt;We know that \(\frac{5}{10}\) is the same as \(5 \cdot \frac{1}{10}\) is the same as \(5 \cdot 10^{-1}\). So let&amp;rsquo;s write out the log again:&lt;/p&gt;
$$\log_{10}(\frac{5}{10}) = \log_{10}(5 \cdot 10^{-1})$$&lt;p&gt;Using the product rule (see above), we can turn this into:&lt;/p&gt;
$$\log_{10}(5) + \log_{10}(10^{-1})$$&lt;p&gt;And now, using the power rule, we move the -1 down and in front:&lt;/p&gt;
$$\log_{10}(5) + -1 \cdot \log_{10}(10)$$&lt;p&gt;So we get:&lt;/p&gt;
$$\log_{10}(\frac{5}{10}) = \log_{10}(5) - \log_{10}(10)$$&lt;h2 id="change-of-base"&gt;Change of base&lt;/h2&gt;
&lt;p&gt;In Python we can calculate the log in any base with &lt;code&gt;math.log(x, base)&lt;/code&gt;. When you don&amp;rsquo;t have that function available (like on a calculator), you might want to know how you can easily change the base to a supported one.&lt;/p&gt;
&lt;p&gt;The general rule is:&lt;/p&gt;
$$\log_{b}(x) = \frac{\log_{c}(x)}{\log_{c}(b)}$$&lt;p&gt;But let&amp;rsquo;s look at an example again (from base 2 to base 10) and see why this works.&lt;/p&gt;
$$\log_{2}(16) = x$$&lt;p&gt;For this equation we know that \(2^x = 16\).&lt;/p&gt;
&lt;p&gt;We will now take the log in our desired base 10 on both sides, to be able to use the power rule.&lt;/p&gt;
$$\log_{10}(2^x) = \log_{10}(16)$$&lt;p&gt;With the power rule we can bring the exponent down and to the front:&lt;/p&gt;
$$x \cdot \log_{10}(2) = \log_{10}(16)$$&lt;p&gt;To get out final result, we devide both sides by \(\log_{10}(2)\):&lt;/p&gt;
$$x = \frac{\log_{10}(16)}{\log_{10}(2)} = \log_{2}(16)$$&lt;h2 id="more"&gt;More&lt;/h2&gt;
&lt;p&gt;Much more to cover, but that&amp;rsquo;s it for now at this point. Take a look at the handy cheat sheet of &lt;a href="https://en.wikipedia.org/wiki/List_of_logarithmic_identities"&gt;logarithmic identities&lt;/a&gt; for a review of the above, plus additional properties.&lt;/p&gt;</description></item><item><title>LaTeX mathematics cheat sheet</title><link>https://davidhamann.de/2017/06/12/latex-cheat-sheet/</link><pubDate>Mon, 12 Jun 2017 00:00:00 +0000</pubDate><guid>https://davidhamann.de/2017/06/12/latex-cheat-sheet/</guid><description>&lt;p&gt;&lt;a href="http://www.latex-project.org"&gt;LaTeX&lt;/a&gt; is the de facto standard typesetting system for scientific writing. A lot of the nice looking equations you see in books and all around the web are written using LaTeX commands. Knowing a few of the mathematics commands is not only helpful if you want to write a book or an article (or do some &lt;a href="http://www.tug.org/texshowcase/"&gt;extreme stuff&lt;/a&gt;), but can come in handy in a lot of places, as many systems support LaTeX. You can use LaTeX in &lt;a href="https://www.mathjax.org"&gt;MathJax&lt;/a&gt; to display expressions on the web (like here), you can make yourself good looking mathematics flashcards in &lt;a href="https://apps.ankiweb.net"&gt;Anki&lt;/a&gt;, you can even nerd out and send formulas built with LaTeX commands to your friends via an &lt;a href="https://itunes.apple.com/us/app/vulcanize/id1154777474?mt=8"&gt;iMessage app&lt;/a&gt;. Also, Apple&amp;rsquo;s latest Pages release now supports LaTeX equations.&lt;/p&gt;
&lt;p&gt;Reasons enough to get familiar with the standard commands!&lt;/p&gt;
&lt;p&gt;While a lot of commands can be written out in plain (e.g. 1+1=2), there are other frequently used commands you will need to look up or memorise.&lt;/p&gt;
&lt;p&gt;I plan to update this post continuously as I find myself looking for a common symbol I haven&amp;rsquo;t listed yet. Feel free to drop me an email or comment when you land here and don&amp;rsquo;t find the answer to a frequently used symbol.&lt;/p&gt;
&lt;p&gt;Here is the cheat sheet (naturally incomplete):&lt;/p&gt;
&lt;h2 id="fractions"&gt;Fractions&lt;/h2&gt;
&lt;table border="1" style="display: table"&gt;
 &lt;thead&gt;
 &lt;tr style="text-align: right;"&gt;
 &lt;th&gt;Command&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Output&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;\frac&lt;/td&gt;
 &lt;td&gt;Build a fraction like so: \frac{1}{2}&lt;/td&gt;
 &lt;td&gt;$$\frac{1}{2}$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\frac{\frac{}}{}&lt;/td&gt;
 &lt;td&gt;You can nest fractions: \frac{\frac{1}{2}}{2}&lt;/td&gt;
 &lt;td&gt;$$\frac{\frac{1}{2}}{2}$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="greek-letters"&gt;Greek letters&lt;/h2&gt;
&lt;p&gt;(capitalize by capitalizing the command)&lt;/p&gt;
&lt;table border="1" style="display: table"&gt;
 &lt;thead&gt;
 &lt;tr style="text-align: right;"&gt;
 &lt;th&gt;Command&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Output&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;\alpha&lt;/td&gt;
 &lt;td&gt;alpha&lt;/td&gt;
 &lt;td&gt;$$\alpha$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\beta&lt;/td&gt;
 &lt;td&gt;beta&lt;/td&gt;
 &lt;td&gt;$$\beta$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\gamma&lt;/td&gt;
 &lt;td&gt;gamma&lt;/td&gt;
 &lt;td&gt;$$\gamma$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\delta&lt;/td&gt;
 &lt;td&gt;delta&lt;/td&gt;
 &lt;td&gt;$$\delta$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\epsilon&lt;/td&gt;
 &lt;td&gt;epsilon&lt;/td&gt;
 &lt;td&gt;$$\epsilon$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\zeta&lt;/td&gt;
 &lt;td&gt;zeta&lt;/td&gt;
 &lt;td&gt;$$\zeta$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\eta&lt;/td&gt;
 &lt;td&gt;eta&lt;/td&gt;
 &lt;td&gt;$$\eta$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\theta&lt;/td&gt;
 &lt;td&gt;theta&lt;/td&gt;
 &lt;td&gt;$$\theta$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\iota&lt;/td&gt;
 &lt;td&gt;iota&lt;/td&gt;
 &lt;td&gt;$$\iota$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\kappa&lt;/td&gt;
 &lt;td&gt;kappa&lt;/td&gt;
 &lt;td&gt;$$\kappa$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\lambda&lt;/td&gt;
 &lt;td&gt;lambda&lt;/td&gt;
 &lt;td&gt;$$\lambda$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\mu&lt;/td&gt;
 &lt;td&gt;mu&lt;/td&gt;
 &lt;td&gt;$$\mu$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\nu&lt;/td&gt;
 &lt;td&gt;nu&lt;/td&gt;
 &lt;td&gt;$$\nu$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\xi&lt;/td&gt;
 &lt;td&gt;xi&lt;/td&gt;
 &lt;td&gt;$$\xi$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;o&lt;/td&gt;
 &lt;td&gt;omicron&lt;/td&gt;
 &lt;td&gt;$$o$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\pi&lt;/td&gt;
 &lt;td&gt;pi&lt;/td&gt;
 &lt;td&gt;$$\pi$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\rho&lt;/td&gt;
 &lt;td&gt;rho&lt;/td&gt;
 &lt;td&gt;$$\rho$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\sigma&lt;/td&gt;
 &lt;td&gt;sigma&lt;/td&gt;
 &lt;td&gt;$$\sigma$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\tau&lt;/td&gt;
 &lt;td&gt;tau&lt;/td&gt;
 &lt;td&gt;$$\tau$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\upsilon&lt;/td&gt;
 &lt;td&gt;upsilon&lt;/td&gt;
 &lt;td&gt;$$\upsilon$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\phi&lt;/td&gt;
 &lt;td&gt;phi&lt;/td&gt;
 &lt;td&gt;$$\phi$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\chi&lt;/td&gt;
 &lt;td&gt;chi&lt;/td&gt;
 &lt;td&gt;$$\chi$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\psi&lt;/td&gt;
 &lt;td&gt;psi&lt;/td&gt;
 &lt;td&gt;$$\psi$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\omega&lt;/td&gt;
 &lt;td&gt;omega&lt;/td&gt;
 &lt;td&gt;$$\omega$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="logic"&gt;Logic&lt;/h2&gt;
&lt;table border="1" style="display: table"&gt;
 &lt;thead&gt;
 &lt;tr style="text-align: right;"&gt;
 &lt;th&gt;Command&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Output&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;\forall&lt;/td&gt;
 &lt;td&gt;For all&lt;/td&gt;
 &lt;td&gt;$$\forall$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\exists&lt;/td&gt;
 &lt;td&gt;Exists&lt;/td&gt;
 &lt;td&gt;$$\exists$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\lor&lt;/td&gt;
 &lt;td&gt;Or&lt;/td&gt;
 &lt;td&gt;$$\lor$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\land&lt;/td&gt;
 &lt;td&gt;And&lt;/td&gt;
 &lt;td&gt;$$\land$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\veebar&lt;/td&gt;
 &lt;td&gt;Xor&lt;/td&gt;
 &lt;td&gt;$$\veebar$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\neg&lt;/td&gt;
 &lt;td&gt;Not&lt;/td&gt;
 &lt;td&gt;$$\neg$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="operators"&gt;Operators&lt;/h2&gt;
&lt;table border="1" style="display: table"&gt;
 &lt;thead&gt;
 &lt;tr style="text-align: right;"&gt;
 &lt;th&gt;Command&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Output&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;\times&lt;/td&gt;
 &lt;td&gt;Times&lt;/td&gt;
 &lt;td&gt;$$\times$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\cdot&lt;/td&gt;
 &lt;td&gt;Dot&lt;/td&gt;
 &lt;td&gt;$$\cdot$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\div&lt;/td&gt;
 &lt;td&gt;Division&lt;/td&gt;
 &lt;td&gt;$$\div$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\pm&lt;/td&gt;
 &lt;td&gt;Plus minus&lt;/td&gt;
 &lt;td&gt;$$\pm$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="relation"&gt;Relation&lt;/h2&gt;
&lt;table border="1" style="display: table"&gt;
 &lt;thead&gt;
 &lt;tr style="text-align: right;"&gt;
 &lt;th&gt;Command&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Output&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;\neq&lt;/td&gt;
 &lt;td&gt;Not equal&lt;/td&gt;
 &lt;td&gt;$$\neq$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\approx&lt;/td&gt;
 &lt;td&gt;Approximately equal&lt;/td&gt;
 &lt;td&gt;$$\approx$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\leq&lt;/td&gt;
 &lt;td&gt;Less than or equal&lt;/td&gt;
 &lt;td&gt;$$\leq$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\geq&lt;/td&gt;
 &lt;td&gt;Greater than or equal&lt;/td&gt;
 &lt;td&gt;$$\geq$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\ll&lt;/td&gt;
 &lt;td&gt;Much less than&lt;/td&gt;
 &lt;td&gt;$$\ll$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\gg&lt;/td&gt;
 &lt;td&gt;Much greater than&lt;/td&gt;
 &lt;td&gt;$$\gg$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="sets"&gt;Sets&lt;/h2&gt;
&lt;p&gt;(Often you can put an &amp;ldquo;n&amp;rdquo; before the command and get the negation)&lt;/p&gt;
&lt;table border="1" style="display: table"&gt;
 &lt;thead&gt;
 &lt;tr style="text-align: right;"&gt;
 &lt;th&gt;Command&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Output&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;\supset&lt;/td&gt;
 &lt;td&gt;Proper superset&lt;/td&gt;
 &lt;td&gt;$$\supset$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\supseteq&lt;/td&gt;
 &lt;td&gt;Superset&lt;/td&gt;
 &lt;td&gt;$$\supseteq$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\subset&lt;/td&gt;
 &lt;td&gt;Proper Subset&lt;/td&gt;
 &lt;td&gt;$$\subset$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\subseteq&lt;/td&gt;
 &lt;td&gt;Subset&lt;/td&gt;
 &lt;td&gt;$$\subseteq$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\in&lt;/td&gt;
 &lt;td&gt;Member&lt;/td&gt;
 &lt;td&gt;$$\in$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\emptyset&lt;/td&gt;
 &lt;td&gt;Empty set&lt;/td&gt;
 &lt;td&gt;$$\emptyset$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\mathbb{R}&lt;/td&gt;
 &lt;td&gt;Set of real numbers&lt;/td&gt;
 &lt;td&gt;$$\mathbb{R}$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\cup&lt;/td&gt;
 &lt;td&gt;Set union (belonging to A OR B)&lt;/td&gt;
 &lt;td&gt;$$\cup$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\cap&lt;/td&gt;
 &lt;td&gt;Set intersection (belonging to A AND B)&lt;/td&gt;
 &lt;td&gt;$$\cap$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="super-subscript-exponents--indices"&gt;Super-/Subscript (Exponents / Indices)&lt;/h2&gt;
&lt;table border="1" style="display: table"&gt;
 &lt;thead&gt;
 &lt;tr style="text-align: right;"&gt;
 &lt;th&gt;Command&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Output&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;^&lt;/td&gt;
 &lt;td&gt;Use ^ for superscript. Example: x^2&lt;/td&gt;
 &lt;td&gt;$$x^2$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;^{}&lt;/td&gt;
 &lt;td&gt;Use ^{} for exponents with &gt;1 digit. Example: x^{10}&lt;/td&gt;
 &lt;td&gt;$$x^{10}$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;_&lt;/td&gt;
 &lt;td&gt;Use _ for subscript. Example: x_0&lt;/td&gt;
 &lt;td&gt;$$x_0$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;_{}&lt;/td&gt;
 &lt;td&gt;Use _{} for subscript with &gt;1 digit. Example: x_{10}&lt;/td&gt;
 &lt;td&gt;$$x_{10}$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="others"&gt;Others&lt;/h2&gt;
&lt;table border="1" style="display: table"&gt;
 &lt;thead&gt;
 &lt;tr style="text-align: right;"&gt;
 &lt;th&gt;Command&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;th&gt;Output&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;\infty&lt;/td&gt;
 &lt;td&gt;Infinity&lt;/td&gt;
 &lt;td&gt;$$\infty$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\partial&lt;/td&gt;
 &lt;td&gt;Partial&lt;/td&gt;
 &lt;td&gt;$$\partial$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\hat{}&lt;/td&gt;
 &lt;td&gt;Estimator&lt;/td&gt;
 &lt;td&gt;$$\hat{\theta}$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;\sqrt[root]{}&lt;/td&gt;
 &lt;td&gt;Square root&lt;/td&gt;
 &lt;td&gt;$$\sqrt[3]{4}$$&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;</description></item></channel></rss>