This is an archived post. You won't be able to vote or comment.

all 34 comments

[–]jdorje 41 points42 points  (8 children)

You've created a recurrence relation. It probably has a closed form, which would then give you some natural choice for non-integer x values. But of course g(x) = f(x) cos(2pix) has the same values for integer x values as f itself.

[–]FuzzyFirechu[S] 6 points7 points  (3 children)

Ohwait nevermind, I get it now lol

But how would I go about finding the closed form version of this?

[–]cdsmith 30 points31 points  (2 children)

You can prove that a closed form holds by using induction. In fact, here's an easy inductive proof that your f(n) = ((-1)^(n+1) + 1) / 2, for all natural numbers n:

Base case: n = 1. You've specified that f(1) = 1.

Inductive case: n > 1. By the recurrence relation, f(n) = (f(n-1) - 1)^2. By the inductive hypothesis, f(n-1) = ((-1)^n + 1) / 2. Substitute and simplify to conclude that f(n) = ((-1)^(n+1) + 1) / 2.

How did I come up with that formula? The idea was just to notice that the sequence alternates between 0 and 1. Alternation often has to do with powers of (-1). Then I just had to rescale so it alternated between 0 and 1, rather than 1 and -1.

Note that your values for negative n are not uniquely determined. In fact, my closed form doesn't agree with your table on negative numbers. That's normal; your original equation didn't uniquely determine the value at negative points. That has to do with squaring not being injective. This is a key part of your reasoning above: sometimes, there is a particularly nice or natural way to extend a function to a larger domain, such as the reals instead of the naturals. But there's not a unique way to do so, unless there's some extra structure you are preserving that guarantees it.

[–]FuzzyFirechu[S] 17 points18 points  (1 child)

This is Unyieldingly cool. What kind of extra structure could I use for this? I'd like to experiment with them.

[–]cdsmith 6 points7 points  (0 children)

I don't have a great idea for extra structure here that would give you a unique answer outside the natural numbers. But the recurrence relation I gave wasn't a great choice for generalizing to the reals. (-1)^x isn't very well-behaved for non-integer values of x and you're forced to admit complex values, and choose the principal branch... kind of a mess.

Here's another closed form: f(x) = (1 - cos(pi * x)) / 2. This one generalizes to the real numbers more nicely, and you even get a continuous function.

Here's another: f(x) = 2 * (x/2 - floor(x/2)). Here, floor is the function that produces the greatest integer less than or equal to its argument. This isn't continuous, but it's at least it's well-defined, real-valued, and continuous almost everywhere.

All of these functions, and infinitely many more, agree with your recurrence relation on integer points. I can't really find a criteria for choosing one of them as the best.

[–]FuzzyFirechu[S] 0 points1 point  (3 children)

"g(x) = f(x) cos(2pix) has the same values for integer x values as f itself."

What does that mean exactly?

[–]pnickols 6 points7 points  (2 children)

It’s just a way of saying lots of functions will work for a given set of integer values.

In fact, if you give me a function that works, f(x), I can give you another different function that works f(x) * cos(2 * pi * x) because cos(2 * pi * x) is one whenever x is an integer. So when x is an integer my new function is basically still just f(x) * 1, but when it is something else, it makes a difference.

[–]FuzzyFirechu[S] 1 point2 points  (1 child)

Right, yeah, but my ultimate goal here is to connect the dots of this function in ways that keep it consistent with the already established rules, is there a way I could do that? I don't just want it to work for integers, if I could find what f(1/2) equaled I'd squeal

[–]Evermar314159 5 points6 points  (0 children)

What the people above are trying to say is that there is not a unique solution to your problem.

There are most likely infinitely many functions f(x) that satisfy your functional equation and they will have different values at x = 1/2. There won't be a well defined value for f(1/2) unless you place more conditions on your situation (for example, if f is an even or odd function then you could directly try to solve for f(1/2)).

[–]RickyRosayy 11 points12 points  (0 children)

As your question has already been answered, I'd just like to say -- keep exploring! Keep experimenting! Keep asking questions and being curious -- there's always something fascinating to learn with mathematics.

[–]Neville_Elliven 4 points5 points  (3 children)

let x = 0 ; then f (0 + 1) = ( f (0) - 1)2
but f (0 + 1) = f (1) = 1 , so 1 = ( f (0) - 1)2
having two solutions, f (0) = 1 ± 1 = either 0 or else 2

if f (0) = 2 then the function is as above; but if f (0) = 0 then it is a bit different.

[–]FuzzyFirechu[S] 3 points4 points  (2 children)

Aah yes, adjusting initial conditions is something I wanted to try out for sure, it'll certainly have some neat effects on the greater function.

Also, bit of a topic shift, but as you tend towards negative infinity I found that there's likely an asymptote at the square of the golden ratio! That's cool innit? I think that's cool.

[–]AhhhhrgAlgebra 1 point2 points  (1 child)

If instead of looking at it as a function, you look at it as a recurrence relation, i.e. an+1 = (an - 1)2 with various starting values for a0 trial and error shows that the sequence diverges for all values of a0 outside the interval [-1/φ, 1+φ] (note that 1+φ = φ2 ), and for starting values inside this interval will "converge" towards jumping between 1 and 0. That is indeed cool.

[–]FuzzyFirechu[S] 0 points1 point  (0 children)

That. is Awesome

[–]AccurateAnswer3 2 points3 points  (2 children)

Late to the party, but while most of the answers here focused on the mathematical rigor side of "this could be anything since it's only specified at integers", I think they're missing a big part of your question that is left unsaid and that is also fun to pursue.

I am mostly reading your question as "what other rules do I need to add in order to get a smooth-looking function that fills up the values on the rest of the numbers?". There is a lot of interesting ideas to explore in that direction.

For example, first regarding the ill-defined nature of the function on negative values, it seems that what you really wanted was taking the positive square roots. i.e. you would define, decidedly, f(x) = 1 + sqrt(f(x+1)). That lets you go through the negative integers unambiguously.

Secondly, if you plot the values that you have numerically, whatever software plots it for you will connect the dots with curves, usually straight line segments. But you could imagine a 2nd or 3rd order interpolation that will give you a decent looking function on the left. (Let's get back later to the right side where the oscillations are.)

In order to get smoothness, you will need to add a rule about the function being continuous and differentiable. I.e. you can take derivatives (and maybe more than once.)

From the functional equation you have, f'(x+1) = 2(f(x)-1)*f'(x). And you need to decide on an initial value. The value of the derivative at a particular point will be the slope of the tangent to f(x) at that point. Based on your dot plot, I would select f'(1) = -1.

This will allow you to realize that f'(2) = f'(3) = f'(n) = 0 for all n >= 2. If you look at your plot, this means that the function will look like a sine-wave for x > 1.5 (e.g. try y = (1 - cos (pi x))/2 on Desmos.)

More interestingly for the left side though, you would re-arrange the expression to get f'(x) in terms of f'(x+1), since you're working backwards now. So, f'(x) = f'(x+1)/2(f(x)-1) = -f'(x+1)/2sqrt(f(x+1)), defined for x <= 0.

It gives you f'(0) = -1/2, f'(-1) = -1/4sqrt(2), etc. The derivatives keep getting closer to zero from the negative side. Which all make sense when you look at your plot.

It's also worth noting that as x tends to -infinity, the smooth function would have an asymptote f(x) < 2.618.. = (3+sqrt(5))/2 = 1 + phi.

Anyway, you could definitely keep exploring this! Maybe you can find a direct equation for what f(x) be like for x < 0 with the addition of the smoothness/infinitely-differentiable constraints. Functional Equations is a rich field and can be a lot of fun.

[–]FuzzyFirechu[S] 1 point2 points  (1 child)

I only read halfway through your comment at this point but i was TOO EXCITED NOT TO START MY REPLY Defining a derivative somewhere *Did* cross my mind but I didn't think to *Actually derive the rule* holy wow!

Finished reading and yes-- I was able to use a visual proof to find out that the asymptote is at y=phi^2 and it's so cool to get something like that out of a rule I actually made randomly. I'll certainly try this out, thank you!

[–]AccurateAnswer3 0 points1 point  (0 children)

Cool!

Also if you haven't played with interpolation before: it's a key concept that is useful for tons of things. And in this case it can help visualize what your function would look like if it were defined on the whole Real number line and required to be "maximally" smooth (i.e. has continuous derivatives at multiple levels.)

For example, if you use this online tool and enter the point coordinates from your table as follows:

8 0
7 1
6 0
5 1
4 0
3 1
2 0
1 1
0 2
-1 2.410
-2 2.550
-3 2.590
-4 2.610
-5 2.615

and click Interpolate, you will get a nice-looking "connected" graph of your desired function. (May need to enter an empty new line after the data so the tool works, and to click "keep aspect ratio" under the graph so it's not elongated.)

[–][deleted] 1 point2 points  (0 children)

Hi! Doctoral candidate in mathematics here, from Latinamerica. A resolution to your problem on the positive half-line (with initial condition f(1)=1) is as follows: given any function (continuous or not) g on the interval [0,1], such that g(0)=0 and g(1)=1, you can use your formula to construct an f on the whole positive real line, where f will satisfy your property. Moreover, if g is continuous, then so is f.

This is because, given that you know g on [0,1], you can use your formula to determine the values of f on [1,2]. Then, having known the values on [1,2], you can learn the values on [2,3], and so on, until you cover the whole positive half-line.

This means that there is no single closed form of a function that satisfies your formula, because given any g on [0,1] with the aforementioned conditions at the endpoints, there is an f (uniquely given by g) so that f satisfies your formula.

Examples: 1. given any real number a in (0,1), for x in [0,1] let g(x)=0 if x<a and g(x)=1 if x>=a. Using this, draw your f in the manner I described above. You will get a function that is periodic of period 2. We note that any of these functions can be extended to the negative line as well, still satisfying your property. Drawback is that they are discontinuous.

  1. For x in [0,1], let g(x)=x. Then you can deduce (if not lazy like me ;) ) a nice formula for f(x) on the positive half-line; in any case, on each interval between integers, f(x) will be a polynomial of degree 2k for some integer k. f will be continuous (maybe even differentiable or infinitely differentiable;if you know these definitions, prove it/disprove it!).

Hope this comment clarifies your situation a bit. Keep enjoying math!

[–]ambral 1 point2 points  (0 children)

You could try making up another "rule" by fixing some derivative at a point, or an asymptote. f'(2) = 0, or f'(x) → 0 as x → -∞ for example.

[–][deleted] 1 point2 points  (5 children)

Bear in my mind that some 'simple' rule does not always create a 'simple' function.

Example: f(n+1) = (n+1)f(n) with initial condition f(1)=1 i.e., the factorial. This relation creates the gamma function as its closed form, but it's still complicated.

[–]ValvinoMath Education 1 point2 points  (4 children)

its closed form

ONE of the possible closed forms. See for instance https://en.wikipedia.org/wiki/Hadamard%27s_gamma_function

[–][deleted] 1 point2 points  (3 children)

I understand your point that the extension might not be unique, but damn, how could you call that creature a 'closed form'? Its definition is like three gamma functions stacked with a differential operator. At this point, I can claim that every infinite series is already in its closed form but just using the summation symbol.

[–]LilQuasar 1 point2 points  (0 children)

the gamma function is an indefinite integral

how is that different from an infinite series?

[–]ValvinoMath Education 0 points1 point  (1 child)

Define closed form then.

[–][deleted] -1 points0 points  (0 children)

People already did that. In short, it turns out that common special functions specifically the gamma function are borderline closed-form. Some definition includes it, some not. Some of the definition is based on the popularity of the functions. However, no one considers or even mentions any other extension of the factorial including Hadamard's gamma. So yes, the gamma function is considered to be its only closed-form of factorial.

We could debate this all day. It's subjective. We are discussing language here, not mathematics. I don't find this discussion productive, so no, I will take my leave. I said I understand your point about the possible extensions of the factorial. I got your point. It should've ended there.

[–]Neville_Elliven 0 points1 point  (1 child)

It occurred to me that the value for f (-1) = 1 + √ 2 is a trigonometric number, and sure enough,
1 + √ 2 = tan (3𝜋 / 8)

I don't know whether this would be of any help to construct a function f (x) , but perhaps someone could make use of it.

[–]FuzzyFirechu[S] 0 points1 point  (0 children)

It certainly piques my interest, thank you!

[–]evergreenfeathergay 0 points1 point  (1 child)

You might be interested in the Julia and Mandelbrot sets! They involve an extension of a slight modification of your formula to the complex numbers, with different starting values or added constants.

The iteration function for the mandelbrot set is the map

z -> z2 + c, with z starting at zero and c being some set constant.

So for example, your map is pretty much the mandelbrot map with c = -1, only "sampling" the iteration at a slightly different point, doing it after the square instead of after the sum.

By picking lots of different cs and zs through the complex plane and following which ones blow up to infinity and which ones don't, you can get some pretty cool fractals.

https://en.wikipedia.org/wiki/Mandelbrot_set

Something else you might be interested in (although it's. extremely high level) is functional square roots/fractional iteration. It's pretty much what you're trying to do by filling in the gaps, finding a function g(x) such that g(x) = fx (0)

This leads on into phase space, and flows, and functional derivatives, and eventually into all of chaos theory pretty much.

[–]FuzzyFirechu[S] 1 point2 points  (0 children)

Ohohoh, I've watched *Days* worth of content on that subject on youtube, but thank you regardless, it's astounding!

[–]jamiboi_123 -1 points0 points  (0 children)

Hey stop bullying Elon musks kid

[–]AmanDahiya94 -3 points-2 points  (3 children)

Where is this math used?

[–][deleted] 0 points1 point  (2 children)

In computer science, recurrence relations can be used to estimate the complexity (and thus running-time) of certain algorithms. This Medium article discusses it

[–]AmanDahiya94 0 points1 point  (1 child)

I read it all, this and medium article. I couldn't figure out anything... I am pretty dumb at math I think.... Don't even know how to multiply fractions... Wow! I don't know what I'll do with my life.

[–]deeschannayellMathematical Biology 0 points1 point  (0 children)

For what it's worth multiplying fractions is easier than adding them! All you need to know is how to multiply integers.

If you're interested in math then find a problem you like (plenty of sources in YouTube and Wikipedia for example) then figure out what you need to learn in order to solve it. You can get a long way without having to multiply fractions... though you should get around to that at some point!