MHB Interpolating Points with Continuous Modular Functions?

AI Thread Summary
The discussion focuses on defining a continuous function \( F(x;n) \) that interpolates points of the form \( (x, x \mod n) \) for integers \( n \) and \( x \). An example provided is \( F(x;2) = \frac{1}{2} - \frac{1}{2}\cos(\pi x) \), which successfully interpolates the points for \( n=2 \). Participants suggest that for smoothness, \( F(x;n) \) should be expressed as a trigonometric function, with a proposed general form involving a sum of sine and cosine terms. The constant term in \( F(x;n) \) appears to be \( \frac{n-1}{2} \), and a more complex expression for \( F(x;4) \) is also derived. The conversation concludes with a formula for \( F(x;n) \) that incorporates periodic properties and additional constraints to solve for unknown coefficients.
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:
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top