14

I'm getting acquainted with Discrete Calculus, and I really like taking functions that arise in traditional calculus and finding what their counterparts in discrete-land are.

For example, if we define our difference operator

$$\Delta f(n) = f(n + 1) - f(n)$$

(the analogue of the familiar derivative operator $D = \frac{d}{dx}$) then we can ask: what is the $e^x$ of this operator? That is, what is the function $g$ such that $\Delta g(n) = g(n)$? The answer is $2^x$, since:

$$\Delta 2^x = 2^{x+1} - 2^x = 2(2^x) - 2^x = 2^x$$

Likewise, we can ask what the $g(x) = x^n$ of discrete calculus is -- it turns out to be

$$g(x) = \overbrace{x(x - 1)(x - 2) \dots (x - (n - 1))}^{n \text{ factors}}$$

My question is: is there a $\sin$ and $\cos$ of discrete calculus? By which I mean, are there any functions $f$ such that $\Delta^2 f = -f$?

Eli Rose
  • 8,381

3 Answers3

10

$(1+i)^x$ and $(1-i)^x$ and their linear combinations. The real part of $(1+i)^x$ is OEIS sequence A146559, the imaginary part A009545.

Robert Israel
  • 470,583
10

There are solutions to $\Delta^2 f = -f$, but sadly they lack some of the interesting properties of their continuous counterparts: they are not periodic.

Fortunately there is a way to construct periodic analogues of $\sin$ and $\cos$, and both solutions (periodic and nonperiodic) have a connection with a much deeper question: if the discrete counterparts of real numbers are ordinary integers, which are the discrete counterparts of complex numbers?

It turns out there are two "natural" candidates: the Gaussian integers $a+bi$ and the Eisenstein integers $a+b\omega$, where $a,b\in\mathbb{Z}$ and $\omega = \frac{\sqrt{3}i-1}{2}$ is a third root of unity. These are special in that they are the only choices that generate a regular periodic lattice in the complex plane.

In analogy with the discrete real exponential, which is $(1+1)^x = 2^x$, one can define for each of these complex integers a discrete version of the imaginary exponential $e^{ix}$:

  • Gaussian imaginary exponential: $(1+i)^x$

  • Eisenstein imaginary exponential: $(1+\omega)^x$

Of these, only the Eisenstein imaginary exponential turns out to be periodic, the reason being that $|1+\omega| = |e^{\pi i/3}|=1$ (this has a geometrical interpretation: you can construct a regular hexagon of side $L$ inscribed in a circle of radius $L$, while you can't do that with a square). From these one can define the corresponding sines and cosines with a discrete Euler's formula:

$$(1+i)^x = \cos_G (x) + i \sin_G (x)$$ $$(1+\omega)^x = \cos_E (x) + \omega \sin_E (x)$$

Thanks to the periodicity of the Eisenstein exponential, you even have an analogue of Euler's identity and a discrete version of $\pi$:

$$(1+\omega)^3 + 1 = 0$$

where the discrete $\pi$ is $3$. In the Gaussian case the solutions have a sort of "semiperiod" equal to $4$, but it's not as satisfying.

At the level of difference equations, to get the periodic trigonometric functions one has to replace $\Delta^2$ by the central difference $\nabla \Delta$ (where $\nabla f(n) = f(n)-f(n-1)$).

pregunton
  • 6,358
  • There are two cubic roots of unity (not equal to $1$). If where any difference which root to use? – Yuriy S Apr 04 '16 at 11:12
  • @YuriyS No, not really. The two cubic roots of unity are complex conjugates of each other, so the formulas are essentially the same; using $\omega$ corresponds to circling the hexagon anticlockwise, while using $\bar{\omega}$ corresponds to circling the hexagon clockwise. – pregunton Apr 04 '16 at 12:18
  • Thank you. It's just that I found out (before I knew what these integers were called) that it's more convenient to use all three roots to describe them. This question – Yuriy S Apr 04 '16 at 12:48
4

Note that if $f(n)$ is a discrete sinusoid, then $$ f(n+1)=f(n)+\Delta f(n) $$ and $$ \Delta f(n+1) = \Delta f(n) + \Delta^2 f(n) = \Delta f(n) - f(n), $$ or $$ \left(\begin{matrix}f(n+1) \\ \Delta f(n+1)\end{matrix}\right)=\left(\begin{matrix}1 & 1 \\ -1 & 1 \end{matrix}\right)\left(\begin{matrix}f(n)\\ \Delta f(n)\end{matrix}\right). $$ Also, $$ \left(\begin{matrix}1 & 1 \\ -1 & 1 \end{matrix}\right)^2 = \left(\begin{matrix}1 & 1 \\ -1 & 1 \end{matrix}\right)\left(\begin{matrix}1 & 1 \\ -1 & 1 \end{matrix}\right)=\left(\begin{matrix}0 & 2 \\ -2 & 0 \end{matrix}\right), $$ $$ \left(\begin{matrix}1 & 1 \\ -1 & 1 \end{matrix}\right)^3 = \left(\begin{matrix}1 & 1 \\ -1 & 1 \end{matrix}\right)\left(\begin{matrix}0 & 2 \\ -2 & 0 \end{matrix}\right)=\left(\begin{matrix}-2 & 2 \\ -2 & -2 \end{matrix}\right), $$ $$ \left(\begin{matrix}1 & 1 \\ -1 & 1 \end{matrix}\right)^4 = \left(\begin{matrix}1 & 1 \\ -1 & 1 \end{matrix}\right)\left(\begin{matrix}-2 & 2 \\ -2 & -2 \end{matrix}\right)=\left(\begin{matrix}-4 & 0 \\ 0 & -4 \end{matrix}\right)=-4\hat{I}. $$ So the discrete $\cos$, which starts with $f(0)=1$ and $\Delta f(0)=0$, is $$ \left( 1, 1, 0, -2, -4, -4, 0, 8, 16, \ldots\right), $$ and the discrete $\sin$, which starts with $f(0)=0$ and $\Delta f(0)=1$, is $$ \left(0, 1, 2, 2, 0, -4, -8, -8, 0, \ldots\right). $$ The fact that these grow as $2^{n/2}$, rather than being periodic, is a consequence of your non-symmetric choice of $\Delta^2$. If you define $\Delta^2 f(n)=f(n-1) - 2f(n) + f(n+1)$, say, you will find functions closer to what you might have expected.

mjqxxxx
  • 43,344
  • Interesting -- so that would require $\Delta^2$ to be defined as something other than $\Delta \circ \Delta$? Or for $\Delta$ to be defined differently? – Eli Rose Sep 18 '15 at 18:31
  • Yes.... see @pregunton's answer. You want to look at the equation $\Delta \nabla f = -f$ instead, where $(\nabla f)(n) = f(n) - f(n-1)$. – mjqxxxx Sep 21 '15 at 02:28