4 ms·
Most functions are not invertible. In modulo arithmetic (numbers wrap around like days of the week, months, hours in a day, or the units column, e.g. mod 10 ha
by hyperpallium 7y ago
Most functions are not invertible.
In modulo arithmetic (numbers wrap around like days of the week, months, hours in a day, or the units column, e.g. mod 10 has numbers 0 to 9, and 9+1=0) we can count them.
There are n^n possible functions (each of the n inputs could map to any n values), but only n! invertible functions (the first input can be to any of n, the second can be to any but the first's, etc (n)(n-1)(n-2)...(1)).
n!/n^n < 1/2 for all n>2
Does this converge to a fraction as n->infinity (i.e. for the naturals)? As a recurrence relation, we have:
n!/n^n = (n-1)!/(n-1)^(n-1) x n(n-1)^(n-1)/n^n
We could change variables to rewrite the factor as (n+1)n^n/(n+1)^(n+1) = n^n/(n+1)^n
Since n+1 converges to n, I think this converges to 1. Meaning that the whole thing converges to something - but working out what it converges to is beyond my abiility.
EDIT Wolfram says the limit is actually 0 https://www.wolframalpha.com/input/?i=n%21%2Fn%5En https://www.wolframalpha.com/input/?i=n%21%2Fn%5En
lim_(n->∞) n^(-n) n! = 0
Reversibility is very rare indeed! At least, with the prior pr density implied from this comception of functions.
- OscarCunningham 7y agoStirling's approximation says that n! ~ sqrt(2 pi n) (n/e)^n. So n!/n^n ~ sqrt(2 pi n)e^-n.
- hyperpallium 7y agoCool! So the 1/e^n factor will bring it to 0, as n goes to infinity, I think?
- OscarCunningham 7y agoYeah, e^n grows much faster than sqrt(2 pi n), so sqrt(2 pi n)/e^n will tend to 0.