Ques 1)
Number of functions from X to X are: [tex]n^n[/tex]
Ques 2)
Number of relation from X to X are: [tex]2^{n^2}[/tex]
Relation--
A relation from a set A to set B is the set of all the ordered of the type:
(a,b) where a belongs to A and b belongs to B.
if A has m elements and B has n elements.
Then the total number of relation from A to B are: [tex]2^mn[/tex]
Function--
A function from a set A to set B is the set of all the ordered pair where each element of set A is mapped to a single element of the other set.
i.e. every element has a single image.
if A has m elements and B has n elements.
Then the total number of functions from A to B are: [tex]n^m[/tex]