โโโโฑ*.๏ฝก:๏ฝกโฑ*.:๏ฝกโง*.๏ฝกโฐ*.:๏ฝกโง*.๏ฝก:๏ฝก*.๏ฝกโฑ โโโ
A function is a special relationship from to , where and are both sets, where elements of relate to exactly one element of .
Each element in the domain (set ) maps to at least one element in the codomain (set ). No element in the domain can be mapped to more than one element in the codomain.
Terms
- Domain โ the values that can be in
- Codomain โ the set of values that can be in
- Range โ all values of that produces for a given
Examples
- Valid Function โ
- Invalid Function โ
Total Functions
- Also known as โdefined everywhere functionsโ
- Every element in the domain is mapped to an element in the codomain, such as
- Total Function โ
- Partial Function โ โ only defined for , not

Onto Function
- Every element in the codomain is mapped to at least one element in the domain

One to One Function
- Every element in the codomain is mapped to at most one element in the domain

Inverse of a Function
- A function is invertible if and only if is both one-to-one and onto.
- Given , one can deduce
-
One Way Function
- Given , one cannot deduce
Hashing Functions
- Encryption can be decrypted (two-way function)
- Hashed passwords cannot be decrypted (one-way function)
Function Composition
- Functions can be combined/nested with the syntax or
โโโโฑ*.๏ฝก:๏ฝกโฑ*.:๏ฝกโง*.๏ฝกโฐ*.:๏ฝกโง*.๏ฝก:๏ฝก*.๏ฝกโฑ โโโ