Can a Function Contain Itself? Exploring Self-Containing Functions

  • Thread starter Trepidation
  • Start date
  • Tags
    Functions
In summary, the conversation discusses the possibility of a function containing itself and solving an equation exclusively for the function. It is concluded that it is possible to solve the equation, but not in a closed form, and the function would just equal a constant. It is also mentioned that knowing the function D and N does not help in solving the equation.
  • #1
Trepidation
29
0
First off, I'd like to say that I'm new here and not very advanced. I'm really here in the hopes of learning something, so that my mathematical tools might match up with the mathematical level of my ideas ><.

So... First off: Is it possible for a function to contain itself? For instance, here's something I've been messing around with today:

[tex]f(x) = a ( f(x) ) +x[/tex]

Now... If I change the notation from [tex]f(x)[/tex] to [tex]y[/tex] for clarity, I get this equation, which I can rearrange in the following way:

[tex]y = ay + x[/tex]

[tex]y - ay = x[/tex]

[tex]y(1-a) = x[/tex]

[tex]y = \frac{x}{1-a}[/tex]

And, returning the notation to its original form:

[tex]f(x) = \frac{x}{1-a}[/tex]


In which case, my result (without all of the work I posted above) would be that

[tex]f(x) = a( f(x) ) + x[/tex]

is identical to

[tex]f(x) = \frac{x}{1-a}[/tex]


Is this correct, or incorrect; is there some property of functions that makes what I've done wrong? If it is correct, is there a name for this sort of "self-containing" function?

Thanks in advance for your replies... ^^
 
Mathematics news on Phys.org
  • #2
Yes, that is valid. I would call it recursive, but I am a programmer, not a mathematician. Replacing a function with a variable in that case, though, is fine.
 
  • #3
Alright, that's good then. Thank you. ^^

So... This is as different from what I just asked about as multiplication is from addition. But I guess it's related somehow ><.

Is it possible to solve this equation excusively for the function P(w)? What I mean is, isolate P(w) completely to one side, defining the function, without having it appear anywhere within itself. No D(P(w)) or anything like that.

And, if so, how, if you know? Or do you not know at all ><? My problem:

[tex]P(w) = \frac{N(w)}{D(P(w))}[/tex]
 
  • #4
I do not know of a way to take a function outside of another unknown function. If you know what the function “D” is, though, just replace it with the formula inside that function, and simplify.

The problem is that, if you do not know what the function D looks like, you do not know how it is transforming P(w), and therefore, you do not know how to reverse that to get it out of it… though I am not very advanced in mathematics, do not trust me that it is impossible with an unknown function! :)
 
  • #5
In general, the answer is no. For example, let [tex] N(w)=1 [/tex] , let [tex]D(u)=sin(u) [/tex], and call [tex]P(w)=y [/tex],then your problem is: [tex]y*Sin(y)=1 [/tex], in this case P(w) will just equal a constant which is about as simple as a function can get, but it can't be found in closed form, which I would call unsolvable.
(p.s. y can be found approximately using root finding methods, like Newtons method)
 
  • #6
I know what function D and function N are. P is the unknown. I can't use the inverse of D, because if I do, it looks like this:

[tex]P(w) = \frac{N(w)}{D(P(w))}[/tex]

[tex]P(w) * D(P(w)) = N(w)[/tex]

[tex]D^{-1}(P(w)) * P(w) = D^{-1}(N(w))[/tex]

As you can see, that doesn't help at all. Which is why I ask if it can be done at all...? It might, I don't know. And if it can, I really need to know how ><.

Thanks again for your help so far!
 

What are self-containing functions?

Self-containing functions are functions that contain all the code and variables needed to perform a specific task within the function itself. This means that the function does not rely on external variables or code to execute its task.

Why are self-containing functions important?

Self-containing functions offer several benefits, including increased modularity, easier debugging, and improved code organization. They also help prevent naming conflicts and make it easier to reuse code in different parts of a program.

How do you create a self-containing function?

To create a self-containing function, you simply need to define the function and include all the code and variables necessary for it to perform its task within the function body. This includes any parameters, local variables, and the code to execute the task.

Can self-containing functions call other functions?

Yes, self-containing functions can call other functions. However, it is important to ensure that the called functions are also self-containing to maintain the benefits of modularity and organization.

What is the difference between self-containing functions and regular functions?

The main difference between self-containing functions and regular functions is that self-containing functions do not rely on external variables or code to perform their task. This makes them more modular and self-contained, and they can be easily reused in different parts of a program.

Similar threads

Replies
17
Views
2K
Replies
2
Views
1K
Replies
12
Views
1K
Replies
2
Views
242
  • General Math
Replies
13
Views
2K
Replies
28
Views
2K
Replies
9
Views
1K
  • General Math
Replies
6
Views
1K
  • General Math
Replies
9
Views
2K
Back
Top