MHB Interpolating Points with Continuous Modular Functions?

Click For Summary
SUMMARY

The discussion focuses on defining a continuous function $$F(x;n)$$ that interpolates points (x, x mod n) for any integer n. The participants derive specific formulas for $$F(x;2)$$ and $$F(x;3)$$, with $$F(x;3) = 1 - \cos\left(\frac{2\pi x}{3}\right) - \frac{1}{\sqrt{3}}\sin\left(\frac{2\pi x}{3}\right)$$ being a notable example. The general form of the function is proposed as a sum of trigonometric components, with the constant term identified as $$\frac{n-1}{2}$$ for smooth functions. The discussion emphasizes the need for periodicity and smoothness in the function's definition.

PREREQUISITES
  • Understanding of continuous functions and interpolation techniques
  • Familiarity with trigonometric functions and their properties
  • Basic knowledge of modular arithmetic and periodic functions
  • Experience with mathematical notation and expressions
NEXT STEPS
  • Research the properties of continuous functions in mathematical analysis
  • Explore interpolation methods in numerical analysis
  • Learn about the Fourier series and its applications in periodic functions
  • Investigate the use of trigonometric identities in function approximation
USEFUL FOR

Mathematicians, students studying calculus or numerical methods, and anyone interested in function interpolation and modular arithmetic.

SatyaDas
Messages
22
Reaction score
0
Define a continuous function $$F(x;n)$$ that interpolates points (x, x mod n) for a given integer n and all integer x. For example $$F(x;2)=\frac{1}{2}-\frac{1}{2}\cos\left(\pi x\right)$$ interpolates all points (x, x mod 2) when x is an integer. Similarly $$F(x;3)$$ should interpolate points (0,0), (1,1), (2,2), (3,0), (4,1), and so on and so forth.

[DESMOS]{"version":7,"graph":{"viewport":{"xmin":-0.307498196717283,"ymin":-1.0867151664943222,"xmax":8.25153781299237,"ymax":3.6140340364698735},"xAxisMinorSubdivisions":1,"yAxisMinorSubdivisions":1},"randomSeed":"e7520ae08f59a65224c632735e784ac7","expressions":{"list":[{"type":"expression","id":"1","color":"#c74440","latex":"\\frac{1}{2}-\\frac{1}{2}\\cos\\left(\\pi x\\right)"},{"id":"6","type":"table","columns":[{"values":["0","1","2","3","4","5","6","7","8","9","10"],"hidden":true,"id":"4","color":"#6042a6","latex":"x"},{"values":["0","1","0","1","0","1","0","1","0","1","0"],"id":"5","color":"#000000","latex":"y"}]}]}}[/DESMOS]
 
Mathematics news on Phys.org
As a first shot, here's $F(x;3) = 1 - \cos\left(\frac{2\pi x}3\right) - \frac1{\sqrt3}\sin\left(\frac{2\pi x}3\right)$:

[DESMOS]{"version":7,"graph":{"viewport":{"xmin":-2.8493548505939787,"ymin":-4.648035822948437,"xmax":12.843943840753106,"ymax":8.544113758660483}},"randomSeed":"fa42535881c2cad8cca69bf627c0af41","expressions":{"list":[{"id":"6","type":"table","columns":[{"values":["0","1","2","3","4","5","6","7","8","9","10","11"],"hidden":true,"id":"4","color":"#6042a6","latex":"x_1"},{"values":["0","1","2","0","1","2","0","1","2","0","1","2"],"id":"5","color":"#000000","latex":"y_1"}]},{"type":"expression","id":"1","color":"#c74440","latex":"1\\ -\\ \\cos\\left(\\frac{2\\pi x}{3}\\right)\\ -\\ \\frac{1}{\\sqrt{3}}\\sin\\left(\\frac{2\\pi x}{3}\\right)"}]}}[/DESMOS]
 
Opalg said:
As a first shot, here's $F(x;3) = 1 - \cos\left(\frac{2\pi x}3\right) - \frac1{\sqrt3}\sin\left(\frac{2\pi x}3\right)$:
Nice attempt. Below is my output for F(x;3).
m-3.png
 
Of course, if you only require $F(x;n)$ to be continuous then you can use a sawtooth function consisting of straight line segments from $(kn,0)$ to $(kn+n-1,n-1)$ and from $(kn+n-1,n-1)$ to $((k+1)n,0)$ (for all $k\in\Bbb{Z}$). But I am assuming that you want $F(x;n)$ to be a smooth function. So it presumably needs to be a trigonometric function.

For $n=4$ I'm getting $F(x;4) = \frac32 - \cos\bigl(\frac{\pi x}2\bigr) - \sin\bigl(\frac{\pi x}2\bigr) - \frac12\cos(\pi x)$. I don't yet see what the general formula should be, but it seems that the constant term in $F(x;n)$ must be $\frac{n-1}2$.

[DESMOS]{"version":7,"graph":{"viewport":{"xmin":-2.8126723934116136,"ymin":-7.943888407281889,"xmax":17.187327606588386,"ymax":8.868573830351757}},"randomSeed":"20aff6dd18a698f6934d1e00080549f9","expressions":{"list":[{"type":"expression","id":"1","color":"#c74440","latex":"\\frac{3}{2\\ }\\ -\\ \\cos\\left(\\frac{\\pi x}{2}\\right)\\ -\\ \\sin\\left(\\frac{\\pi x}{2}\\right)\\ -\\ \\frac{1}{2}\\cos\\left(\\pi x\\right)"}]}}[/DESMOS]
 
Opalg said:
Of course, if you only require $F(x;n)$ to be continuous then you can use a sawtooth function consisting of straight line segments from $(kn,0)$ to $(kn+n-1,n-1)$ and from $(kn+n-1,n-1)$ to $((k+1)n,0)$ (for all $k\in\Bbb{Z}$). But I am assuming that you want $F(x;n)$ to be a smooth function. So it presumably needs to be a trigonometric function.

For $n=4$ I'm getting $F(x;4) = \frac32 - \cos\bigl(\frac{\pi x}2\bigr) - \sin\bigl(\frac{\pi x}2\bigr) - \frac12\cos(\pi x)$. I don't yet see what the general formula should be, but it seems that the constant term in $F(x;n)$ must be $\frac{n-1}2$.

Indeed, I meant smooth function and your finding of constant term matches with mine. So, high five. Below is my output for F(x;4). I guess it will help to get the idea that there is a pattern.
m-4.png
 
Here is my solution.
Since $F(x;n)$ is periodic with period $n$, we can assume that the function can be expressed as
$$
F(x;n)=\sum_{i=0}^{n-1}\left(a_i\cos\left(\frac{2\pi i x}{n}\right)+b_i\sin\left(\frac{2\pi i x}{n}\right)\right).
$$
There are total of $2n$ unknowns.
We get $n$ equations by using the fact
$$
F(j;n)=j\text{ for all }j\in Z\text{ and }0\le j\le n-1.
$$
We need $n$ more equations so that we can find all the unknowns. For that purpose we can impose more restrictions on the properties of the function $F(x;n)$. If we assume $F'(x;n)=0$ for all $x\in Z$ then we get $n$ more equations. So, now we have a system of $2n$ equations with $2n$ unknowns. If we solve them we get:
$$
a_0=\frac{n-1}{2},\\
a_i=-\frac{n-i}{n} \text{ for all } 0<i<n,\\
b_0=0,\text{ and}\\
b_i=-\frac{n-i}{n}\cot\left(\frac{i\pi}{n}\right)\text{ for all } 0<i<n.
$$
If we simplify things we get
$$
F\left(x;n\right)=\frac{n-1}{2}-\sum_{i=1}^{n-1}\left(1-\frac{i}{n}\right)\csc\left(\pi\frac{i}{n}\right)\sin\left(\pi\frac{i}{n}\left(2x+1\right)\right).
$$
This graph can be visualized interactively at desmos:
[DESMOS]{"version":7,"graph":{"viewport":{"xmin":-9.482047024807466,"ymin":-2.5350658426248973,"xmax":21.090566527405265,"ymax":14.255865825972153}},"randomSeed":"612b9f843d4d8a7b35fc02d3415719d3","expressions":{"list":[{"type":"expression","id":"1","color":"#c74440","latex":"F\\left(x,n\\right)=\\frac{n-1}{2}-\\sum_{i=1}^{n-1}\\left(1-\\frac{i}{n}\\right)\\csc\\left(\\pi\\frac{i}{n}\\right)\\sin\\left(\\pi\\frac{i}{n}\\left(2x+1\\right)\\right)"},{"type":"expression","id":"2","color":"#2d70b3","latex":"F\\left(x,N\\right)"},{"type":"expression","id":"3","color":"#388c46","latex":"N=5","hidden":true,"slider":{"hardMin":true,"hardMax":true,"min":"0","max":"100","step":"1"}}]}}[/DESMOS]
 
Last edited:

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K