Scrambling Function I need an algorithm which has the following property:


*

*$f(x)$ will lie between $[a, b]$ (both integers) when $x$ is an element of $[a, b]$ 

*There should be no collisions i.e. $f(x)$ should always be unique for unique $x$
The simplest function is $f(x) = x$. Can there be a family of such functions? How can I mathematically represent it? 
In simple words - I want a function which can distribute all numbers between $[a,b]$ in the output set which is also $[a,b]$.
Sorry I am not a mathematician :) So this is the best I can do to express what I need :) 
 A: From the title of your question I surmise that you are thinking about functions $f$ mapping the set $\{a,a+1,a+2,\ldots, b\}$ one-one onto itself. We may as well assume that $S:=\{1,2,3,\ldots,n\}$ for some given natural number $n$.
Maps of this sort are called permutations of $S$; there are exactly $$n!:=n\cdot(n-1)\cdot(n-2)\cdot\ldots\cdot2\cdot 1$$ of them. Any such map can be obtained in the following way: Choose arbitrarily $f(1)\in S$; there are $n$ possibilities for this. Then choose arbitrarily $f(2)\in S\setminus \{f(1)\}$; there are $n-1$ choices left for this. And so on, until there remains a single element to pick as $f(n)$. The resulting $f$ can be encoded as a list
$$\bigl(f(1),f(2),f(3),\ldots, f(n)\bigr)\tag{1}$$
containing $n$ different entries $f(k)\in \{1,2,3,\ldots,n\}$.
The set or family of all $f$ that can be constructed in this way is called the symmetric group on $S$, and is denoted by ${\cal S}_n$ (or similar).
If you need an algorithm that systematically produces all $n!$ lists $(1)$ of such $f\in{\cal S}_n$, let us know.
