Math Equations

Tuesday, August 13, 2019

When you forget a theorem of geometry

... you should try Gröbner bases.

Suppose four points \(A,B,C,D\) lie on a common circle. How do the four quadrances to the point \(M:\equiv(AC)(BD)\) relate?



Let me Gröbner that for you.
% sage
┌──────────────────────┐
│ SageMath version 8.8 │
└──────────────────────┘
sage: R.<x0,y0,x1,y1,x2,y2,x3,y3,s,t,q0,q1,q2,q3> = PolynomialRing(QQ, order='lex')
sage: xm, ym, xm1, ym1 = x0*s+x2*(1-s), y0*s+y2*(1-s), x1*t+x3*(1-t), y1*t+y3*(1-t)
sage: ideal(x0^2+y0^2-1, x1^2+y1^2-1, x2^2+y2^2-1, x3^2+y3^2-1,
....:       xm-xm1, ym-ym1,
....:       -q0+(xm-x0)^2+(ym-y0)^2, -q1+(xm-x1)^2+(ym-y1)^2,
....:       -q2+(xm-x2)^2+(ym-y2)^2, -q3+(xm-x3)^2+(ym-y3)^2).groebner_basis()[-1]
q0*q2 - q1*q3
\[Q(A,M)Q(C,M)=Q(B,M)Q(D,M)\]

Friday, July 20, 2018

Sums of powers of roots

It is known since Newton's time that sums of the form \(\sigma_k:=\sum x_i^k\) are polynomial expressions in the coefficients of \(f=\prod(z-x_i)\). What follows is my best understanding of this. We use a formal power series approach, and therefore define \(N_f:=\sum\sigma_kz^k\). I want to prove that \[z^nf(\frac1z)N_f(z) = z^{n-1}f'(\frac1z).\label{th1}\tag{1}\] (It is written this way since \(z^nf(\frac1z)\) and \(z^{n-1}f'(\frac1z)\) are polynomials.)

The proof uses logarithmic differentiation and geometric series expansion only. \begin{align*} \frac{z^{n-1}f'(\frac1z)}{z^nf(\frac1z)} &= \frac1z(\log f)'\left(\frac1z\right) &&= \frac1z\sum\frac1{\frac1z-x_i} \\ &= \sum\frac1{1-x_iz} &&= \sum x_i^kz^k \\ &= \sum\sigma_kz^k &&= N_f(z) \end{align*} For example suppose \(f=(z-x_0)(z-x_1)=(z-2)(z-3)=z^2-5z+6\). The first few sums are \[\sigma_0 = 2,\quad\sigma_1=5,\quad\sigma_2=13,\quad\sigma_3=35,\quad\sigma_4=97\] so \(N_f\approx2+5z+13z^2+35z^3+97z^4\). Furthermore \(z^nf(\frac1z)=1-5z+6z^2\) and \(z^{n-1}f'(\frac1z)=2-5z\). We may test \((\ref{th1})\) by computing its left- and right-hand sides up to fourth order: \[(2+5z+13z^2+35z^3+97z^4)(1-5z+6z^2) = (2-5z) \mod z^5.\] Conversely, we can compute more terms \(\sigma_k\) by polynomial division: \[N_f = \frac{2-5z}{1-5z+6z^2} = \sum_{0\leq k\lt m}\sigma_kz^k + z^m\frac{\textrm{remainder polynomial}}{1-5z+6z^2}\] In python:
>>> z = sympy.var('z')
>>> Nf = sympy.fps((2-5*z)/(1-5*z+6*z*z))
>>> Nf.truncate(10)
2 + 5*z + 13*z**2 + 35*z**3 + 97*z**4 + 275*z**5
+ 793*z**6 + 2315*z**7 + 6817*z**8 + 20195*z**9 + O(z**10)

Wednesday, March 7, 2018

Demuxing a random variable

Suppose \(f = ag + (1-a)h\), a convex combination of pdfs. Then \(f\) is a pdf.

Suppose \(X\) has \(f\) as pdf. For any evaluation \(x\) of \(X\), produce a random variable with conditional distribution, \[Y\sim\text{Bernoulli}\left(\frac{(1-a)h(x)}{(ag(x)+(1-a)h(x)}\right).\] Then \(X|(Y=0)\sim g\) and \(X|(Y=1)\sim h\) since \begin{align} p(x|0) &= \frac{p(0|x)p(x)}{\sum_{x'}p(0|x')p(x')} = \frac{\frac{ag(x)}{f(x)}f(x)}{\sum_{x'}\frac{ag(x)}{f(x)}f(x)}\\ &= \frac{ag(x)}{\sum_{x'}ag(x')} = \frac{a\cdot g(x)}{a\cdot1} = g(x)\\ p(x|1) &= \frac{p(1|x)p(x)}{\sum_{x'}p(1|x')p(x')} = \frac{\frac{(1-a)h(x)}{f(x)}f(x)}{\sum_{x'}\frac{(1-a)h(x)}{f(x)}f(x)}\\ &= \frac{(1-a)h(x)}{\sum_{x'}(1-a)h(x')} = \frac{(1-a)\cdot h(x)}{(1-a)\cdot1} = h(x). \end{align}

The utility of this construction is as follows: It lets you turn a probabilistic experiment with definite outcomes (say the probabilities are \([0.2,\,0.6,\,0.2]\)) into an experiment with outcomes which are again probability distributions, such as \([0.4,\,0.6,\,0]\) and \([0,\,0.6,\,0.4]\), each with probability \(\frac12\). This blurs the distinction between deterministic variables (or often equivalently zero variance, zero entropy) and nondeterministic variables (positive variance, positive entropy).

In fact, it suggests that entropy can be calculated from the coefficients of an arbitrary convex combination. In the example just given, the entropy of \([0.2,\,0.6,\,0.2]\)) with respect to \([0.4,\,0.6,\,0]\) and \([0,\,0.6,\,0.4]\) is the entropy of \([0.5,\,0.5]\) with respect to \([1,\,0]\) and \([0,\,1]\), i.e. \(\frac12\log2+\frac12\log2=1\).

And why not try affine combinations! \[[0.2,\,0.6,\,0.2] = 2\cdot[\frac13,\,\frac13,\,\frac13]-1\cdot[\frac7{15},\,\frac1{15},\,\frac7{15}].\] The associated entropy in base 2 is \[-2\log2+1\log(-1) = -2+\pi i\log e = -2 + 4.53236i.\]

Thursday, June 8, 2017

A proposition of trigonometry, or complex numbers

Prop. If \(0,1,z,w\) all lie on a circle centered at \(1/2\) then \(zw\) is the orthogonal projection of \(0\) onto the line through \(z\) and \(w\).

Proof. If \(z,w\) to lie on that circle, then \[(z-\frac12)(\overline{z}-\frac12)=\frac14,\text{ which simplifies to }z\overline{z}=\frac{z+\overline{z}}2\] \[(w-\frac12)(\overline{w}-\frac12)=\frac14,\text{ which simplifies to }w\overline{w}=\frac{w+\overline{w}}2.\] Introducing names \(z=a+bi,w=c+di\) these equations turn into \[a^2+b^2=a,\quad c^2+d^2=c.\] Two things need to be shown: \((1)\) \(zw\) lies on the line through \(z\) and \(w\), and \((2)\) \(zw\) is perpendicular to \(z-w\).

\((1)\) Verify that the following determinant is zero. \begin{align*} \begin{vmatrix}1&a&b\\1&c&d\\1&ac-bd&ad+bc\end{vmatrix}&=acd+bc^2-acd+bd^2-a^2d-abc+abc-b^2d+ad-bc\\ &=b(c^2+d^2)-(a^2+b^2)d+ad-bc=bc-ad+ad-bc=0. \end{align*} \((2)\) Verify that \(zw/(z-w)\) is imaginary, or equivalently that \(zw(\overline z-\overline w)\) is imaginary. \begin{align*} zw(\overline z-\overline w)+\overline{zw(\overline z-\overline w)}&=z\overline zw-zw\overline w+z\overline z\overline w-\overline zw\overline w=z\overline z(w+\overline w)-(z+\overline z)w\overline w\\ &=\frac{z+\overline z}2(w+\overline w)-(z+\overline z)\frac{w+\overline w}2=\frac12(z+\overline z)(w+\overline w)(1-1)=0. \end{align*}

Tuesday, May 9, 2017

Extremely rational cubic polynomials

By an extremely rational cubic polynomial, I mean a cubic polynomial \(p\) such that both \(p\) and \(p'\) are products of rational linear factors. A parametrization will now be derived.

Seek to satisfy \(p=(a+x)(b+x)(c+x),\ p'=3(d+x)(e+x)\) as polynomials.
\begin{align*}
0=p'(-e)&=ab+ac+bc-2(a+b+c)e+3e^2 \\
(3e-a-b-c)^2&=(a+b+c)^2-3(ab+ac+bc) \\
&=a^2+b^2+c^2-ab-ac-bc
\end{align*}We thus need to parametrize triples \((a,b,c)\) such that the right-hand side is a square.

By the cubic number system, I mean triples \((a,b,c)\) with the following operations.
\begin{align*}
(a,b,c)+(d,e,f)&\equiv(a+d,b+e,c+f) \\
(a,b,c)(d,e,f)&\equiv(ad+bf+ce,ae+bd+cf,af+be+cd) \\
Q(a,b,c)&\equiv a^2+b^2+c^2-ab-ac-bc
\end{align*}This system is a close sibling of the usual complex number system. Its relevance to us is in the last definition. It is the expression we want to make into a square. Verify the identity \(Q(zw)=Q(z)Q(w)\) to realize that our task can be fulfilled by setting \((a,b,c)\equiv(u,v,w)^2\). Normally, one would use fractions \(a,b,c,u,v,w\) in this number system, but we can just as well use complex parameters \(u,v,w\).

Here is the parametrization.
\begin{align*}
p&=(a+x)(b+x)(c+x),\quad p'=3(d+x)(e+x),\quad p''=6(f+x) \\
a&=u^2+2vw,\quad b=w^2+2uv,\quad c=v^2+2uw\\
d,e&=\frac13((u+v+w)^2\pm Q(u,v,w)),\quad f=\frac13(u+v+w)^2\end{align*}
Here is an example.
\begin{align*}
(u,v,w)&=(1,2,7) \\
(a,b,c)&=(1^2+2\times 2\times 7,\ 7^2+2\times 1\times 2,\ 2^2+2\times 1\times 7)=(29,53,18) \\
p&=(29+x)(53+x)(18+x)=27666+3013x+100x^2+x^3 \\
Q(u,v,w)&=1^2+2^2+7^2-1\times 2-1\times 7-2\times 7=31 \\
Q(a,b,c)&=29\times 29+53\times 53+18\times 18-29\times 53-29\times 18-53\times 18=961 \\
d,e&=\frac13({10}^2\pm 31)=\frac{131}3,23\\
p'&=3(\frac{131}3+x)(23+x)=(131+3x)(69+x)=3013+200x+3x^2\\
f&=\frac{100}3,\quad p''=6(\frac{100}3+x)=200+6x

\end{align*}
An example involving complex parameters \(u,v,w\) is best given visually and interactively.

Monday, March 14, 2016

Estimating a quarter turn in radians

Compute two sequences $\begin{matrix}a_0&\dots&a_{n-1}\\b_0&\dots&b_{n-1}\end{matrix}$ of unsigned integers with
$$\begin{align}\begin{matrix}a_0&a_{n-1}\\b_0&b_{n-1}\end{matrix} &= \begin{matrix}1&0\\0&1,\end{matrix}\\\left|\begin{matrix}a_k&a_{k+1}\\b_k&b_{k+1}\end{matrix} \right| &= 1\;\text{for all $k.$}\end{align}$$Then $$\sum\frac1{a_ka_{k+1}+b_kb_{k+1}} \approx \frac\tau4.$$

The idea is as follows: Integrate 1 from 0 to $\frac\tau4.$ A small term $\Delta\theta$ can be approximated as $\sin \Delta\theta$. Take $\sin^2 \Delta\theta$ to be the spread between two adjacent vectors $\begin{matrix}a_k\\b_k\end{matrix}$, $\begin{matrix}a_{k+1}\\b_{k+1}\end{matrix}.$ This spread is $$\frac{(a_kb_{k+1}-a_{k+1}b_k)^2}{(a_k^2+b_k^2)(a_{k+1}^2+b_{k+1}^2)} = \frac1{(a_ka_{k+1}+b_kb_{k+1})^2+1} \approx \frac1{(a_ka_{k+1}+b_kb_{k+1})^2}.$$Thus $\Delta\theta\approx\frac1{a_ka_{k+1}+b_kb_{k+1}}.$

Here's an algorithm:

#include <iostream>
#include <iomanip>
using namespace std;

long double integrate(unsigned long a0, unsigned long b0,
                      unsigned long a1, unsigned long b1) {   
    if (a0*a1+b0*b1 > 100000)
        return 1.0L/(a0*a1+b0*b1);
    else
        return integrate(a0+a1, b0+b1, a1, b1) + integrate(a0, b0, a0+a1, b0+b1);
}

int main() {
    cout << "approx " << setprecision(20) << integrate(1, 0, 0, 1) << endl;
}

The output is 1.5707963268188070548, which equals $\frac\tau4$ to 9 decimal places.


Thursday, November 26, 2015

Continuous matrices

This will be a naive discussion about functions roughly of the form $A: \mathbb{R}^2\to\mathbb{R}$ but allowing delta behaviour which I only know of informally so far. $A$ is a continuous matrix. Addition $A+B$ is done componentwise and multiplication $AB$ is carried out by integrating
$$(AB)(x,y)=\int_{-\infty}^{+\infty}A(x,z)B(z,y)dz.$$

The plot operator $P$, defined through $P_f(x,y)=\delta(x-f(y))$, creates a continuous matrix. One interesting property, when combined with the usual associativity and distributivity of matrix operations, is that
$$ P_fP_g=\int_{-\infty}^{+\infty}\delta(x-f(z))\delta(z-g(y))dz=\delta(x-f(g(y)))=P_{f\circ g}.$$ This property makes it possible to interpret an arbitrary continuous matrix as a superposition of graphs $A = \sum \alpha_iP_{f_i}$ of single variable functions $f_i$, and to interpret multiplication of two matrices $A,B$ as a weaving together of all possible compositions: $AB = \sum\alpha_i\beta_jP_{f_i\circ g_j}.$ But all this is just conceptual speculation.


Here is a new light on fourier transforms: $F(x,y)=e^{-ixy}$. The inversion formula $FFf(x)=\tau f(-x)$ can be written as $F^2=\tau\delta(x+y)$ and verified using the definition of matrix multiplication.


In simple cases of signal analysis a linear operator $T$ transforming the signal is characterized through its impulse response $h=T\delta$ in the fashion $Tx(t)=\int_{-\infty}^{+\infty}h(t-u)x(u)du$, i.e. through the convolution $Tx=h*x$. The $h*$ part can be written as a matrix. Indeed, for any functions $x,y$,
$$ x*y(t) = \int_{-\infty}^{+\infty}x(t-u)y(u)du = C_xy(t) $$ where $C_f(x,y)=f(x-y)$ in general. In this case we have $Tx=h*x=C_hx$ so that $T=C_h$ in the same sense that a finite-dimensional linear transformation is equal to its transformation matrix.


This reminds me of the familiar way to define complex multiplication:
$$\left(\begin{matrix}a\\b\end{matrix}\right)\left(\begin{matrix}c\\d\end{matrix}\right)=\left(\begin{matrix}a&-b\\b&a\end{matrix}\right)\left(\begin{matrix}c\\d\end{matrix}\right).$$ Maybe it's more common to use matrices in both steads but we see that with this formulation $zw=M_zw$ where $M_z$ is chosen in the obvious way. The similarity between $C$ and $M$ is that both are obtained by repeating data across diagonals.

Another similarity: In the same way that matrix models verify the associativity $M_uM_vM_w$ of complex number multiplication $uvw$, they verify the associativity $C_fC_gC_h$ of convolutions $f*g*h$. And the same holds for the distributive property.



Friday, April 24, 2015

The square root algorithm

I was taught that to get the square root of a number \(a\) you iterate \(x\mapsto \frac{x+\frac ax}2\) until you're happy with the result. More generally, to scale a vector \(v\) to have quadrance \(a\) you iterate \(v\mapsto \frac{1+\frac a{v\cdot v}}2v\). That's a direct analog. With negative quadrances you get chaotic behavior.

Sunday, March 1, 2015

Tetrahedra on a hyperbolic parabola

Instructed by a youtube video I folded a hyperbolic parabola. It looked like a regular tetrahedron so I wondered if there is any regular tetrahedron on the rational surface \(z=x^2-y^2\).



It should be centered at the origin and have the following vertices:\[[a,b,a^2-b^2], [-a,-b,a^2-b^2], [-b, a, -a^2+b^2], [b, -a, -a^2+b^2].\]We want all quadrances to be the same. By symmetry, only one equation is needed:\[4a^2+4b^2=(a-b)^2+(a+b)^2+4(a^2-b^2)^2\]or equivalently\[a^2+b^2=2(a^2-b^2)^2.\]

Our approach is to try to solve for one of the variables, say \(a\) in terms of \(b\). We will plug in different rational \(b\) and filter out those which give rational \(a\). A major insight is that filtering can be done by parametrization, or a change of variables if you wish. Let's start with completing the square:\[\left(a^2-\frac{4b^2+1}4\right)^2=b^2+\frac1{16}.\]Denote the left-hand side by \(c\). We can find points on the hyperbola \(c^2-b^2=\frac1{16}\) by first parametrizing the unit circle and noticing that\[c^2-b^2=\frac1{16}\iff\left(\frac bc\right)^2+\left(\frac1{4c}\right)^2=1.\]The parametrization becomes (we choose \(2t\) rather than \(1-t^2\) in the denominator)\[(b,c)=\left(\frac{1-t^2}{8t},\frac{1+t^2}{8t}\right).\]and thus the completed square can be written (we arbitrarily choose a plus sign when taking roots)\begin{align*}a^2&=\frac{\dfrac{(1-t^2)^2}{16t^2}+1}4+\frac{1+t^2}{8t}=\frac{1+14t^2+t^4+8t+8t^3}{64t^2}\\&=\frac{(1+t)^4+4t(1+t)^2}{64t^2}=\frac{(1+t)^2}{64t^2}((1+t)^2+4t).\end{align*}We now turn to the equation\[d^2=(1+t)^2+4t=(t+3)^2-8=e^2-8.\]In this case let's try a different substitution:\begin{align*}(d,e)&=(u+v,u-v)\\uv&=-2\\(d,e)&=\left(u-\frac2u,u+\frac2u\right)=\left(\frac{u^2-2}u,\frac{u^2+2}u\right)\\t&=e-3=\frac{u^2-3u+2}u=\frac{(u-1)(u-2)}u.\end{align*}Finally,\begin{align*}(a,b)&=\left(\frac{1+t}{8t}d,\frac{1-t^2}{8t}\right)=\left(\frac{\frac{u^2-2u+2}u\cdot\frac{u^2-2}u}{8\frac{(u-1)(u-2)}u},\frac{-\frac{u^2-2u+2}u\cdot\frac{u^2-4u+2}u}{8\frac{(u-1)(u-2)}u}\right)\\&=\frac{u^2-2u+2}{8u(u-1)(u-2)}(u^2-2, -u^2+4u-2).\end{align*}In particular, one possible tetrahedron, obtained when \(u=-1\), has vertices\[[a,b,a^2-b^2]=\frac1{48}[5, 35, -25],\text{ etc}.\]

Sunday, February 15, 2015

More music

Yesterday I was determined to write a song, and so I did.

 

Sunday, February 1, 2015

Theorem classification

I claim (as an experiment) that there are three kinds of theorems "If A then B". Let \(|A|\) be the number of arrangements of objects that fit the description, i.e. interpret \(A\) as a set of tuples.
  1. \(|A| = \aleph_0\) – these give exact answers
  2. \(|A| = c\) – these give approximate results, usually to arbitrary precision
  3. \(|A| > \aleph_0\text{ but }|A|\not=c\) – these are even deeper set-theoretical fantasies
If \(|A|\in\mathbb{N}\text{ or }|A| = 0\) then the theorem doesn't deserve to be called a theorem because the use of the implication can be avoided by enumerating all statements \((a_i\in A,b_i\in B)_{i=1}^n\).

A subtle issue is that my use of sets is not justified. For example, according to present set theory, there is no set of all sets, so my classification cannot handle statements like "All sets have a power set". I count all such theorems into category 3 because they are set-theoretic.

How many functions are there?

Claim
There are more real functions than there are real numbers.

Explanation
\(\{f:\mathbb{R}\to\mathbb{R}\} \geq \{f:\mathbb{R}\to\{0, 1\}\} = \mathcal{P}(\mathbb{R}) > \mathbb{R}\)

Claim
There are just as many continuous functions as there are real numbers.

Explanation
\(\{f:\mathbb{R}\to\mathbb{R}, f\text{ continuous}\}\\\qquad\begin{cases}\geq\{f:\{0\}\to\mathbb{R}\} = \mathbb{R}\\\leq\{f:\mathbb{N}\times\mathbb{N}\to\mathbb{R}\}=\mathbb{R}^{\mathbb{N}\cdot\mathbb{N}}=2^{\mathbb{N}\cdot\mathbb{N}\cdot\mathbb{N}}=2^\mathbb{N}=\mathbb{R}\end{cases}\)

The first step on the second line is justified by the fact that for every continuous function, there is a sequence of parallelogram functions converging pointwise to it. By parallelogram function, I mean a function whose value is specified at evenly distributed points and interpolated linearly in between. For example, a parallelogram function approximating \(\sin(x)\) is \[f(x) = \sin(\lfloor x\rfloor) + (x-\lfloor x\rfloor)\sin(\lfloor x\rfloor+1).\]
To narrow the number of parallelogram functions down to \(\{f:\mathbb{N}\times\mathbb{N}\to\mathbb{R}\}\), require that the value at \(0\) be specified and that the distance between specified points for the \(n\)th function in the sequence be \(1/n\).

Central motion excludes the center

Central motion is the motion of a particle under the influence of a central force. I have known for some year that the particle cannot not pass through the origin. Mimicking a proof in my multivariable calculus book, I'll formalize the fact.

Theorem
If \(r:(a, b)\to\mathbb{R}^3\) is twice differentiable, \(r(t)\times r''(t) = \vec{0}\) for all \(t\) and \(r(t_0)\times r'(t_0) \not=\vec{0}\) for some \(t_0\), then \(r(t)\) is never \(\vec{0}\).

Proof
\[\frac{d}{dt}(r(t)\times r'(t)) = r'(t)\times r'(t) + r(t)\times r''(t) = \vec{0}\]Thus \(r(t)\times r'(t)=c\) for some \(c\). Because \(r(t_0)\times r'(t_0) \not=\vec{0}\), \(c\not=\vec{0}\). If \(r(t_1)\) were \(\vec{0}\) for some \(t_1\) then \(c\) would be \(\vec{0}\) so there is no such \(t_1\).

I wonder how to generalize this to higher dimensions.

Friday, January 30, 2015

Continuity at infinity

Usually \(f(x)\to L\text{ as }x\to \infty\) is defined in an epsilon N fashion. With a projective point of view, infinity becomes a point among the usual numbers, and the definitions of convergence at finite and infinite points can be unified. What strikes me is that this means that if f(x) converges as x goes to infinity, then f can be continuously extended at infinity.

Saturday, January 24, 2015

Cauchy–Schwarz

Finally I understand the Cauchy–Schwarz inequality! No induction needed.

Theorem
\(a, b\in \mathrm{Rat}^n\)
\(n\in\mathrm{Nat}\)
                     
\((a\bullet b)^2 \leq \mathop{\rm Q}(a)\mathop{\rm Q}(b)\)

Proof
Recall that by definition
\[a\bullet b=\sum_{i=1}^n a_ib_i\]\[\mathop{\rm Q}(a)=\sum_{i=1}^n a_i^2\]\[\mathop{\rm Q}(b)=\sum_{i=1}^n b_i^2.\]
The claim, reformulated as
\[\left(\sum_{i=1}^n a_ib_i\right)^2 \leq \left(\sum_{i=1}^n a_i^2\right)\left(\sum_{i=1}^n b_i^2\right),\]
is equivalent to (by distributing terms)
\[\left(\sum_{i=1}^n a_i^2b_i^2\right)+\sum_{1\leq i<j\leq n}2a_ib_ia_jb_j \leq \left(\sum_{i=1}^n a_i^2b_i^2\right)+\sum_{1\leq i<j\leq n}a_i^2b_j^2+a_j^2b_i^2\]
and (by collecting terms)
\[0 \leq \sum_{1\leq i<j\leq n}a_i^2b_j^2+a_j^2b_i^2-2a_ib_ia_jb_j = \sum_{1\leq i<j\leq n}(a_ib_j-a_jb_i)^2.\]
The last statement is true because squares are positive and sums of positive numbers are positive.

Saturday, January 10, 2015

A spiral

Let \(\mathbb{O}\) be the countable set of all infinite rational number sequences which are ultimately but not identically zero, and let \(H\) contain those elements in \(\mathbb{O}\) whose last nonzero element is positive. With respect to \(\mathbb{O}\), define \(H^\complement\). Then \(f(x) = -x\) is a bijection from \(H\) to \(H^\complement\).

Also, \(H\) looks like a spiral. To see that, require the last nonzero element to be the first, then the second, and then the third one, and watch this sequence of subsets twist into a new dimension at each step.

That's really something! A spiral whose reflection in the origin is its complement.

Monday, October 27, 2014

Elegant matrix inversion

I had an exam today. One question inspired me. Let \(\mathbf{E}_n\hspace{-3pt}: n\times n\) and \(\mathbf{e}_{ij}=1\). Then the inverse of \(\mathbf{A}_n = \mathbf{E}_n - \mathbf{I}_n\) is \(\mathbf{A}_n^{-1} = \frac1{n-1}\mathbf{E}_n-\mathbf{I}_n\) if \(2\leq n\). There are two interesting things about this: The inverse can be expressed using matrix operations, and the matrix operations can be used to verify that \(\mathbf{A}^{-1}\) is actually an inverse.

To verify the result, note first that \(\mathbf{E}_n^2=n\mathbf{E}_n\). This identity can be seen as the workhorse of the method. Check that \(\mathbf{A}\mathbf{A}^{-1}=\mathbf{I}\).
\[\begin{align}\mathbf{A}_n^\phantom{-1}\hspace{-4pt}\mathbf{A}_n^{-1} &= (\mathbf{E}_n - \mathbf{I}_n)\left(\frac1{n-1}\mathbf{E}_n-\mathbf{I}_n\right) \\&= \frac n{n-1}\mathbf{E}_n-\mathbf{E}_n-\frac1{n-1}\mathbf{E}_n+\mathbf{I}_n = \mathbf{I}_n\end{align}\]

I'll have to think about this some more sometime. Can other simple matrices be inverted and expressed using matrix operations? What are some useful workhorses? Why has no one told me about this before?

Tuesday, August 12, 2014

First four bars

Today I wrote the first piece of music that sounded interesting and good. It's only four bars.

Saturday, August 2, 2014

An open question

Is there a nonnegative function \(f\) such that \(\displaystyle\int\limits_0^\infty \cfrac{f(x)}{\int\limits_x^\infty f(y)\; dy} dx\) exists?

Saturday, July 26, 2014

The area of a triangle a, b, c

This week, I encountered the following problem in my textbook: Show that the area of a triangle ABC is given by \(\sqrt{s(s-a)(s-b)(s-c)}\), where \(s = (a+b+c)/2\) is the semi-perimeter of the triangle. I want to share my solution because it shows how you can avoid time-consuming algebra by factoring instead of expanding.



\[\small\begin{array}{l}
A = \sqrt{A^2}\\
\quad A^2 = \left(\frac{bh}{2}\right)^2 = \frac{b^2h^2}{4}\\
\quad\quad h^2 = \begin{cases} c^2-(c\cos{A})^2 \\ a^2-(b-c\cos{A})^2 \end{cases}\\
\quad\quad c\cos{A} = \frac{c^2+b^2-a^2}{2b}\\
\quad\quad h^2 = c^2 - \left(\frac{c^2+b^2-a^2}{2b}\right)^2 = \Pi\left(c \pm \frac{c^2+b^2-a^2}{2b}\right) = \Pi\frac{2bc \pm (c^2+b^2-a^2)}{2b}\\
\quad \begin{aligned}A^2 &= \cfrac{(2bc + (c^2+b^2-a^2))(2bc - (c^2+b^2-a^2))}{16} \\&= \cfrac{((b+c)^2-a^2)(a^2 - (b-c)^2)}{16} \\&= \cfrac{(b+c+a)(b+c-a)(a-b+c)(a+b-c)}{2\cdot2\cdot2\cdot2} \\&= \cfrac{a+b+c}{2}\cdot\cfrac{a+b+c-2a}{2}\cdot\cfrac{a+b+c-2b}{2}\cdot\cfrac{a+b+c-2c}{2} \\&= s(s-a)(s-b)(s-c)\end{aligned}\\
A = \sqrt{s(s-a)(s-b)(s-c)}
\end{array}\]