p********0 发帖数: 186 | 1 Hi,
I have 5 integers, I want a function to unique map these 5 integers to 1
integer.
1, 2, 3, 4, 5
should have a different key
than 2, 3, 4, 5, 1
so simple summation would not work. | p********0 发帖数: 186 | 2 To make my question more clear,
five integers
x_[1}, x_{2}, ,,, x_{5} | s*****g 发帖数: 5159 | 3 Say you have five numbers, x1, x2, ..., x5。
let p1, p2, p3 .... be prime number in sequential increasing number.
x = p1^x1+p2^x2+......
This is a one-one perfect mapping.
Google Godel number.
【在 p********0 的大作中提到】 : Hi, : I have 5 integers, I want a function to unique map these 5 integers to 1 : integer. : 1, 2, 3, 4, 5 : should have a different key : than 2, 3, 4, 5, 1 : so simple summation would not work.
| j****a 发帖数: 1277 | 4 good one. will x = \sum_i (i*x_i) work?
【在 s*****g 的大作中提到】 : Say you have five numbers, x1, x2, ..., x5。 : let p1, p2, p3 .... be prime number in sequential increasing number. : x = p1^x1+p2^x2+...... : This is a one-one perfect mapping. : Google Godel number.
| D****A 发帖数: 360 | 5 理论上没问题,实际计算很快就溢出
【在 s*****g 的大作中提到】 : Say you have five numbers, x1, x2, ..., x5。 : let p1, p2, p3 .... be prime number in sequential increasing number. : x = p1^x1+p2^x2+...... : This is a one-one perfect mapping. : Google Godel number.
| q*******i 发帖数: 353 | 6 实际计算很快就溢出,是什么意思。
【在 D****A 的大作中提到】 : 理论上没问题,实际计算很快就溢出
|
|