Interpolating Points with Continuous Modular Functions?

  • Context: MHB 
  • Thread starter Thread starter SatyaDas
  • Start date Start date
  • Tags Tags
    Continuous Function
Click For Summary

Discussion Overview

The discussion focuses on defining a continuous function $$F(x;n)$$ that interpolates points of the form (x, x mod n) for integer values of n and x. Participants explore different forms of the function, particularly emphasizing the need for smoothness and periodicity in the function's definition.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant proposes a specific function $$F(x;2)=\frac{1}{2}-\frac{1}{2}\cos\left(\pi x\right)$$ as an interpolating function for n=2.
  • Another participant suggests $$F(x;3) = 1 - \cos\left(\frac{2\pi x}{3}\right) - \frac{1}{\sqrt{3}}\sin\left(\frac{2\pi x}{3}\right)$$ as an attempt for n=3.
  • There is a discussion about using a sawtooth function for continuity, with one participant noting that a smooth function likely requires a trigonometric form.
  • For n=4, a proposed function is $$F(x;4) = \frac{3}{2} - \cos\bigl(\frac{\pi x}{2}\bigr) - \sin\bigl(\frac{\pi x}{2}\bigr) - \frac{1}{2}\cos(\pi x)$$, with the constant term suggested to be $$\frac{n-1}{2}$$.
  • Another participant outlines a general approach for $$F(x;n)$$ as a Fourier series, involving sums of sine and cosine functions, and provides a detailed formula for the coefficients.

Areas of Agreement / Disagreement

Participants express varying approaches to defining the function, with some agreeing on the need for smoothness and periodicity, while others propose different forms and methods. The discussion remains unresolved regarding the general formula for $$F(x;n)$$ and the specific forms for different values of n.

Contextual Notes

Participants note the need for additional equations to solve for the unknowns in the proposed Fourier series approach, indicating that the problem may depend on specific assumptions about the function's properties.

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 0 ·
Replies
0
Views
665
  • · 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 5 ·
Replies
5
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K