However there is one general type of monotonic function that stands out for me and that is a strictly increasing monotonic function, which can be thought of as an example of a one to one function which stands out from other kinds of monotonic functions some of which can be many to one. So it would seem that the term monotonic refers to several kinds of functions some of which can be many to one style functions, however some such as strictly increasing monotonic functions are very much one to one. In this post I will be focusing mainly on the topic of one to one functions which interest me when it comes to the topic of making an experience point system.
Say I have a get y function that will return a y value and takes one argument that is called x, and in the body of this function I am just multiplying the given x value by 5. This is then a very basic example of a strictly increasing monotonic function, and on top of that it is also one to one. The reason why is because for every given x value there is a unique y value that is returned. This differs from functions that are many to one where there may be more than one value for x that will return the same y value.
What is great about one to one functions is that it should be possible at least in most cases to create an inverse of the function. For example lets take my basic one to one example where I am just multiplying x by 5, creating an inverse of that would just involve dividing y by 5. So then I can create a get y function along with my get x function.
Now that I have all of the basic out of the way when it comes to one to one functions I can now start getting into some actual use case examples.
So writing a one to one function is the first step in making an experience point system, but there is a bot more to it than just having a one to one function. Generally I would want a function where that will take an argument that represents level that will return a xp point value to get to that level.