🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Mathematical functions

posted in IfThen Software
Published June 18, 2011
Advertisement
A function is similar to a relation. It is a set of ordered pairs (a, b) where a is an element of some set A and b is an element of some set B. For each element in A, there is exactly one ordered pair with that element in the first position. Given such a function f, we say that it is a function from A to B, which is written f:A->B. We could also say that f:A->B is a mapping from A to B, in which case we would say that f maps from A into B. This is written b = f(a), similar to how a relation is written aRb. a is mapped into b by f, and we say that b is the image of a under f.

Something worth noting is that because there is exactly one ordered pair per element in A, there is exactly one image of each element in A under f. In other words, an element of A has exactly one image, no more, no less. However, multiple elements of A can share the same image. If each image is the image of only a single element of A, we say that f is one-to-one. If all the elements of B are images of elements in A under f, we say that the function f maps from A onto B, rather than "into".

A composition of two functions f:A->B and g:B->C is the function fog:A->C which maps from A into C. Such a function is written c = g(f(a)) where a is an element of A and c is an element of C. This works exactly how you think it would: First b = f(a) is calculated, and the resulting element b is fed into g.

And lastly we have something called a "permutation". A permutation is a function f:A->A where A is not the empty set and f is both one-to-one and maps from A onto A. What you end up with is a function which rearranges the elements in A.

Reposted from http://invisiblegdev.blogspot.com/
Previous Entry Equivalence relations
Next Entry Back to the SHMUP?
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement