Compare Functions: Which is Better?

In summary, the conversation discusses the comparison of two functions and their characteristics in terms of complexity and predictability. The purpose of the functions is to find weights between nodes in a graph, using different properties x and y. The question is whether it is possible to determine which function is simpler when both functions produce the same results on a given set of data points. However, the definition of "simpler" is subjective and varies depending on the context and specific definitions.
  • #1
klinmy
5
0
Hi, I would like know if it is possible to tell which function is better over another?

For instance, I have two functions:

(i) f(x,y)=exp(a*x) * exp(b*y)
(ii) f(x,y)=a(exp(x)) * b(exp(y))


I would like to know the characteristics of both the functions which make it better/less better over another. (e.g.: the effect of a and b towards the results; the complexity or etc.)
I've tried plotting the functions in 3D graphs, but didn't help much.. Please guide.

Thanks in advance!
 
Physics news on Phys.org
  • #2
I have no idea what you mean by "better". I can only think that it would depend upon what you wanted to use the function for. And since there are many different applications for functions, there cannot be one single answer to this question.
 
  • #3
HallsofIvy said:
I have no idea what you mean by "better". I can only think that it would depend upon what you wanted to use the function for. And since there are many different applications for functions, there cannot be one single answer to this question.


Thanks. I just wonder if it is possible to tell the differences between two functions when both of them do actually serve the same purpose. In this case, both functions are used to find the weights between nodes (graph), and x and y are two different properties to consider. So by looking at the functions, can we say that, e.g: output of function (ii) is easier to be predicted when a and b are tuned; function (i) is more complex than function (ii) and etc.

I hope this makes sense..
Thanks.
 
  • #4
As I interpret the question, it is this:

Suppose f(x) and g(x) are two different functions. Suppose we have a set of data points (x,y) and f and g agree with each other on those data points. (i.e. y = f(x) = g(x for all i). Is there a way to say which of f and g is the simpler representation of the data?

That is a sensible but imprecise question since, as HallsOfIvy indicates, any answer would depend on what you mean by "simpler". There is no universally accepted meaning for one function being simpler than another. However, there various specific definitions of "simpler" have been invented and there are specific results about how to compare functions once you establish which definition you are using. Thinking in terms of fitting equations to data, some people define "f is simpler than g" to mean that fitting f to g involves using the data to find fewer unknown constants.
 
  • #5
Thank you so much for rephrasing my question Stephen. It sounds so much clearer and more professional.

Sorry that I just noticed the mistake I made in function(ii), where the * is actually a +.

(i) f(x,y)=exp(a*x) * exp(b*y)
(ii) g(x,y)=a(exp(x)) + b(exp(y))

I tried running both the functions, and found that both generated the same shape of graph when the same a and b were used. So does this mean that both functions are actually the same?

Thanks.
 
  • #6
correction: similar shape with different interval between i.
 

FAQ: Compare Functions: Which is Better?

What is the purpose of comparing functions?

The purpose of comparing functions is to determine which function is more effective or efficient in achieving a specific goal or task.

What factors should be considered when comparing functions?

Some factors that should be considered when comparing functions include the complexity and readability of the code, the speed and performance of the function, and the memory usage.

How do you determine which function is better?

In order to determine which function is better, you can run tests and analyze the results to see which function performs better in terms of speed, memory usage, and overall effectiveness.

Are there any limitations to comparing functions?

Yes, there can be limitations to comparing functions. Some factors, such as user preference and the specific use case of the function, may not be easily quantifiable and may vary depending on the situation.

Can a function be better in some aspects but worse in others?

Yes, it is possible for a function to excel in one aspect but fall short in another. This is why it is important to consider multiple factors when comparing functions instead of solely focusing on one aspect.

Similar threads

Replies
5
Views
2K
Replies
4
Views
1K
Replies
5
Views
1K
Replies
4
Views
4K
Replies
32
Views
3K
Replies
3
Views
3K
Replies
1
Views
1K
Replies
3
Views
2K
Back
Top